aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/tty_mutex.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/tty_mutex.c')
-rw-r--r--drivers/tty/tty_mutex.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/drivers/tty/tty_mutex.c b/drivers/tty/tty_mutex.c
index 3b2bb7719442..9ff986c32a21 100644
--- a/drivers/tty/tty_mutex.c
+++ b/drivers/tty/tty_mutex.c
@@ -15,30 +15,18 @@
15 * Don't use in new code. 15 * Don't use in new code.
16 */ 16 */
17static DEFINE_MUTEX(big_tty_mutex); 17static DEFINE_MUTEX(big_tty_mutex);
18struct task_struct *__big_tty_mutex_owner;
19EXPORT_SYMBOL_GPL(__big_tty_mutex_owner);
20 18
21/* 19/*
22 * Getting the big tty mutex. 20 * Getting the big tty mutex.
23 */ 21 */
24void __lockfunc tty_lock(void) 22void __lockfunc tty_lock(void)
25{ 23{
26 struct task_struct *task = current;
27
28 WARN_ON(__big_tty_mutex_owner == task);
29
30 mutex_lock(&big_tty_mutex); 24 mutex_lock(&big_tty_mutex);
31 __big_tty_mutex_owner = task;
32} 25}
33EXPORT_SYMBOL(tty_lock); 26EXPORT_SYMBOL(tty_lock);
34 27
35void __lockfunc tty_unlock(void) 28void __lockfunc tty_unlock(void)
36{ 29{
37 struct task_struct *task = current;
38
39 WARN_ON(__big_tty_mutex_owner != task);
40 __big_tty_mutex_owner = NULL;
41
42 mutex_unlock(&big_tty_mutex); 30 mutex_unlock(&big_tty_mutex);
43} 31}
44EXPORT_SYMBOL(tty_unlock); 32EXPORT_SYMBOL(tty_unlock);