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 /net/sunrpc | |
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 'net/sunrpc')
-rw-r--r-- | net/sunrpc/svc.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index f4a509a925b5..b252401c8601 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c | |||
@@ -919,3 +919,18 @@ err_bad: | |||
919 | svc_putnl(resv, ntohl(rpc_stat)); | 919 | svc_putnl(resv, ntohl(rpc_stat)); |
920 | goto sendit; | 920 | goto sendit; |
921 | } | 921 | } |
922 | |||
923 | /* | ||
924 | * Return (transport-specific) limit on the rpc payload. | ||
925 | */ | ||
926 | u32 svc_max_payload(const struct svc_rqst *rqstp) | ||
927 | { | ||
928 | int max = RPCSVC_MAXPAYLOAD_TCP; | ||
929 | |||
930 | if (rqstp->rq_sock->sk_sock->type == SOCK_DGRAM) | ||
931 | max = RPCSVC_MAXPAYLOAD_UDP; | ||
932 | if (rqstp->rq_server->sv_bufsz < max) | ||
933 | max = rqstp->rq_server->sv_bufsz; | ||
934 | return max; | ||
935 | } | ||
936 | EXPORT_SYMBOL_GPL(svc_max_payload); | ||