File tree Expand file tree Collapse file tree 5 files changed +11
-9
lines changed Expand file tree Collapse file tree 5 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 14
14
#include <linux/nfs4.h>
15
15
#include <linux/percpu_counter.h>
16
16
#include <linux/siphash.h>
17
+ #include <linux/sunrpc/stats.h>
17
18
18
19
/* Hash tables for nfs4_clientid state */
19
20
#define CLIENT_HASH_BITS 4
@@ -179,6 +180,9 @@ struct nfsd_net {
179
180
/* Per-netns stats counters */
180
181
struct percpu_counter counter [NFSD_STATS_COUNTERS_NUM ];
181
182
183
+ /* sunrpc svc stats */
184
+ struct svc_stat nfsd_svcstats ;
185
+
182
186
/* longest hash chain seen */
183
187
unsigned int longest_chain ;
184
188
Original file line number Diff line number Diff line change @@ -1674,6 +1674,8 @@ static __net_init int nfsd_net_init(struct net *net)
1674
1674
retval = nfsd_stat_counters_init (nn );
1675
1675
if (retval )
1676
1676
goto out_repcache_error ;
1677
+ memset (& nn -> nfsd_svcstats , 0 , sizeof (nn -> nfsd_svcstats ));
1678
+ nn -> nfsd_svcstats .program = & nfsd_program ;
1677
1679
nn -> nfsd_versions = NULL ;
1678
1680
nn -> nfsd4_minorversions = NULL ;
1679
1681
nfsd4_init_leases_net (nn );
Original file line number Diff line number Diff line change @@ -661,7 +661,7 @@ int nfsd_create_serv(struct net *net)
661
661
if (nfsd_max_blksize == 0 )
662
662
nfsd_max_blksize = nfsd_get_default_max_blksize ();
663
663
nfsd_reset_versions (nn );
664
- serv = svc_create_pooled (& nfsd_program , & nfsd_svcstats ,
664
+ serv = svc_create_pooled (& nfsd_program , & nn -> nfsd_svcstats ,
665
665
nfsd_max_blksize , nfsd );
666
666
if (serv == NULL )
667
667
return - ENOMEM ;
Original file line number Diff line number Diff line change 27
27
28
28
#include "nfsd.h"
29
29
30
- struct svc_stat nfsd_svcstats = {
31
- .program = & nfsd_program ,
32
- };
33
-
34
30
static int nfsd_show (struct seq_file * seq , void * v )
35
31
{
36
32
struct net * net = pde_data (file_inode (seq -> file ));
@@ -56,7 +52,7 @@ static int nfsd_show(struct seq_file *seq, void *v)
56
52
seq_puts (seq , "\nra 0 0 0 0 0 0 0 0 0 0 0 0\n" );
57
53
58
54
/* show my rpc info */
59
- svc_seq_show (seq , & nfsd_svcstats );
55
+ svc_seq_show (seq , & nn -> nfsd_svcstats );
60
56
61
57
#ifdef CONFIG_NFSD_V4
62
58
/* Show count for individual nfsv4 operations */
@@ -121,7 +117,9 @@ void nfsd_stat_counters_destroy(struct nfsd_net *nn)
121
117
122
118
void nfsd_proc_stat_init (struct net * net )
123
119
{
124
- svc_proc_register (net , & nfsd_svcstats , & nfsd_proc_ops );
120
+ struct nfsd_net * nn = net_generic (net , nfsd_net_id );
121
+
122
+ svc_proc_register (net , & nn -> nfsd_svcstats , & nfsd_proc_ops );
125
123
}
126
124
127
125
void nfsd_proc_stat_shutdown (struct net * net )
Original file line number Diff line number Diff line change 10
10
#include <uapi/linux/nfsd/stats.h>
11
11
#include <linux/percpu_counter.h>
12
12
13
- extern struct svc_stat nfsd_svcstats ;
14
-
15
13
int nfsd_percpu_counters_init (struct percpu_counter * counters , int num );
16
14
void nfsd_percpu_counters_reset (struct percpu_counter * counters , int num );
17
15
void nfsd_percpu_counters_destroy (struct percpu_counter * counters , int num );
You can’t perform that action at this time.
0 commit comments