aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2006-01-09 23:52:07 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-10 11:01:31 -0500
commitf042e0f80b0a9f5bb57c36d60a2798de6ca943b2 (patch)
tree57d8835c4683ec3456ebd73d3c65df0ec5725a74
parent51a990588a3e38f7963964813786fa4f0da43ecc (diff)
[PATCH] ->compat_ioctl for 390 tape_char
The only own ioctl, TAPE390_DISPLAY, is compat_clean, everything else is routed through common translation code. 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.c2
-rw-r--r--drivers/s390/char/tape_char.c20
2 files changed, 20 insertions, 2 deletions
diff --git a/arch/s390/kernel/compat_ioctl.c b/arch/s390/kernel/compat_ioctl.c
index da473bda962f..432aeb38b50d 100644
--- a/arch/s390/kernel/compat_ioctl.c
+++ b/arch/s390/kernel/compat_ioctl.c
@@ -63,8 +63,6 @@ COMPATIBLE_IOCTL(BIODASDSATTR)
63COMPATIBLE_IOCTL(BIODASDCMFENABLE) 63COMPATIBLE_IOCTL(BIODASDCMFENABLE)
64COMPATIBLE_IOCTL(BIODASDCMFDISABLE) 64COMPATIBLE_IOCTL(BIODASDCMFDISABLE)
65COMPATIBLE_IOCTL(BIODASDREADALLCMB) 65COMPATIBLE_IOCTL(BIODASDREADALLCMB)
66
67COMPATIBLE_IOCTL(TAPE390_DISPLAY)
68}; 66};
69 67
70int ioctl_table_size = ARRAY_SIZE(ioctl_start); 68int ioctl_table_size = ARRAY_SIZE(ioctl_start);
diff --git a/drivers/s390/char/tape_char.c b/drivers/s390/char/tape_char.c
index 86262a13f7c6..5ce7ca38ace0 100644
--- a/drivers/s390/char/tape_char.c
+++ b/drivers/s390/char/tape_char.c
@@ -37,6 +37,8 @@ static int tapechar_open(struct inode *,struct file *);
37static int tapechar_release(struct inode *,struct file *); 37static int tapechar_release(struct inode *,struct file *);
38static int tapechar_ioctl(struct inode *, struct file *, unsigned int, 38static int tapechar_ioctl(struct inode *, struct file *, unsigned int,
39 unsigned long); 39 unsigned long);
40static long tapechar_compat_ioctl(struct file *, unsigned int,
41 unsigned long);
40 42
41static struct file_operations tape_fops = 43static struct file_operations tape_fops =
42{ 44{
@@ -44,6 +46,7 @@ static struct file_operations tape_fops =
44 .read = tapechar_read, 46 .read = tapechar_read,
45 .write = tapechar_write, 47 .write = tapechar_write,
46 .ioctl = tapechar_ioctl, 48 .ioctl = tapechar_ioctl,
49 .compat_ioctl = tapechar_compat_ioctl,
47 .open = tapechar_open, 50 .open = tapechar_open,
48 .release = tapechar_release, 51 .release = tapechar_release,
49}; 52};
@@ -463,6 +466,23 @@ tapechar_ioctl(struct inode *inp, struct file *filp,
463 return device->discipline->ioctl_fn(device, no, data); 466 return device->discipline->ioctl_fn(device, no, data);
464} 467}
465 468
469static long
470tapechar_compat_ioctl(struct file *filp, unsigned int no, unsigned long data)
471{
472 struct tape_device *device = filp->private_data;
473 int rval = -ENOIOCTLCMD;
474
475 if (device->discipline->ioctl_fn) {
476 lock_kernel();
477 rval = device->discipline->ioctl_fn(device, no, data);
478 unlock_kernel();
479 if (rval == -EINVAL)
480 rval = -ENOIOCTLCMD;
481 }
482
483 return rval;
484}
485
466/* 486/*
467 * Initialize character device frontend. 487 * Initialize character device frontend.
468 */ 488 */