Skip to contentSkip to conversation

nfs41 do not allocate unused back channel pages

PATCH New [email protected] 1 participant 1 message Jan 28, 2010

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

PATCH 1/1 nfs41 do not allocate unused back channel pages

From: Andy Adamson <[email protected]>

---
 include/linux/sunrpc/svc.h |   12 ++++++++++++
 net/sunrpc/svc.c           |    4 ++++
 2 files changed, 16 insertions(+), 0 deletions(-)
include/linux/sunrpc/svc.h +12 -0
index 5a3085b..02329f4 100644
@@ -281,6 +281,18 @@ struct svc_rqst {
 };
 
 /*
+ * Determine if a shared backchannel is in use
+ */
+static inline int svc_is_backchannel(const struct svc_rqst *rqstp)
+{
+#ifdef CONFIG_NFS_V4_1
+	if (rqstp->rq_server->bc_xprt)
+		return 1;
+#endif /* CONFIG_NFS_V4_1 */
+	return 0;
+}
+
+/*
  * Rigorous type checking on sockaddr type conversions
  */
 static inline struct sockaddr_in *svc_addr_in(const struct svc_rqst *rqst)
net/sunrpc/svc.c +4 -0
index 538ca43..6dcf8c9 100644
@@ -506,6 +506,10 @@ svc_init_buffer(struct svc_rqst *rqstp, unsigned int size)
 {
 	unsigned int pages, arghi;
 
+	/* bc_xprt uses fore channel allocated buffers */
+	if (svc_is_backchannel(rqstp))
+		return 1;
+
 	pages = size / PAGE_SIZE + 1; /* extra page as we hold both request and reply.
 				       * We assume one is at most one page
 				       */
Signature · 1 line
1.6.6