aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/clnt.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-06-14 17:26:17 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-07-10 23:40:30 -0400
commit4ada539ed77c7a2bbcb75cafbbd7bd8d2b9bef7b (patch)
treecb4ba7df88aee07173dc7e44a3c35249ae4ab539 /net/sunrpc/clnt.c
parentab418d70e1fceda1e2824c45ba3323a1b1413507 (diff)
SUNRPC: Make create_client() take a reference to the rpciod workqueue
Ensures that an rpc_client always has the possibility to send asynchronous RPC calls. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/clnt.c')
-rw-r--r--net/sunrpc/clnt.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 78bbb359281d..fe838e996ee3 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -111,6 +111,9 @@ static struct rpc_clnt * rpc_new_client(struct rpc_xprt *xprt, char *servname, s
111 dprintk("RPC: creating %s client for %s (xprt %p)\n", 111 dprintk("RPC: creating %s client for %s (xprt %p)\n",
112 program->name, servname, xprt); 112 program->name, servname, xprt);
113 113
114 err = rpciod_up();
115 if (err)
116 goto out_no_rpciod;
114 err = -EINVAL; 117 err = -EINVAL;
115 if (!xprt) 118 if (!xprt)
116 goto out_no_xprt; 119 goto out_no_xprt;
@@ -191,6 +194,8 @@ out_no_stats:
191out_err: 194out_err:
192 xprt_put(xprt); 195 xprt_put(xprt);
193out_no_xprt: 196out_no_xprt:
197 rpciod_down();
198out_no_rpciod:
194 return ERR_PTR(err); 199 return ERR_PTR(err);
195} 200}
196 201
@@ -287,6 +292,7 @@ rpc_clone_client(struct rpc_clnt *clnt)
287 xprt_get(clnt->cl_xprt); 292 xprt_get(clnt->cl_xprt);
288 kref_get(&clnt->cl_kref); 293 kref_get(&clnt->cl_kref);
289 rpc_register_client(new); 294 rpc_register_client(new);
295 rpciod_up();
290 return new; 296 return new;
291out_no_path: 297out_no_path:
292 rpc_free_iostats(new->cl_metrics); 298 rpc_free_iostats(new->cl_metrics);
@@ -344,6 +350,7 @@ out_free:
344 rpc_free_iostats(clnt->cl_metrics); 350 rpc_free_iostats(clnt->cl_metrics);
345 clnt->cl_metrics = NULL; 351 clnt->cl_metrics = NULL;
346 xprt_put(clnt->cl_xprt); 352 xprt_put(clnt->cl_xprt);
353 rpciod_down();
347 kfree(clnt); 354 kfree(clnt);
348} 355}
349 356