Unionfs: support ->unlocked_ioctl and ->compat_ioctl
authorErez Zadok <ezk@cs.sunysb.edu>
Fri, 24 Sep 2010 06:27:44 +0000 (02:27 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Sun, 24 Nov 2013 19:27:41 +0000 (14:27 -0500)
Old ->ioctl was split into ->unlocked_ioctl and ->compat_ioctl.  Compat
version doesn't need to lock_kernel any longer.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/commonfops.c
fs/unionfs/file.c

index 740c4ade190ae2a9aefe738c321a953b44d814ba..51ea65e82b4772287084ae62090e7410c765e37d 100644 (file)
@@ -739,12 +739,12 @@ static long do_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                goto out;
        if (lower_file->f_op->unlocked_ioctl) {
                err = lower_file->f_op->unlocked_ioctl(lower_file, cmd, arg);
+#ifdef CONFIG_COMPAT
        } else if (lower_file->f_op->ioctl) {
-               lock_kernel();
-               err = lower_file->f_op->ioctl(
+               err = lower_file->f_op->compat_ioctl(
                        lower_file->f_path.dentry->d_inode,
                        lower_file, cmd, arg);
-               unlock_kernel();
+#endif
        }
 
 out:
index 5a8f4e0774bc427ddfa7eaba99d51fb0dac5236b..1c694c3737d8666882c1e5c33e3f0b8740baed4e 100644 (file)
@@ -368,6 +368,9 @@ struct file_operations unionfs_main_fops = {
        .write          = unionfs_write,
        .readdir        = unionfs_file_readdir,
        .unlocked_ioctl = unionfs_ioctl,
+#ifdef CONFIG_COMPAT
+       .compat_ioctl   = unionfs_ioctl,
+#endif
        .mmap           = unionfs_mmap,
        .open           = unionfs_open,
        .flush          = unionfs_flush,