summaryrefslogtreecommitdiffstats
path: root/utils/mount/network.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2010-09-08 13:27:31 -0400
committerSteve Dickson <steved@redhat.com>2010-09-09 10:38:48 -0400
commitf99d1b8e8768ab96b51bed52f21a626ac9a4797f (patch)
treeb87440b4bdf8a67b430bcc7074972a04d89631f3 /utils/mount/network.c
parent44f09b7c4c79ca184a29138078c68a4db7aeb85a (diff)
downloadnfs-utils-f99d1b8e8768ab96b51bed52f21a626ac9a4797f.tar.gz
nfs-utils-f99d1b8e8768ab96b51bed52f21a626ac9a4797f.tar.xz
nfs-utils-f99d1b8e8768ab96b51bed52f21a626ac9a4797f.zip
mount.nfs: Support an "rdma" mount option
The kernel NFS client's mount option parser recognizes a stand-alone "rdma" mount option, similar to the legacy "udp" and "tcp" options. The mount.nfs command text-based mount option parser used to pass "rdma" straight to the kernel, but since we've started handling MNT in the kernel instead of in user space, "rdma" on the command line has not worked. Until now, no-one has noticed, especially since an "rdma" mount option isn't documented in nfs(5). Support "rdma" in mount.nfs command, and document it in nfs(5). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/mount/network.c')
-rw-r--r--utils/mount/network.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/utils/mount/network.c b/utils/mount/network.c
index d6b5205..d612427 100644
--- a/utils/mount/network.c
+++ b/utils/mount/network.c
@@ -83,6 +83,7 @@ static const char *nfs_nfs_pgmtbl[] = {
static const char *nfs_transport_opttbl[] = {
"udp",
"tcp",
+ "rdma",
"proto",
NULL,
};
@@ -1307,7 +1308,10 @@ nfs_nfs_protocol(struct mount_options *options, unsigned long *protocol)
case 1: /* tcp */
*protocol = IPPROTO_TCP;
return 1;
- case 2: /* proto */
+ case 2: /* rdma */
+ *protocol = NFSPROTO_RDMA;
+ return 1;
+ case 3: /* proto */
option = po_get(options, "proto");
if (option != NULL) {
if (!nfs_get_proto(option, &family, protocol)) {
@@ -1396,10 +1400,11 @@ int nfs_nfs_proto_family(struct mount_options *options,
switch (po_rightmost(options, nfs_transport_opttbl)) {
case 0: /* udp */
case 1: /* tcp */
+ case 2: /* rdma */
/* for compatibility; these are always AF_INET */
*family = AF_INET;
return 1;
- case 2: /* proto */
+ case 3: /* proto */
option = po_get(options, "proto");
if (option != NULL &&
!nfs_get_proto(option, &tmp_family, &protocol)) {