public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nfsd: eliminate "to_delegation" define
@ 2014-10-01 12:05 Jeff Layton
  2014-10-01 12:42 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Layton @ 2014-10-01 12:05 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs, hch

We now have cb_to_delegation and to_delegation, which do the same thing
and are defined separately in different .c files. Move the
cb_to_delegation definition into a header file and eliminate the
redundant to_delegation definition.

Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Jeff Layton <jlayton@primarydata.com>
---
 fs/nfsd/nfs4callback.c | 5 +----
 fs/nfsd/nfs4state.c    | 3 ---
 fs/nfsd/state.h        | 3 +++
 3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index 4fe4be1ee82e..ed2b1151b171 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -49,9 +49,6 @@ static void nfsd4_mark_cb_fault(struct nfs4_client *, int reason);
 
 /* Index of predefined Linux callback client operations */
 
-#define to_delegation(cb) \
-	container_of(cb, struct nfs4_delegation, dl_recall)
-
 struct nfs4_cb_compound_hdr {
 	/* args */
 	u32		ident;	/* minorversion 0 only */
@@ -491,7 +488,7 @@ static void nfs4_xdr_enc_cb_null(struct rpc_rqst *req, struct xdr_stream *xdr,
 static void nfs4_xdr_enc_cb_recall(struct rpc_rqst *req, struct xdr_stream *xdr,
 				   const struct nfsd4_callback *cb)
 {
-	const struct nfs4_delegation *dp = to_delegation(cb);
+	const struct nfs4_delegation *dp = cb_to_delegation(cb);
 	struct nfs4_cb_compound_hdr hdr = {
 		.ident = cb->cb_clp->cl_cb_ident,
 		.minorversion = cb->cb_minorversion,
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 551f32d7f5c7..5c0cac173068 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -3360,9 +3360,6 @@ nfs4_share_conflict(struct svc_fh *current_fh, unsigned int deny_type)
 	return ret;
 }
 
-#define cb_to_delegation(cb) \
-	container_of(cb, struct nfs4_delegation, dl_recall)
-
 static void nfsd4_cb_recall_prepare(struct nfsd4_callback *cb)
 {
 	struct nfs4_delegation *dp = cb_to_delegation(cb);
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h
index bf52dc7b15e7..0a47c6a6b301 100644
--- a/fs/nfsd/state.h
+++ b/fs/nfsd/state.h
@@ -132,6 +132,9 @@ struct nfs4_delegation {
 	struct nfsd4_callback	dl_recall;
 };
 
+#define cb_to_delegation(cb) \
+	container_of(cb, struct nfs4_delegation, dl_recall)
+
 /* client delegation callback info */
 struct nfs4_cb_conn {
 	/* SETCLIENTID info */
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] nfsd: eliminate "to_delegation" define
  2014-10-01 12:05 [PATCH] nfsd: eliminate "to_delegation" define Jeff Layton
@ 2014-10-01 12:42 ` Christoph Hellwig
  2014-10-01 16:29   ` J. Bruce Fields
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2014-10-01 12:42 UTC (permalink / raw)
  To: Jeff Layton; +Cc: bfields, linux-nfs, hch

On Wed, Oct 01, 2014 at 08:05:22AM -0400, Jeff Layton wrote:
> We now have cb_to_delegation and to_delegation, which do the same thing
> and are defined separately in different .c files. Move the
> cb_to_delegation definition into a header file and eliminate the
> redundant to_delegation definition.
> 
> Cc: Christoph Hellwig <hch@infradead.org>
> Signed-off-by: Jeff Layton <jlayton@primarydata.com>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] nfsd: eliminate "to_delegation" define
  2014-10-01 12:42 ` Christoph Hellwig
@ 2014-10-01 16:29   ` J. Bruce Fields
  0 siblings, 0 replies; 3+ messages in thread
From: J. Bruce Fields @ 2014-10-01 16:29 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Jeff Layton, linux-nfs

On Wed, Oct 01, 2014 at 05:42:57AM -0700, Christoph Hellwig wrote:
> On Wed, Oct 01, 2014 at 08:05:22AM -0400, Jeff Layton wrote:
> > We now have cb_to_delegation and to_delegation, which do the same thing
> > and are defined separately in different .c files. Move the
> > cb_to_delegation definition into a header file and eliminate the
> > redundant to_delegation definition.
> > 
> > Cc: Christoph Hellwig <hch@infradead.org>
> > Signed-off-by: Jeff Layton <jlayton@primarydata.com>
> 
> Looks good,
> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>

Got it, thanks.--b.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-01 16:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-01 12:05 [PATCH] nfsd: eliminate "to_delegation" define Jeff Layton
2014-10-01 12:42 ` Christoph Hellwig
2014-10-01 16:29   ` 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