]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
nfs41 do not allocate unused back channel pages
authorAndy Adamson <andros@netapp.com>
Wed, 27 Jan 2010 02:24:04 +0000 (21:24 -0500)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 10 Feb 2010 13:31:02 +0000 (08:31 -0500)
Signed-off-by: Andy Adamson <andros@netapp.com>
[Trond.Myklebust@netapp.com: moved definition of svc_is_backchannel()
 into include/linux/sunrpc/bc_xprt.h.]
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
include/linux/sunrpc/bc_xprt.h
net/sunrpc/svc.c

index 6508f0dc0eff0119f5d9b10ab2a08ee7b75c5f27..d7152b451e21d7fb2bb84fcd3ffc33afa8ace8e9 100644 (file)
@@ -38,12 +38,27 @@ int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs);
 void xprt_destroy_backchannel(struct rpc_xprt *, int max_reqs);
 void bc_release_request(struct rpc_task *);
 int bc_send(struct rpc_rqst *req);
+
+/*
+ * Determine if a shared backchannel is in use
+ */
+static inline int svc_is_backchannel(const struct svc_rqst *rqstp)
+{
+       if (rqstp->rq_server->bc_xprt)
+               return 1;
+       return 0;
+}
 #else /* CONFIG_NFS_V4_1 */
 static inline int xprt_setup_backchannel(struct rpc_xprt *xprt,
                                         unsigned int min_reqs)
 {
        return 0;
 }
+
+static inline int svc_is_backchannel(const struct svc_rqst *rqstp)
+{
+       return 0;
+}
 #endif /* CONFIG_NFS_V4_1 */
 #endif /* _LINUX_SUNRPC_BC_XPRT_H */
 
index 538ca433a56cc72e2bae671e2b74174cb8efb3a8..6dcf8c9c784c862248a770b051c3f7f956922489 100644 (file)
@@ -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
                                       */