tree 70951f8d97dc191df3c772c830b667ad7af6dfd9
parent 2babe1f6fea717c36c008c878fe095d1ca5696c1
author Arnaldo Carvalho de Melo <[EMAIL PROTECTED]> Wed, 24 Aug 2005 11:52:58 
-0700
committer David S. Miller <[EMAIL PROTECTED]> Tue, 30 Aug 2005 06:05:32 -0700

[ICSK]: Generalise tcp_listen_poll

Signed-off-by: Arnaldo Carvalho de Melo <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>

 include/net/inet_connection_sock.h |   10 ++++++++++
 net/ipv4/tcp.c                     |   11 +----------
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/include/net/inet_connection_sock.h 
b/include/net/inet_connection_sock.h
--- a/include/net/inet_connection_sock.h
+++ b/include/net/inet_connection_sock.h
@@ -260,6 +260,16 @@ extern void inet_csk_reqsk_queue_prune(s
                                       const unsigned long max_rto);
 
 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 void inet_csk_listen_stop(struct sock *sk);
 
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -310,15 +310,6 @@ void tcp_enter_memory_pressure(void)
 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.
  *
  *     Note that we don't need to lock the socket, as the upper poll layers
@@ -333,7 +324,7 @@ unsigned int tcp_poll(struct file *file,
 
        poll_wait(file, sk->sk_sleep, wait);
        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
           by poll logic and correct handling of state changes
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to