Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1290474

[PATCH 6/6] n_tty: Remove tty count checks from unthrottle

From Peter Hurley <peter@hurleysoftware.com>
Newsgroups linux.kernel
Subject [PATCH 6/6] n_tty: Remove tty count checks from unthrottle
Date 2015-12-12 23:20 +0100
Message-ID <qF0Gd-8bC-7@gated-at.bofh.it> (permalink)
References <qF0Gd-8bC-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Since n_tty_check_unthrottle() is only called from n_tty_read()
which only originates from a userspace read(), the tty count cannot
be 0; the read() guarantees the file descriptor has not yet been
released.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
---
 drivers/tty/n_tty.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index 5034da0..dd34c5d 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -263,8 +263,6 @@ static void n_tty_check_unthrottle(struct tty_struct *tty)
 	if (tty->driver->type == TTY_DRIVER_TYPE_PTY) {
 		if (chars_in_buffer(tty) > TTY_THRESHOLD_UNTHROTTLE)
 			return;
-		if (!tty->count)
-			return;
 		n_tty_kick_worker(tty);
 		tty_wakeup(tty->link);
 		return;
@@ -283,8 +281,6 @@ static void n_tty_check_unthrottle(struct tty_struct *tty)
 		tty_set_flow_change(tty, TTY_UNTHROTTLE_SAFE);
 		if (chars_in_buffer(tty) > TTY_THRESHOLD_UNTHROTTLE)
 			break;
-		if (!tty->count)
-			break;
 		n_tty_kick_worker(tty);
 		unthrottled = tty_unthrottle_safe(tty);
 		if (!unthrottled)
-- 
2.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/6] More n_tty fixes Peter Hurley <peter@hurleysoftware.com> - 2015-12-12 23:20 +0100
  [PATCH 6/6] n_tty: Remove tty count checks from unthrottle Peter Hurley <peter@hurleysoftware.com> - 2015-12-12 23:20 +0100
  [PATCH 4/6] tty: Fix ioctl(FIOASYNC) on hungup file Peter Hurley <peter@hurleysoftware.com> - 2015-12-12 23:20 +0100
  [PATCH 3/6] tty: Add fasync() hung up file operation Peter Hurley <peter@hurleysoftware.com> - 2015-12-12 23:20 +0100
  [PATCH 1/6] n_tty: Always wake up read()/poll() if new input Peter Hurley <peter@hurleysoftware.com> - 2015-12-12 23:20 +0100
    Re: [PATCH 1/6] n_tty: Always wake up read()/poll() if new input Johannes Stezenbach <js@sig21.net> - 2015-12-13 15:50 +0100
      Re: [PATCH 1/6] n_tty: Always wake up read()/poll() if new input Peter Hurley <peter@hurleysoftware.com> - 2015-12-13 21:00 +0100
  [PATCH 2/6] tty, n_tty: Remove fasync() ldisc notification Peter Hurley <peter@hurleysoftware.com> - 2015-12-12 23:20 +0100

csiph-web