summaryrefslogtreecommitdiff
path: root/fs/nfsd/netns.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2023-12-15 03:56:34 +0300
committerChuck Lever <chuck.lever@oracle.com>2024-01-08 01:54:33 +0300
commit1e3577a4521ef33199eea05ce7b9099825848c49 (patch)
tree4ab957dcd5a796583096731bf17ced779190efe3 /fs/nfsd/netns.h
parent7b207ccd983350a5dedd132b57c666186dd02a7c (diff)
downloadlinux-1e3577a4521ef33199eea05ce7b9099825848c49.tar.xz
SUNRPC: discard sv_refcnt, and svc_get/svc_put
sv_refcnt is no longer useful. lockd and nfs-cb only ever have the svc active when there are a non-zero number of threads, so sv_refcnt mirrors sv_nrthreads. nfsd also keeps the svc active between when a socket is added and when the first thread is started, but we don't really need a refcount for that. We can simply not destroy the svc while there are any permanent sockets attached. So remove sv_refcnt and the get/put functions. Instead of a final call to svc_put(), call svc_destroy() instead. This is changed to also store NULL in the passed-in pointer to make it easier to avoid use-after-free situations. Signed-off-by: NeilBrown <neilb@suse.de> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd/netns.h')
-rw-r--r--fs/nfsd/netns.h7
1 files changed, 0 insertions, 7 deletions
diff --git a/fs/nfsd/netns.h b/fs/nfsd/netns.h
index 16dbef245dbb..74b4360779a1 100644
--- a/fs/nfsd/netns.h
+++ b/fs/nfsd/netns.h
@@ -126,13 +126,6 @@ struct nfsd_net {
struct svc_info nfsd_info;
#define nfsd_serv nfsd_info.serv
- /* When a listening socket is added to nfsd, keep_active is set
- * and this justifies a reference on nfsd_serv. This stops
- * nfsd_serv from being freed. When the number of threads is
- * set, keep_active is cleared and the reference is dropped. So
- * when the last thread exits, the service will be destroyed.
- */
- int keep_active;
/*
* clientid and stateid data for construction of net unique COPY