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

TOMOYO Linux Cross Reference
Linux/fs/nfs/iostat.h

Version: ~ [ linux-5.13-rc5 ] ~ [ linux-5.12.9 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.42 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.124 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.193 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.235 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.271 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.271 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ 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.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  *  linux/fs/nfs/iostat.h
  3  *
  4  *  Declarations for NFS client per-mount statistics
  5  *
  6  *  Copyright (C) 2005, 2006 Chuck Lever <cel@netapp.com>
  7  *
  8  */
  9 
 10 #ifndef _NFS_IOSTAT
 11 #define _NFS_IOSTAT
 12 
 13 #include <linux/percpu.h>
 14 #include <linux/cache.h>
 15 #include <linux/nfs_iostat.h>
 16 
 17 struct nfs_iostats {
 18         unsigned long long      bytes[__NFSIOS_BYTESMAX];
 19 #ifdef CONFIG_NFS_FSCACHE
 20         unsigned long long      fscache[__NFSIOS_FSCACHEMAX];
 21 #endif
 22         unsigned long           events[__NFSIOS_COUNTSMAX];
 23 } ____cacheline_aligned;
 24 
 25 static inline void nfs_inc_server_stats(const struct nfs_server *server,
 26                                         enum nfs_stat_eventcounters stat)
 27 {
 28         this_cpu_inc(server->io_stats->events[stat]);
 29 }
 30 
 31 static inline void nfs_inc_stats(const struct inode *inode,
 32                                  enum nfs_stat_eventcounters stat)
 33 {
 34         nfs_inc_server_stats(NFS_SERVER(inode), stat);
 35 }
 36 
 37 static inline void nfs_add_server_stats(const struct nfs_server *server,
 38                                         enum nfs_stat_bytecounters stat,
 39                                         long addend)
 40 {
 41         this_cpu_add(server->io_stats->bytes[stat], addend);
 42 }
 43 
 44 static inline void nfs_add_stats(const struct inode *inode,
 45                                  enum nfs_stat_bytecounters stat,
 46                                  long addend)
 47 {
 48         nfs_add_server_stats(NFS_SERVER(inode), stat, addend);
 49 }
 50 
 51 #ifdef CONFIG_NFS_FSCACHE
 52 static inline void nfs_add_fscache_stats(struct inode *inode,
 53                                          enum nfs_stat_fscachecounters stat,
 54                                          long addend)
 55 {
 56         this_cpu_add(NFS_SERVER(inode)->io_stats->fscache[stat], addend);
 57 }
 58 static inline void nfs_inc_fscache_stats(struct inode *inode,
 59                                          enum nfs_stat_fscachecounters stat)
 60 {
 61         this_cpu_inc(NFS_SERVER(inode)->io_stats->fscache[stat]);
 62 }
 63 #endif
 64 
 65 static inline struct nfs_iostats __percpu *nfs_alloc_iostats(void)
 66 {
 67         return alloc_percpu(struct nfs_iostats);
 68 }
 69 
 70 static inline void nfs_free_iostats(struct nfs_iostats __percpu *stats)
 71 {
 72         if (stats != NULL)
 73                 free_percpu(stats);
 74 }
 75 
 76 #endif /* _NFS_IOSTAT */
 77 

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

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | 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.

osdn.jp