aboutsummaryrefslogtreecommitdiffstats
path: root/block/scsi_ioctl.c
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2007-07-09 06:39:20 -0400
committerJens Axboe <jens.axboe@oracle.com>2007-07-16 02:52:45 -0400
commit45e79a3acdcf54113b3d7b23e9e64e6541dbfeb5 (patch)
treeb8e7598b26ce446577e162189e635f6b87b10a5b /block/scsi_ioctl.c
parent7e75d73080d822d2bbbd5b0f7f293719dd1f9109 (diff)
bsg: add a request_queue argument to scsi_cmd_ioctl()
bsg uses scsi_cmd_ioctl() for some SCSI/sg ioctl commands. scsi_cmd_ioctl() gets a request queue from a gendisk arguement. This prevents bsg being bound to SCSI devices that don't have a gendisk (like OSD). This adds a request_queue argument to scsi_cmd_ioctl(). The SCSI/sg ioctl commands doesn't use a gendisk so it's safe for any SCSI devices to use scsi_cmd_ioctl(). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/scsi_ioctl.c')
-rw-r--r--block/scsi_ioctl.c10
1 files changed, 3 insertions, 7 deletions
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
548 return __blk_send_generic(q, bd_disk, GPCMD_START_STOP_UNIT, data); 548 return __blk_send_generic(q, bd_disk, GPCMD_START_STOP_UNIT, data);
549} 549}
550 550
551int scsi_cmd_ioctl(struct file *file, struct gendisk *bd_disk, unsigned int cmd, void __user *arg) 551int scsi_cmd_ioctl(struct file *file, struct request_queue *q,
552 struct gendisk *bd_disk, unsigned int cmd, void __user *arg)
552{ 553{
553 request_queue_t *q;
554 int err; 554 int err;
555 555
556 q = bd_disk->queue; 556 if (!q || blk_get_queue(q))
557 if (!q)
558 return -ENXIO;
559
560 if (blk_get_queue(q))
561 return -ENXIO; 557 return -ENXIO;
562 558
563 switch (cmd) { 559 switch (cmd) {