Skip to content

Commit 58d7216

Browse files
committed
NFSD: Remove NFSD_BUFSIZE
Clean up: The documenting comment for NFSD_BUFSIZE is quite stale. NFSD_BUFSIZE is used only for NFSv4 Reply these days; never for NFSv2 or v3, and never for RPC Calls. Even so, the byte count estimate does not include the size of the NFSv4 COMPOUND Reply HEADER or the RPC auth flavor. Reviewed-by: Jeff Layton <[email protected]> Reviewed-by: NeilBrown <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent 0af165b commit 58d7216

File tree

4 files changed

+3
-16
lines changed

4 files changed

+3
-16
lines changed

fs/nfsd/nfs4proc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3845,7 +3845,7 @@ static const struct svc_procedure nfsd_procedures4[2] = {
38453845
.pc_ressize = sizeof(struct nfsd4_compoundres),
38463846
.pc_release = nfsd4_release_compoundargs,
38473847
.pc_cachetype = RC_NOCACHE,
3848-
.pc_xdrressize = NFSD_BUFSIZE/4,
3848+
.pc_xdrressize = 3+NFSSVC_MAXBLKSIZE/4,
38493849
.pc_name = "COMPOUND",
38503850
},
38513851
};

fs/nfsd/nfs4state.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4406,7 +4406,7 @@ nfsd4_sequence(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
44064406
nfserr_rep_too_big;
44074407
if (xdr_restrict_buflen(xdr, buflen - rqstp->rq_auth_slack))
44084408
goto out_put_session;
4409-
svc_reserve(rqstp, buflen);
4409+
svc_reserve_auth(rqstp, buflen);
44104410

44114411
status = nfs_ok;
44124412
/* Success! accept new slot seqid */

fs/nfsd/nfs4xdr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2564,7 +2564,7 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
25642564
/* Sessions make the DRC unnecessary: */
25652565
if (argp->minorversion)
25662566
cachethis = false;
2567-
svc_reserve(argp->rqstp, max_reply + readbytes);
2567+
svc_reserve_auth(argp->rqstp, max_reply + readbytes);
25682568
argp->rqstp->rq_cachetype = cachethis ? RC_REPLBUFF : RC_NOCACHE;
25692569

25702570
argp->splice_ok = nfsd_read_splice_ok(argp->rqstp);

fs/nfsd/nfsd.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,6 @@ bool nfsd_support_version(int vers);
5050
/* NFSv2 is limited by the protocol specification, see RFC 1094 */
5151
#define NFSSVC_MAXBLKSIZE_V2 (8*1024)
5252

53-
54-
/*
55-
* Largest number of bytes we need to allocate for an NFS
56-
* call or reply. Used to control buffer sizes. We use
57-
* the length of v3 WRITE, READDIR and READDIR replies
58-
* which are an RPC header, up to 26 XDR units of reply
59-
* data, and some page data.
60-
*
61-
* Note that accuracy here doesn't matter too much as the
62-
* size is rounded up to a page size when allocating space.
63-
*/
64-
#define NFSD_BUFSIZE ((RPC_MAX_HEADER_WITH_AUTH+26)*XDR_UNIT + NFSSVC_MAXBLKSIZE)
65-
6653
struct readdir_cd {
6754
__be32 err; /* 0, nfserr, or nfserr_eof */
6855
};

0 commit comments

Comments
 (0)