Commit e41ee44c authored by Josef Bacik's avatar Josef Bacik Committed by Chuck Lever

nfsd: remove nfsd_stats, make th_cnt a global counter

This is the last global stat, take it out of the nfsd_stats struct and
make it a global part of nfsd, report it the same as always.
Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent 4b148854
...@@ -86,6 +86,7 @@ extern struct mutex nfsd_mutex; ...@@ -86,6 +86,7 @@ extern struct mutex nfsd_mutex;
extern spinlock_t nfsd_drc_lock; extern spinlock_t nfsd_drc_lock;
extern unsigned long nfsd_drc_max_mem; extern unsigned long nfsd_drc_max_mem;
extern unsigned long nfsd_drc_mem_used; extern unsigned long nfsd_drc_mem_used;
extern atomic_t nfsd_th_cnt; /* number of available threads */
extern const struct seq_operations nfs_exports_op; extern const struct seq_operations nfs_exports_op;
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#define NFSDDBG_FACILITY NFSDDBG_SVC #define NFSDDBG_FACILITY NFSDDBG_SVC
atomic_t nfsd_th_cnt = ATOMIC_INIT(0);
extern struct svc_program nfsd_program; extern struct svc_program nfsd_program;
static int nfsd(void *vrqstp); static int nfsd(void *vrqstp);
#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL) #if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
...@@ -924,7 +925,7 @@ nfsd(void *vrqstp) ...@@ -924,7 +925,7 @@ nfsd(void *vrqstp)
current->fs->umask = 0; current->fs->umask = 0;
atomic_inc(&nfsdstats.th_cnt); atomic_inc(&nfsd_th_cnt);
set_freezable(); set_freezable();
...@@ -940,7 +941,7 @@ nfsd(void *vrqstp) ...@@ -940,7 +941,7 @@ nfsd(void *vrqstp)
nfsd_file_net_dispose(nn); nfsd_file_net_dispose(nn);
} }
atomic_dec(&nfsdstats.th_cnt); atomic_dec(&nfsd_th_cnt);
out: out:
/* Release the thread */ /* Release the thread */
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include "nfsd.h" #include "nfsd.h"
struct nfsd_stats nfsdstats;
struct svc_stat nfsd_svcstats = { struct svc_stat nfsd_svcstats = {
.program = &nfsd_program, .program = &nfsd_program,
}; };
...@@ -47,7 +46,7 @@ static int nfsd_show(struct seq_file *seq, void *v) ...@@ -47,7 +46,7 @@ static int nfsd_show(struct seq_file *seq, void *v)
percpu_counter_sum_positive(&nn->counter[NFSD_STATS_IO_WRITE])); percpu_counter_sum_positive(&nn->counter[NFSD_STATS_IO_WRITE]));
/* thread usage: */ /* thread usage: */
seq_printf(seq, "th %u 0", atomic_read(&nfsdstats.th_cnt)); seq_printf(seq, "th %u 0", atomic_read(&nfsd_th_cnt));
/* deprecated thread usage histogram stats */ /* deprecated thread usage histogram stats */
for (i = 0; i < 10; i++) for (i = 0; i < 10; i++)
......
...@@ -10,12 +10,6 @@ ...@@ -10,12 +10,6 @@
#include <uapi/linux/nfsd/stats.h> #include <uapi/linux/nfsd/stats.h>
#include <linux/percpu_counter.h> #include <linux/percpu_counter.h>
struct nfsd_stats {
atomic_t th_cnt; /* number of available threads */
};
extern struct nfsd_stats nfsdstats;
extern struct svc_stat nfsd_svcstats; extern struct svc_stat nfsd_svcstats;
int nfsd_percpu_counters_init(struct percpu_counter *counters, int num); int nfsd_percpu_counters_init(struct percpu_counter *counters, int num);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment