From 8262037f406dc8e0908ad51f355c3dfd4d662aba Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 9 Jan 2006 20:52:12 -0800 Subject: [PATCH] add ->compat_ioctl to dasd Add a compat_ioctl method to the dasd driver so the last entries in arch/s390/kernel/compat_ioctl.c can go away. Unlike the previous attempt this one does not replace the ioctl method with an unlocked_ioctl method so that the ioctl_by_bdev calls in s390 partition code continue to work. Signed-off-by: Christoph Hellwig Cc: Martin Schwidefsky Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/s390/block/dasd.c | 1 + drivers/s390/block/dasd_int.h | 1 + drivers/s390/block/dasd_ioctl.c | 12 ++++++++++++ 3 files changed, 14 insertions(+) (limited to 'drivers/s390') diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 2472fa1a1be..9c25654b1e7 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -1751,6 +1751,7 @@ dasd_device_operations = { .open = dasd_open, .release = dasd_release, .ioctl = dasd_ioctl, + .compat_ioctl = dasd_compat_ioctl, .getgeo = dasd_getgeo, }; diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h index 2fb05c4a528..e4b401500b0 100644 --- a/drivers/s390/block/dasd_int.h +++ b/drivers/s390/block/dasd_int.h @@ -527,6 +527,7 @@ void dasd_ioctl_exit(void); int dasd_ioctl_no_register(struct module *, int, dasd_ioctl_fn_t); int dasd_ioctl_no_unregister(struct module *, int, dasd_ioctl_fn_t); int dasd_ioctl(struct inode *, struct file *, unsigned int, unsigned long); +long dasd_compat_ioctl(struct file *, unsigned int, unsigned long); /* externals in dasd_proc.c */ int dasd_proc_init(void); diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c index 8e4dcd58599..9396fcacb8f 100644 --- a/drivers/s390/block/dasd_ioctl.c +++ b/drivers/s390/block/dasd_ioctl.c @@ -118,6 +118,18 @@ dasd_ioctl(struct inode *inp, struct file *filp, return -EINVAL; } +long +dasd_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) +{ + int rval; + + lock_kernel(); + rval = dasd_ioctl(filp->f_dentry->d_inode, filp, cmd, arg); + unlock_kernel(); + + return (rval == -EINVAL) ? -ENOIOCTLCMD : rval; +} + static int dasd_ioctl_api_version(struct block_device *bdev, int no, long args) { -- cgit v1.2.3-18-g5258