diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2008-04-30 03:53:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-30 11:29:40 -0400 |
commit | 04f378b198da233ca0aca341b113dc6579d46123 (patch) | |
tree | 696e7bd401125cee71ecaa2047c4273f38732554 /drivers/char/pty.c | |
parent | e52384426064bca0669a954736206adca7595d48 (diff) |
tty: BKL pushdown
- Push the BKL down into the line disciplines
- Switch the tty layer to unlocked_ioctl
- Introduce a new ctrl_lock spin lock for the control bits
- Eliminate much of the lock_kernel use in n_tty
- Prepare to (but don't yet) call the drivers with the lock dropped
on the paths that historically held the lock
BKL now primarily protects open/close/ldisc change in the tty layer
[jirislaby@gmail.com: a couple of fixes]
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/pty.c')
-rw-r--r-- | drivers/char/pty.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/char/pty.c b/drivers/char/pty.c index 706ff34728f1..6288356b769d 100644 --- a/drivers/char/pty.c +++ b/drivers/char/pty.c | |||
@@ -181,6 +181,7 @@ static int pty_set_lock(struct tty_struct *tty, int __user * arg) | |||
181 | static void pty_flush_buffer(struct tty_struct *tty) | 181 | static void pty_flush_buffer(struct tty_struct *tty) |
182 | { | 182 | { |
183 | struct tty_struct *to = tty->link; | 183 | struct tty_struct *to = tty->link; |
184 | unsigned long flags; | ||
184 | 185 | ||
185 | if (!to) | 186 | if (!to) |
186 | return; | 187 | return; |
@@ -189,8 +190,10 @@ static void pty_flush_buffer(struct tty_struct *tty) | |||
189 | to->ldisc.flush_buffer(to); | 190 | to->ldisc.flush_buffer(to); |
190 | 191 | ||
191 | if (to->packet) { | 192 | if (to->packet) { |
193 | spin_lock_irqsave(&tty->ctrl_lock, flags); | ||
192 | tty->ctrl_status |= TIOCPKT_FLUSHWRITE; | 194 | tty->ctrl_status |= TIOCPKT_FLUSHWRITE; |
193 | wake_up_interruptible(&to->read_wait); | 195 | wake_up_interruptible(&to->read_wait); |
196 | spin_unlock_irqrestore(&tty->ctrl_lock, flags); | ||
194 | } | 197 | } |
195 | } | 198 | } |
196 | 199 | ||