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
@@ -184,6 +185,9 @@ struct nfsd_net {
184
185
/* Per-netns stats counters */
185
186
struct percpu_counter counter [NFSD_STATS_COUNTERS_NUM ];
186
187
188
+ /* sunrpc svc stats */
189
+ struct svc_stat nfsd_svcstats ;
190
+
187
191
/* longest hash chain seen */
188
192
unsigned int longest_chain ;
189
193
Original file line number Diff line number Diff line change @@ -1527,6 +1527,8 @@ static __net_init int nfsd_net_init(struct net *net)
1527
1527
retval = nfsd_stat_counters_init (nn );
1528
1528
if (retval )
1529
1529
goto out_repcache_error ;
1530
+ memset (& nn -> nfsd_svcstats , 0 , sizeof (nn -> nfsd_svcstats ));
1531
+ nn -> nfsd_svcstats .program = & nfsd_program ;
1530
1532
nn -> nfsd_versions = NULL ;
1531
1533
nn -> nfsd4_minorversions = NULL ;
1532
1534
nfsd4_init_leases_net (nn );
Original file line number Diff line number Diff line change @@ -670,7 +670,7 @@ int nfsd_create_serv(struct net *net)
670
670
if (nfsd_max_blksize == 0 )
671
671
nfsd_max_blksize = nfsd_get_default_max_blksize ();
672
672
nfsd_reset_versions (nn );
673
- serv = svc_create_pooled (& nfsd_program , & nfsd_svcstats ,
673
+ serv = svc_create_pooled (& nfsd_program , & nn -> nfsd_svcstats ,
674
674
nfsd_max_blksize , nfsd );
675
675
if (serv == NULL )
676
676
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