diff options
author | Tom Tucker <tom@opengridcomputing.com> | 2007-12-30 22:07:53 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2008-02-01 16:42:11 -0500 |
commit | 7a18208383ab3f3ce4a1f4e0536acc9372523d81 (patch) | |
tree | 851a1cc29d753297c2e7cf4cb4a95c4af7868427 /net/sunrpc/svc.c | |
parent | bb5cf160b282644c4491afbf76fbc66f5dc35030 (diff) |
svc: Make close transport independent
Move sk_list and sk_ready to svc_xprt. This involves close because these
lists are walked by svcs when closing all their transports. So I combined
the moving of these lists to svc_xprt with making close transport independent.
The svc_force_sock_close has been changed to svc_close_all and takes a list
as an argument. This removes some svc internals knowledge from the svcs.
This code races with module removal and transport addition.
Thanks to Simon Holm Thøgersen for a compile fix.
Signed-off-by: Tom Tucker <tom@opengridcomputing.com>
Acked-by: Neil Brown <neilb@suse.de>
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: Greg Banks <gnb@sgi.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Cc: Simon Holm Thøgersen <odie@cs.aau.dk>
Diffstat (limited to 'net/sunrpc/svc.c')
-rw-r--r-- | net/sunrpc/svc.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index 8281a0402652..a5eb2d6b14ae 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c | |||
@@ -459,9 +459,6 @@ svc_create_pooled(struct svc_program *prog, unsigned int bufsize, | |||
459 | void | 459 | void |
460 | svc_destroy(struct svc_serv *serv) | 460 | svc_destroy(struct svc_serv *serv) |
461 | { | 461 | { |
462 | struct svc_sock *svsk; | ||
463 | struct svc_sock *tmp; | ||
464 | |||
465 | dprintk("svc: svc_destroy(%s, %d)\n", | 462 | dprintk("svc: svc_destroy(%s, %d)\n", |
466 | serv->sv_program->pg_name, | 463 | serv->sv_program->pg_name, |
467 | serv->sv_nrthreads); | 464 | serv->sv_nrthreads); |
@@ -476,14 +473,12 @@ svc_destroy(struct svc_serv *serv) | |||
476 | 473 | ||
477 | del_timer_sync(&serv->sv_temptimer); | 474 | del_timer_sync(&serv->sv_temptimer); |
478 | 475 | ||
479 | list_for_each_entry_safe(svsk, tmp, &serv->sv_tempsocks, sk_list) | 476 | svc_close_all(&serv->sv_tempsocks); |
480 | svc_force_close_socket(svsk); | ||
481 | 477 | ||
482 | if (serv->sv_shutdown) | 478 | if (serv->sv_shutdown) |
483 | serv->sv_shutdown(serv); | 479 | serv->sv_shutdown(serv); |
484 | 480 | ||
485 | list_for_each_entry_safe(svsk, tmp, &serv->sv_permsocks, sk_list) | 481 | svc_close_all(&serv->sv_permsocks); |
486 | svc_force_close_socket(svsk); | ||
487 | 482 | ||
488 | BUG_ON(!list_empty(&serv->sv_permsocks)); | 483 | BUG_ON(!list_empty(&serv->sv_permsocks)); |
489 | BUG_ON(!list_empty(&serv->sv_tempsocks)); | 484 | BUG_ON(!list_empty(&serv->sv_tempsocks)); |