aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/megaraid.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2010-04-26 18:24:01 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2010-05-16 23:27:04 -0400
commitf4927c45beda9a70e5c3bda0bd9f12b4f713c00b (patch)
tree18256d3dd635e931838e3d83b071ca5a1e61a163 /drivers/scsi/megaraid.c
parent16ef8def80ea97c3cacdcaa765bdf62b2d94f86d (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/megaraid.c')
-rw-r--r--drivers/scsi/megaraid.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
index 4bf7edca9e69..0b6e3228610a 100644
--- a/drivers/scsi/megaraid.c
+++ b/drivers/scsi/megaraid.c
@@ -91,12 +91,15 @@ static struct proc_dir_entry *mega_proc_dir_entry;
91/* For controller re-ordering */ 91/* For controller re-ordering */
92static struct mega_hbas mega_hbas[MAX_CONTROLLERS]; 92static struct mega_hbas mega_hbas[MAX_CONTROLLERS];
93 93
94static long
95megadev_unlocked_ioctl(struct file *filep, unsigned int cmd, unsigned long arg);
96
94/* 97/*
95 * The File Operations structure for the serial/ioctl interface of the driver 98 * The File Operations structure for the serial/ioctl interface of the driver
96 */ 99 */
97static const struct file_operations megadev_fops = { 100static const struct file_operations megadev_fops = {
98 .owner = THIS_MODULE, 101 .owner = THIS_MODULE,
99 .ioctl = megadev_ioctl, 102 .unlocked_ioctl = megadev_unlocked_ioctl,
100 .open = megadev_open, 103 .open = megadev_open,
101}; 104};
102 105
@@ -3302,8 +3305,7 @@ megadev_open (struct inode *inode, struct file *filep)
3302 * controller. 3305 * controller.
3303 */ 3306 */
3304static int 3307static int
3305megadev_ioctl(struct inode *inode, struct file *filep, unsigned int cmd, 3308megadev_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
3306 unsigned long arg)
3307{ 3309{
3308 adapter_t *adapter; 3310 adapter_t *adapter;
3309 nitioctl_t uioc; 3311 nitioctl_t uioc;
@@ -3694,6 +3696,18 @@ freemem_and_return:
3694 return 0; 3696 return 0;
3695} 3697}
3696 3698
3699static long
3700megadev_unlocked_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
3701{
3702 int ret;
3703
3704 lock_kernel();
3705 ret = megadev_ioctl(filep, cmd, arg);
3706 unlock_kernel();
3707
3708 return ret;
3709}
3710
3697/** 3711/**
3698 * mega_m_to_n() 3712 * mega_m_to_n()
3699 * @arg - user address 3713 * @arg - user address