aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/clnt.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-06-09 19:49:36 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-07-10 23:40:29 -0400
commit90c5755ff5111ffdcca10a1e8a823dba29f37b6d (patch)
treea3ca80b629d11e341fa2bcdf30e0d712dcccc3ba /net/sunrpc/clnt.c
parent848f1fe6be2e290691bb6c13cbb8fd92bd0cfaab (diff)
SUNRPC: Kill rpc_clnt->cl_oneshot
Replace it with explicit calls to rpc_shutdown_client() or rpc_destroy_client() (for the case of asynchronous calls). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/clnt.c')
-rw-r--r--net/sunrpc/clnt.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index fb65249538d4..34662dfa9cc0 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -249,8 +249,6 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args)
249 clnt->cl_intr = 1; 249 clnt->cl_intr = 1;
250 if (args->flags & RPC_CLNT_CREATE_AUTOBIND) 250 if (args->flags & RPC_CLNT_CREATE_AUTOBIND)
251 clnt->cl_autobind = 1; 251 clnt->cl_autobind = 1;
252 if (args->flags & RPC_CLNT_CREATE_ONESHOT)
253 clnt->cl_oneshot = 1;
254 if (args->flags & RPC_CLNT_CREATE_DISCRTRY) 252 if (args->flags & RPC_CLNT_CREATE_DISCRTRY)
255 clnt->cl_discrtry = 1; 253 clnt->cl_discrtry = 1;
256 254
@@ -285,7 +283,6 @@ rpc_clone_client(struct rpc_clnt *clnt)
285 new->cl_xprt = xprt_get(clnt->cl_xprt); 283 new->cl_xprt = xprt_get(clnt->cl_xprt);
286 /* Turn off autobind on clones */ 284 /* Turn off autobind on clones */
287 new->cl_autobind = 0; 285 new->cl_autobind = 0;
288 new->cl_oneshot = 0;
289 INIT_LIST_HEAD(&new->cl_tasks); 286 INIT_LIST_HEAD(&new->cl_tasks);
290 spin_lock_init(&new->cl_lock); 287 spin_lock_init(&new->cl_lock);
291 rpc_init_rtt(&new->cl_rtt_default, clnt->cl_xprt->timeout.to_initval); 288 rpc_init_rtt(&new->cl_rtt_default, clnt->cl_xprt->timeout.to_initval);
@@ -304,8 +301,7 @@ out_no_clnt:
304 301
305/* 302/*
306 * Properly shut down an RPC client, terminating all outstanding 303 * Properly shut down an RPC client, terminating all outstanding
307 * requests. Note that we must be certain that cl_oneshot is cleared, 304 * requests.
308 * or else the client would be destroyed when the last task releases it.
309 */ 305 */
310int 306int
311rpc_shutdown_client(struct rpc_clnt *clnt) 307rpc_shutdown_client(struct rpc_clnt *clnt)
@@ -314,8 +310,6 @@ rpc_shutdown_client(struct rpc_clnt *clnt)
314 clnt->cl_protname, clnt->cl_server); 310 clnt->cl_protname, clnt->cl_server);
315 311
316 while (!list_empty(&clnt->cl_tasks)) { 312 while (!list_empty(&clnt->cl_tasks)) {
317 /* Don't let rpc_release_client destroy us */
318 clnt->cl_oneshot = 0;
319 rpc_killall_tasks(clnt); 313 rpc_killall_tasks(clnt);
320 wait_event_timeout(destroy_wait, 314 wait_event_timeout(destroy_wait,
321 list_empty(&clnt->cl_tasks), 1*HZ); 315 list_empty(&clnt->cl_tasks), 1*HZ);
@@ -366,8 +360,6 @@ rpc_release_client(struct rpc_clnt *clnt)
366 360
367 if (list_empty(&clnt->cl_tasks)) 361 if (list_empty(&clnt->cl_tasks))
368 wake_up(&destroy_wait); 362 wake_up(&destroy_wait);
369 if (clnt->cl_oneshot)
370 rpc_destroy_client(clnt);
371 kref_put(&clnt->cl_kref, rpc_free_client); 363 kref_put(&clnt->cl_kref, rpc_free_client);
372} 364}
373 365