diff options
author | Arnd Bergmann <arnd@arndb.de> | 2010-04-26 18:24:01 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2010-05-16 23:27:04 -0400 |
commit | f4927c45beda9a70e5c3bda0bd9f12b4f713c00b (patch) | |
tree | 18256d3dd635e931838e3d83b071ca5a1e61a163 /drivers/scsi/sg.c | |
parent | 16ef8def80ea97c3cacdcaa765bdf62b2d94f86d (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/sg.c')
-rw-r--r-- | drivers/scsi/sg.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index dee1c96288d4..ef752b248c4d 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c | |||
@@ -758,8 +758,7 @@ sg_common_write(Sg_fd * sfp, Sg_request * srp, | |||
758 | } | 758 | } |
759 | 759 | ||
760 | static int | 760 | static int |
761 | sg_ioctl(struct inode *inode, struct file *filp, | 761 | sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg) |
762 | unsigned int cmd_in, unsigned long arg) | ||
763 | { | 762 | { |
764 | void __user *p = (void __user *)arg; | 763 | void __user *p = (void __user *)arg; |
765 | int __user *ip = p; | 764 | int __user *ip = p; |
@@ -1078,6 +1077,18 @@ sg_ioctl(struct inode *inode, struct file *filp, | |||
1078 | } | 1077 | } |
1079 | } | 1078 | } |
1080 | 1079 | ||
1080 | static long | ||
1081 | sg_unlocked_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg) | ||
1082 | { | ||
1083 | int ret; | ||
1084 | |||
1085 | lock_kernel(); | ||
1086 | ret = sg_ioctl(filp, cmd_in, arg); | ||
1087 | unlock_kernel(); | ||
1088 | |||
1089 | return ret; | ||
1090 | } | ||
1091 | |||
1081 | #ifdef CONFIG_COMPAT | 1092 | #ifdef CONFIG_COMPAT |
1082 | static long sg_compat_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg) | 1093 | static long sg_compat_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg) |
1083 | { | 1094 | { |
@@ -1322,7 +1333,7 @@ static const struct file_operations sg_fops = { | |||
1322 | .read = sg_read, | 1333 | .read = sg_read, |
1323 | .write = sg_write, | 1334 | .write = sg_write, |
1324 | .poll = sg_poll, | 1335 | .poll = sg_poll, |
1325 | .ioctl = sg_ioctl, | 1336 | .unlocked_ioctl = sg_unlocked_ioctl, |
1326 | #ifdef CONFIG_COMPAT | 1337 | #ifdef CONFIG_COMPAT |
1327 | .compat_ioctl = sg_compat_ioctl, | 1338 | .compat_ioctl = sg_compat_ioctl, |
1328 | #endif | 1339 | #endif |