aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlasdair G Kergon <agk@redhat.com>2006-10-03 04:15:21 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-03 11:04:13 -0400
commit7006f6eca874cd44d37ccb8cfeb8bed04e3bff22 (patch)
tree2e0827157e770e62493dea144e5d9ef73091e554
parent9af4aa30b713a58e5952045f52c41a6e3baa2fdc (diff)
[PATCH] dm: export blkdev_driver_ioctl
Export blkdev_driver_ioctl for device-mapper. If we get as far as the device-mapper ioctl handler, we know the ioctl is not a standard block layer BLK* one, so we don't need to check for them a second time and can call blkdev_driver_ioctl() directly. 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>
-rw-r--r--block/ioctl.c5
-rw-r--r--drivers/md/dm-linear.c2
-rw-r--r--drivers/md/dm-mpath.c3
-rw-r--r--include/linux/fs.h3
4 files changed, 9 insertions, 4 deletions
diff --git a/block/ioctl.c b/block/ioctl.c
index 309760b7e37f..58aab630dfc1 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -199,8 +199,8 @@ static int blkdev_locked_ioctl(struct file *file, struct block_device *bdev,
199 return -ENOIOCTLCMD; 199 return -ENOIOCTLCMD;
200} 200}
201 201
202static int blkdev_driver_ioctl(struct inode *inode, struct file *file, 202int blkdev_driver_ioctl(struct inode *inode, struct file *file,
203 struct gendisk *disk, unsigned cmd, unsigned long arg) 203 struct gendisk *disk, unsigned cmd, unsigned long arg)
204{ 204{
205 int ret; 205 int ret;
206 if (disk->fops->unlocked_ioctl) 206 if (disk->fops->unlocked_ioctl)
@@ -215,6 +215,7 @@ static int blkdev_driver_ioctl(struct inode *inode, struct file *file,
215 215
216 return -ENOTTY; 216 return -ENOTTY;
217} 217}
218EXPORT_SYMBOL_GPL(blkdev_driver_ioctl);
218 219
219int blkdev_ioctl(struct inode *inode, struct file *file, unsigned cmd, 220int blkdev_ioctl(struct inode *inode, struct file *file, unsigned cmd,
220 unsigned long arg) 221 unsigned long arg)
diff --git a/drivers/md/dm-linear.c b/drivers/md/dm-linear.c
index c58f072ccae6..2a6bad451f86 100644
--- a/drivers/md/dm-linear.c
+++ b/drivers/md/dm-linear.c
@@ -105,7 +105,7 @@ static int linear_ioctl(struct dm_target *ti, struct inode *inode,
105 struct linear_c *lc = (struct linear_c *) ti->private; 105 struct linear_c *lc = (struct linear_c *) ti->private;
106 struct block_device *bdev = lc->dev->bdev; 106 struct block_device *bdev = lc->dev->bdev;
107 107
108 return blkdev_ioctl(bdev->bd_inode, filp, cmd, arg); 108 return blkdev_driver_ioctl(bdev->bd_inode, filp, bdev->bd_disk, cmd, arg);
109} 109}
110 110
111static struct target_type linear_target = { 111static struct target_type linear_target = {
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index 14cfdb538efd..dcfbf830964c 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -1290,7 +1290,8 @@ static int multipath_ioctl(struct dm_target *ti, struct inode *inode,
1290 1290
1291 spin_unlock_irqrestore(&m->lock, flags); 1291 spin_unlock_irqrestore(&m->lock, flags);
1292 1292
1293 return r ? : blkdev_ioctl(bdev->bd_inode, filp, cmd, arg); 1293 return r ? : blkdev_driver_ioctl(bdev->bd_inode, filp, bdev->bd_disk,
1294 cmd, arg);
1294} 1295}
1295 1296
1296/*----------------------------------------------------------------- 1297/*-----------------------------------------------------------------
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 7b61e94bf8fc..f53bf4ff1955 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1523,6 +1523,9 @@ extern const struct file_operations def_fifo_fops;
1523#ifdef CONFIG_BLOCK 1523#ifdef CONFIG_BLOCK
1524extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); 1524extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long);
1525extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); 1525extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long);
1526extern int blkdev_driver_ioctl(struct inode *inode, struct file *file,
1527 struct gendisk *disk, unsigned cmd,
1528 unsigned long arg);
1526extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); 1529extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long);
1527extern int blkdev_get(struct block_device *, mode_t, unsigned); 1530extern int blkdev_get(struct block_device *, mode_t, unsigned);
1528extern int blkdev_put(struct block_device *); 1531extern int blkdev_put(struct block_device *);