aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-01-12 10:01:27 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-14 18:07:24 -0500
commit577ebb374c78314ac4617242f509e2f5e7156649 (patch)
tree690ae95d67bb8f9fd66bc0daebc90a46904420ac /block
parent81d48f0aee544885c39ef6e1ffb1175f276e6adf (diff)
block: add and use scsi_blk_cmd_ioctl
Introduce a wrapper around scsi_cmd_ioctl that takes a block device. The function will then be enhanced to detect partition block devices and, in that case, subject the ioctls to whitelisting. Cc: linux-scsi@vger.kernel.org Cc: Jens Axboe <axboe@kernel.dk> Cc: James Bottomley <JBottomley@parallels.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'block')
-rw-r--r--block/scsi_ioctl.c7
1 files changed, 7 insertions, 0 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);