tty: replace BKL with a new tty_lock
[linux-2.6-block.git] / drivers / char / vt_ioctl.c
index 72dcfb2dc1262911daf3d5e64f043b67425652c7..cf87c533622906047b72c0dc94d8a00f009ee1c1 100644 (file)
@@ -509,7 +509,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
 
        console = vc->vc_num;
 
-       lock_kernel();
+       tty_lock();
 
        if (!vc_cons_allocated(console)) {      /* impossible? */
                ret = -ENOIOCTLCMD;
@@ -1336,7 +1336,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
                ret = -ENOIOCTLCMD;
        }
 out:
-       unlock_kernel();
+       tty_unlock();
        return ret;
 eperm:
        ret = -EPERM;
@@ -1503,7 +1503,7 @@ long vt_compat_ioctl(struct tty_struct *tty, struct file * file,
 
        console = vc->vc_num;
 
-       lock_kernel();
+       tty_lock();
 
        if (!vc_cons_allocated(console)) {      /* impossible? */
                ret = -ENOIOCTLCMD;
@@ -1571,11 +1571,11 @@ long vt_compat_ioctl(struct tty_struct *tty, struct file * file,
                goto fallback;
        }
 out:
-       unlock_kernel();
+       tty_unlock();
        return ret;
 
 fallback:
-       unlock_kernel();
+       tty_unlock();
        return vt_ioctl(tty, file, cmd, arg);
 }