summaryrefslogtreecommitdiff
path: root/include/linux/tty.h
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2016-01-10 08:35:23 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-01-28 02:13:28 +0300
commit4a510969374ab8853451c337e43d28fb864e43fd (patch)
tree7868ef29c68bd7265dcf6fe5b2ab4088abeb7842 /include/linux/tty.h
parent527ffc11e1c0aa049b3a831d6f07ed98e06a0819 (diff)
downloadlinux-4a510969374ab8853451c337e43d28fb864e43fd.tar.xz
tty: Make tty_files_lock per-tty
Access to tty->tty_files list is always per-tty, never for all ttys simultaneously. Replace global tty_files_lock spinlock with per-tty ->files_lock. Initialize when the ->tty_files list is inited, in alloc_tty_struct(). Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/tty.h')
-rw-r--r--include/linux/tty.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h
index da16b5980c25..780adbfc6dce 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -302,6 +302,7 @@ struct tty_struct {
struct work_struct hangup_work;
void *disc_data;
void *driver_data;
+ spinlock_t files_lock; /* protects tty_files list */
struct list_head tty_files;
#define N_TTY_BUF_SIZE 4096
@@ -508,7 +509,6 @@ extern int tty_standard_install(struct tty_driver *driver,
struct tty_struct *tty);
extern struct mutex tty_mutex;
-extern spinlock_t tty_files_lock;
#define tty_is_writelocked(tty) (mutex_is_locked(&tty->atomic_write_lock))