]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
NFSD: Remove NFSSVC_MAXBLKSIZE_V2 macro
authorChuck Lever <chuck.lever@oracle.com>
Mon, 28 Apr 2025 19:37:00 +0000 (15:37 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Thu, 15 May 2025 20:16:28 +0000 (16:16 -0400)
The 8192-byte maximum is a protocol-defined limit, and we already
have a symbolic constant defined whose name matches the name of
the limit defined in the protocol. Replace the duplicate.

No change in behavior is expected.

Reviewed-by: NeilBrown <neil@brown.name>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfsd.h
fs/nfsd/nfsproc.c
fs/nfsd/nfsxdr.c

index b9ac81023c13e2042b913d2f4339da74893b1826..6428a431d7659dd47ae4656d26df8c4bdc11224f 100644 (file)
@@ -47,8 +47,6 @@ bool nfsd_support_version(int vers);
  * Maximum blocksizes supported by daemon under various circumstances.
  */
 #define NFSSVC_MAXBLKSIZE       RPCSVC_MAXPAYLOAD
-/* NFSv2 is limited by the protocol specification, see RFC 1094 */
-#define NFSSVC_MAXBLKSIZE_V2    (8*1024)
 
 struct readdir_cd {
        __be32                  err;    /* 0, nfserr, or nfserr_eof */
index 65cbe04184f31f25fcdf9b002daad8883d2775b9..11fc9a1d5d804be03441481d87ecd865e696eb4b 100644 (file)
@@ -212,7 +212,7 @@ nfsd_proc_read(struct svc_rqst *rqstp)
                SVCFH_fmt(&argp->fh),
                argp->count, argp->offset);
 
-       argp->count = min_t(u32, argp->count, NFSSVC_MAXBLKSIZE_V2);
+       argp->count = min_t(u32, argp->count, NFS_MAXDATA);
        argp->count = min_t(u32, argp->count, rqstp->rq_res.buflen);
 
        resp->pages = rqstp->rq_next_page;
@@ -707,7 +707,7 @@ static const struct svc_procedure nfsd_procedures2[18] = {
                .pc_argzero = sizeof(struct nfsd_readargs),
                .pc_ressize = sizeof(struct nfsd_readres),
                .pc_cachetype = RC_NOCACHE,
-               .pc_xdrressize = ST+AT+1+NFSSVC_MAXBLKSIZE_V2/4,
+               .pc_xdrressize = ST+AT+1+NFS_MAXDATA/4,
                .pc_name = "READ",
        },
        [NFSPROC_WRITECACHE] = {
index 5777f40c7353b436fc398806c4107aa56847c8dc..fc262ceafca972df353a389eea2d7e99fd6bc1d2 100644 (file)
@@ -336,7 +336,7 @@ nfssvc_decode_writeargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
        /* opaque data */
        if (xdr_stream_decode_u32(xdr, &args->len) < 0)
                return false;
-       if (args->len > NFSSVC_MAXBLKSIZE_V2)
+       if (args->len > NFS_MAXDATA)
                return false;
 
        return xdr_stream_subsegment(xdr, &args->payload, args->len);
@@ -540,7 +540,7 @@ nfssvc_encode_statfsres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
                p = xdr_reserve_space(xdr, XDR_UNIT * 5);
                if (!p)
                        return false;
-               *p++ = cpu_to_be32(NFSSVC_MAXBLKSIZE_V2);
+               *p++ = cpu_to_be32(NFS_MAXDATA);
                *p++ = cpu_to_be32(stat->f_bsize);
                *p++ = cpu_to_be32(stat->f_blocks);
                *p++ = cpu_to_be32(stat->f_bfree);