summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ch.c
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2008-05-16 14:12:52 -0600
committerJonathan Corbet <corbet@lwn.net>2008-06-20 14:05:52 -0600
commitb0061a0ec4d10a69309d0371a01e8b99387009ef (patch)
treedbda9a89b9eb6102ec879badec88b7ebe4c9a3e6 /drivers/scsi/ch.c
parentdea3f665d6fa263a9870a54e9f8cfd146016f140 (diff)
downloadblackbird-op-linux-b0061a0ec4d10a69309d0371a01e8b99387009ef.tar.gz
blackbird-op-linux-b0061a0ec4d10a69309d0371a01e8b99387009ef.zip
changer: BKL pushdown
Add lock_kernel() calls to ch_open(), though the existing locking looks adequate. Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'drivers/scsi/ch.c')
-rw-r--r--drivers/scsi/ch.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c
index 75c84d7b9ce8..8e821be380f4 100644
--- a/drivers/scsi/ch.c
+++ b/drivers/scsi/ch.c
@@ -22,6 +22,7 @@
#include <linux/chio.h> /* here are all the ioctls */
#include <linux/mutex.h>
#include <linux/idr.h>
+#include <linux/smp_lock.h>
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
@@ -571,16 +572,19 @@ ch_open(struct inode *inode, struct file *file)
scsi_changer *ch;
int minor = iminor(inode);
+ lock_kernel();
spin_lock(&ch_index_lock);
ch = idr_find(&ch_index_idr, minor);
if (NULL == ch || scsi_device_get(ch->device)) {
spin_unlock(&ch_index_lock);
+ unlock_kernel();
return -ENXIO;
}
spin_unlock(&ch_index_lock);
file->private_data = ch;
+ unlock_kernel();
return 0;
}
OpenPOWER on IntegriCloud