From bc591ccff27e6a85d3a0d6fcb16cfadcc45267a8 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 2 Oct 2006 02:17:44 -0700 Subject: [PATCH] knfsd: add a callback for when last rpc thread finishes nfsd has some cleanup that it wants to do when the last thread exits, and there will shortly be some more. So collect this all into one place and define a callback for an rpc service to call when the service is about to be destroyed. [akpm@osdl.org: cleanups, build fix] Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/sunrpc/svc.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 73140ee5c63..bff5e9b486c 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h @@ -42,6 +42,11 @@ struct svc_serv { int sv_tmpcnt; /* count of temporary sockets */ char * sv_name; /* service name */ + + void (*sv_shutdown)(struct svc_serv *serv); + /* Callback to use when last thread + * exits. + */ }; /* @@ -328,7 +333,8 @@ typedef void (*svc_thread_fn)(struct svc_rqst *); /* * Function prototypes. */ -struct svc_serv * svc_create(struct svc_program *, unsigned int); +struct svc_serv * svc_create(struct svc_program *, unsigned int, + void (*shutdown)(struct svc_serv*)); int svc_create_thread(svc_thread_fn, struct svc_serv *); void svc_exit_thread(struct svc_rqst *); void svc_destroy(struct svc_serv *); -- cgit v1.2.3