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/3w-sas.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/3w-sas.c')
-rw-r--r-- | drivers/scsi/3w-sas.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/scsi/3w-sas.c b/drivers/scsi/3w-sas.c index 54c5ffb1eaa1..8af380951f17 100644 --- a/drivers/scsi/3w-sas.c +++ b/drivers/scsi/3w-sas.c | |||
@@ -750,19 +750,22 @@ static void twl_load_sgl(TW_Device_Extension *tw_dev, TW_Command_Full *full_comm | |||
750 | 750 | ||
751 | /* This function handles ioctl for the character device | 751 | /* This function handles ioctl for the character device |
752 | This interface is used by smartmontools open source software */ | 752 | This interface is used by smartmontools open source software */ |
753 | static int twl_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) | 753 | static long twl_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
754 | { | 754 | { |
755 | long timeout; | 755 | long timeout; |
756 | unsigned long *cpu_addr, data_buffer_length_adjusted = 0, flags = 0; | 756 | unsigned long *cpu_addr, data_buffer_length_adjusted = 0, flags = 0; |
757 | dma_addr_t dma_handle; | 757 | dma_addr_t dma_handle; |
758 | int request_id = 0; | 758 | int request_id = 0; |
759 | TW_Ioctl_Driver_Command driver_command; | 759 | TW_Ioctl_Driver_Command driver_command; |
760 | struct inode *inode = file->f_dentry->d_inode; | ||
760 | TW_Ioctl_Buf_Apache *tw_ioctl; | 761 | TW_Ioctl_Buf_Apache *tw_ioctl; |
761 | TW_Command_Full *full_command_packet; | 762 | TW_Command_Full *full_command_packet; |
762 | TW_Device_Extension *tw_dev = twl_device_extension_list[iminor(inode)]; | 763 | TW_Device_Extension *tw_dev = twl_device_extension_list[iminor(inode)]; |
763 | int retval = -EFAULT; | 764 | int retval = -EFAULT; |
764 | void __user *argp = (void __user *)arg; | 765 | void __user *argp = (void __user *)arg; |
765 | 766 | ||
767 | lock_kernel(); | ||
768 | |||
766 | /* Only let one of these through at a time */ | 769 | /* Only let one of these through at a time */ |
767 | if (mutex_lock_interruptible(&tw_dev->ioctl_lock)) { | 770 | if (mutex_lock_interruptible(&tw_dev->ioctl_lock)) { |
768 | retval = -EINTR; | 771 | retval = -EINTR; |
@@ -858,6 +861,7 @@ out3: | |||
858 | out2: | 861 | out2: |
859 | mutex_unlock(&tw_dev->ioctl_lock); | 862 | mutex_unlock(&tw_dev->ioctl_lock); |
860 | out: | 863 | out: |
864 | unlock_kernel(); | ||
861 | return retval; | 865 | return retval; |
862 | } /* End twl_chrdev_ioctl() */ | 866 | } /* End twl_chrdev_ioctl() */ |
863 | 867 | ||
@@ -884,7 +888,7 @@ out: | |||
884 | /* File operations struct for character device */ | 888 | /* File operations struct for character device */ |
885 | static const struct file_operations twl_fops = { | 889 | static const struct file_operations twl_fops = { |
886 | .owner = THIS_MODULE, | 890 | .owner = THIS_MODULE, |
887 | .ioctl = twl_chrdev_ioctl, | 891 | .unlocked_ioctl = twl_chrdev_ioctl, |
888 | .open = twl_chrdev_open, | 892 | .open = twl_chrdev_open, |
889 | .release = NULL | 893 | .release = NULL |
890 | }; | 894 | }; |