lkml.org 
[lkml]   [2005]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 4/4] ->compat_ioctl for 390 tape_char
Date
On Sünnavend 05 November 2005 00:51, Christoph Hellwig wrote:
> we return -ENOIOCTLCMD if we didn't have a valid compat ioctl, and in
> that case the vfs code will try to find it in the core translation
> table.

No, the function you wrote returns -ENOIOCTLCMD only if
device->discipline->ioctl_fn is NULL, otherwise it returns the
code it gets from that function, which is -EINVAL.

> I'm not sure moving everything from fs/compat_ioctl.c is a good idea.
> Everything that is just in a single driver or subsystem that has
> common ioctl code - sure.  else it doesn't make a lot of sense.

It turns out that almost everything is a single driver, the exceptions
are:

- tty ioctls: I move the conversion into drivers/char/tty_io.c with a
relatively big switch() statement. All drivers implementing these
use tty_operations.
- block ioctl: similar for drivers/block/ioctl.c
- net ioctl: similar for net/compat.c. I also add compat_ioctl methods
for proto_ops.
- cdrom, tape, v4l: I create a new file that contains a compat_ioctl
file operation that can be used in each driver, either by pointing
directly to it or by calling it from their own compat_ioctl
handler. The handlers end up calling f_op->ioctl() internally.
- file systems: many file systems implement EXT2_IOC_GETFLAGS etc.
those are trivial to handle, so I duplicate the code for each of those
file systems.

Arnd <><
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-11-05 02:18    [from the cache]
©2003-2011 Jasper Spaans