aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/svc.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/svc.c')
-rw-r--r--net/sunrpc/svc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 44b8d9d4c18a..f5aee4c61676 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -26,7 +26,8 @@
26 * Create an RPC service 26 * Create an RPC service
27 */ 27 */
28struct svc_serv * 28struct svc_serv *
29svc_create(struct svc_program *prog, unsigned int bufsize) 29svc_create(struct svc_program *prog, unsigned int bufsize,
30 void (*shutdown)(struct svc_serv *serv))
30{ 31{
31 struct svc_serv *serv; 32 struct svc_serv *serv;
32 int vers; 33 int vers;
@@ -39,6 +40,7 @@ svc_create(struct svc_program *prog, unsigned int bufsize)
39 serv->sv_nrthreads = 1; 40 serv->sv_nrthreads = 1;
40 serv->sv_stats = prog->pg_stats; 41 serv->sv_stats = prog->pg_stats;
41 serv->sv_bufsz = bufsize? bufsize : 4096; 42 serv->sv_bufsz = bufsize? bufsize : 4096;
43 serv->sv_shutdown = shutdown;
42 xdrsize = 0; 44 xdrsize = 0;
43 while (prog) { 45 while (prog) {
44 prog->pg_lovers = prog->pg_nvers-1; 46 prog->pg_lovers = prog->pg_nvers-1;
@@ -91,6 +93,9 @@ svc_destroy(struct svc_serv *serv)
91 sk_list); 93 sk_list);
92 svc_delete_socket(svsk); 94 svc_delete_socket(svsk);
93 } 95 }
96 if (serv->sv_shutdown)
97 serv->sv_shutdown(serv);
98
94 while (!list_empty(&serv->sv_permsocks)) { 99 while (!list_empty(&serv->sv_permsocks)) {
95 svsk = list_entry(serv->sv_permsocks.next, 100 svsk = list_entry(serv->sv_permsocks.next,
96 struct svc_sock, 101 struct svc_sock,