Commit eab996d4 authored by Tom Tucker's avatar Tom Tucker Committed by J. Bruce Fields

svc: Make svc_sock_release svc_xprt_release

The svc_sock_release function only touches transport independent fields.
Change the function to manipulate svc_xprt directly instead of the transport
dependent svc_sock structure.
Signed-off-by: default avatarTom Tucker <tom@opengridcomputing.com>
Acked-by: default avatarNeil Brown <neilb@suse.de>
Reviewed-by: default avatarChuck Lever <chuck.lever@oracle.com>
Reviewed-by: default avatarGreg Banks <gnb@sgi.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
parent 9dbc240f
...@@ -368,10 +368,9 @@ void svc_reserve(struct svc_rqst *rqstp, int space) ...@@ -368,10 +368,9 @@ void svc_reserve(struct svc_rqst *rqstp, int space)
} }
} }
static void static void svc_xprt_release(struct svc_rqst *rqstp)
svc_sock_release(struct svc_rqst *rqstp)
{ {
struct svc_sock *svsk = rqstp->rq_sock; struct svc_xprt *xprt = rqstp->rq_xprt;
rqstp->rq_xprt->xpt_ops->xpo_release_rqst(rqstp); rqstp->rq_xprt->xpt_ops->xpo_release_rqst(rqstp);
...@@ -379,7 +378,6 @@ svc_sock_release(struct svc_rqst *rqstp) ...@@ -379,7 +378,6 @@ svc_sock_release(struct svc_rqst *rqstp)
rqstp->rq_res.page_len = 0; rqstp->rq_res.page_len = 0;
rqstp->rq_res.page_base = 0; rqstp->rq_res.page_base = 0;
/* Reset response buffer and release /* Reset response buffer and release
* the reservation. * the reservation.
* But first, check that enough space was reserved * But first, check that enough space was reserved
...@@ -392,9 +390,9 @@ svc_sock_release(struct svc_rqst *rqstp) ...@@ -392,9 +390,9 @@ svc_sock_release(struct svc_rqst *rqstp)
rqstp->rq_res.head[0].iov_len = 0; rqstp->rq_res.head[0].iov_len = 0;
svc_reserve(rqstp, 0); svc_reserve(rqstp, 0);
rqstp->rq_sock = NULL; rqstp->rq_xprt = NULL;
svc_xprt_put(&svsk->sk_xprt); svc_xprt_put(xprt);
} }
/* /*
...@@ -1593,7 +1591,7 @@ svc_recv(struct svc_rqst *rqstp, long timeout) ...@@ -1593,7 +1591,7 @@ svc_recv(struct svc_rqst *rqstp, long timeout)
/* No data, incomplete (TCP) read, or accept() */ /* No data, incomplete (TCP) read, or accept() */
if (len == 0 || len == -EAGAIN) { if (len == 0 || len == -EAGAIN) {
rqstp->rq_res.len = 0; rqstp->rq_res.len = 0;
svc_sock_release(rqstp); svc_xprt_release(rqstp);
return -EAGAIN; return -EAGAIN;
} }
clear_bit(XPT_OLD, &svsk->sk_xprt.xpt_flags); clear_bit(XPT_OLD, &svsk->sk_xprt.xpt_flags);
...@@ -1613,7 +1611,7 @@ void ...@@ -1613,7 +1611,7 @@ void
svc_drop(struct svc_rqst *rqstp) svc_drop(struct svc_rqst *rqstp)
{ {
dprintk("svc: socket %p dropped request\n", rqstp->rq_sock); dprintk("svc: socket %p dropped request\n", rqstp->rq_sock);
svc_sock_release(rqstp); svc_xprt_release(rqstp);
} }
/* /*
...@@ -1646,7 +1644,7 @@ svc_send(struct svc_rqst *rqstp) ...@@ -1646,7 +1644,7 @@ svc_send(struct svc_rqst *rqstp)
else else
len = xprt->xpt_ops->xpo_sendto(rqstp); len = xprt->xpt_ops->xpo_sendto(rqstp);
mutex_unlock(&xprt->xpt_mutex); mutex_unlock(&xprt->xpt_mutex);
svc_sock_release(rqstp); svc_xprt_release(rqstp);
if (len == -ECONNREFUSED || len == -ENOTCONN || len == -EAGAIN) if (len == -ECONNREFUSED || len == -ENOTCONN || len == -EAGAIN)
return 0; return 0;
......
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