diff options
author | J. Bruce Fields <bfields@redhat.com> | 2014-06-24 17:43:45 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2014-07-08 17:14:27 -0400 |
commit | d5e2338324102dcf34aa25aeaf96064cc4d94dce (patch) | |
tree | 637478358b86076a8411e4de66a2271c1ac11487 /fs/nfsd/xdr4.h | |
parent | bcaab953b1d3790c724a211f2452b574fd49a7ce (diff) |
nfsd4: replace defer_free by svcxdr_tmpalloc
Avoid an extra allocation for the tmpbuf struct itself, and stop
ignoring some allocation failures.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/xdr4.h')
-rw-r--r-- | fs/nfsd/xdr4.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h index 4379cc871607..efce9010cad4 100644 --- a/fs/nfsd/xdr4.h +++ b/fs/nfsd/xdr4.h @@ -478,6 +478,14 @@ struct nfsd4_op { bool nfsd4_cache_this_op(struct nfsd4_op *); +/* + * Memory needed just for the duration of processing one compound: + */ +struct svcxdr_tmpbuf { + struct svcxdr_tmpbuf *next; + char buf[]; +}; + struct nfsd4_compoundargs { /* scratch variables for XDR decode */ __be32 * p; @@ -486,10 +494,7 @@ struct nfsd4_compoundargs { int pagelen; __be32 tmp[8]; __be32 * tmpp; - struct tmpbuf { - struct tmpbuf *next; - void *buf; - } *to_free; + struct svcxdr_tmpbuf *to_free; struct svc_rqst *rqstp; |