diff options
Diffstat (limited to 'fs/nfs/client.c')
-rw-r--r-- | fs/nfs/client.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 9e7d49fac4e3..ee72691ce94f 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), @@ -162,6 +161,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; atomic_set(&clp->cl_count, 1); clp->cl_cons_state = NFS_CS_INITING; @@ -320,6 +320,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 */ @@ -525,6 +528,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", @@ -662,6 +669,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; |