]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
nfsd: drop the nfsd4_fattr_args "size" field
authorJeff Layton <jlayton@kernel.org>
Fri, 4 Oct 2024 13:16:45 +0000 (09:16 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 11 Nov 2024 18:42:07 +0000 (13:42 -0500)
We already have a slot for this in the kstat structure. Just overwrite
that instead of keeping a copy.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4xdr.c

index 8d25aef51ad150625540e1b8baba8baf9d64b788..7f1cb1cdb67e28fac216eea9803045f277992708 100644 (file)
@@ -2928,7 +2928,6 @@ struct nfsd4_fattr_args {
        struct kstat            stat;
        struct kstatfs          statfs;
        struct nfs4_acl         *acl;
-       u64                     size;
 #ifdef CONFIG_NFSD_V4_SECURITY_LABEL
        void                    *context;
        int                     contextlen;
@@ -3047,7 +3046,7 @@ static __be32 nfsd4_encode_fattr4_change(struct xdr_stream *xdr,
 static __be32 nfsd4_encode_fattr4_size(struct xdr_stream *xdr,
                                       const struct nfsd4_fattr_args *args)
 {
-       return nfsd4_encode_uint64_t(xdr, args->size);
+       return nfsd4_encode_uint64_t(xdr, args->stat.size);
 }
 
 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,
                if (status)
                        goto out;
        }
-       args.size = 0;
        if (attrmask[0] & (FATTR4_WORD0_CHANGE | FATTR4_WORD0_SIZE)) {
                status = nfsd4_deleg_getattr_conflict(rqstp, dentry,
                                        &file_modified, &size);
@@ -3569,9 +3567,7 @@ nfsd4_encode_fattr4(struct svc_rqst *rqstp, struct xdr_stream *xdr,
        if (err)
                goto out_nfserr;
        if (file_modified)
-               args.size = size;
-       else
-               args.size = args.stat.size;
+               args.stat.size = size;
 
        if (!(args.stat.result_mask & STATX_BTIME))
                /* underlying FS does not offer btime so we can't share it */