nfs41 do not allocate unused back channel pages
Subsystems (3)
PATCH 1/1 nfs41 do not allocate unused back channel pages
From: Andy Adamson <[email protected]>
Signed-off-by 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
@@ -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
@@ -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