public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Steve Dickson <steved@redhat.com>
To: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: [PATCH 1/3] Added support for the the -o rdma option
Date: Tue,  7 Sep 2010 16:21:59 -0400	[thread overview]
Message-ID: <1283890921-3447-2-git-send-email-steved@redhat.com> (raw)
In-Reply-To: <1283890921-3447-1-git-send-email-steved@redhat.com>

Network transports can be specified with both
the proto= and -o options. The patch adds support
for the -o rdma option.

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 utils/mount/stropts.c |   29 ++++++++++++++++++++---------
 1 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index 0241400..eb6ecc5 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -98,6 +98,22 @@ struct nfsmount_info {
 				child;		/* forked bg child? */
 };
 
+/*
+ * Check the options to see if the transport is RDMA
+ */
+static int nfs_rdma_option(struct mount_options *options)
+{
+	char *option;
+
+	if (po_contains(options, "rdma"))
+		return 1;
+	option = po_get(options, "proto");
+	if (option && strcmp(option, "rdma") == 0)
+		return 1;
+
+	return 0;
+}
+
 #ifdef MOUNT_CONFIG
 static void nfs_default_version(struct nfsmount_info *mi);
 
@@ -302,11 +318,8 @@ static int nfs_set_version(struct nfsmount_info *mi)
 
 	if (strncmp(mi->type, "nfs4", 4) == 0)
 		mi->version = 4;
-	else {
-		char *option = po_get(mi->options, "proto");
-		if (option && strcmp(option, "rdma") == 0)
-			mi->version = 3;
-	}
+	else if (mi->version == 0 && nfs_rdma_option(mi->options))
+		mi->version = 3; /* The default for RDMA mounts */
 
 	/*
 	 * If we still don't know, check for version-specific
@@ -491,13 +504,11 @@ nfs_rewrite_pmap_mount_options(struct mount_options *options)
 	struct sockaddr *mnt_saddr = &mnt_address.sa;
 	socklen_t mnt_salen = sizeof(mnt_address);
 	struct pmap mnt_pmap;
-	char *option;
 
 	/*
-	 * Skip option negotiation for proto=rdma mounts.
+	 * Skip option negotiation for RDMA mounts.
 	 */
-	option = po_get(options, "proto");
-	if (option && strcmp(option, "rdma") == 0)
+	if (nfs_rdma_option(options))
 		goto out;
 
 	/*
-- 
1.7.2.1


  reply	other threads:[~2010-09-07 20:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-07 20:21 [PATCH 0/3] mount: Updated RDMA processing in the mount command Steve Dickson
2010-09-07 20:21 ` Steve Dickson [this message]
2010-09-07 20:22 ` [PATCH 2/3] Ensure the corrrect address family is used on RDMA mounts Steve Dickson
2010-09-07 20:22 ` [PATCH 3/3] Document the rdma mount option in the nfs man page Steve Dickson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1283890921-3447-2-git-send-email-steved@redhat.com \
    --to=steved@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox