* [PATCH 02/15] dm linear: support ioctls
@ 2006-06-21 19:33 Alasdair G Kergon
2006-06-22 3:56 ` Andrew Morton
0 siblings, 1 reply; 2+ messages in thread
From: Alasdair G Kergon @ 2006-06-21 19:33 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel, Milan Broz
From: Milan Broz <mbroz@redhat.com>
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 <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Index: linux-2.6.17/drivers/md/dm-linear.c
===================================================================
--- linux-2.6.17.orig/drivers/md/dm-linear.c 2006-06-21 17:45:16.000000000 +0100
+++ linux-2.6.17/drivers/md/dm-linear.c 2006-06-21 18:32:07.000000000 +0100
@@ -96,14 +96,25 @@ static int linear_status(struct dm_targe
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)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 02/15] dm linear: support ioctls
2006-06-21 19:33 [PATCH 02/15] dm linear: support ioctls Alasdair G Kergon
@ 2006-06-22 3:56 ` Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2006-06-22 3:56 UTC (permalink / raw)
To: Alasdair G Kergon; +Cc: linux-kernel, mbroz
On Wed, 21 Jun 2006 20:33:08 +0100
Alasdair G Kergon <agk@redhat.com> wrote:
> From: Milan Broz <mbroz@redhat.com>
>
> 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 <mbroz@redhat.com>
> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
>
> Index: linux-2.6.17/drivers/md/dm-linear.c
> ===================================================================
> --- linux-2.6.17.orig/drivers/md/dm-linear.c 2006-06-21 17:45:16.000000000 +0100
> +++ linux-2.6.17/drivers/md/dm-linear.c 2006-06-21 18:32:07.000000000 +0100
> @@ -96,14 +96,25 @@ static int linear_status(struct dm_targe
> 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);
> +}
but, but.. the blockdev's driver may have decided to use a different ioctl
handler.
We should go through file_operations.ioctl/unlocked_ioctl.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-06-22 3:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-21 19:33 [PATCH 02/15] dm linear: support ioctls Alasdair G Kergon
2006-06-22 3:56 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).