Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 82476
b: refs/heads/master
c: eab996d
h: refs/heads/master
v: v3
  • Loading branch information
Tom Tucker authored and J. Bruce Fields committed Feb 1, 2008
1 parent 5f8ea1e commit 425ba28
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9dbc240f199c16c3c0859c255ad52a663d8ee51d
refs/heads/master: eab996d4aca7a9d8621d2b98c00ce420df85eaed
16 changes: 7 additions & 9 deletions trunk/net/sunrpc/svcsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,18 +368,16 @@ void svc_reserve(struct svc_rqst *rqstp, int space)
}
}

static void
svc_sock_release(struct svc_rqst *rqstp)
static void svc_xprt_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);

svc_free_res_pages(rqstp);
rqstp->rq_res.page_len = 0;
rqstp->rq_res.page_base = 0;


/* Reset response buffer and release
* the reservation.
* But first, check that enough space was reserved
Expand All @@ -392,9 +390,9 @@ svc_sock_release(struct svc_rqst *rqstp)

rqstp->rq_res.head[0].iov_len = 0;
svc_reserve(rqstp, 0);
rqstp->rq_sock = NULL;
rqstp->rq_xprt = NULL;

svc_xprt_put(&svsk->sk_xprt);
svc_xprt_put(xprt);
}

/*
Expand Down Expand Up @@ -1593,7 +1591,7 @@ svc_recv(struct svc_rqst *rqstp, long timeout)
/* No data, incomplete (TCP) read, or accept() */
if (len == 0 || len == -EAGAIN) {
rqstp->rq_res.len = 0;
svc_sock_release(rqstp);
svc_xprt_release(rqstp);
return -EAGAIN;
}
clear_bit(XPT_OLD, &svsk->sk_xprt.xpt_flags);
Expand All @@ -1613,7 +1611,7 @@ void
svc_drop(struct svc_rqst *rqstp)
{
dprintk("svc: socket %p dropped request\n", rqstp->rq_sock);
svc_sock_release(rqstp);
svc_xprt_release(rqstp);
}

/*
Expand Down Expand Up @@ -1646,7 +1644,7 @@ svc_send(struct svc_rqst *rqstp)
else
len = xprt->xpt_ops->xpo_sendto(rqstp);
mutex_unlock(&xprt->xpt_mutex);
svc_sock_release(rqstp);
svc_xprt_release(rqstp);

if (len == -ECONNREFUSED || len == -ENOTCONN || len == -EAGAIN)
return 0;
Expand Down

0 comments on commit 425ba28

Please sign in to comment.