* [PATCH] nfsd: start documenting some XDR handling functions
@ 2013-11-20 8:24 Christoph Hellwig
2013-11-21 16:46 ` J. Bruce Fields
0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2013-11-20 8:24 UTC (permalink / raw)
To: bfields; +Cc: linux-nfs
Signed-off-by: Christoph Hellwig <hch@lst.de>
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index fc10dd7..9423522 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -193,6 +193,15 @@ static int zero_clientid(clientid_t *clid)
return (clid->cl_boot == 0) && (clid->cl_id == 0);
}
+/**
+ * defer_free - mark an allocation as deferred freed
+ * @argp: NFSv4 compound argument structure to be freed with
+ * @release: release callback to free @p, typically kfree()
+ * @p: pointer to be freed
+ *
+ * Marks @p to be freed when processing the compound operation
+ * described in @argp finishes.
+ */
static int
defer_free(struct nfsd4_compoundargs *argp,
void (*release)(const void *), void *p)
@@ -209,6 +218,16 @@ defer_free(struct nfsd4_compoundargs *argp,
return 0;
}
+/**
+ * savemem - duplicate a chunk of memory for later processing
+ * @argp: NFSv4 compound argument structure to be freed with
+ * @p: pointer to be duplicated
+ * @nbytes: length to be duplicated
+ *
+ * Returns a pointer to a copy of @nbytes bytes of memory at @p
+ * that are preserved until processing of the NFSv4 compound
+ * operation described by @argp finishes.
+ */
static char *savemem(struct nfsd4_compoundargs *argp, __be32 *p, int nbytes)
{
if (p == argp->tmp) {
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] nfsd: start documenting some XDR handling functions
2013-11-20 8:24 [PATCH] nfsd: start documenting some XDR handling functions Christoph Hellwig
@ 2013-11-21 16:46 ` J. Bruce Fields
0 siblings, 0 replies; 2+ messages in thread
From: J. Bruce Fields @ 2013-11-21 16:46 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-nfs
On Wed, Nov 20, 2013 at 12:24:11AM -0800, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Thanks, applying for 3.14.
--b.
>
> diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
> index fc10dd7..9423522 100644
> --- a/fs/nfsd/nfs4xdr.c
> +++ b/fs/nfsd/nfs4xdr.c
> @@ -193,6 +193,15 @@ static int zero_clientid(clientid_t *clid)
> return (clid->cl_boot == 0) && (clid->cl_id == 0);
> }
>
> +/**
> + * defer_free - mark an allocation as deferred freed
> + * @argp: NFSv4 compound argument structure to be freed with
> + * @release: release callback to free @p, typically kfree()
> + * @p: pointer to be freed
> + *
> + * Marks @p to be freed when processing the compound operation
> + * described in @argp finishes.
> + */
> static int
> defer_free(struct nfsd4_compoundargs *argp,
> void (*release)(const void *), void *p)
> @@ -209,6 +218,16 @@ defer_free(struct nfsd4_compoundargs *argp,
> return 0;
> }
>
> +/**
> + * savemem - duplicate a chunk of memory for later processing
> + * @argp: NFSv4 compound argument structure to be freed with
> + * @p: pointer to be duplicated
> + * @nbytes: length to be duplicated
> + *
> + * Returns a pointer to a copy of @nbytes bytes of memory at @p
> + * that are preserved until processing of the NFSv4 compound
> + * operation described by @argp finishes.
> + */
> static char *savemem(struct nfsd4_compoundargs *argp, __be32 *p, int nbytes)
> {
> if (p == argp->tmp) {
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-11-21 16:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-20 8:24 [PATCH] nfsd: start documenting some XDR handling functions Christoph Hellwig
2013-11-21 16:46 ` J. Bruce Fields
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).