Skip to content

Commit

Permalink
[PATCH] dm linear: support ioctls
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Milan Broz authored and Linus Torvalds committed Oct 3, 2006
1 parent aa129a2 commit ab17ffa
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion drivers/md/dm-linear.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ab17ffa

Please sign in to comment.