From 8b635618ac76aa0c47714918e631f5f8a36b6747 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Fri, 14 Jan 2005 23:38:01 -0800 Subject: [PATCH] ioctl rework #2 - add ->unlocked_ioctl method and a do_ioctl wrapper in ioctl.c so all places calling ->ioctl get it. THis provides us a patch to migrate away from holding bkl across ioctl implementations. - add ->compat_ioctl method and call it in compat_sys_ioctl before doing the hash lookup for registered handlers. - streamline compat_sys_ioctl and move the complex error reporting into a function of its own From: "Michael S. Tsirkin" Handle generic ioctl commands by falling back on static conversion functions in fs/compat_ioctl.c on -ENOIOCTLCMD code. From: "Michael S. Tsirkin" With new unlocked_ioctl and ioctl_compat, ioctls can now be as fast as read/write. So lets use fget_light/fput_light there, to get some speedup in common case on SMP. Signed-off-by: Michael s. Tsirkin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/fs.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/linux') diff --git a/include/linux/fs.h b/include/linux/fs.h index 4d26f55c1299..945dbfabec83 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -907,8 +907,8 @@ typedef int (*read_actor_t)(read_descriptor_t *, struct page *, unsigned long, u /* * NOTE: - * read, write, poll, fsync, readv, writev can be called - * without the big kernel lock held in all filesystems. + * read, write, poll, fsync, readv, writev, unlocked_ioctl and compat_ioctl + * can be called without the big kernel lock held in all filesystems. */ struct file_operations { struct module *owner; @@ -920,6 +920,8 @@ struct file_operations { int (*readdir) (struct file *, void *, filldir_t); unsigned int (*poll) (struct file *, struct poll_table_struct *); int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long); + long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); + long (*compat_ioctl) (struct file *, unsigned int, unsigned long); int (*mmap) (struct file *, struct vm_area_struct *); int (*open) (struct inode *, struct file *); int (*flush) (struct file *); -- cgit v1.2.3