Commit d5b337b4 authored by Benny Halevy's avatar Benny Halevy Committed by J. Bruce Fields

nfsd: use nfs client rpc callback program

since commit ff7d9756
"nfsd: use static memory for callback program and stats"
do_probe_callback uses a static callback program
(NFS4_CALLBACK) rather than the one set in clp->cl_callback.cb_prog
as passed in by the client in setclientid (4.0)
or create_session (4.1).

This patches introduces rpc_create_args.prognumber that allows
overriding program->number when creating rpc_clnt.
Signed-off-by: default avatarBenny Halevy <bhalevy@panasas.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
parent 97eb89bb
...@@ -380,6 +380,7 @@ static int do_probe_callback(void *data) ...@@ -380,6 +380,7 @@ static int do_probe_callback(void *data)
.addrsize = sizeof(addr), .addrsize = sizeof(addr),
.timeout = &timeparms, .timeout = &timeparms,
.program = &cb_program, .program = &cb_program,
.prognumber = cb->cb_prog,
.version = nfs_cb_version[1]->number, .version = nfs_cb_version[1]->number,
.authflavor = RPC_AUTH_UNIX, /* XXX: need AUTH_GSS... */ .authflavor = RPC_AUTH_UNIX, /* XXX: need AUTH_GSS... */
.flags = (RPC_CLNT_CREATE_NOPING | RPC_CLNT_CREATE_QUIET), .flags = (RPC_CLNT_CREATE_NOPING | RPC_CLNT_CREATE_QUIET),
......
...@@ -104,6 +104,7 @@ struct rpc_create_args { ...@@ -104,6 +104,7 @@ struct rpc_create_args {
const struct rpc_timeout *timeout; const struct rpc_timeout *timeout;
char *servername; char *servername;
struct rpc_program *program; struct rpc_program *program;
u32 prognumber; /* overrides program->number */
u32 version; u32 version;
rpc_authflavor_t authflavor; rpc_authflavor_t authflavor;
unsigned long flags; unsigned long flags;
......
...@@ -174,7 +174,7 @@ static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args, stru ...@@ -174,7 +174,7 @@ static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args, stru
clnt->cl_procinfo = version->procs; clnt->cl_procinfo = version->procs;
clnt->cl_maxproc = version->nrprocs; clnt->cl_maxproc = version->nrprocs;
clnt->cl_protname = program->name; clnt->cl_protname = program->name;
clnt->cl_prog = program->number; clnt->cl_prog = args->prognumber ? : program->number;
clnt->cl_vers = version->number; clnt->cl_vers = version->number;
clnt->cl_stats = program->stats; clnt->cl_stats = program->stats;
clnt->cl_metrics = rpc_alloc_iostats(clnt); clnt->cl_metrics = rpc_alloc_iostats(clnt);
......
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