aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/cciss.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/cciss.c')
-rw-r--r--drivers/block/cciss.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 6124c2fd2d33..ba9c3a4947c7 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -26,7 +26,6 @@
26#include <linux/pci.h> 26#include <linux/pci.h>
27#include <linux/kernel.h> 27#include <linux/kernel.h>
28#include <linux/slab.h> 28#include <linux/slab.h>
29#include <linux/smp_lock.h>
30#include <linux/delay.h> 29#include <linux/delay.h>
31#include <linux/major.h> 30#include <linux/major.h>
32#include <linux/fs.h> 31#include <linux/fs.h>
@@ -66,6 +65,7 @@ MODULE_SUPPORTED_DEVICE("HP Smart Array Controllers");
66MODULE_VERSION("3.6.26"); 65MODULE_VERSION("3.6.26");
67MODULE_LICENSE("GPL"); 66MODULE_LICENSE("GPL");
68 67
68static DEFINE_MUTEX(cciss_mutex);
69static int cciss_allow_hpsa; 69static int cciss_allow_hpsa;
70module_param(cciss_allow_hpsa, int, S_IRUGO|S_IWUSR); 70module_param(cciss_allow_hpsa, int, S_IRUGO|S_IWUSR);
71MODULE_PARM_DESC(cciss_allow_hpsa, 71MODULE_PARM_DESC(cciss_allow_hpsa,
@@ -1059,9 +1059,9 @@ static int cciss_unlocked_open(struct block_device *bdev, fmode_t mode)
1059{ 1059{
1060 int ret; 1060 int ret;
1061 1061
1062 lock_kernel(); 1062 mutex_lock(&cciss_mutex);
1063 ret = cciss_open(bdev, mode); 1063 ret = cciss_open(bdev, mode);
1064 unlock_kernel(); 1064 mutex_unlock(&cciss_mutex);
1065 1065
1066 return ret; 1066 return ret;
1067} 1067}
@@ -1074,13 +1074,13 @@ static int cciss_release(struct gendisk *disk, fmode_t mode)
1074 ctlr_info_t *h; 1074 ctlr_info_t *h;
1075 drive_info_struct *drv; 1075 drive_info_struct *drv;
1076 1076
1077 lock_kernel(); 1077 mutex_lock(&cciss_mutex);
1078 h = get_host(disk); 1078 h = get_host(disk);
1079 drv = get_drv(disk); 1079 drv = get_drv(disk);
1080 dev_dbg(&h->pdev->dev, "cciss_release %s\n", disk->disk_name); 1080 dev_dbg(&h->pdev->dev, "cciss_release %s\n", disk->disk_name);
1081 drv->usage_count--; 1081 drv->usage_count--;
1082 h->usage_count--; 1082 h->usage_count--;
1083 unlock_kernel(); 1083 mutex_unlock(&cciss_mutex);
1084 return 0; 1084 return 0;
1085} 1085}
1086 1086
@@ -1088,9 +1088,9 @@ static int do_ioctl(struct block_device *bdev, fmode_t mode,
1088 unsigned cmd, unsigned long arg) 1088 unsigned cmd, unsigned long arg)
1089{ 1089{
1090 int ret; 1090 int ret;
1091 lock_kernel(); 1091 mutex_lock(&cciss_mutex);
1092 ret = cciss_ioctl(bdev, mode, cmd, arg); 1092 ret = cciss_ioctl(bdev, mode, cmd, arg);
1093 unlock_kernel(); 1093 mutex_unlock(&cciss_mutex);
1094 return ret; 1094 return ret;
1095} 1095}
1096 1096