Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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 <hch@lst.de>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Christoph Hellwig and committed by
Linus Torvalds
8262037f ec3cad96

+14 -21
-21
arch/s390/kernel/compat_ioctl.c
··· 42 42 #include <linux/compat_ioctl.h> 43 43 #define DECLARES 44 44 #include "../../../fs/compat_ioctl.c" 45 - 46 - /* s390 only ioctls */ 47 - COMPATIBLE_IOCTL(DASDAPIVER) 48 - COMPATIBLE_IOCTL(BIODASDDISABLE) 49 - COMPATIBLE_IOCTL(BIODASDENABLE) 50 - COMPATIBLE_IOCTL(BIODASDRSRV) 51 - COMPATIBLE_IOCTL(BIODASDRLSE) 52 - COMPATIBLE_IOCTL(BIODASDSLCK) 53 - COMPATIBLE_IOCTL(BIODASDINFO) 54 - COMPATIBLE_IOCTL(BIODASDINFO2) 55 - COMPATIBLE_IOCTL(BIODASDFMT) 56 - COMPATIBLE_IOCTL(BIODASDPRRST) 57 - COMPATIBLE_IOCTL(BIODASDQUIESCE) 58 - COMPATIBLE_IOCTL(BIODASDRESUME) 59 - COMPATIBLE_IOCTL(BIODASDPRRD) 60 - COMPATIBLE_IOCTL(BIODASDPSRD) 61 - COMPATIBLE_IOCTL(BIODASDGATTR) 62 - COMPATIBLE_IOCTL(BIODASDSATTR) 63 - COMPATIBLE_IOCTL(BIODASDCMFENABLE) 64 - COMPATIBLE_IOCTL(BIODASDCMFDISABLE) 65 - COMPATIBLE_IOCTL(BIODASDREADALLCMB) 66 45 }; 67 46 68 47 int ioctl_table_size = ARRAY_SIZE(ioctl_start);
+1
drivers/s390/block/dasd.c
··· 1751 1751 .open = dasd_open, 1752 1752 .release = dasd_release, 1753 1753 .ioctl = dasd_ioctl, 1754 + .compat_ioctl = dasd_compat_ioctl, 1754 1755 .getgeo = dasd_getgeo, 1755 1756 }; 1756 1757
+1
drivers/s390/block/dasd_int.h
··· 527 527 int dasd_ioctl_no_register(struct module *, int, dasd_ioctl_fn_t); 528 528 int dasd_ioctl_no_unregister(struct module *, int, dasd_ioctl_fn_t); 529 529 int dasd_ioctl(struct inode *, struct file *, unsigned int, unsigned long); 530 + long dasd_compat_ioctl(struct file *, unsigned int, unsigned long); 530 531 531 532 /* externals in dasd_proc.c */ 532 533 int dasd_proc_init(void);
+12
drivers/s390/block/dasd_ioctl.c
··· 118 118 return -EINVAL; 119 119 } 120 120 121 + long 122 + dasd_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 123 + { 124 + int rval; 125 + 126 + lock_kernel(); 127 + rval = dasd_ioctl(filp->f_dentry->d_inode, filp, cmd, arg); 128 + unlock_kernel(); 129 + 130 + return (rval == -EINVAL) ? -ENOIOCTLCMD : rval; 131 + } 132 + 121 133 static int 122 134 dasd_ioctl_api_version(struct block_device *bdev, int no, long args) 123 135 {