tty: replace BKL with a new tty_lock

As a preparation for replacing the big kernel lock
in the TTY layer, wrap all the callers in new
macros tty_lock, tty_lock_nested and tty_unlock.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Arnd Bergmann
2010-06-01 22:53:01 +02:00
committed by Greg Kroah-Hartman
parent 3f582b8c11
commit ec79d6056d
17 changed files with 161 additions and 115 deletions

View File

@@ -67,15 +67,15 @@ static void set_led(char state)
static int briq_panel_open(struct inode *ino, struct file *filep)
{
lock_kernel();
tty_lock();
/* enforce single access, vfd_is_open is protected by BKL */
if (vfd_is_open) {
unlock_kernel();
tty_unlock();
return -EBUSY;
}
vfd_is_open = 1;
unlock_kernel();
tty_unlock();
return 0;
}