aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2013-11-20 03:24:11 -0500
committerJ. Bruce Fields <bfields@redhat.com>2013-12-10 20:37:47 -0500
commit2d8498dbf8041c51ca49a0be6be594501638e591 (patch)
treedaa52e13c7a54b95ed3e56c80df549af188908ad
parent6e14b46b91fee8a049b0940333ce13a820beaaa5 (diff)
nfsd: start documenting some XDR handling functions
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r--fs/nfsd/nfs4xdr.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index ee7237f99f54..79754139ccdf 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -190,6 +190,15 @@ static int zero_clientid(clientid_t *clid)
190 return (clid->cl_boot == 0) && (clid->cl_id == 0); 190 return (clid->cl_boot == 0) && (clid->cl_id == 0);
191} 191}
192 192
193/**
194 * defer_free - mark an allocation as deferred freed
195 * @argp: NFSv4 compound argument structure to be freed with
196 * @release: release callback to free @p, typically kfree()
197 * @p: pointer to be freed
198 *
199 * Marks @p to be freed when processing the compound operation
200 * described in @argp finishes.
201 */
193static int 202static int
194defer_free(struct nfsd4_compoundargs *argp, 203defer_free(struct nfsd4_compoundargs *argp,
195 void (*release)(const void *), void *p) 204 void (*release)(const void *), void *p)
@@ -206,6 +215,16 @@ defer_free(struct nfsd4_compoundargs *argp,
206 return 0; 215 return 0;
207} 216}
208 217
218/**
219 * savemem - duplicate a chunk of memory for later processing
220 * @argp: NFSv4 compound argument structure to be freed with
221 * @p: pointer to be duplicated
222 * @nbytes: length to be duplicated
223 *
224 * Returns a pointer to a copy of @nbytes bytes of memory at @p
225 * that are preserved until processing of the NFSv4 compound
226 * operation described by @argp finishes.
227 */
209static char *savemem(struct nfsd4_compoundargs *argp, __be32 *p, int nbytes) 228static char *savemem(struct nfsd4_compoundargs *argp, __be32 *p, int nbytes)
210{ 229{
211 if (p == argp->tmp) { 230 if (p == argp->tmp) {