diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2012-01-12 16:01:27 +0100 |
---|---|---|
committer | Willy Tarreau <w@1wt.eu> | 2012-02-11 15:40:54 +0100 |
commit | 7d064959836f6ab504b80a6ad858ed14aa0bb7a0 (patch) | |
tree | d7413b3891ec4c786ff1a2de21a31bcdbbe7c8b7 /block | |
parent | d172827c67001f409b59264cf2dd87e090681d7d (diff) |
block: add and use scsi_blk_cmd_ioctl
commit 577ebb374c78314ac4617242f509e2f5e7156649 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
[bwh: Backport to 2.6.32 - adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
[wt: slightly changed the interface to match 2.6.27's scsi_cmd_ioctl()
which still needs the file pointer but has no mode parameter].
Signed-off-by: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'block')
-rw-r--r-- | block/scsi_ioctl.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index dd3281a5fb5f..29dc026ca315 100644 --- a/block/scsi_ioctl.c +++ b/block/scsi_ioctl.c @@ -653,3 +653,11 @@ int scsi_cmd_ioctl(struct file *file, struct request_queue *q, } EXPORT_SYMBOL(scsi_cmd_ioctl); + +int scsi_cmd_blk_ioctl(struct file *file, struct block_device *bd, + unsigned int cmd, void __user *arg) +{ + return scsi_cmd_ioctl(file, bd->bd_disk->queue, bd->bd_disk, cmd, arg); +} +EXPORT_SYMBOL(scsi_cmd_blk_ioctl); + |