aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/bsg.c2
-rw-r--r--block/scsi_ioctl.c10
2 files changed, 4 insertions, 8 deletions
diff --git a/block/bsg.c b/block/bsg.c
index c85d961ee41..0427ece9b6d 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -900,7 +900,7 @@ bsg_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
case SG_EMULATED_HOST:
case SCSI_IOCTL_SEND_COMMAND: {
void __user *uarg = (void __user *) arg;
- return scsi_cmd_ioctl(file, bd->disk, cmd, uarg);
+ return scsi_cmd_ioctl(file, bd->queue, bd->disk, cmd, uarg);
}
case SG_IO: {
struct request *rq;
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index db53b2c268d..a26ba07955f 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -548,16 +548,12 @@ static inline int blk_send_start_stop(request_queue_t *q, struct gendisk *bd_dis
return __blk_send_generic(q, bd_disk, GPCMD_START_STOP_UNIT, data);
}
-int scsi_cmd_ioctl(struct file *file, struct gendisk *bd_disk, unsigned int cmd, void __user *arg)
+int scsi_cmd_ioctl(struct file *file, struct request_queue *q,
+ struct gendisk *bd_disk, unsigned int cmd, void __user *arg)
{
- request_queue_t *q;
int err;
- q = bd_disk->queue;
- if (!q)
- return -ENXIO;
-
- if (blk_get_queue(q))
+ if (!q || blk_get_queue(q))
return -ENXIO;
switch (cmd) {