Lines Matching defs:tty
2 #include <linux/tty.h>
7 #include "tty.h"
9 /* Legacy tty mutex glue */
12 * Getting the big tty mutex.
15 void tty_lock(struct tty_struct *tty)
17 if (WARN(tty->magic != TTY_MAGIC, "L Bad %p\n", tty))
19 tty_kref_get(tty);
20 mutex_lock(&tty->legacy_mutex);
24 int tty_lock_interruptible(struct tty_struct *tty)
28 if (WARN(tty->magic != TTY_MAGIC, "L Bad %p\n", tty))
30 tty_kref_get(tty);
31 ret = mutex_lock_interruptible(&tty->legacy_mutex);
33 tty_kref_put(tty);
37 void tty_unlock(struct tty_struct *tty)
39 if (WARN(tty->magic != TTY_MAGIC, "U Bad %p\n", tty))
41 mutex_unlock(&tty->legacy_mutex);
42 tty_kref_put(tty);
46 void tty_lock_slave(struct tty_struct *tty)
48 if (tty && tty != tty->link)
49 tty_lock(tty);
52 void tty_unlock_slave(struct tty_struct *tty)
54 if (tty && tty != tty->link)
55 tty_unlock(tty);
58 void tty_set_lock_subclass(struct tty_struct *tty)
60 lockdep_set_subclass(&tty->legacy_mutex, TTY_LOCK_SLAVE);