Skip to contentSkip to conversation

rpcsvc-pages

PATCH In review Andreas Gruenbacher 1 participant 1 message Apr 26, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 3/11 rpcsvc-pages

Add a page to an rpc reply from the allocated pool

Andreas Gruenbacher <[email protected]>, SUSE Labs

include/linux/sunrpc/svc.h +11 -0
Index: linux-2.6.6-rc2/include/linux/sunrpc/svc.h
===================================================================
@@ -177,6 +177,17 @@ xdr_ressize_check(struct svc_rqst *rqstp
 	return vec->iov_len <= PAGE_SIZE;
 }
 
+static inline struct page *
+svc_take_res_page(struct svc_rqst *rqstp)
+{
+	if (rqstp->rq_arghi <= rqstp->rq_argused)
+		return NULL;
+	rqstp->rq_arghi--;
+	rqstp->rq_respages[rqstp->rq_resused] =
+		rqstp->rq_argpages[rqstp->rq_arghi];
+	return rqstp->rq_respages[rqstp->rq_resused++];
+}
+
 static inline int svc_take_page(struct svc_rqst *rqstp)
 {
 	if (rqstp->rq_arghi <= rqstp->rq_argused)