Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>

authored by

Jeff Layton and committed by
Chuck Lever
c757ca1a f67eef8d

+4 -3
+4 -1
fs/nfsd/nfs4callback.c
··· 364 364 struct nfs4_delegation *dp = 365 365 container_of(fattr, struct nfs4_delegation, dl_cb_fattr); 366 366 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; 367 370 368 371 encode_nfs_cb_opnum4(xdr, OP_CB_GETATTR); 369 372 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)); 371 374 hdr->nops++; 372 375 } 373 376
-1
fs/nfsd/nfs4state.c
··· 1184 1184 nfsd4_init_cb(&dp->dl_cb_fattr.ncf_getattr, dp->dl_stid.sc_client, 1185 1185 &nfsd4_cb_getattr_ops, NFSPROC4_CLNT_CB_GETATTR); 1186 1186 dp->dl_cb_fattr.ncf_file_modified = false; 1187 - dp->dl_cb_fattr.ncf_cb_bmap[0] = FATTR4_WORD0_CHANGE | FATTR4_WORD0_SIZE; 1188 1187 get_nfs4_file(fp); 1189 1188 dp->dl_stid.sc_file = fp; 1190 1189 return dp;
-1
fs/nfsd/state.h
··· 140 140 struct nfs4_cb_fattr { 141 141 struct nfsd4_callback ncf_getattr; 142 142 u32 ncf_cb_status; 143 - u32 ncf_cb_bmap[1]; 144 143 145 144 /* from CB_GETATTR reply */ 146 145 u64 ncf_cb_change;