Skip to content

Commit

Permalink
tty: drop the BKL for driver/ldisc ioctl methods
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alan Cox authored and Linus Torvalds committed Apr 30, 2008
1 parent 1c2630c commit d17468c
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions drivers/char/tty_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit d17468c

Please sign in to comment.