nilfs2: clean up indirect function calling conventions
[pandora-kernel.git] / fs / ioctl.c
index 421aab4..ac2d47e 100644 (file)
@@ -427,20 +427,12 @@ static int ioctl_fioasync(unsigned int fd, struct file *filp,
        /* Did FASYNC state change ? */
        if ((flag ^ filp->f_flags) & FASYNC) {
                if (filp->f_op && filp->f_op->fasync)
+                       /* fasync() adjusts filp->f_flags */
                        error = filp->f_op->fasync(fd, filp, on);
                else
                        error = -ENOTTY;
        }
-       if (error)
-               return error;
-
-       spin_lock(&filp->f_lock);
-       if (on)
-               filp->f_flags |= FASYNC;
-       else
-               filp->f_flags &= ~FASYNC;
-       spin_unlock(&filp->f_lock);
-       return error;
+       return error < 0 ? error : 0;
 }
 
 static int ioctl_fsfreeze(struct file *filp)
@@ -507,10 +499,7 @@ int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd,
                break;
 
        case FIOASYNC:
-               /* BKL needed to avoid races tweaking f_flags */
-               lock_kernel();
                error = ioctl_fioasync(fd, filp, argp);
-               unlock_kernel();
                break;
 
        case FIOQSIZE: