aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/megaraid.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/megaraid.c')
-rw-r--r--drivers/scsi/megaraid.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
index 0b6e3228610a..7ceb5cf12c6b 100644
--- a/drivers/scsi/megaraid.c
+++ b/drivers/scsi/megaraid.c
@@ -46,7 +46,7 @@
46#include <linux/pci.h> 46#include <linux/pci.h>
47#include <linux/init.h> 47#include <linux/init.h>
48#include <linux/dma-mapping.h> 48#include <linux/dma-mapping.h>
49#include <linux/smp_lock.h> 49#include <linux/mutex.h>
50#include <linux/slab.h> 50#include <linux/slab.h>
51#include <scsi/scsicam.h> 51#include <scsi/scsicam.h>
52 52
@@ -62,6 +62,7 @@ MODULE_DESCRIPTION ("LSI Logic MegaRAID legacy driver");
62MODULE_LICENSE ("GPL"); 62MODULE_LICENSE ("GPL");
63MODULE_VERSION(MEGARAID_MODULE_VERSION); 63MODULE_VERSION(MEGARAID_MODULE_VERSION);
64 64
65static DEFINE_MUTEX(megadev_mutex);
65static unsigned int max_cmd_per_lun = DEF_CMD_PER_LUN; 66static unsigned int max_cmd_per_lun = DEF_CMD_PER_LUN;
66module_param(max_cmd_per_lun, uint, 0); 67module_param(max_cmd_per_lun, uint, 0);
67MODULE_PARM_DESC(max_cmd_per_lun, "Maximum number of commands which can be issued to a single LUN (default=DEF_CMD_PER_LUN=63)"); 68MODULE_PARM_DESC(max_cmd_per_lun, "Maximum number of commands which can be issued to a single LUN (default=DEF_CMD_PER_LUN=63)");
@@ -101,6 +102,7 @@ static const struct file_operations megadev_fops = {
101 .owner = THIS_MODULE, 102 .owner = THIS_MODULE,
102 .unlocked_ioctl = megadev_unlocked_ioctl, 103 .unlocked_ioctl = megadev_unlocked_ioctl,
103 .open = megadev_open, 104 .open = megadev_open,
105 .llseek = noop_llseek,
104}; 106};
105 107
106/* 108/*
@@ -3282,7 +3284,6 @@ mega_init_scb(adapter_t *adapter)
3282static int 3284static int
3283megadev_open (struct inode *inode, struct file *filep) 3285megadev_open (struct inode *inode, struct file *filep)
3284{ 3286{
3285 cycle_kernel_lock();
3286 /* 3287 /*
3287 * Only allow superuser to access private ioctl interface 3288 * Only allow superuser to access private ioctl interface
3288 */ 3289 */
@@ -3701,9 +3702,9 @@ megadev_unlocked_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
3701{ 3702{
3702 int ret; 3703 int ret;
3703 3704
3704 lock_kernel(); 3705 mutex_lock(&megadev_mutex);
3705 ret = megadev_ioctl(filep, cmd, arg); 3706 ret = megadev_ioctl(filep, cmd, arg);
3706 unlock_kernel(); 3707 mutex_unlock(&megadev_mutex);
3707 3708
3708 return ret; 3709 return ret;
3709} 3710}