aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/tty_io.c
diff options
context:
space:
mode:
authorDavide Libenzi <davidel@xmailserver.org>2009-03-31 18:24:24 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-01 11:59:21 -0400
commit4b19449db074eec86ae31a96d3cdca4aa7f138ab (patch)
tree3316e76279fee09aff54ad18c6f808919b93a472 /drivers/char/tty_io.c
parent395108880efff4a4ffa1ffa554477f7f5ba6a031 (diff)
epoll keyed wakeups: make tty use keyed wakeups
Introduce keyed event wakeups inside the TTY code. Signed-off-by: Davide Libenzi <davidel@xmailserver.org> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Ingo Molnar <mingo@elte.hu> Cc: David Miller <davem@davemloft.net> Cc: William Lee Irwin III <wli@movementarian.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/tty_io.c')
-rw-r--r--drivers/char/tty_io.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 224f271d8cbe..33dac94922a7 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -464,7 +464,7 @@ void tty_wakeup(struct tty_struct *tty)
464 tty_ldisc_deref(ld); 464 tty_ldisc_deref(ld);
465 } 465 }
466 } 466 }
467 wake_up_interruptible(&tty->write_wait); 467 wake_up_interruptible_poll(&tty->write_wait, POLLOUT);
468} 468}
469 469
470EXPORT_SYMBOL_GPL(tty_wakeup); 470EXPORT_SYMBOL_GPL(tty_wakeup);
@@ -587,8 +587,8 @@ static void do_tty_hangup(struct work_struct *work)
587 * FIXME: Once we trust the LDISC code better we can wait here for 587 * FIXME: Once we trust the LDISC code better we can wait here for
588 * ldisc completion and fix the driver call race 588 * ldisc completion and fix the driver call race
589 */ 589 */
590 wake_up_interruptible(&tty->write_wait); 590 wake_up_interruptible_poll(&tty->write_wait, POLLOUT);
591 wake_up_interruptible(&tty->read_wait); 591 wake_up_interruptible_poll(&tty->read_wait, POLLIN);
592 /* 592 /*
593 * Shutdown the current line discipline, and reset it to 593 * Shutdown the current line discipline, and reset it to
594 * N_TTY. 594 * N_TTY.
@@ -879,7 +879,7 @@ void stop_tty(struct tty_struct *tty)
879 if (tty->link && tty->link->packet) { 879 if (tty->link && tty->link->packet) {
880 tty->ctrl_status &= ~TIOCPKT_START; 880 tty->ctrl_status &= ~TIOCPKT_START;
881 tty->ctrl_status |= TIOCPKT_STOP; 881 tty->ctrl_status |= TIOCPKT_STOP;
882 wake_up_interruptible(&tty->link->read_wait); 882 wake_up_interruptible_poll(&tty->link->read_wait, POLLIN);
883 } 883 }
884 spin_unlock_irqrestore(&tty->ctrl_lock, flags); 884 spin_unlock_irqrestore(&tty->ctrl_lock, flags);
885 if (tty->ops->stop) 885 if (tty->ops->stop)
@@ -913,7 +913,7 @@ void start_tty(struct tty_struct *tty)
913 if (tty->link && tty->link->packet) { 913 if (tty->link && tty->link->packet) {
914 tty->ctrl_status &= ~TIOCPKT_STOP; 914 tty->ctrl_status &= ~TIOCPKT_STOP;
915 tty->ctrl_status |= TIOCPKT_START; 915 tty->ctrl_status |= TIOCPKT_START;
916 wake_up_interruptible(&tty->link->read_wait); 916 wake_up_interruptible_poll(&tty->link->read_wait, POLLIN);
917 } 917 }
918 spin_unlock_irqrestore(&tty->ctrl_lock, flags); 918 spin_unlock_irqrestore(&tty->ctrl_lock, flags);
919 if (tty->ops->start) 919 if (tty->ops->start)
@@ -970,7 +970,7 @@ static ssize_t tty_read(struct file *file, char __user *buf, size_t count,
970void tty_write_unlock(struct tty_struct *tty) 970void tty_write_unlock(struct tty_struct *tty)
971{ 971{
972 mutex_unlock(&tty->atomic_write_lock); 972 mutex_unlock(&tty->atomic_write_lock);
973 wake_up_interruptible(&tty->write_wait); 973 wake_up_interruptible_poll(&tty->write_wait, POLLOUT);
974} 974}
975 975
976int tty_write_lock(struct tty_struct *tty, int ndelay) 976int tty_write_lock(struct tty_struct *tty, int ndelay)
@@ -1623,21 +1623,21 @@ void tty_release_dev(struct file *filp)
1623 1623
1624 if (tty_closing) { 1624 if (tty_closing) {
1625 if (waitqueue_active(&tty->read_wait)) { 1625 if (waitqueue_active(&tty->read_wait)) {
1626 wake_up(&tty->read_wait); 1626 wake_up_poll(&tty->read_wait, POLLIN);
1627 do_sleep++; 1627 do_sleep++;
1628 } 1628 }
1629 if (waitqueue_active(&tty->write_wait)) { 1629 if (waitqueue_active(&tty->write_wait)) {
1630 wake_up(&tty->write_wait); 1630 wake_up_poll(&tty->write_wait, POLLOUT);
1631 do_sleep++; 1631 do_sleep++;
1632 } 1632 }
1633 } 1633 }
1634 if (o_tty_closing) { 1634 if (o_tty_closing) {
1635 if (waitqueue_active(&o_tty->read_wait)) { 1635 if (waitqueue_active(&o_tty->read_wait)) {
1636 wake_up(&o_tty->read_wait); 1636 wake_up_poll(&o_tty->read_wait, POLLIN);
1637 do_sleep++; 1637 do_sleep++;
1638 } 1638 }
1639 if (waitqueue_active(&o_tty->write_wait)) { 1639 if (waitqueue_active(&o_tty->write_wait)) {
1640 wake_up(&o_tty->write_wait); 1640 wake_up_poll(&o_tty->write_wait, POLLOUT);
1641 do_sleep++; 1641 do_sleep++;
1642 } 1642 }
1643 } 1643 }