Skip to content

Commit

Permalink
nfsd: eliminate "to_delegation" define
Browse files Browse the repository at this point in the history
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.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jeff Layton <jlayton@primarydata.com>
  • Loading branch information
Jeff Layton authored and J. Bruce Fields committed Oct 1, 2014
1 parent 24bab49 commit 34549ab
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions fs/nfsd/nfs4callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 0 additions & 3 deletions fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions fs/nfsd/state.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 34549ab

Please sign in to comment.