Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
b3369c68
Commit
b3369c68
authored
May 15, 2008
by
Jonathan Corbet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
st: cdev lock_kernel() pushdown
Signed-off-by:
Jonathan Corbet
<
corbet@lwn.net
>
parent
d4514d1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
drivers/scsi/st.c
drivers/scsi/st.c
+9
-2
No files found.
drivers/scsi/st.c
View file @
b3369c68
...
@@ -38,6 +38,7 @@ static const char *verstr = "20080224";
...
@@ -38,6 +38,7 @@ static const char *verstr = "20080224";
#include <linux/cdev.h>
#include <linux/cdev.h>
#include <linux/delay.h>
#include <linux/delay.h>
#include <linux/mutex.h>
#include <linux/mutex.h>
#include <linux/smp_lock.h>
#include <asm/uaccess.h>
#include <asm/uaccess.h>
#include <asm/dma.h>
#include <asm/dma.h>
...
@@ -1113,7 +1114,7 @@ static int check_tape(struct scsi_tape *STp, struct file *filp)
...
@@ -1113,7 +1114,7 @@ static int check_tape(struct scsi_tape *STp, struct file *filp)
}
}
/* Open the device. Needs to
be called with
BKL only because of incrementing the SCSI host
/* Open the device. Needs to
take the
BKL only because of incrementing the SCSI host
module count. */
module count. */
static
int
st_open
(
struct
inode
*
inode
,
struct
file
*
filp
)
static
int
st_open
(
struct
inode
*
inode
,
struct
file
*
filp
)
{
{
...
@@ -1123,6 +1124,7 @@ static int st_open(struct inode *inode, struct file *filp)
...
@@ -1123,6 +1124,7 @@ static int st_open(struct inode *inode, struct file *filp)
int
dev
=
TAPE_NR
(
inode
);
int
dev
=
TAPE_NR
(
inode
);
char
*
name
;
char
*
name
;
lock_kernel
();
/*
/*
* We really want to do nonseekable_open(inode, filp); here, but some
* We really want to do nonseekable_open(inode, filp); here, but some
* versions of tar incorrectly call lseek on tapes and bail out if that
* versions of tar incorrectly call lseek on tapes and bail out if that
...
@@ -1130,8 +1132,10 @@ static int st_open(struct inode *inode, struct file *filp)
...
@@ -1130,8 +1132,10 @@ static int st_open(struct inode *inode, struct file *filp)
*/
*/
filp
->
f_mode
&=
~
(
FMODE_PREAD
|
FMODE_PWRITE
);
filp
->
f_mode
&=
~
(
FMODE_PREAD
|
FMODE_PWRITE
);
if
(
!
(
STp
=
scsi_tape_get
(
dev
)))
if
(
!
(
STp
=
scsi_tape_get
(
dev
)))
{
unlock_kernel
();
return
-
ENXIO
;
return
-
ENXIO
;
}
write_lock
(
&
st_dev_arr_lock
);
write_lock
(
&
st_dev_arr_lock
);
filp
->
private_data
=
STp
;
filp
->
private_data
=
STp
;
...
@@ -1140,6 +1144,7 @@ static int st_open(struct inode *inode, struct file *filp)
...
@@ -1140,6 +1144,7 @@ static int st_open(struct inode *inode, struct file *filp)
if
(
STp
->
in_use
)
{
if
(
STp
->
in_use
)
{
write_unlock
(
&
st_dev_arr_lock
);
write_unlock
(
&
st_dev_arr_lock
);
scsi_tape_put
(
STp
);
scsi_tape_put
(
STp
);
unlock_kernel
();
DEB
(
printk
(
ST_DEB_MSG
"%s: Device already in use.
\n
"
,
name
);
)
DEB
(
printk
(
ST_DEB_MSG
"%s: Device already in use.
\n
"
,
name
);
)
return
(
-
EBUSY
);
return
(
-
EBUSY
);
}
}
...
@@ -1188,12 +1193,14 @@ static int st_open(struct inode *inode, struct file *filp)
...
@@ -1188,12 +1193,14 @@ static int st_open(struct inode *inode, struct file *filp)
retval
=
(
-
EIO
);
retval
=
(
-
EIO
);
goto
err_out
;
goto
err_out
;
}
}
unlock_kernel
();
return
0
;
return
0
;
err_out:
err_out:
normalize_buffer
(
STp
->
buffer
);
normalize_buffer
(
STp
->
buffer
);
STp
->
in_use
=
0
;
STp
->
in_use
=
0
;
scsi_tape_put
(
STp
);
scsi_tape_put
(
STp
);
unlock_kernel
();
return
retval
;
return
retval
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment