diff options
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 |