diff options
Diffstat (limited to 'include/linux/sunrpc')
| -rw-r--r-- | include/linux/sunrpc/svc.h | 24 | ||||
| -rw-r--r-- | include/linux/sunrpc/svcsock.h | 1 |
2 files changed, 24 insertions, 1 deletions
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 24464d66411a..2fa53b11e52c 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h @@ -15,6 +15,7 @@ #include <linux/sunrpc/xdr.h> #include <linux/sunrpc/svcauth.h> #include <linux/wait.h> +#include <linux/mm.h> /* * RPC service. @@ -171,7 +172,7 @@ xdr_ressize_check(struct svc_rqst *rqstp, u32 *p) return vec->iov_len <= PAGE_SIZE; } -static int inline take_page(struct svc_rqst *rqstp) +static int inline svc_take_page(struct svc_rqst *rqstp) { if (rqstp->rq_arghi <= rqstp->rq_argused) return -ENOMEM; @@ -180,6 +181,27 @@ static int inline take_page(struct svc_rqst *rqstp) return 0; } +static void inline svc_pushback_allpages(struct svc_rqst *rqstp) +{ + while (rqstp->rq_resused) { + if (rqstp->rq_respages[--rqstp->rq_resused] == NULL) + continue; + rqstp->rq_argpages[rqstp->rq_arghi++] = + rqstp->rq_respages[rqstp->rq_resused]; + rqstp->rq_respages[rqstp->rq_resused] = NULL; + } +} + +static void inline svc_free_allpages(struct svc_rqst *rqstp) +{ + while (rqstp->rq_resused) { + if (rqstp->rq_respages[--rqstp->rq_resused] == NULL) + continue; + put_page(rqstp->rq_respages[rqstp->rq_resused]); + rqstp->rq_respages[rqstp->rq_resused] = NULL; + } +} + struct svc_deferred_req { struct svc_serv *serv; u32 prot; /* protocol (UDP or TCP) */ diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h index 2f90342e4c76..61f37d10b47d 100644 --- a/include/linux/sunrpc/svcsock.h +++ b/include/linux/sunrpc/svcsock.h @@ -37,6 +37,7 @@ struct svc_sock { struct list_head sk_deferred; /* deferred requests that need to * be revisted */ + struct semaphore sk_sem; /* to serialize sending data */ int (*sk_recvfrom)(struct svc_rqst *rqstp); int (*sk_sendto)(struct svc_rqst *rqstp); |
