2 #include <linux/module.h>
3 #include <linux/kallsyms.h>
4 #include <linux/semaphore.h>
5 #include <linux/sched.h>
7 /* Legacy tty mutex glue */
10 * Getting the big tty mutex.
13 void __lockfunc
tty_lock(struct tty_struct
*tty
)
15 if (WARN(tty
->magic
!= TTY_MAGIC
, "L Bad %p\n", tty
))
18 mutex_lock(&tty
->legacy_mutex
);
20 EXPORT_SYMBOL(tty_lock
);
22 int tty_lock_interruptible(struct tty_struct
*tty
)
24 if (WARN(tty
->magic
!= TTY_MAGIC
, "L Bad %p\n", tty
))
27 return mutex_lock_interruptible(&tty
->legacy_mutex
);
30 void __lockfunc
tty_unlock(struct tty_struct
*tty
)
32 if (WARN(tty
->magic
!= TTY_MAGIC
, "U Bad %p\n", tty
))
34 mutex_unlock(&tty
->legacy_mutex
);
37 EXPORT_SYMBOL(tty_unlock
);
39 void __lockfunc
tty_lock_slave(struct tty_struct
*tty
)
41 if (tty
&& tty
!= tty
->link
)
45 void __lockfunc
tty_unlock_slave(struct tty_struct
*tty
)
47 if (tty
&& tty
!= tty
->link
)
51 void tty_set_lock_subclass(struct tty_struct
*tty
)
53 lockdep_set_subclass(&tty
->legacy_mutex
, TTY_LOCK_SLAVE
);
This page took 0.100915 seconds and 6 git commands to generate.