]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
nfs41: use session attributes for rsize and wsize
authorAndy Adamson <andros@netapp.com>
Wed, 1 Apr 2009 13:22:33 +0000 (09:22 -0400)
committerBenny Halevy <bhalevy@panasas.com>
Wed, 17 Jun 2009 19:24:53 +0000 (12:24 -0700)
Set the mount points rsize and wsize to the negotiated session fore channel
maximum response and requeset size. These values will be bound checked in
nfs_server_set_fsinfo.

Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
[move nfs4_session_set_rwsize into CONFIG_NFS_V4]
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/client.c

index a9828baaa44573347eabe3a211a05e3c6993725a..bb7432d83b5a43c5d77e3ea45fa2aa0a4a2f8a6e 100644 (file)
@@ -1206,6 +1206,21 @@ static void nfs4_init_session(struct nfs_client *clp,
 #endif /* CONFIG_NFS_V4_1 */
 }
 
+/*
+ * Session has been established, and the client marked ready.
+ * Set the mount rsize and wsize with negotiated fore channel
+ * attributes which will be bound checked in nfs_server_set_fsinfo.
+ */
+static void nfs4_session_set_rwsize(struct nfs_server *server)
+{
+#ifdef CONFIG_NFS_V4_1
+       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;
+#endif /* CONFIG_NFS_V4_1 */
+}
+
 /*
  * Create a version 4 volume record
  */
@@ -1296,6 +1311,8 @@ struct nfs_server *nfs4_create_server(const struct nfs_parsed_mount_data *data,
                (unsigned long long) server->fsid.minor);
        dprintk("Mount FH: %d\n", mntfh->size);
 
+       nfs4_session_set_rwsize(server);
+
        error = nfs_probe_fsinfo(server, mntfh, &fattr);
        if (error < 0)
                goto error;