aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/cpqarray.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/cpqarray.c')
-rw-r--r--drivers/block/cpqarray.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c
index abb4ec6690f..c459aeea3c0 100644
--- a/drivers/block/cpqarray.c
+++ b/drivers/block/cpqarray.c
@@ -35,6 +35,7 @@
35#include <linux/seq_file.h> 35#include <linux/seq_file.h>
36#include <linux/init.h> 36#include <linux/init.h>
37#include <linux/hdreg.h> 37#include <linux/hdreg.h>
38#include <linux/smp_lock.h>
38#include <linux/spinlock.h> 39#include <linux/spinlock.h>
39#include <linux/blkdev.h> 40#include <linux/blkdev.h>
40#include <linux/genhd.h> 41#include <linux/genhd.h>
@@ -197,7 +198,7 @@ static const struct block_device_operations ida_fops = {
197 .owner = THIS_MODULE, 198 .owner = THIS_MODULE,
198 .open = ida_open, 199 .open = ida_open,
199 .release = ida_release, 200 .release = ida_release,
200 .locked_ioctl = ida_ioctl, 201 .ioctl = ida_ioctl,
201 .getgeo = ida_getgeo, 202 .getgeo = ida_getgeo,
202 .revalidate_disk= ida_revalidate, 203 .revalidate_disk= ida_revalidate,
203}; 204};
@@ -1128,7 +1129,7 @@ static int ida_getgeo(struct block_device *bdev, struct hd_geometry *geo)
1128 * ida_ioctl does some miscellaneous stuff like reporting drive geometry, 1129 * ida_ioctl does some miscellaneous stuff like reporting drive geometry,
1129 * setting readahead and submitting commands from userspace to the controller. 1130 * setting readahead and submitting commands from userspace to the controller.
1130 */ 1131 */
1131static int ida_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long arg) 1132static int ida_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long arg)
1132{ 1133{
1133 drv_info_t *drv = get_drv(bdev->bd_disk); 1134 drv_info_t *drv = get_drv(bdev->bd_disk);
1134 ctlr_info_t *host = get_host(bdev->bd_disk); 1135 ctlr_info_t *host = get_host(bdev->bd_disk);
@@ -1192,6 +1193,19 @@ out_passthru:
1192 } 1193 }
1193 1194
1194} 1195}
1196
1197static int ida_ioctl(struct block_device *bdev, fmode_t mode,
1198 unsigned int cmd, unsigned long param)
1199{
1200 int ret;
1201
1202 lock_kernel();
1203 ret = ida_locked_ioctl(bdev, mode, cmd, param);
1204 unlock_kernel();
1205
1206 return ret;
1207}
1208
1195/* 1209/*
1196 * ida_ctlr_ioctl is for passing commands to the controller from userspace. 1210 * ida_ctlr_ioctl is for passing commands to the controller from userspace.
1197 * The command block (io) has already been copied to kernel space for us, 1211 * The command block (io) has already been copied to kernel space for us,