[pnfs] [PATCH 1/2] nfs41: add mount command option minorvers

sager at netapp.com sager at netapp.com
Tue Apr 29 22:42:31 EDT 2008


From: Mike Sager <sager at netapp.com>

mount -t nfs4 -o minorvers=[0|1] specifies whether to use 4.0 or 4.1.
The default is 1.

Signed-off-by: Mike Sager <sager at netapp.com>
---
 fs/nfs/internal.h |    3 +++
 fs/nfs/super.c    |   18 ++++++++++++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index 07eea8e..526623a 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -41,6 +41,9 @@ struct nfs_parsed_mount_data {
 	unsigned int		auth_flavor_len;
 	rpc_authflavor_t	auth_flavors[1];
 	char			*client_address;
+#ifdef CONFIG_NFS_V4_1
+	int			minorvers;
+#endif /* CONFIG_NFS_V4_1 */
 
 	struct {
 		struct sockaddr_storage	address;
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 52241f6..e84d451 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -90,6 +90,9 @@ enum {
 	Opt_mountport,
 	Opt_mountvers,
 	Opt_nfsvers,
+#ifdef CONFIG_NFS_V4_1
+	Opt_minorvers,
+#endif /* CONFIG_NFS_V4_1 */
 
 	/* Mount options that take string arguments */
 	Opt_sec, Opt_proto, Opt_mountproto, Opt_mounthost,
@@ -145,6 +148,9 @@ static match_table_t nfs_mount_option_tokens = {
 	{ Opt_mountvers, "mountvers=%u" },
 	{ Opt_nfsvers, "nfsvers=%u" },
 	{ Opt_nfsvers, "vers=%u" },
+#ifdef CONFIG_NFS_V4_1
+	{ Opt_minorvers, "minorvers=%u" },
+#endif /* CONFIG_NFS_V4_1 */
 
 	{ Opt_sec, "sec=%s" },
 	{ Opt_proto, "proto=%s" },
@@ -884,6 +890,15 @@ static int nfs_parse_mount_options(char *raw,
 				goto out_unrec_vers;
 			}
 			break;
+#ifdef CONFIG_NFS_V4_1
+		case Opt_minorvers:
+			if (match_int(args, &option))
+				return 0;
+			if (option < 0 || option > NFS4_MAX_MINOR_VERSION)
+				return 0;
+			mnt->minorvers = option;
+			break;
+#endif /* CONFIG_NFS_V4_1 */
 
 		case Opt_sec:
 			string = match_strdup(args);
@@ -1755,6 +1770,9 @@ static int nfs4_validate_mount_data(void *options,
 	args->acdirmin		= 30;
 	args->acdirmax		= 60;
 	args->nfs_server.protocol = XPRT_TRANSPORT_TCP;
+#ifdef CONFIG_NFS_V4_1
+	args->minorvers		= NFS4_MAX_MINOR_VERSION;
+#endif /* CONFIG_NFS_V4_1 */
 
 	switch (data->version) {
 	case 1:
-- 
1.5.3.3



More information about the pNFS mailing list