diff options
author | Greg Banks <gnb@melbourne.sgi.com> | 2006-10-04 05:15:47 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-04 10:55:16 -0400 |
commit | 7adae489fe794e3e203ff168595f635d0b845e59 (patch) | |
tree | f20544b72bdaea7cff0d340b5b4e5bfcaf2ce8fb /fs/nfsd/nfs3proc.c | |
parent | 3cc03b164cf01c6f36e64720b58610d292fb26f7 (diff) |
[PATCH] knfsd: Prepare knfsd for support of rsize/wsize of up to 1MB, over TCP
The limit over UDP remains at 32K. Also, make some of the apparently
arbitrary sizing constants clearer.
The biggest change here involves replacing NFSSVC_MAXBLKSIZE by a function of
the rqstp. This allows it to be different for different protocols (udp/tcp)
and also allows it to depend on the servers declared sv_bufsiz.
Note that we don't actually increase sv_bufsz for nfs yet. That comes next.
Signed-off-by: Greg Banks <gnb@melbourne.sgi.com>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/nfsd/nfs3proc.c')
-rw-r--r-- | fs/nfsd/nfs3proc.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/nfsd/nfs3proc.c b/fs/nfsd/nfs3proc.c index 0c4fab018791..a5ebc7dbb384 100644 --- a/fs/nfsd/nfs3proc.c +++ b/fs/nfsd/nfs3proc.c | |||
@@ -160,6 +160,7 @@ nfsd3_proc_read(struct svc_rqst *rqstp, struct nfsd3_readargs *argp, | |||
160 | struct nfsd3_readres *resp) | 160 | struct nfsd3_readres *resp) |
161 | { | 161 | { |
162 | int nfserr; | 162 | int nfserr; |
163 | u32 max_blocksize = svc_max_payload(rqstp); | ||
163 | 164 | ||
164 | dprintk("nfsd: READ(3) %s %lu bytes at %lu\n", | 165 | dprintk("nfsd: READ(3) %s %lu bytes at %lu\n", |
165 | SVCFH_fmt(&argp->fh), | 166 | SVCFH_fmt(&argp->fh), |
@@ -172,8 +173,8 @@ nfsd3_proc_read(struct svc_rqst *rqstp, struct nfsd3_readargs *argp, | |||
172 | */ | 173 | */ |
173 | 174 | ||
174 | resp->count = argp->count; | 175 | resp->count = argp->count; |
175 | if (NFSSVC_MAXBLKSIZE < resp->count) | 176 | if (max_blocksize < resp->count) |
176 | resp->count = NFSSVC_MAXBLKSIZE; | 177 | resp->count = max_blocksize; |
177 | 178 | ||
178 | svc_reserve(rqstp, ((1 + NFS3_POST_OP_ATTR_WORDS + 3)<<2) + resp->count +4); | 179 | svc_reserve(rqstp, ((1 + NFS3_POST_OP_ATTR_WORDS + 3)<<2) + resp->count +4); |
179 | 180 | ||
@@ -538,15 +539,16 @@ nfsd3_proc_fsinfo(struct svc_rqst * rqstp, struct nfsd_fhandle *argp, | |||
538 | struct nfsd3_fsinfores *resp) | 539 | struct nfsd3_fsinfores *resp) |
539 | { | 540 | { |
540 | int nfserr; | 541 | int nfserr; |
542 | u32 max_blocksize = svc_max_payload(rqstp); | ||
541 | 543 | ||
542 | dprintk("nfsd: FSINFO(3) %s\n", | 544 | dprintk("nfsd: FSINFO(3) %s\n", |
543 | SVCFH_fmt(&argp->fh)); | 545 | SVCFH_fmt(&argp->fh)); |
544 | 546 | ||
545 | resp->f_rtmax = NFSSVC_MAXBLKSIZE; | 547 | resp->f_rtmax = max_blocksize; |
546 | resp->f_rtpref = NFSSVC_MAXBLKSIZE; | 548 | resp->f_rtpref = max_blocksize; |
547 | resp->f_rtmult = PAGE_SIZE; | 549 | resp->f_rtmult = PAGE_SIZE; |
548 | resp->f_wtmax = NFSSVC_MAXBLKSIZE; | 550 | resp->f_wtmax = max_blocksize; |
549 | resp->f_wtpref = NFSSVC_MAXBLKSIZE; | 551 | resp->f_wtpref = max_blocksize; |
550 | resp->f_wtmult = PAGE_SIZE; | 552 | resp->f_wtmult = PAGE_SIZE; |
551 | resp->f_dtpref = PAGE_SIZE; | 553 | resp->f_dtpref = PAGE_SIZE; |
552 | resp->f_maxfilesize = ~(u32) 0; | 554 | resp->f_maxfilesize = ~(u32) 0; |