diff options
author | Alexandros Batsakis <batsakis@netapp.com> | 2009-12-05 13:36:55 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-12-05 13:36:55 -0500 |
commit | 2449ea2e191123729b2dc37a06fcb9d6ea7e2736 (patch) | |
tree | f5b71099baefb6c550511b3d5f3da26b8c384454 /fs/nfs/client.c | |
parent | 7b183d0d432ab3525ae29511a5348ead3e790620 (diff) | |
download | linux-2449ea2e191123729b2dc37a06fcb9d6ea7e2736.tar.gz linux-2449ea2e191123729b2dc37a06fcb9d6ea7e2736.tar.bz2 linux-2449ea2e191123729b2dc37a06fcb9d6ea7e2736.zip |
nfs41: V2 adjust max_rqst_sz, max_resp_sz w.r.t to rsize, wsize
The v4.1 client should take into account the desired rsize, wsize when
negotiating the max size in CREATE_SESSION. Accordingly, it should use
rsize, wsize that are smaller than the session negotiated values.
Signed-off-by: Alexandros Batsakis <batsakis@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/client.c')
-rw-r--r-- | fs/nfs/client.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 99ea196f071f..ee77713ce68b 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c @@ -1260,10 +1260,20 @@ error: static void nfs4_session_set_rwsize(struct nfs_server *server) { #ifdef CONFIG_NFS_V4_1 + struct nfs4_session *sess; + u32 server_resp_sz; + u32 server_rqst_sz; + if (!nfs4_has_session(server->nfs_client)) return; - server->rsize = server->nfs_client->cl_session->fc_attrs.max_resp_sz; - server->wsize = server->nfs_client->cl_session->fc_attrs.max_rqst_sz; + sess = server->nfs_client->cl_session; + server_resp_sz = sess->fc_attrs.max_resp_sz - nfs41_maxread_overhead; + server_rqst_sz = sess->fc_attrs.max_rqst_sz - nfs41_maxwrite_overhead; + + if (server->rsize > server_resp_sz) + server->rsize = server_resp_sz; + if (server->wsize > server_rqst_sz) + server->wsize = server_rqst_sz; #endif /* CONFIG_NFS_V4_1 */ } |