aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--block/scsi_ioctl.c7
-rw-r--r--drivers/block/cciss.c6
-rw-r--r--drivers/block/ub.c3
-rw-r--r--drivers/block/virtio_blk.c4
-rw-r--r--drivers/cdrom/cdrom.c3
-rw-r--r--drivers/ide/ide-floppy_ioctl.c3
-rw-r--r--drivers/scsi/sd.c2
-rw-r--r--include/linux/blkdev.h2
8 files changed, 18 insertions, 12 deletions
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index fbdf0d802ec4..a2c11f330872 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -690,6 +690,13 @@ int scsi_cmd_ioctl(struct request_queue *q, struct gendisk *bd_disk, fmode_t mod
690} 690}
691EXPORT_SYMBOL(scsi_cmd_ioctl); 691EXPORT_SYMBOL(scsi_cmd_ioctl);
692 692
693int scsi_cmd_blk_ioctl(struct block_device *bd, fmode_t mode,
694 unsigned int cmd, void __user *arg)
695{
696 return scsi_cmd_ioctl(bd->bd_disk->queue, bd->bd_disk, mode, cmd, arg);
697}
698EXPORT_SYMBOL(scsi_cmd_blk_ioctl);
699
693static int __init blk_scsi_ioctl_init(void) 700static int __init blk_scsi_ioctl_init(void)
694{ 701{
695 blk_set_cmd_filter_defaults(&blk_default_cmd_filter); 702 blk_set_cmd_filter_defaults(&blk_default_cmd_filter);
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 587cce57adae..b0f553b26d0f 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1735,7 +1735,7 @@ static int cciss_ioctl(struct block_device *bdev, fmode_t mode,
1735 case CCISS_BIG_PASSTHRU: 1735 case CCISS_BIG_PASSTHRU:
1736 return cciss_bigpassthru(h, argp); 1736 return cciss_bigpassthru(h, argp);
1737 1737
1738 /* scsi_cmd_ioctl handles these, below, though some are not */ 1738 /* scsi_cmd_blk_ioctl handles these, below, though some are not */
1739 /* very meaningful for cciss. SG_IO is the main one people want. */ 1739 /* very meaningful for cciss. SG_IO is the main one people want. */
1740 1740
1741 case SG_GET_VERSION_NUM: 1741 case SG_GET_VERSION_NUM:
@@ -1746,9 +1746,9 @@ static int cciss_ioctl(struct block_device *bdev, fmode_t mode,
1746 case SG_EMULATED_HOST: 1746 case SG_EMULATED_HOST:
1747 case SG_IO: 1747 case SG_IO:
1748 case SCSI_IOCTL_SEND_COMMAND: 1748 case SCSI_IOCTL_SEND_COMMAND:
1749 return scsi_cmd_ioctl(disk->queue, disk, mode, cmd, argp); 1749 return scsi_cmd_blk_ioctl(bdev, mode, cmd, argp);
1750 1750
1751 /* scsi_cmd_ioctl would normally handle these, below, but */ 1751 /* scsi_cmd_blk_ioctl would normally handle these, below, but */
1752 /* they aren't a good fit for cciss, as CD-ROMs are */ 1752 /* they aren't a good fit for cciss, as CD-ROMs are */
1753 /* not supported, and we don't have any bus/target/lun */ 1753 /* not supported, and we don't have any bus/target/lun */
1754 /* which we present to the kernel. */ 1754 /* which we present to the kernel. */
diff --git a/drivers/block/ub.c b/drivers/block/ub.c
index 0e376d46bdd1..7333b9e44411 100644
--- a/drivers/block/ub.c
+++ b/drivers/block/ub.c
@@ -1744,12 +1744,11 @@ static int ub_bd_release(struct gendisk *disk, fmode_t mode)
1744static int ub_bd_ioctl(struct block_device *bdev, fmode_t mode, 1744static int ub_bd_ioctl(struct block_device *bdev, fmode_t mode,
1745 unsigned int cmd, unsigned long arg) 1745 unsigned int cmd, unsigned long arg)
1746{ 1746{
1747 struct gendisk *disk = bdev->bd_disk;
1748 void __user *usermem = (void __user *) arg; 1747 void __user *usermem = (void __user *) arg;
1749 int ret; 1748 int ret;
1750 1749
1751 mutex_lock(&ub_mutex); 1750 mutex_lock(&ub_mutex);
1752 ret = scsi_cmd_ioctl(disk->queue, disk, mode, cmd, usermem); 1751 ret = scsi_cmd_blk_ioctl(bdev, mode, cmd, usermem);
1753 mutex_unlock(&ub_mutex); 1752 mutex_unlock(&ub_mutex);
1754 1753
1755 return ret; 1754 return ret;
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index ffd5ca919295..c4a60badf252 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -250,8 +250,8 @@ static int virtblk_ioctl(struct block_device *bdev, fmode_t mode,
250 if (!virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_SCSI)) 250 if (!virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_SCSI))
251 return -ENOTTY; 251 return -ENOTTY;
252 252
253 return scsi_cmd_ioctl(disk->queue, disk, mode, cmd, 253 return scsi_cmd_blk_ioctl(bdev, mode, cmd,
254 (void __user *)data); 254 (void __user *)data);
255} 255}
256 256
257/* We provide getgeo only to please some old bootloader/partitioning tools */ 257/* We provide getgeo only to please some old bootloader/partitioning tools */
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index 1bbf7645a97c..55eaf474d32c 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -2746,12 +2746,11 @@ int cdrom_ioctl(struct cdrom_device_info *cdi, struct block_device *bdev,
2746{ 2746{
2747 void __user *argp = (void __user *)arg; 2747 void __user *argp = (void __user *)arg;
2748 int ret; 2748 int ret;
2749 struct gendisk *disk = bdev->bd_disk;
2750 2749
2751 /* 2750 /*
2752 * Try the generic SCSI command ioctl's first. 2751 * Try the generic SCSI command ioctl's first.
2753 */ 2752 */
2754 ret = scsi_cmd_ioctl(disk->queue, disk, mode, cmd, argp); 2753 ret = scsi_cmd_blk_ioctl(bdev, mode, cmd, argp);
2755 if (ret != -ENOTTY) 2754 if (ret != -ENOTTY)
2756 return ret; 2755 return ret;
2757 2756
diff --git a/drivers/ide/ide-floppy_ioctl.c b/drivers/ide/ide-floppy_ioctl.c
index d267b7affad6..a22ca8467010 100644
--- a/drivers/ide/ide-floppy_ioctl.c
+++ b/drivers/ide/ide-floppy_ioctl.c
@@ -292,8 +292,7 @@ int ide_floppy_ioctl(ide_drive_t *drive, struct block_device *bdev,
292 * and CDROM_SEND_PACKET (legacy) ioctls 292 * and CDROM_SEND_PACKET (legacy) ioctls
293 */ 293 */
294 if (cmd != CDROM_SEND_PACKET && cmd != SCSI_IOCTL_SEND_COMMAND) 294 if (cmd != CDROM_SEND_PACKET && cmd != SCSI_IOCTL_SEND_COMMAND)
295 err = scsi_cmd_ioctl(bdev->bd_disk->queue, bdev->bd_disk, 295 err = scsi_cmd_blk_ioctl(bdev, mode, cmd, argp);
296 mode, cmd, argp);
297 296
298 if (err == -ENOTTY) 297 if (err == -ENOTTY)
299 err = generic_ide_ioctl(drive, bdev, cmd, arg); 298 err = generic_ide_ioctl(drive, bdev, cmd, arg);
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 7b3f8075e2a5..b4d57bb04c72 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1097,7 +1097,7 @@ static int sd_ioctl(struct block_device *bdev, fmode_t mode,
1097 error = scsi_ioctl(sdp, cmd, p); 1097 error = scsi_ioctl(sdp, cmd, p);
1098 break; 1098 break;
1099 default: 1099 default:
1100 error = scsi_cmd_ioctl(disk->queue, disk, mode, cmd, p); 1100 error = scsi_cmd_blk_ioctl(bdev, mode, cmd, p);
1101 if (error != -ENOTTY) 1101 if (error != -ENOTTY)
1102 break; 1102 break;
1103 error = scsi_ioctl(sdp, cmd, p); 1103 error = scsi_ioctl(sdp, cmd, p);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 94acd8172b5b..ca7b869508c7 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -675,6 +675,8 @@ extern int blk_insert_cloned_request(struct request_queue *q,
675 struct request *rq); 675 struct request *rq);
676extern void blk_delay_queue(struct request_queue *, unsigned long); 676extern void blk_delay_queue(struct request_queue *, unsigned long);
677extern void blk_recount_segments(struct request_queue *, struct bio *); 677extern void blk_recount_segments(struct request_queue *, struct bio *);
678extern int scsi_cmd_blk_ioctl(struct block_device *, fmode_t,
679 unsigned int, void __user *);
678extern int scsi_cmd_ioctl(struct request_queue *, struct gendisk *, fmode_t, 680extern int scsi_cmd_ioctl(struct request_queue *, struct gendisk *, fmode_t,
679 unsigned int, void __user *); 681 unsigned int, void __user *);
680extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t, 682extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t,