summaryrefslogtreecommitdiff
path: root/fs/nfsd/nfsd.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2023-07-31 16:48:32 +1000
committerChuck Lever <chuck.lever@oracle.com>2023-08-29 17:45:22 -0400
commit9f28a971ee9fdf1bf8ce8c88b103f483be610277 (patch)
treeaca1a38039b819f0795b869bb925f35ebc3b7ccf /fs/nfsd/nfsd.h
parent18e4cf915543257eae2925671934937163f5639b (diff)
nfsd: separate nfsd_last_thread() from nfsd_put()
Now that the last nfsd thread is stopped by an explicit act of calling svc_set_num_threads() with a count of zero, we only have a limited number of places that can happen, and don't need to call nfsd_last_thread() in nfsd_put() So separate that out and call it at the two places where the number of threads is set to zero. Move the clearing of ->nfsd_serv and the call to svc_xprt_destroy_all() into nfsd_last_thread(), as they are really part of the same action. nfsd_put() is now a thin wrapper around svc_put(), so make it a static inline. nfsd_put() cannot be called after nfsd_last_thread(), so in a couple of places we have to use svc_put() instead. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd/nfsd.h')
-rw-r--r--fs/nfsd/nfsd.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h
index d88498f8b275..11c14faa6c67 100644
--- a/fs/nfsd/nfsd.h
+++ b/fs/nfsd/nfsd.h
@@ -96,7 +96,12 @@ int nfsd_pool_stats_open(struct inode *, struct file *);
int nfsd_pool_stats_release(struct inode *, struct file *);
void nfsd_shutdown_threads(struct net *net);
-void nfsd_put(struct net *net);
+static inline void nfsd_put(struct net *net)
+{
+ struct nfsd_net *nn = net_generic(net, nfsd_net_id);
+
+ svc_put(nn->nfsd_serv);
+}
bool i_am_nfsd(void);