Skip to content

Commit c757ca1

Browse files
jtlaytonchucklever
authored andcommitted
nfsd: drop the ncf_cb_bmap field
This is always the same value, and in a later patch we're going to need to set bits in WORD2. We can simplify this code and save a little space in the delegation too. Just hardcode the bitmap in the callback encode function. Signed-off-by: Jeff Layton <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent f67eef8 commit c757ca1

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

fs/nfsd/nfs4callback.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,10 +364,13 @@ encode_cb_getattr4args(struct xdr_stream *xdr, struct nfs4_cb_compound_hdr *hdr,
364364
struct nfs4_delegation *dp =
365365
container_of(fattr, struct nfs4_delegation, dl_cb_fattr);
366366
struct knfsd_fh *fh = &dp->dl_stid.sc_file->fi_fhandle;
367+
u32 bmap[1];
368+
369+
bmap[0] = FATTR4_WORD0_CHANGE | FATTR4_WORD0_SIZE;
367370

368371
encode_nfs_cb_opnum4(xdr, OP_CB_GETATTR);
369372
encode_nfs_fh4(xdr, fh);
370-
encode_bitmap4(xdr, fattr->ncf_cb_bmap, ARRAY_SIZE(fattr->ncf_cb_bmap));
373+
encode_bitmap4(xdr, bmap, ARRAY_SIZE(bmap));
371374
hdr->nops++;
372375
}
373376

fs/nfsd/nfs4state.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,6 @@ alloc_init_deleg(struct nfs4_client *clp, struct nfs4_file *fp,
11841184
nfsd4_init_cb(&dp->dl_cb_fattr.ncf_getattr, dp->dl_stid.sc_client,
11851185
&nfsd4_cb_getattr_ops, NFSPROC4_CLNT_CB_GETATTR);
11861186
dp->dl_cb_fattr.ncf_file_modified = false;
1187-
dp->dl_cb_fattr.ncf_cb_bmap[0] = FATTR4_WORD0_CHANGE | FATTR4_WORD0_SIZE;
11881187
get_nfs4_file(fp);
11891188
dp->dl_stid.sc_file = fp;
11901189
return dp;

fs/nfsd/state.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ struct nfs4_cpntf_state {
140140
struct nfs4_cb_fattr {
141141
struct nfsd4_callback ncf_getattr;
142142
u32 ncf_cb_status;
143-
u32 ncf_cb_bmap[1];
144143

145144
/* from CB_GETATTR reply */
146145
u64 ncf_cb_change;

0 commit comments

Comments
 (0)