summaryrefslogtreecommitdiff
path: root/drivers/scsi/osst.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2010-04-27 00:24:01 +0200
committerFrederic Weisbecker <fweisbec@gmail.com>2010-05-17 05:27:04 +0200
commitf4927c45beda9a70e5c3bda0bd9f12b4f713c00b (patch)
tree18256d3dd635e931838e3d83b071ca5a1e61a163 /drivers/scsi/osst.c
parent16ef8def80ea97c3cacdcaa765bdf62b2d94f86d (diff)
scsi: Push down BKL into ioctl functions
Push down the bkl into ioctl functions on the scsi layer. [jkacur: Forward declaration missing ';'. Conflicting declaraction in megaraid.h changed Fixed missing inodes declarations] Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: John Kacur <jkacur@redhat.com> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'drivers/scsi/osst.c')
-rw-r--r--drivers/scsi/osst.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c
index b219118f8bd6..8dbf1c3afb7b 100644
--- a/drivers/scsi/osst.c
+++ b/drivers/scsi/osst.c
@@ -4932,7 +4932,7 @@ static int os_scsi_tape_close(struct inode * inode, struct file * filp)
/* The ioctl command */
-static int osst_ioctl(struct inode * inode,struct file * file,
+static long osst_ioctl(struct file * file,
unsigned int cmd_in, unsigned long arg)
{
int i, cmd_nr, cmd_type, blk, retval = 0;
@@ -4943,8 +4943,11 @@ static int osst_ioctl(struct inode * inode,struct file * file,
char * name = tape_name(STp);
void __user * p = (void __user *)arg;
- if (mutex_lock_interruptible(&STp->lock))
+ lock_kernel();
+ if (mutex_lock_interruptible(&STp->lock)) {
+ unlock_kernel();
return -ERESTARTSYS;
+ }
#if DEBUG
if (debugging && !STp->in_use) {
@@ -5256,12 +5259,15 @@ static int osst_ioctl(struct inode * inode,struct file * file,
mutex_unlock(&STp->lock);
- return scsi_ioctl(STp->device, cmd_in, p);
+ retval = scsi_ioctl(STp->device, cmd_in, p);
+ unlock_kernel();
+ return retval;
out:
if (SRpnt) osst_release_request(SRpnt);
mutex_unlock(&STp->lock);
+ unlock_kernel();
return retval;
}
@@ -5613,7 +5619,7 @@ static const struct file_operations osst_fops = {
.owner = THIS_MODULE,
.read = osst_read,
.write = osst_write,
- .ioctl = osst_ioctl,
+ .unlocked_ioctl = osst_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = osst_compat_ioctl,
#endif