aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2007-02-12 03:53:30 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-12 12:48:35 -0500
commite79eff1f90826b207b1152fc87aa97fa74fb7f9c (patch)
tree8cd39c30c01fdbca8c93652512441b7dda666eea /net
parent482fb94e1b0c2efe8258334aa2a68d4f4a91de9c (diff)
[PATCH] knfsd: SUNRPC: aplit svc_sock_enqueue out of svc_setup_socket
Rather than calling svc_sock_enqueue at the end of svc_setup_socket, we now call it (via svc_sock_recieved) after calling svc_setup_socket at each call site. We do this because a subsequent patch will insert some code between the two calls at one call site. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/svcsock.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index d120fadeb1ae..7292baf5a741 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -938,7 +938,7 @@ svc_tcp_accept(struct svc_sock *svsk)
938 if (!(newsvsk = svc_setup_socket(serv, newsock, &err, 938 if (!(newsvsk = svc_setup_socket(serv, newsock, &err,
939 (SVC_SOCK_ANONYMOUS | SVC_SOCK_TEMPORARY)))) 939 (SVC_SOCK_ANONYMOUS | SVC_SOCK_TEMPORARY))))
940 goto failed; 940 goto failed;
941 941 svc_sock_received(newsvsk);
942 942
943 /* make sure that we don't have too many active connections. 943 /* make sure that we don't have too many active connections.
944 * If we have, something must be dropped. 944 * If we have, something must be dropped.
@@ -1546,8 +1546,6 @@ static struct svc_sock *svc_setup_socket(struct svc_serv *serv,
1546 dprintk("svc: svc_setup_socket created %p (inet %p)\n", 1546 dprintk("svc: svc_setup_socket created %p (inet %p)\n",
1547 svsk, svsk->sk_sk); 1547 svsk, svsk->sk_sk);
1548 1548
1549 clear_bit(SK_BUSY, &svsk->sk_flags);
1550 svc_sock_enqueue(svsk);
1551 return svsk; 1549 return svsk;
1552} 1550}
1553 1551
@@ -1571,8 +1569,10 @@ int svc_addsock(struct svc_serv *serv,
1571 err = -EISCONN; 1569 err = -EISCONN;
1572 else { 1570 else {
1573 svsk = svc_setup_socket(serv, so, &err, SVC_SOCK_DEFAULTS); 1571 svsk = svc_setup_socket(serv, so, &err, SVC_SOCK_DEFAULTS);
1574 if (svsk) 1572 if (svsk) {
1573 svc_sock_received(svsk);
1575 err = 0; 1574 err = 0;
1575 }
1576 } 1576 }
1577 if (err) { 1577 if (err) {
1578 sockfd_put(so); 1578 sockfd_put(so);
@@ -1623,8 +1623,10 @@ static int svc_create_socket(struct svc_serv *serv, int protocol,
1623 goto bummer; 1623 goto bummer;
1624 } 1624 }
1625 1625
1626 if ((svsk = svc_setup_socket(serv, sock, &error, flags)) != NULL) 1626 if ((svsk = svc_setup_socket(serv, sock, &error, flags)) != NULL) {
1627 svc_sock_received(svsk);
1627 return ntohs(inet_sk(svsk->sk_sk)->sport); 1628 return ntohs(inet_sk(svsk->sk_sk)->sport);
1629 }
1628 1630
1629bummer: 1631bummer:
1630 dprintk("svc: svc_create_socket error = %d\n", -error); 1632 dprintk("svc: svc_create_socket error = %d\n", -error);