aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2006-01-09 23:52:12 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-10 11:01:32 -0500
commit8262037f406dc8e0908ad51f355c3dfd4d662aba (patch)
tree43d60f935d3e5eeb089c90cbca204ac7bfa61576
parentec3cad96901373ad0e21611cfbcc372fe09df1f7 (diff)
[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>
-rw-r--r--arch/s390/kernel/compat_ioctl.c21
-rw-r--r--drivers/s390/block/dasd.c1
-rw-r--r--drivers/s390/block/dasd_int.h1
-rw-r--r--drivers/s390/block/dasd_ioctl.c12
4 files changed, 14 insertions, 21 deletions
diff --git a/arch/s390/kernel/compat_ioctl.c b/arch/s390/kernel/compat_ioctl.c
index 432aeb38b50d..d716b1768c99 100644
--- a/arch/s390/kernel/compat_ioctl.c
+++ b/arch/s390/kernel/compat_ioctl.c
@@ -42,27 +42,6 @@ struct ioctl_trans ioctl_start[] = {
42#include <linux/compat_ioctl.h> 42#include <linux/compat_ioctl.h>
43#define DECLARES 43#define DECLARES
44#include "../../../fs/compat_ioctl.c" 44#include "../../../fs/compat_ioctl.c"
45
46/* s390 only ioctls */
47COMPATIBLE_IOCTL(DASDAPIVER)
48COMPATIBLE_IOCTL(BIODASDDISABLE)
49COMPATIBLE_IOCTL(BIODASDENABLE)
50COMPATIBLE_IOCTL(BIODASDRSRV)
51COMPATIBLE_IOCTL(BIODASDRLSE)
52COMPATIBLE_IOCTL(BIODASDSLCK)
53COMPATIBLE_IOCTL(BIODASDINFO)
54COMPATIBLE_IOCTL(BIODASDINFO2)
55COMPATIBLE_IOCTL(BIODASDFMT)
56COMPATIBLE_IOCTL(BIODASDPRRST)
57COMPATIBLE_IOCTL(BIODASDQUIESCE)
58COMPATIBLE_IOCTL(BIODASDRESUME)
59COMPATIBLE_IOCTL(BIODASDPRRD)
60COMPATIBLE_IOCTL(BIODASDPSRD)
61COMPATIBLE_IOCTL(BIODASDGATTR)
62COMPATIBLE_IOCTL(BIODASDSATTR)
63COMPATIBLE_IOCTL(BIODASDCMFENABLE)
64COMPATIBLE_IOCTL(BIODASDCMFDISABLE)
65COMPATIBLE_IOCTL(BIODASDREADALLCMB)
66}; 45};
67 46
68int ioctl_table_size = ARRAY_SIZE(ioctl_start); 47int ioctl_table_size = ARRAY_SIZE(ioctl_start);
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index 2472fa1a1be1..9c25654b1e75 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -1751,6 +1751,7 @@ dasd_device_operations = {
1751 .open = dasd_open, 1751 .open = dasd_open,
1752 .release = dasd_release, 1752 .release = dasd_release,
1753 .ioctl = dasd_ioctl, 1753 .ioctl = dasd_ioctl,
1754 .compat_ioctl = dasd_compat_ioctl,
1754 .getgeo = dasd_getgeo, 1755 .getgeo = dasd_getgeo,
1755}; 1756};
1756 1757
diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h
index 2fb05c4a528c..e4b401500b01 100644
--- a/drivers/s390/block/dasd_int.h
+++ b/drivers/s390/block/dasd_int.h
@@ -527,6 +527,7 @@ void dasd_ioctl_exit(void);
527int dasd_ioctl_no_register(struct module *, int, dasd_ioctl_fn_t); 527int dasd_ioctl_no_register(struct module *, int, dasd_ioctl_fn_t);
528int dasd_ioctl_no_unregister(struct module *, int, dasd_ioctl_fn_t); 528int dasd_ioctl_no_unregister(struct module *, int, dasd_ioctl_fn_t);
529int dasd_ioctl(struct inode *, struct file *, unsigned int, unsigned long); 529int dasd_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
530long dasd_compat_ioctl(struct file *, unsigned int, unsigned long);
530 531
531/* externals in dasd_proc.c */ 532/* externals in dasd_proc.c */
532int dasd_proc_init(void); 533int dasd_proc_init(void);
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c
index 8e4dcd58599e..9396fcacb8f8 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,
118 return -EINVAL; 118 return -EINVAL;
119} 119}
120 120
121long
122dasd_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
121static int 133static int
122dasd_ioctl_api_version(struct block_device *bdev, int no, long args) 134dasd_ioctl_api_version(struct block_device *bdev, int no, long args)
123{ 135{