Skip to content

Commit

Permalink
bsg: cdev lock_kernel() pushdown
Browse files Browse the repository at this point in the history
Push the cdev lock_kernel call into bsg_open().

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
  • Loading branch information
Jonathan Corbet committed May 18, 2008
1 parent b8291ad commit 75bd2ef
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion block/bsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <linux/uio.h>
#include <linux/idr.h>
#include <linux/bsg.h>
#include <linux/smp_lock.h>

#include <scsi/scsi.h>
#include <scsi/scsi_ioctl.h>
Expand Down Expand Up @@ -834,7 +835,11 @@ static struct bsg_device *bsg_get_device(struct inode *inode, struct file *file)

static int bsg_open(struct inode *inode, struct file *file)
{
struct bsg_device *bd = bsg_get_device(inode, file);
struct bsg_device *bd;

lock_kernel();
bd = bsg_get_device(inode, file);
unlock_kernel();

if (IS_ERR(bd))
return PTR_ERR(bd);
Expand Down

0 comments on commit 75bd2ef

Please sign in to comment.