diff options
author | Jonathan Corbet <corbet@lwn.net> | 2008-05-15 18:07:56 +0200 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2008-06-20 22:03:43 +0200 |
commit | ea2959a2972410f15155a015df74ce77ac79f8b8 (patch) | |
tree | e8496a1a99b7f805a13cdb1e3560995319cdab1c /drivers/block/paride/pt.c | |
parent | AoE: cdev lock_kernel() pushdown (diff) | |
download | linux-ea2959a2972410f15155a015df74ce77ac79f8b8.tar.xz linux-ea2959a2972410f15155a015df74ce77ac79f8b8.zip |
paride: cdev lock_kernel() pushdown
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'drivers/block/paride/pt.c')
-rw-r--r-- | drivers/block/paride/pt.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/block/paride/pt.c b/drivers/block/paride/pt.c index 8b9549ab4a4e..314333db16ee 100644 --- a/drivers/block/paride/pt.c +++ b/drivers/block/paride/pt.c @@ -146,6 +146,7 @@ static int (*drives[4])[6] = {&drive0, &drive1, &drive2, &drive3}; #include <linux/mtio.h> #include <linux/device.h> #include <linux/sched.h> /* current, TASK_*, schedule_timeout() */ +#include <linux/smp_lock.h> #include <asm/uaccess.h> @@ -650,8 +651,11 @@ static int pt_open(struct inode *inode, struct file *file) struct pt_unit *tape = pt + unit; int err; - if (unit >= PT_UNITS || (!tape->present)) + lock_kernel(); + if (unit >= PT_UNITS || (!tape->present)) { + unlock_kernel(); return -ENODEV; + } err = -EBUSY; if (!atomic_dec_and_test(&tape->available)) @@ -678,10 +682,12 @@ static int pt_open(struct inode *inode, struct file *file) } file->private_data = tape; + unlock_kernel(); return 0; out: atomic_inc(&tape->available); + unlock_kernel(); return err; } |