Skip to content

Commit 3a40543

Browse files
jtlaytonchucklever
authored andcommitted
nfsd: drop the nfsd4_fattr_args "size" field
We already have a slot for this in the kstat structure. Just overwrite that instead of keeping a copy. Signed-off-by: Jeff Layton <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent c757ca1 commit 3a40543

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

fs/nfsd/nfs4xdr.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2928,7 +2928,6 @@ struct nfsd4_fattr_args {
29282928
struct kstat stat;
29292929
struct kstatfs statfs;
29302930
struct nfs4_acl *acl;
2931-
u64 size;
29322931
#ifdef CONFIG_NFSD_V4_SECURITY_LABEL
29332932
void *context;
29342933
int contextlen;
@@ -3047,7 +3046,7 @@ static __be32 nfsd4_encode_fattr4_change(struct xdr_stream *xdr,
30473046
static __be32 nfsd4_encode_fattr4_size(struct xdr_stream *xdr,
30483047
const struct nfsd4_fattr_args *args)
30493048
{
3050-
return nfsd4_encode_uint64_t(xdr, args->size);
3049+
return nfsd4_encode_uint64_t(xdr, args->stat.size);
30513050
}
30523051

30533052
static __be32 nfsd4_encode_fattr4_fsid(struct xdr_stream *xdr,
@@ -3555,7 +3554,6 @@ nfsd4_encode_fattr4(struct svc_rqst *rqstp, struct xdr_stream *xdr,
35553554
if (status)
35563555
goto out;
35573556
}
3558-
args.size = 0;
35593557
if (attrmask[0] & (FATTR4_WORD0_CHANGE | FATTR4_WORD0_SIZE)) {
35603558
status = nfsd4_deleg_getattr_conflict(rqstp, dentry,
35613559
&file_modified, &size);
@@ -3569,9 +3567,7 @@ nfsd4_encode_fattr4(struct svc_rqst *rqstp, struct xdr_stream *xdr,
35693567
if (err)
35703568
goto out_nfserr;
35713569
if (file_modified)
3572-
args.size = size;
3573-
else
3574-
args.size = args.stat.size;
3570+
args.stat.size = size;
35753571

35763572
if (!(args.stat.result_mask & STATX_BTIME))
35773573
/* underlying FS does not offer btime so we can't share it */

0 commit comments

Comments
 (0)