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 <[email protected]>
Acked-by: Neil Brown <[email protected]>
Reviewed-by: Chuck Lever <[email protected]>
Reviewed-by: Greg Banks <[email protected]>
Signed-off-by: J. Bruce Fields <[email protected]>
Cc: Simon Holm Thøgersen <[email protected]>
This commit is contained in:
Tom Tucker 2007-12-30 21:07:53 -06:00 • committed by J. Bruce Fields
commit 7a18208383
7 changed files with 62 additions and 69 deletions

View file

@ -221,10 +221,10 @@ lockd(struct svc_rqst *rqstp)
static int find_xprt(struct svc_serv *serv, char *proto)
{
struct svc_sock *svsk;
struct svc_xprt *xprt;
int found = 0;
list_for_each_entry(svsk, &serv->sv_permsocks, sk_list)
if (strcmp(svsk->sk_xprt.xpt_class->xcl_name, proto) == 0) {
list_for_each_entry(xprt, &serv->sv_permsocks, xpt_list)
if (strcmp(xprt->xpt_class->xcl_name, proto) == 0) {
found = 1;
break;
}