diff options
author | NeilBrown <neilb@suse.de> | 2024-07-15 09:14:18 +0200 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2024-09-21 01:31:03 +0200 |
commit | 60749cbe3d8ae572a6c7dda675de3e8b25797a18 (patch) | |
tree | 07ff0382aa54a50bd4135466adf3d9c88207a65c /fs | |
parent | sunrpc: document locking rules for svc_exit_thread() (diff) | |
download | linux-60749cbe3d8ae572a6c7dda675de3e8b25797a18.tar.xz linux-60749cbe3d8ae572a6c7dda675de3e8b25797a18.zip |
sunrpc: change sp_nrthreads from atomic_t to unsigned int.
sp_nrthreads is only ever accessed under the service mutex
nlmsvc_mutex nfs_callback_mutex nfsd_mutex
so these is no need for it to be an atomic_t.
The fact that all code using it is single-threaded means that we can
simplify svc_pool_victim and remove the temporary elevation of
sp_nrthreads.
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfsd/nfsctl.c | 2 | ||||
-rw-r--r-- | fs/nfsd/nfssvc.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index 965519995aeb..1c9e5b4bcb0a 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c @@ -1769,7 +1769,7 @@ int nfsd_nl_threads_get_doit(struct sk_buff *skb, struct genl_info *info) struct svc_pool *sp = &nn->nfsd_serv->sv_pools[i]; err = nla_put_u32(skb, NFSD_A_SERVER_THREADS, - atomic_read(&sp->sp_nrthreads)); + sp->sp_nrthreads); if (err) goto err_unlock; } diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c index 5bc4dc60ea4c..b1dc3404173b 100644 --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c @@ -641,7 +641,7 @@ int nfsd_get_nrthreads(int n, int *nthreads, struct net *net) if (serv) for (i = 0; i < serv->sv_nrpools && i < n; i++) - nthreads[i] = atomic_read(&serv->sv_pools[i].sp_nrthreads); + nthreads[i] = serv->sv_pools[i].sp_nrthreads; return 0; } |