From f58c4c0a17e500e767473598b3deafaa1d64051d Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Tue, 9 Oct 2007 13:23:51 +0200 Subject: compat_ioctl: move common block ioctls to compat_blkdev_ioctl Make compat_blkdev_ioctl and blkdev_ioctl reflect the respective native versions. This is somewhat more efficient and makes it easier to keep the two in sync. Also get rid of the bogus handling for broken_blkgetsize and the duplicate entry for BLKRASET. Signed-off-by: Arnd Bergmann Signed-off-by: Jens Axboe --- block/ioctl.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'block/ioctl.c') diff --git a/block/ioctl.c b/block/ioctl.c index f7e3e8abf887..52d6385216ad 100644 --- a/block/ioctl.c +++ b/block/ioctl.c @@ -217,6 +217,10 @@ int blkdev_driver_ioctl(struct inode *inode, struct file *file, } EXPORT_SYMBOL_GPL(blkdev_driver_ioctl); +/* + * always keep this in sync with compat_blkdev_ioctl() and + * compat_blkdev_locked_ioctl() + */ int blkdev_ioctl(struct inode *inode, struct file *file, unsigned cmd, unsigned long arg) { @@ -284,21 +288,4 @@ int blkdev_ioctl(struct inode *inode, struct file *file, unsigned cmd, return blkdev_driver_ioctl(inode, file, disk, cmd, arg); } - -/* Most of the generic ioctls are handled in the normal fallback path. - This assumes the blkdev's low level compat_ioctl always returns - ENOIOCTLCMD for unknown ioctls. */ -long compat_blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg) -{ - struct block_device *bdev = file->f_path.dentry->d_inode->i_bdev; - struct gendisk *disk = bdev->bd_disk; - int ret = -ENOIOCTLCMD; - if (disk->fops->compat_ioctl) { - lock_kernel(); - ret = disk->fops->compat_ioctl(file, cmd, arg); - unlock_kernel(); - } - return ret; -} - EXPORT_SYMBOL_GPL(blkdev_ioctl); -- cgit v1.2.3