diff options
author | H. Nikolaus Schaller <hns@goldelico.com> | 2013-09-10 08:19:11 +0200 |
---|---|---|
committer | H. Nikolaus Schaller <hns@goldelico.com> | 2013-09-10 08:19:11 +0200 |
commit | 76a315a6b2c7ca3ba8c74919b49f95d9337e4c1f (patch) | |
tree | 47aabbd33c80cffc07621b1d6fb5b4fa57c2db01 /drivers/tty/pty.c | |
parent | 7fa58b5c60298c7b6bf665f896479e26645bf9a6 (diff) | |
parent | 300893b08f3bc7057a7a5f84074090ba66c8b5ca (diff) | |
download | kernel_goldelico_gta04-76a315a6b2c7ca3ba8c74919b49f95d9337e4c1f.zip kernel_goldelico_gta04-76a315a6b2c7ca3ba8c74919b49f95d9337e4c1f.tar.gz kernel_goldelico_gta04-76a315a6b2c7ca3ba8c74919b49f95d9337e4c1f.tar.bz2 |
merge linus/master (3.12-rc0); fixed conflicts
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Diffstat (limited to 'drivers/tty/pty.c')
-rw-r--r-- | drivers/tty/pty.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c index abfd990..25c9bc7 100644 --- a/drivers/tty/pty.c +++ b/drivers/tty/pty.c @@ -89,17 +89,13 @@ static void pty_unthrottle(struct tty_struct *tty) * pty_space - report space left for writing * @to: tty we are writing into * - * The tty buffers allow 64K but we sneak a peak and clip at 8K this - * allows a lot of overspill room for echo and other fun messes to - * be handled properly + * Limit the buffer space used by ptys to 8k. */ static int pty_space(struct tty_struct *to) { - int n = 8192 - to->port->buf.memory_used; - if (n < 0) - return 0; - return n; + int n = tty_buffer_space_avail(to->port); + return min(n, 8192); } /** @@ -125,10 +121,8 @@ static int pty_write(struct tty_struct *tty, const unsigned char *buf, int c) /* Stuff the data into the input queue of the other end */ c = tty_insert_flip_string(to->port, buf, c); /* And shovel */ - if (c) { + if (c) tty_flip_buffer_push(to->port); - tty_wakeup(tty); - } } return c; } @@ -287,7 +281,7 @@ static int pty_resize(struct tty_struct *tty, struct winsize *ws) struct tty_struct *pty = tty->link; /* For a PTY we need to lock the tty side */ - mutex_lock(&tty->termios_mutex); + mutex_lock(&tty->winsize_mutex); if (!memcmp(ws, &tty->winsize, sizeof(*ws))) goto done; @@ -314,7 +308,7 @@ static int pty_resize(struct tty_struct *tty, struct winsize *ws) tty->winsize = *ws; pty->winsize = *ws; /* Never used so will go away soon */ done: - mutex_unlock(&tty->termios_mutex); + mutex_unlock(&tty->winsize_mutex); return 0; } |