From: Milan Broz Date: Tue, 3 Oct 2006 08:15:18 +0000 (-0700) Subject: [PATCH] dm linear: support ioctls X-Git-Tag: v2.6.19-rc1~282 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=ab17ffa440cb54ca64111fa4922ba12496fcc8af;p=linux-2.6-omap-h63xx.git [PATCH] dm linear: support ioctls When an ioctl is performed on a device with a linear target, simply pass it on to the underlying block device. Note that the ioctl will pass through the filtering in blkdev_ioctl() twice. Signed-off-by: Milan Broz Signed-off-by: Alasdair G Kergon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/md/dm-linear.c b/drivers/md/dm-linear.c index 47b3c62bbdb..c58f072ccae 100644 --- a/drivers/md/dm-linear.c +++ b/drivers/md/dm-linear.c @@ -98,14 +98,25 @@ static int linear_status(struct dm_target *ti, status_type_t type, return 0; } +static int linear_ioctl(struct dm_target *ti, struct inode *inode, + struct file *filp, unsigned int cmd, + unsigned long arg) +{ + struct linear_c *lc = (struct linear_c *) ti->private; + struct block_device *bdev = lc->dev->bdev; + + return blkdev_ioctl(bdev->bd_inode, filp, cmd, arg); +} + static struct target_type linear_target = { .name = "linear", - .version= {1, 0, 1}, + .version= {1, 0, 2}, .module = THIS_MODULE, .ctr = linear_ctr, .dtr = linear_dtr, .map = linear_map, .status = linear_status, + .ioctl = linear_ioctl, }; int __init dm_linear_init(void)