summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2006-01-09 20:52:07 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-10 08:01:31 -0800
commitf042e0f80b0a9f5bb57c36d60a2798de6ca943b2 (patch)
tree57d8835c4683ec3456ebd73d3c65df0ec5725a74
parent51a990588a3e38f7963964813786fa4f0da43ecc (diff)
downloadblackbird-op-linux-f042e0f80b0a9f5bb57c36d60a2798de6ca943b2.tar.gz
blackbird-op-linux-f042e0f80b0a9f5bb57c36d60a2798de6ca943b2.zip
[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)
COMPATIBLE_IOCTL(BIODASDCMFENABLE)
COMPATIBLE_IOCTL(BIODASDCMFDISABLE)
COMPATIBLE_IOCTL(BIODASDREADALLCMB)
-
-COMPATIBLE_IOCTL(TAPE390_DISPLAY)
};
int 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 *);
static int tapechar_release(struct inode *,struct file *);
static int tapechar_ioctl(struct inode *, struct file *, unsigned int,
unsigned long);
+static long tapechar_compat_ioctl(struct file *, unsigned int,
+ unsigned long);
static struct file_operations tape_fops =
{
@@ -44,6 +46,7 @@ static struct file_operations tape_fops =
.read = tapechar_read,
.write = tapechar_write,
.ioctl = tapechar_ioctl,
+ .compat_ioctl = tapechar_compat_ioctl,
.open = tapechar_open,
.release = tapechar_release,
};
@@ -463,6 +466,23 @@ tapechar_ioctl(struct inode *inp, struct file *filp,
return device->discipline->ioctl_fn(device, no, data);
}
+static long
+tapechar_compat_ioctl(struct file *filp, unsigned int no, unsigned long data)
+{
+ struct tape_device *device = filp->private_data;
+ int rval = -ENOIOCTLCMD;
+
+ if (device->discipline->ioctl_fn) {
+ lock_kernel();
+ rval = device->discipline->ioctl_fn(device, no, data);
+ unlock_kernel();
+ if (rval == -EINVAL)
+ rval = -ENOIOCTLCMD;
+ }
+
+ return rval;
+}
+
/*
* Initialize character device frontend.
*/
OpenPOWER on IntegriCloud