diff options
| author | Andy Adamson <andros@netapp.com> | 2010-01-26 21:24:04 -0500 |
|---|---|---|
| committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-02-10 08:31:02 -0500 |
| commit | ba17686f62db88f6a591121e768a0c83a2a2647d (patch) | |
| tree | b32b611d474e062d908af555b012dec0d4f703a5 | |
| parent | 9733f0d9289cbcac4fa03db0cb5aec1ab01c6bc9 (diff) | |
nfs41 do not allocate unused back channel pages
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>
| -rw-r--r-- | include/linux/sunrpc/bc_xprt.h | 15 | ||||
| -rw-r--r-- | net/sunrpc/svc.c | 4 |
2 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/sunrpc/bc_xprt.h b/include/linux/sunrpc/bc_xprt.h index 6508f0dc0eff..d7152b451e21 100644 --- a/include/linux/sunrpc/bc_xprt.h +++ b/include/linux/sunrpc/bc_xprt.h | |||
| @@ -38,12 +38,27 @@ int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs); | |||
| 38 | void xprt_destroy_backchannel(struct rpc_xprt *, int max_reqs); | 38 | void xprt_destroy_backchannel(struct rpc_xprt *, int max_reqs); |
| 39 | void bc_release_request(struct rpc_task *); | 39 | void bc_release_request(struct rpc_task *); |
| 40 | int bc_send(struct rpc_rqst *req); | 40 | int bc_send(struct rpc_rqst *req); |
| 41 | |||
| 42 | /* | ||
| 43 | * Determine if a shared backchannel is in use | ||
| 44 | */ | ||
| 45 | static inline int svc_is_backchannel(const struct svc_rqst *rqstp) | ||
| 46 | { | ||
| 47 | if (rqstp->rq_server->bc_xprt) | ||
| 48 | return 1; | ||
| 49 | return 0; | ||
| 50 | } | ||
| 41 | #else /* CONFIG_NFS_V4_1 */ | 51 | #else /* CONFIG_NFS_V4_1 */ |
| 42 | static inline int xprt_setup_backchannel(struct rpc_xprt *xprt, | 52 | static inline int xprt_setup_backchannel(struct rpc_xprt *xprt, |
| 43 | unsigned int min_reqs) | 53 | unsigned int min_reqs) |
| 44 | { | 54 | { |
| 45 | return 0; | 55 | return 0; |
| 46 | } | 56 | } |
| 57 | |||
| 58 | static inline int svc_is_backchannel(const struct svc_rqst *rqstp) | ||
| 59 | { | ||
| 60 | return 0; | ||
| 61 | } | ||
| 47 | #endif /* CONFIG_NFS_V4_1 */ | 62 | #endif /* CONFIG_NFS_V4_1 */ |
| 48 | #endif /* _LINUX_SUNRPC_BC_XPRT_H */ | 63 | #endif /* _LINUX_SUNRPC_BC_XPRT_H */ |
| 49 | 64 | ||
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index 538ca433a56c..6dcf8c9c784c 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c | |||
| @@ -506,6 +506,10 @@ svc_init_buffer(struct svc_rqst *rqstp, unsigned int size) | |||
| 506 | { | 506 | { |
| 507 | unsigned int pages, arghi; | 507 | unsigned int pages, arghi; |
| 508 | 508 | ||
| 509 | /* bc_xprt uses fore channel allocated buffers */ | ||
| 510 | if (svc_is_backchannel(rqstp)) | ||
| 511 | return 1; | ||
| 512 | |||
| 509 | pages = size / PAGE_SIZE + 1; /* extra page as we hold both request and reply. | 513 | pages = size / PAGE_SIZE + 1; /* extra page as we hold both request and reply. |
| 510 | * We assume one is at most one page | 514 | * We assume one is at most one page |
| 511 | */ | 515 | */ |
