mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
tty: Make lock subclasses available for other tty locks
Besides nested legacy_mutex locking which is required on pty pair teardown, other nested pty operations require lock subclassing. Move lock subclass definition to tty interface header, include/linux/tty.h, and document its use. Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
fb5ef9e7da
commit
3abf87cd3e
2 changed files with 18 additions and 11 deletions
|
|
@ -4,18 +4,8 @@
|
|||
#include <linux/semaphore.h>
|
||||
#include <linux/sched.h>
|
||||
|
||||
/*
|
||||
* Nested tty locks are necessary for releasing pty pairs.
|
||||
* The stable lock order is master pty first, then slave pty.
|
||||
*/
|
||||
|
||||
/* Legacy tty mutex glue */
|
||||
|
||||
enum {
|
||||
TTY_MUTEX_NORMAL,
|
||||
TTY_MUTEX_SLAVE,
|
||||
};
|
||||
|
||||
/*
|
||||
* Getting the big tty mutex.
|
||||
*/
|
||||
|
|
@ -58,5 +48,5 @@ void __lockfunc tty_unlock_slave(struct tty_struct *tty)
|
|||
|
||||
void tty_set_lock_subclass(struct tty_struct *tty)
|
||||
{
|
||||
lockdep_set_subclass(&tty->legacy_mutex, TTY_MUTEX_SLAVE);
|
||||
lockdep_set_subclass(&tty->legacy_mutex, TTY_LOCK_SLAVE);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue