diff options
-rw-r--r-- | fs/nfsd/nfssvc.c | 2 | ||||
-rw-r--r-- | include/linux/sunrpc/svc.h | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c index cdec3993e0d5..9773f593b3ff 100644 --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c | |||
@@ -200,7 +200,7 @@ int nfsd_create_serv(void) | |||
200 | int err = 0; | 200 | int err = 0; |
201 | lock_kernel(); | 201 | lock_kernel(); |
202 | if (nfsd_serv) { | 202 | if (nfsd_serv) { |
203 | nfsd_serv->sv_nrthreads++; | 203 | svc_get(nfsd_serv); |
204 | unlock_kernel(); | 204 | unlock_kernel(); |
205 | return 0; | 205 | return 0; |
206 | } | 206 | } |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index c27d806af310..54d8e7bc2341 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -71,6 +71,17 @@ struct svc_serv { | |||
71 | }; | 71 | }; |
72 | 72 | ||
73 | /* | 73 | /* |
74 | * We use sv_nrthreads as a reference count. svc_destroy() drops | ||
75 | * this refcount, so we need to bump it up around operations that | ||
76 | * change the number of threads. Horrible, but there it is. | ||
77 | * Should be called with the BKL held. | ||
78 | */ | ||
79 | static inline void svc_get(struct svc_serv *serv) | ||
80 | { | ||
81 | serv->sv_nrthreads++; | ||
82 | } | ||
83 | |||
84 | /* | ||
74 | * Maximum payload size supported by a kernel RPC server. | 85 | * Maximum payload size supported by a kernel RPC server. |
75 | * This is use to determine the max number of pages nfsd is | 86 | * This is use to determine the max number of pages nfsd is |
76 | * willing to return in a single READ operation. | 87 | * willing to return in a single READ operation. |