Skip to content

Commit cdc2915

Browse files
committed
NFSD: Remove NFSSVC_MAXBLKSIZE_V2 macro
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 <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent 58d7216 commit cdc2915

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

fs/nfsd/nfsd.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ bool nfsd_support_version(int vers);
4747
* Maximum blocksizes supported by daemon under various circumstances.
4848
*/
4949
#define NFSSVC_MAXBLKSIZE RPCSVC_MAXPAYLOAD
50-
/* NFSv2 is limited by the protocol specification, see RFC 1094 */
51-
#define NFSSVC_MAXBLKSIZE_V2 (8*1024)
5250

5351
struct readdir_cd {
5452
__be32 err; /* 0, nfserr, or nfserr_eof */

fs/nfsd/nfsproc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ nfsd_proc_read(struct svc_rqst *rqstp)
212212
SVCFH_fmt(&argp->fh),
213213
argp->count, argp->offset);
214214

215-
argp->count = min_t(u32, argp->count, NFSSVC_MAXBLKSIZE_V2);
215+
argp->count = min_t(u32, argp->count, NFS_MAXDATA);
216216
argp->count = min_t(u32, argp->count, rqstp->rq_res.buflen);
217217

218218
resp->pages = rqstp->rq_next_page;
@@ -707,7 +707,7 @@ static const struct svc_procedure nfsd_procedures2[18] = {
707707
.pc_argzero = sizeof(struct nfsd_readargs),
708708
.pc_ressize = sizeof(struct nfsd_readres),
709709
.pc_cachetype = RC_NOCACHE,
710-
.pc_xdrressize = ST+AT+1+NFSSVC_MAXBLKSIZE_V2/4,
710+
.pc_xdrressize = ST+AT+1+NFS_MAXDATA/4,
711711
.pc_name = "READ",
712712
},
713713
[NFSPROC_WRITECACHE] = {

fs/nfsd/nfsxdr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ nfssvc_decode_writeargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
336336
/* opaque data */
337337
if (xdr_stream_decode_u32(xdr, &args->len) < 0)
338338
return false;
339-
if (args->len > NFSSVC_MAXBLKSIZE_V2)
339+
if (args->len > NFS_MAXDATA)
340340
return false;
341341

342342
return xdr_stream_subsegment(xdr, &args->payload, args->len);
@@ -540,7 +540,7 @@ nfssvc_encode_statfsres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
540540
p = xdr_reserve_space(xdr, XDR_UNIT * 5);
541541
if (!p)
542542
return false;
543-
*p++ = cpu_to_be32(NFSSVC_MAXBLKSIZE_V2);
543+
*p++ = cpu_to_be32(NFS_MAXDATA);
544544
*p++ = cpu_to_be32(stat->f_bsize);
545545
*p++ = cpu_to_be32(stat->f_blocks);
546546
*p++ = cpu_to_be32(stat->f_bfree);

0 commit comments

Comments
 (0)