aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/client.c')
-rw-r--r--fs/nfs/client.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 90d71fda65ce..43c9cb44b7cb 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -9,7 +9,6 @@
* 2 of the License, or (at your option) any later version.
*/
-
#include <linux/module.h>
#include <linux/init.h>
#include <linux/sched.h>
@@ -70,7 +69,7 @@ static const struct rpc_version *nfs_version[5] = {
[4] = NULL,
};
-const struct rpc_program nfs_program = {
+struct rpc_program nfs_program = {
.name = "nfs",
.number = NFS_PROGRAM,
.nrvers = ARRAY_SIZE(nfs_version),
@@ -161,6 +160,7 @@ struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_init)
goto error_dealloc;
clp->rpc_ops = clp->cl_nfs_mod->rpc_ops;
+ clp->nfs_prog = cl_init->nfs_prog;
refcount_set(&clp->cl_count, 1);
clp->cl_cons_state = NFS_CS_INITING;
@@ -311,6 +311,9 @@ again:
/* Match nfsv4 minorversion */
if (clp->cl_minorversion != data->minorversion)
continue;
+ if (clp->nfs_prog != data->nfs_prog)
+ continue;
+
/* Match the full socket address */
if (!rpc_cmp_addr_port(sap, clap))
/* Match all xprt_switch full socket addresses */
@@ -514,6 +517,10 @@ int nfs_create_rpc_client(struct nfs_client *clp,
if (!IS_ERR(clp->cl_rpcclient))
return 0;
+ if (clp->nfs_prog)
+ nfs_program.number = clp->nfs_prog;
+ else
+ nfs_program.number = NFS_PROGRAM;
clnt = rpc_create(&args);
if (IS_ERR(clnt)) {
dprintk("%s: cannot create RPC client. Error = %ld\n",
@@ -652,6 +659,7 @@ static int nfs_init_server(struct nfs_server *server,
.proto = data->nfs_server.protocol,
.net = data->net,
.timeparms = &timeparms,
+ .nfs_prog = data->nfs_prog,
};
struct nfs_client *clp;
int error;