summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty.c
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2009-10-19 07:17:37 +0000
committered <ed@FreeBSD.org>2009-10-19 07:17:37 +0000
commitd92da0f1c09a2f4ad0c89cde70730ba61a90c4e1 (patch)
treee5b553b26bb78eec8b8bd6b72dd2d03c7da28716 /sys/kern/tty.c
parentdc93fde3ad5398c4dda4df4aa39db70ffbf4e889 (diff)
downloadFreeBSD-src-d92da0f1c09a2f4ad0c89cde70730ba61a90c4e1.zip
FreeBSD-src-d92da0f1c09a2f4ad0c89cde70730ba61a90c4e1.tar.gz
Properly set the low watermarks when reducing the baud rate.
Now that buffers are deallocated lazily, we should not use tty*q_getsize() to obtain the buffer size to calculate the low watermarks. Doing this may cause the watermark to be placed outside the typical buffer size. This caused some regressions after my previous commit to the TTY code, which allows pseudo-devices to resize the buffers as well. Reported by: yongari, dougb MFC after: 1 week
Diffstat (limited to 'sys/kern/tty.c')
-rw-r--r--sys/kern/tty.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index a3db944..81f6741 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -109,14 +109,14 @@ tty_watermarks(struct tty *tp)
ttyinq_setsize(&tp->t_inq, tp, bs);
/* Set low watermark at 10% (when 90% is available). */
- tp->t_inlow = (ttyinq_getsize(&tp->t_inq) * 9) / 10;
+ tp->t_inlow = (ttyinq_getallocatedsize(&tp->t_inq) * 9) / 10;
/* Provide an ouput buffer for 0.2 seconds of data. */
bs = MIN(tp->t_termios.c_ospeed / 5, TTYBUF_MAX);
ttyoutq_setsize(&tp->t_outq, tp, bs);
/* Set low watermark at 10% (when 90% is available). */
- tp->t_outlow = (ttyoutq_getsize(&tp->t_outq) * 9) / 10;
+ tp->t_outlow = (ttyoutq_getallocatedsize(&tp->t_outq) * 9) / 10;
}
static int
OpenPOWER on IntegriCloud