summaryrefslogtreecommitdiff
path: root/fs/nfsd/stats.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2024-01-26 10:39:49 -0500
committerChuck Lever <chuck.lever@oracle.com>2024-03-01 09:12:11 -0500
commit16fb9808ab2c99979f081987752abcbc5b092eac (patch)
tree7963592a303d0c257a4e367076ed2ab8bb576159 /fs/nfsd/stats.c
parente41ee44cc6a473b1f414031782c3b4283d7f3e5f (diff)
nfsd: make svc_stat per-network namespace instead of global
The final bit of stats that is global is the rpc svc_stat. Move this into the nfsd_net struct and use that everywhere instead of the global struct. Remove the unused global struct. Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd/stats.c')
-rw-r--r--fs/nfsd/stats.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/nfsd/stats.c b/fs/nfsd/stats.c
index 3a7f791c3052..be52fb1e928e 100644
--- a/fs/nfsd/stats.c
+++ b/fs/nfsd/stats.c
@@ -27,10 +27,6 @@
#include "nfsd.h"
-struct svc_stat nfsd_svcstats = {
- .program = &nfsd_program,
-};
-
static int nfsd_show(struct seq_file *seq, void *v)
{
struct net *net = pde_data(file_inode(seq->file));
@@ -56,7 +52,7 @@ static int nfsd_show(struct seq_file *seq, void *v)
seq_puts(seq, "\nra 0 0 0 0 0 0 0 0 0 0 0 0\n");
/* show my rpc info */
- svc_seq_show(seq, &nfsd_svcstats);
+ svc_seq_show(seq, &nn->nfsd_svcstats);
#ifdef CONFIG_NFSD_V4
/* Show count for individual nfsv4 operations */
@@ -121,7 +117,9 @@ void nfsd_stat_counters_destroy(struct nfsd_net *nn)
void nfsd_proc_stat_init(struct net *net)
{
- svc_proc_register(net, &nfsd_svcstats, &nfsd_proc_ops);
+ struct nfsd_net *nn = net_generic(net, nfsd_net_id);
+
+ svc_proc_register(net, &nn->nfsd_svcstats, &nfsd_proc_ops);
}
void nfsd_proc_stat_shutdown(struct net *net)