diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-11-01 12:14:14 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-11-04 14:43:43 -0500 |
commit | f994c43d19a9116727d4c228d3f13db595bff562 (patch) | |
tree | f736b3811258df24c3efe9ce63096f4a60fb7556 /net/sunrpc | |
parent | 50d2bdb19734f9e9f21e63881a9b6c8db4cc0eb7 (diff) |
SUNRPC: Clean up rpc_bind_new_program
We can and should use the rpc_create_args and __rpc_clone_client()
to change the program and version number on the resulting rpc_client.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r-- | net/sunrpc/clnt.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 50bc9db8762c..c69e199b1082 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -703,21 +703,19 @@ struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *old, | |||
703 | const struct rpc_program *program, | 703 | const struct rpc_program *program, |
704 | u32 vers) | 704 | u32 vers) |
705 | { | 705 | { |
706 | struct rpc_create_args args = { | ||
707 | .program = program, | ||
708 | .prognumber = program->number, | ||
709 | .version = vers, | ||
710 | .authflavor = old->cl_auth->au_flavor, | ||
711 | .client_name = old->cl_principal, | ||
712 | }; | ||
706 | struct rpc_clnt *clnt; | 713 | struct rpc_clnt *clnt; |
707 | const struct rpc_version *version; | ||
708 | int err; | 714 | int err; |
709 | 715 | ||
710 | BUG_ON(vers >= program->nrvers || !program->version[vers]); | 716 | clnt = __rpc_clone_client(&args, old); |
711 | version = program->version[vers]; | ||
712 | clnt = rpc_clone_client(old); | ||
713 | if (IS_ERR(clnt)) | 717 | if (IS_ERR(clnt)) |
714 | goto out; | 718 | goto out; |
715 | clnt->cl_procinfo = version->procs; | ||
716 | clnt->cl_maxproc = version->nrprocs; | ||
717 | clnt->cl_protname = program->name; | ||
718 | clnt->cl_prog = program->number; | ||
719 | clnt->cl_vers = version->number; | ||
720 | clnt->cl_stats = program->stats; | ||
721 | err = rpc_ping(clnt); | 719 | err = rpc_ping(clnt); |
722 | if (err != 0) { | 720 | if (err != 0) { |
723 | rpc_shutdown_client(clnt); | 721 | rpc_shutdown_client(clnt); |