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) |
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: | |||
1260 | static void nfs4_session_set_rwsize(struct nfs_server *server) | 1260 | static void nfs4_session_set_rwsize(struct nfs_server *server) |
1261 | { | 1261 | { |
1262 | #ifdef CONFIG_NFS_V4_1 | 1262 | #ifdef CONFIG_NFS_V4_1 |
1263 | struct nfs4_session *sess; | ||
1264 | u32 server_resp_sz; | ||
1265 | u32 server_rqst_sz; | ||
1266 | |||
1263 | if (!nfs4_has_session(server->nfs_client)) | 1267 | if (!nfs4_has_session(server->nfs_client)) |
1264 | return; | 1268 | return; |
1265 | server->rsize = server->nfs_client->cl_session->fc_attrs.max_resp_sz; | 1269 | sess = server->nfs_client->cl_session; |
1266 | server->wsize = server->nfs_client->cl_session->fc_attrs.max_rqst_sz; | 1270 | server_resp_sz = sess->fc_attrs.max_resp_sz - nfs41_maxread_overhead; |
1271 | server_rqst_sz = sess->fc_attrs.max_rqst_sz - nfs41_maxwrite_overhead; | ||
1272 | |||
1273 | if (server->rsize > server_resp_sz) | ||
1274 | server->rsize = server_resp_sz; | ||
1275 | if (server->wsize > server_rqst_sz) | ||
1276 | server->wsize = server_rqst_sz; | ||
1267 | #endif /* CONFIG_NFS_V4_1 */ | 1277 | #endif /* CONFIG_NFS_V4_1 */ |
1268 | } | 1278 | } |
1269 | 1279 | ||