Commit a67d18f8 authored by Tom Talpey's avatar Tom Talpey Committed by Trond Myklebust

NFS: load the rpc/rdma transport module automatically

When mounting an NFS/RDMA server with the "-o proto=rdma" or
"-o rdma" options, attempt to dynamically load the necessary
"xprtrdma" client transport module. Doing so improves usability,
while avoiding a static module dependency and any unnecesary
resources.
Signed-off-by: default avatarTom Talpey <tmtalpey@gmail.com>
Cc: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 441e3e24
...@@ -1018,6 +1018,7 @@ static int nfs_parse_mount_options(char *raw, ...@@ -1018,6 +1018,7 @@ static int nfs_parse_mount_options(char *raw,
case Opt_rdma: case Opt_rdma:
mnt->flags |= NFS_MOUNT_TCP; /* for side protocols */ mnt->flags |= NFS_MOUNT_TCP; /* for side protocols */
mnt->nfs_server.protocol = XPRT_TRANSPORT_RDMA; mnt->nfs_server.protocol = XPRT_TRANSPORT_RDMA;
xprt_load_transport(p);
break; break;
case Opt_acl: case Opt_acl:
mnt->flags &= ~NFS_MOUNT_NOACL; mnt->flags &= ~NFS_MOUNT_NOACL;
...@@ -1205,12 +1206,14 @@ static int nfs_parse_mount_options(char *raw, ...@@ -1205,12 +1206,14 @@ static int nfs_parse_mount_options(char *raw,
/* vector side protocols to TCP */ /* vector side protocols to TCP */
mnt->flags |= NFS_MOUNT_TCP; mnt->flags |= NFS_MOUNT_TCP;
mnt->nfs_server.protocol = XPRT_TRANSPORT_RDMA; mnt->nfs_server.protocol = XPRT_TRANSPORT_RDMA;
xprt_load_transport(string);
break; break;
default: default:
errors++; errors++;
dfprintk(MOUNT, "NFS: unrecognized " dfprintk(MOUNT, "NFS: unrecognized "
"transport protocol\n"); "transport protocol\n");
} }
kfree(string);
break; break;
case Opt_mountproto: case Opt_mountproto:
string = match_strdup(args); string = match_strdup(args);
...@@ -1218,7 +1221,6 @@ static int nfs_parse_mount_options(char *raw, ...@@ -1218,7 +1221,6 @@ static int nfs_parse_mount_options(char *raw,
goto out_nomem; goto out_nomem;
token = match_token(string, token = match_token(string,
nfs_xprt_protocol_tokens, args); nfs_xprt_protocol_tokens, args);
kfree(string);
switch (token) { switch (token) {
case Opt_xprt_udp: case Opt_xprt_udp:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment