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 <neil@brown.name> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>pull/1112/head
parent
58d721684d
commit
cdc29154d3
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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] = {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue