aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/svcsock.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/svcsock.c')
-rw-r--r--net/sunrpc/svcsock.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index 9564d2e9520e..355ab8da54fe 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -368,10 +368,9 @@ void svc_reserve(struct svc_rqst *rqstp, int space)
368 } 368 }
369} 369}
370 370
371static void 371static void svc_xprt_release(struct svc_rqst *rqstp)
372svc_sock_release(struct svc_rqst *rqstp)
373{ 372{
374 struct svc_sock *svsk = rqstp->rq_sock; 373 struct svc_xprt *xprt = rqstp->rq_xprt;
375 374
376 rqstp->rq_xprt->xpt_ops->xpo_release_rqst(rqstp); 375 rqstp->rq_xprt->xpt_ops->xpo_release_rqst(rqstp);
377 376
@@ -379,7 +378,6 @@ svc_sock_release(struct svc_rqst *rqstp)
379 rqstp->rq_res.page_len = 0; 378 rqstp->rq_res.page_len = 0;
380 rqstp->rq_res.page_base = 0; 379 rqstp->rq_res.page_base = 0;
381 380
382
383 /* Reset response buffer and release 381 /* Reset response buffer and release
384 * the reservation. 382 * the reservation.
385 * But first, check that enough space was reserved 383 * But first, check that enough space was reserved
@@ -392,9 +390,9 @@ svc_sock_release(struct svc_rqst *rqstp)
392 390
393 rqstp->rq_res.head[0].iov_len = 0; 391 rqstp->rq_res.head[0].iov_len = 0;
394 svc_reserve(rqstp, 0); 392 svc_reserve(rqstp, 0);
395 rqstp->rq_sock = NULL; 393 rqstp->rq_xprt = NULL;
396 394
397 svc_xprt_put(&svsk->sk_xprt); 395 svc_xprt_put(xprt);
398} 396}
399 397
400/* 398/*
@@ -1593,7 +1591,7 @@ svc_recv(struct svc_rqst *rqstp, long timeout)
1593 /* No data, incomplete (TCP) read, or accept() */ 1591 /* No data, incomplete (TCP) read, or accept() */
1594 if (len == 0 || len == -EAGAIN) { 1592 if (len == 0 || len == -EAGAIN) {
1595 rqstp->rq_res.len = 0; 1593 rqstp->rq_res.len = 0;
1596 svc_sock_release(rqstp); 1594 svc_xprt_release(rqstp);
1597 return -EAGAIN; 1595 return -EAGAIN;
1598 } 1596 }
1599 clear_bit(XPT_OLD, &svsk->sk_xprt.xpt_flags); 1597 clear_bit(XPT_OLD, &svsk->sk_xprt.xpt_flags);
@@ -1613,7 +1611,7 @@ void
1613svc_drop(struct svc_rqst *rqstp) 1611svc_drop(struct svc_rqst *rqstp)
1614{ 1612{
1615 dprintk("svc: socket %p dropped request\n", rqstp->rq_sock); 1613 dprintk("svc: socket %p dropped request\n", rqstp->rq_sock);
1616 svc_sock_release(rqstp); 1614 svc_xprt_release(rqstp);
1617} 1615}
1618 1616
1619/* 1617/*
@@ -1646,7 +1644,7 @@ svc_send(struct svc_rqst *rqstp)
1646 else 1644 else
1647 len = xprt->xpt_ops->xpo_sendto(rqstp); 1645 len = xprt->xpt_ops->xpo_sendto(rqstp);
1648 mutex_unlock(&xprt->xpt_mutex); 1646 mutex_unlock(&xprt->xpt_mutex);
1649 svc_sock_release(rqstp); 1647 svc_xprt_release(rqstp);
1650 1648
1651 if (len == -ECONNREFUSED || len == -ENOTCONN || len == -EAGAIN) 1649 if (len == -ECONNREFUSED || len == -ENOTCONN || len == -EAGAIN)
1652 return 0; 1650 return 0;