aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2014-07-24 23:59:33 -0400
committerJ. Bruce Fields <bfields@redhat.com>2014-07-29 16:10:20 -0400
commit518776800c094a518ae6d303660b57f1400eb1eb (patch)
tree5b61d53a0ba2ff0a24cc47dc2a0cc5bac151b654 /net
parentc7fb3f0631b8d66b90e0642a95b948febb3f3cee (diff)
SUNRPC: Allow svc_reserve() to notify TCP socket that space has been freed
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/svc_xprt.c2
-rw-r--r--net/sunrpc/svcsock.c9
2 files changed, 11 insertions, 0 deletions
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
index 9cfa391e2bd0..6666c6745858 100644
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -448,6 +448,8 @@ void svc_reserve(struct svc_rqst *rqstp, int space)
448 atomic_sub((rqstp->rq_reserved - space), &xprt->xpt_reserved); 448 atomic_sub((rqstp->rq_reserved - space), &xprt->xpt_reserved);
449 rqstp->rq_reserved = space; 449 rqstp->rq_reserved = space;
450 450
451 if (xprt->xpt_ops->xpo_adjust_wspace)
452 xprt->xpt_ops->xpo_adjust_wspace(xprt);
451 svc_xprt_enqueue(xprt); 453 svc_xprt_enqueue(xprt);
452 } 454 }
453} 455}
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index 88db211d4264..c24a8ff33f8f 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -475,6 +475,14 @@ static void svc_tcp_write_space(struct sock *sk)
475 svc_write_space(sk); 475 svc_write_space(sk);
476} 476}
477 477
478static void svc_tcp_adjust_wspace(struct svc_xprt *xprt)
479{
480 struct svc_sock *svsk = container_of(xprt, struct svc_sock, sk_xprt);
481
482 if (svc_tcp_has_wspace(xprt))
483 clear_bit(SOCK_NOSPACE, &svsk->sk_sock->flags);
484}
485
478/* 486/*
479 * See net/ipv6/ip_sockglue.c : ip_cmsg_recv_pktinfo 487 * See net/ipv6/ip_sockglue.c : ip_cmsg_recv_pktinfo
480 */ 488 */
@@ -1289,6 +1297,7 @@ static struct svc_xprt_ops svc_tcp_ops = {
1289 .xpo_has_wspace = svc_tcp_has_wspace, 1297 .xpo_has_wspace = svc_tcp_has_wspace,
1290 .xpo_accept = svc_tcp_accept, 1298 .xpo_accept = svc_tcp_accept,
1291 .xpo_secure_port = svc_sock_secure_port, 1299 .xpo_secure_port = svc_sock_secure_port,
1300 .xpo_adjust_wspace = svc_tcp_adjust_wspace,
1292}; 1301};
1293 1302
1294static struct svc_xprt_class svc_tcp_class = { 1303static struct svc_xprt_class svc_tcp_class = {