diff options
| author | Jonathan Corbet <corbet@lwn.net> | 2008-05-15 11:09:23 -0400 |
|---|---|---|
| committer | Jonathan Corbet <corbet@lwn.net> | 2008-05-18 17:43:40 -0400 |
| commit | 75bd2ef1457998791cfc89cd59927574488fc22a (patch) | |
| tree | 8468afbf17f58ab7bfbb661fa167e50a9e06994c | |
| parent | b8291ad07a7f3b5b990900f0001198ac23ba893e (diff) | |
bsg: cdev lock_kernel() pushdown
Push the cdev lock_kernel call into bsg_open().
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
| -rw-r--r-- | block/bsg.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/block/bsg.c b/block/bsg.c index f0b7cd343216..dbe3ffd505ca 100644 --- a/block/bsg.c +++ b/block/bsg.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/uio.h> | 19 | #include <linux/uio.h> |
| 20 | #include <linux/idr.h> | 20 | #include <linux/idr.h> |
| 21 | #include <linux/bsg.h> | 21 | #include <linux/bsg.h> |
| 22 | #include <linux/smp_lock.h> | ||
| 22 | 23 | ||
| 23 | #include <scsi/scsi.h> | 24 | #include <scsi/scsi.h> |
| 24 | #include <scsi/scsi_ioctl.h> | 25 | #include <scsi/scsi_ioctl.h> |
| @@ -834,7 +835,11 @@ static struct bsg_device *bsg_get_device(struct inode *inode, struct file *file) | |||
| 834 | 835 | ||
| 835 | static int bsg_open(struct inode *inode, struct file *file) | 836 | static int bsg_open(struct inode *inode, struct file *file) |
| 836 | { | 837 | { |
| 837 | struct bsg_device *bd = bsg_get_device(inode, file); | 838 | struct bsg_device *bd; |
| 839 | |||
| 840 | lock_kernel(); | ||
| 841 | bd = bsg_get_device(inode, file); | ||
| 842 | unlock_kernel(); | ||
| 838 | 843 | ||
| 839 | if (IS_ERR(bd)) | 844 | if (IS_ERR(bd)) |
| 840 | return PTR_ERR(bd); | 845 | return PTR_ERR(bd); |
