Release 4.16 drivers/tty/tty_mutex.c
// SPDX-License-Identifier: GPL-2.0
#include <linux/tty.h>
#include <linux/module.h>
#include <linux/kallsyms.h>
#include <linux/semaphore.h>
#include <linux/sched.h>
/* Legacy tty mutex glue */
/*
* Getting the big tty mutex.
*/
void tty_lock(struct tty_struct *tty)
{
if (WARN(tty->magic != TTY_MAGIC, "L Bad %p\n", tty))
return;
tty_kref_get(tty);
mutex_lock(&tty->legacy_mutex);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Alan Cox | 24 | 61.54% | 1 | 25.00% |
Arnd Bergmann | 9 | 23.08% | 1 | 25.00% |
Peter Hurley | 6 | 15.38% | 2 | 50.00% |
Total | 39 | 100.00% | 4 | 100.00% |
EXPORT_SYMBOL(tty_lock);
int tty_lock_interruptible(struct tty_struct *tty)
{
int ret;
if (WARN(tty->magic != TTY_MAGIC, "L Bad %p\n", tty))
return -EIO;
tty_kref_get(tty);
ret = mutex_lock_interruptible(&tty->legacy_mutex);
if (ret)
tty_kref_put(tty);
return ret;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Peter Hurley | 59 | 100.00% | 2 | 100.00% |
Total | 59 | 100.00% | 2 | 100.00% |
void tty_unlock(struct tty_struct *tty)
{
if (WARN(tty->magic != TTY_MAGIC, "U Bad %p\n", tty))
return;
mutex_unlock(&tty->legacy_mutex);
tty_kref_put(tty);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Alan Cox | 27 | 69.23% | 1 | 33.33% |
Arnd Bergmann | 8 | 20.51% | 1 | 33.33% |
Peter Hurley | 4 | 10.26% | 1 | 33.33% |
Total | 39 | 100.00% | 3 | 100.00% |
EXPORT_SYMBOL(tty_unlock);
void tty_lock_slave(struct tty_struct *tty)
{
if (tty && tty != tty->link)
tty_lock(tty);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Alan Cox | 17 | 68.00% | 1 | 33.33% |
Peter Hurley | 8 | 32.00% | 2 | 66.67% |
Total | 25 | 100.00% | 3 | 100.00% |
void tty_unlock_slave(struct tty_struct *tty)
{
if (tty && tty != tty->link)
tty_unlock(tty);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Alan Cox | 19 | 76.00% | 2 | 66.67% |
Peter Hurley | 6 | 24.00% | 1 | 33.33% |
Total | 25 | 100.00% | 3 | 100.00% |
void tty_set_lock_subclass(struct tty_struct *tty)
{
lockdep_set_subclass(&tty->legacy_mutex, TTY_LOCK_SLAVE);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Peter Hurley | 20 | 100.00% | 2 | 100.00% |
Total | 20 | 100.00% | 2 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Peter Hurley | 103 | 43.83% | 6 | 60.00% |
Alan Cox | 93 | 39.57% | 2 | 20.00% |
Arnd Bergmann | 38 | 16.17% | 1 | 10.00% |
Greg Kroah-Hartman | 1 | 0.43% | 1 | 10.00% |
Total | 235 | 100.00% | 10 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.