Blame view
fs/nfs/iostat.h
1.79 KB
d9ef5a8c2 NFS: introduce me... |
1 2 3 4 5 6 7 |
/* * linux/fs/nfs/iostat.h * * Declarations for NFS client per-mount statistics * * Copyright (C) 2005, 2006 Chuck Lever <cel@netapp.com> * |
d9ef5a8c2 NFS: introduce me... |
8 9 10 11 |
*/ #ifndef _NFS_IOSTAT #define _NFS_IOSTAT |
d9ef5a8c2 NFS: introduce me... |
12 13 |
#include <linux/percpu.h> #include <linux/cache.h> |
34e8f9283 NFS: Move fs/nfs/... |
14 |
#include <linux/nfs_iostat.h> |
d9ef5a8c2 NFS: introduce me... |
15 16 17 |
struct nfs_iostats { unsigned long long bytes[__NFSIOS_BYTESMAX]; |
6a51091d0 NFS: Add some new... |
18 19 20 |
#ifdef CONFIG_NFS_FSCACHE unsigned long long fscache[__NFSIOS_FSCACHEMAX]; #endif |
d9ef5a8c2 NFS: introduce me... |
21 22 |
unsigned long events[__NFSIOS_COUNTSMAX]; } ____cacheline_aligned; |
2e96d2867 NFS: Fix a warnin... |
23 |
static inline void nfs_inc_server_stats(const struct nfs_server *server, |
34e8f9283 NFS: Move fs/nfs/... |
24 |
enum nfs_stat_eventcounters stat) |
d9ef5a8c2 NFS: introduce me... |
25 |
{ |
fce22848a this_cpu: Use thi... |
26 |
this_cpu_inc(server->io_stats->events[stat]); |
d9ef5a8c2 NFS: introduce me... |
27 |
} |
2e96d2867 NFS: Fix a warnin... |
28 |
static inline void nfs_inc_stats(const struct inode *inode, |
34e8f9283 NFS: Move fs/nfs/... |
29 |
enum nfs_stat_eventcounters stat) |
006ea73e5 NFS: add hooks to... |
30 31 32 |
{ nfs_inc_server_stats(NFS_SERVER(inode), stat); } |
2e96d2867 NFS: Fix a warnin... |
33 |
static inline void nfs_add_server_stats(const struct nfs_server *server, |
34e8f9283 NFS: Move fs/nfs/... |
34 |
enum nfs_stat_bytecounters stat, |
dfe52c041 NFS: Squelch comp... |
35 |
long addend) |
d9ef5a8c2 NFS: introduce me... |
36 |
{ |
fce22848a this_cpu: Use thi... |
37 |
this_cpu_add(server->io_stats->bytes[stat], addend); |
d9ef5a8c2 NFS: introduce me... |
38 |
} |
2e96d2867 NFS: Fix a warnin... |
39 |
static inline void nfs_add_stats(const struct inode *inode, |
34e8f9283 NFS: Move fs/nfs/... |
40 |
enum nfs_stat_bytecounters stat, |
dfe52c041 NFS: Squelch comp... |
41 |
long addend) |
006ea73e5 NFS: add hooks to... |
42 43 44 |
{ nfs_add_server_stats(NFS_SERVER(inode), stat, addend); } |
6a51091d0 NFS: Add some new... |
45 46 47 |
#ifdef CONFIG_NFS_FSCACHE static inline void nfs_add_fscache_stats(struct inode *inode, enum nfs_stat_fscachecounters stat, |
dfe52c041 NFS: Squelch comp... |
48 |
long addend) |
6a51091d0 NFS: Add some new... |
49 |
{ |
fce22848a this_cpu: Use thi... |
50 |
this_cpu_add(NFS_SERVER(inode)->io_stats->fscache[stat], addend); |
6a51091d0 NFS: Add some new... |
51 |
} |
e9f456ca5 nfs: define nfs_i... |
52 53 54 55 56 |
static inline void nfs_inc_fscache_stats(struct inode *inode, enum nfs_stat_fscachecounters stat) { this_cpu_inc(NFS_SERVER(inode)->io_stats->fscache[stat]); } |
6a51091d0 NFS: Add some new... |
57 |
#endif |
003cb608a percpu: add __per... |
58 |
static inline struct nfs_iostats __percpu *nfs_alloc_iostats(void) |
d9ef5a8c2 NFS: introduce me... |
59 60 61 |
{ return alloc_percpu(struct nfs_iostats); } |
003cb608a percpu: add __per... |
62 |
static inline void nfs_free_iostats(struct nfs_iostats __percpu *stats) |
d9ef5a8c2 NFS: introduce me... |
63 |
{ |
01d0ae8be NFSv4: Fix an oop... |
64 65 |
if (stats != NULL) free_percpu(stats); |
d9ef5a8c2 NFS: introduce me... |
66 |
} |
34e8f9283 NFS: Move fs/nfs/... |
67 |
#endif /* _NFS_IOSTAT */ |