Commit dc40c7bc authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by David S. Miller

[ICSK]: Generalise tcp_listen_poll

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2babe1f6
...@@ -260,6 +260,16 @@ extern void inet_csk_reqsk_queue_prune(struct sock *parent, ...@@ -260,6 +260,16 @@ extern void inet_csk_reqsk_queue_prune(struct sock *parent,
const unsigned long max_rto); const unsigned long max_rto);
extern void inet_csk_destroy_sock(struct sock *sk); extern void inet_csk_destroy_sock(struct sock *sk);
/*
* LISTEN is a special case for poll..
*/
static inline unsigned int inet_csk_listen_poll(const struct sock *sk)
{
return !reqsk_queue_empty(&inet_csk(sk)->icsk_accept_queue) ?
(POLLIN | POLLRDNORM) : 0;
}
extern int inet_csk_listen_start(struct sock *sk, const int nr_table_entries); extern int inet_csk_listen_start(struct sock *sk, const int nr_table_entries);
extern void inet_csk_listen_stop(struct sock *sk); extern void inet_csk_listen_stop(struct sock *sk);
......
...@@ -309,15 +309,6 @@ void tcp_enter_memory_pressure(void) ...@@ -309,15 +309,6 @@ void tcp_enter_memory_pressure(void)
EXPORT_SYMBOL(tcp_enter_memory_pressure); EXPORT_SYMBOL(tcp_enter_memory_pressure);
/*
* LISTEN is a special case for poll..
*/
static __inline__ unsigned int tcp_listen_poll(struct sock *sk,
poll_table *wait)
{
return !reqsk_queue_empty(&inet_csk(sk)->icsk_accept_queue) ? (POLLIN | POLLRDNORM) : 0;
}
/* /*
* Wait for a TCP event. * Wait for a TCP event.
* *
...@@ -333,7 +324,7 @@ unsigned int tcp_poll(struct file *file, struct socket *sock, poll_table *wait) ...@@ -333,7 +324,7 @@ unsigned int tcp_poll(struct file *file, struct socket *sock, poll_table *wait)
poll_wait(file, sk->sk_sleep, wait); poll_wait(file, sk->sk_sleep, wait);
if (sk->sk_state == TCP_LISTEN) if (sk->sk_state == TCP_LISTEN)
return tcp_listen_poll(sk, wait); return inet_csk_listen_poll(sk);
/* Socket is not locked. We are protected from async events /* Socket is not locked. We are protected from async events
by poll logic and correct handling of state changes by poll logic and correct handling of state changes
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment