diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-09-06 13:13:50 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-09-07 03:48:45 +0200 |
commit | db40980fcdb560d7992b0511df16cdd3f7e381f3 (patch) | |
tree | 337b5c41bd55915a4b894ea6fe09a865e7dcb0e4 /net/sctp | |
parent | mlx4_en: Fixed Ethtool statistics report (diff) | |
download | linux-db40980fcdb560d7992b0511df16cdd3f7e381f3.tar.xz linux-db40980fcdb560d7992b0511df16cdd3f7e381f3.zip |
net: poll() optimizations
No need to test twice sk->sk_shutdown & RCV_SHUTDOWN
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp')
-rw-r--r-- | net/sctp/socket.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index f4bec2772351..cf6dcc908b88 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -5707,13 +5707,12 @@ unsigned int sctp_poll(struct file *file, struct socket *sock, poll_table *wait) if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue)) mask |= POLLERR; if (sk->sk_shutdown & RCV_SHUTDOWN) - mask |= POLLRDHUP; + mask |= POLLRDHUP | POLLIN | POLLRDNORM; if (sk->sk_shutdown == SHUTDOWN_MASK) mask |= POLLHUP; /* Is it readable? Reconsider this code with TCP-style support. */ - if (!skb_queue_empty(&sk->sk_receive_queue) || - (sk->sk_shutdown & RCV_SHUTDOWN)) + if (!skb_queue_empty(&sk->sk_receive_queue)) mask |= POLLIN | POLLRDNORM; /* The association is either gone or not ready. */ |