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 1414#include <linux/nfs4.h>
1515#include <linux/percpu_counter.h>
1616#include <linux/siphash.h>
17+ #include <linux/sunrpc/stats.h>
1718
1819/* Hash tables for nfs4_clientid state */
1920#define CLIENT_HASH_BITS 4
@@ -179,6 +180,9 @@ struct nfsd_net {
179180 /* Per-netns stats counters */
180181 struct percpu_counter counter [NFSD_STATS_COUNTERS_NUM ];
181182
183+ /* sunrpc svc stats */
184+ struct svc_stat nfsd_svcstats ;
185+
182186 /* longest hash chain seen */
183187 unsigned int longest_chain ;
184188
Original file line number Diff line number Diff line change @@ -1674,6 +1674,8 @@ static __net_init int nfsd_net_init(struct net *net)
16741674 retval = nfsd_stat_counters_init (nn );
16751675 if (retval )
16761676 goto out_repcache_error ;
1677+ memset (& nn -> nfsd_svcstats , 0 , sizeof (nn -> nfsd_svcstats ));
1678+ nn -> nfsd_svcstats .program = & nfsd_program ;
16771679 nn -> nfsd_versions = NULL ;
16781680 nn -> nfsd4_minorversions = NULL ;
16791681 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)
661661 if (nfsd_max_blksize == 0 )
662662 nfsd_max_blksize = nfsd_get_default_max_blksize ();
663663 nfsd_reset_versions (nn );
664- serv = svc_create_pooled (& nfsd_program , & nfsd_svcstats ,
664+ serv = svc_create_pooled (& nfsd_program , & nn -> nfsd_svcstats ,
665665 nfsd_max_blksize , nfsd );
666666 if (serv == NULL )
667667 return - ENOMEM ;
Original file line number Diff line number Diff line change 2727
2828#include "nfsd.h"
2929
30- struct svc_stat nfsd_svcstats = {
31- .program = & nfsd_program ,
32- };
33-
3430static int nfsd_show (struct seq_file * seq , void * v )
3531{
3632 struct net * net = pde_data (file_inode (seq -> file ));
@@ -56,7 +52,7 @@ static int nfsd_show(struct seq_file *seq, void *v)
5652 seq_puts (seq , "\nra 0 0 0 0 0 0 0 0 0 0 0 0\n" );
5753
5854 /* show my rpc info */
59- svc_seq_show (seq , & nfsd_svcstats );
55+ svc_seq_show (seq , & nn -> nfsd_svcstats );
6056
6157#ifdef CONFIG_NFSD_V4
6258 /* Show count for individual nfsv4 operations */
@@ -121,7 +117,9 @@ void nfsd_stat_counters_destroy(struct nfsd_net *nn)
121117
122118void nfsd_proc_stat_init (struct net * net )
123119{
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 );
125123}
126124
127125void nfsd_proc_stat_shutdown (struct net * net )
Original file line number Diff line number Diff line change 1010#include <uapi/linux/nfsd/stats.h>
1111#include <linux/percpu_counter.h>
1212
13- extern struct svc_stat nfsd_svcstats ;
14-
1513int nfsd_percpu_counters_init (struct percpu_counter * counters , int num );
1614void nfsd_percpu_counters_reset (struct percpu_counter * counters , int num );
1715void nfsd_percpu_counters_destroy (struct percpu_counter * counters , int num );
You can’t perform that action at this time.
0 commit comments