~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/fs/nfsd/stats.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * Statistics for NFS server.
  4  *
  5  * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
  6  */
  7 #ifndef _NFSD_STATS_H
  8 #define _NFSD_STATS_H
  9 
 10 #include <uapi/linux/nfsd/stats.h>
 11 #include <linux/percpu_counter.h>
 12 
 13 void nfsd_proc_stat_init(struct net *net);
 14 void nfsd_proc_stat_shutdown(struct net *net);
 15 
 16 static inline void nfsd_stats_rc_hits_inc(struct nfsd_net *nn)
 17 {
 18         percpu_counter_inc(&nn->counter[NFSD_STATS_RC_HITS]);
 19 }
 20 
 21 static inline void nfsd_stats_rc_misses_inc(struct nfsd_net *nn)
 22 {
 23         percpu_counter_inc(&nn->counter[NFSD_STATS_RC_MISSES]);
 24 }
 25 
 26 static inline void nfsd_stats_rc_nocache_inc(struct nfsd_net *nn)
 27 {
 28         percpu_counter_inc(&nn->counter[NFSD_STATS_RC_NOCACHE]);
 29 }
 30 
 31 static inline void nfsd_stats_fh_stale_inc(struct nfsd_net *nn,
 32                                            struct svc_export *exp)
 33 {
 34         percpu_counter_inc(&nn->counter[NFSD_STATS_FH_STALE]);
 35         if (exp && exp->ex_stats)
 36                 percpu_counter_inc(&exp->ex_stats->counter[EXP_STATS_FH_STALE]);
 37 }
 38 
 39 static inline void nfsd_stats_io_read_add(struct nfsd_net *nn,
 40                                           struct svc_export *exp, s64 amount)
 41 {
 42         percpu_counter_add(&nn->counter[NFSD_STATS_IO_READ], amount);
 43         if (exp && exp->ex_stats)
 44                 percpu_counter_add(&exp->ex_stats->counter[EXP_STATS_IO_READ], amount);
 45 }
 46 
 47 static inline void nfsd_stats_io_write_add(struct nfsd_net *nn,
 48                                            struct svc_export *exp, s64 amount)
 49 {
 50         percpu_counter_add(&nn->counter[NFSD_STATS_IO_WRITE], amount);
 51         if (exp && exp->ex_stats)
 52                 percpu_counter_add(&exp->ex_stats->counter[EXP_STATS_IO_WRITE], amount);
 53 }
 54 
 55 static inline void nfsd_stats_payload_misses_inc(struct nfsd_net *nn)
 56 {
 57         percpu_counter_inc(&nn->counter[NFSD_STATS_PAYLOAD_MISSES]);
 58 }
 59 
 60 static inline void nfsd_stats_drc_mem_usage_add(struct nfsd_net *nn, s64 amount)
 61 {
 62         percpu_counter_add(&nn->counter[NFSD_STATS_DRC_MEM_USAGE], amount);
 63 }
 64 
 65 static inline void nfsd_stats_drc_mem_usage_sub(struct nfsd_net *nn, s64 amount)
 66 {
 67         percpu_counter_sub(&nn->counter[NFSD_STATS_DRC_MEM_USAGE], amount);
 68 }
 69 
 70 #ifdef CONFIG_NFSD_V4
 71 static inline void nfsd_stats_wdeleg_getattr_inc(struct nfsd_net *nn)
 72 {
 73         percpu_counter_inc(&nn->counter[NFSD_STATS_WDELEG_GETATTR]);
 74 }
 75 #endif
 76 #endif /* _NFSD_STATS_H */
 77 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php