tty: drop the BKL for driver/ldisc ioctl methods
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Wed, 30 Apr 2008 07:53:34 +0000 (00:53 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 30 Apr 2008 15:29:41 +0000 (08:29 -0700)
Now we have pushed the lock down we can stop wrapping the call with a lock in
the tty layer.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/char/tty_io.c

index 2460c4c76161b7d1e1f45d70b3b093a7de38792f..35c7d2eb8b28cbd7ac876378cd31a48eab1eb4d3 100644 (file)
@@ -3459,11 +3459,8 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                switch (cmd) {
                case TIOCSBRK:
                case TIOCCBRK:
-                       if (tty->driver->ioctl) {
-                               lock_kernel();
+                       if (tty->driver->ioctl)
                                retval = tty->driver->ioctl(tty, file, cmd, arg);
-                               unlock_kernel();
-                       }
                        return retval;
 
                /* These two ioctl's always return success; even if */
@@ -3584,18 +3581,14 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                break;
        }
        if (tty->driver->ioctl) {
-               lock_kernel();
                retval = (tty->driver->ioctl)(tty, file, cmd, arg);
-               unlock_kernel();
                if (retval != -ENOIOCTLCMD)
                        return retval;
        }
        ld = tty_ldisc_ref_wait(tty);
        retval = -EINVAL;
        if (ld->ioctl) {
-               lock_kernel();
                retval = ld->ioctl(tty, file, cmd, arg);
-               unlock_kernel();
                if (retval == -ENOIOCTLCMD)
                        retval = -EINVAL;
        }