aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro2008-03-02 08:09:22 -0600
committerAl Viro2008-10-21 06:47:32 -0500
commitd4430d62fa77208824a37fe6f85ab2831d274769 (patch)
tree5d4d0bca31e63eb208fbebe4f39c912b964c1e4d /block/compat_ioctl.c
parentbadf8082c33d18b118d3a6f1b32d5ea6b97d3839 (diff)
downloadkernel-common-d4430d62fa77208824a37fe6f85ab2831d274769.tar.gz
kernel-common-d4430d62fa77208824a37fe6f85ab2831d274769.tar.xz
kernel-common-d4430d62fa77208824a37fe6f85ab2831d274769.zip
[PATCH] beginning of methods conversion
To keep the size of changesets sane we split the switch by drivers; to keep the damn thing bisectable we do the following: 1) rename the affected methods, add ones with correct prototypes, make (few) callers handle both. That's this changeset. 2) for each driver convert to new methods. *ALL* drivers are converted in this series. 3) kill the old (renamed) methods. Note that it _is_ a flagday; all in-tree drivers are converted and by the end of this series no trace of old methods remain. The only reason why we do that this way is to keep the damn thing bisectable and allow per-driver debugging if anything goes wrong. New methods: open(bdev, mode) release(disk, mode) ioctl(bdev, mode, cmd, arg) /* Called without BKL */ compat_ioctl(bdev, mode, cmd, arg) locked_ioctl(bdev, mode, cmd, arg) /* Called with BKL, legacy */ Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'block/compat_ioctl.c')
-rw-r--r--block/compat_ioctl.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/block/compat_ioctl.c b/block/compat_ioctl.c
index 1e559fba7bd..576c4fd1546 100644
--- a/block/compat_ioctl.c
+++ b/block/compat_ioctl.c
@@ -708,17 +708,17 @@ static int compat_blkdev_driver_ioctl(struct inode *inode, struct file *file,
708 return -ENOIOCTLCMD; 708 return -ENOIOCTLCMD;
709 } 709 }
710 710
711 if (disk->fops->unlocked_ioctl) 711 if (disk->fops->__unlocked_ioctl)
712 return disk->fops->unlocked_ioctl(file, cmd, arg); 712 return disk->fops->__unlocked_ioctl(file, cmd, arg);
713 713
714 if (disk->fops->ioctl) { 714 if (disk->fops->__ioctl) {
715 lock_kernel(); 715 lock_kernel();
716 ret = disk->fops->ioctl(inode, file, cmd, arg); 716 ret = disk->fops->__ioctl(inode, file, cmd, arg);
717 unlock_kernel(); 717 unlock_kernel();
718 return ret; 718 return ret;
719 } 719 }
720 720
721 return -ENOTTY; 721 return __blkdev_driver_ioctl(inode->i_bdev, file->f_mode, cmd, arg);
722} 722}
723 723
724static int compat_blkdev_locked_ioctl(struct inode *inode, struct file *file, 724static int compat_blkdev_locked_ioctl(struct inode *inode, struct file *file,
@@ -805,10 +805,11 @@ long compat_blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg)
805 805
806 lock_kernel(); 806 lock_kernel();
807 ret = compat_blkdev_locked_ioctl(inode, file, bdev, cmd, arg); 807 ret = compat_blkdev_locked_ioctl(inode, file, bdev, cmd, arg);
808 /* FIXME: why do we assume -> compat_ioctl needs the BKL? */ 808 if (ret == -ENOIOCTLCMD && disk->fops->__compat_ioctl)
809 if (ret == -ENOIOCTLCMD && disk->fops->compat_ioctl) 809 ret = disk->fops->__compat_ioctl(file, cmd, arg);
810 ret = disk->fops->compat_ioctl(file, cmd, arg);
811 unlock_kernel(); 810 unlock_kernel();
811 if (ret == -ENOIOCTLCMD && disk->fops->compat_ioctl)
812 ret = disk->fops->compat_ioctl(bdev, file->f_mode, cmd, arg);
812 813
813 if (ret != -ENOIOCTLCMD) 814 if (ret != -ENOIOCTLCMD)
814 return ret; 815 return ret;