diff options
Diffstat (limited to 'fs/nfs/iostat.h')
-rw-r--r-- | fs/nfs/iostat.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/fs/nfs/iostat.h b/fs/nfs/iostat.h index dc080e50ec5..7a749515331 100644 --- a/fs/nfs/iostat.h +++ b/fs/nfs/iostat.h @@ -103,6 +103,7 @@ enum nfs_stat_eventcounters { NFSIOS_SILLYRENAME, NFSIOS_SHORTREAD, NFSIOS_SHORTWRITE, + NFSIOS_DELAY, __NFSIOS_COUNTSMAX, }; @@ -116,28 +117,38 @@ struct nfs_iostats { unsigned long events[__NFSIOS_COUNTSMAX]; } ____cacheline_aligned; -static inline void nfs_inc_stats(struct inode *inode, enum nfs_stat_eventcounters stat) +static inline void nfs_inc_server_stats(struct nfs_server *server, enum nfs_stat_eventcounters stat) { struct nfs_iostats *iostats; int cpu; cpu = get_cpu(); - iostats = per_cpu_ptr(NFS_SERVER(inode)->io_stats, cpu); + iostats = per_cpu_ptr(server->io_stats, cpu); iostats->events[stat] ++; put_cpu_no_resched(); } -static inline void nfs_add_stats(struct inode *inode, enum nfs_stat_bytecounters stat, unsigned long addend) +static inline void nfs_inc_stats(struct inode *inode, enum nfs_stat_eventcounters stat) +{ + nfs_inc_server_stats(NFS_SERVER(inode), stat); +} + +static inline void nfs_add_server_stats(struct nfs_server *server, enum nfs_stat_bytecounters stat, unsigned long addend) { struct nfs_iostats *iostats; int cpu; cpu = get_cpu(); - iostats = per_cpu_ptr(NFS_SERVER(inode)->io_stats, cpu); + iostats = per_cpu_ptr(server->io_stats, cpu); iostats->bytes[stat] += addend; put_cpu_no_resched(); } +static inline void nfs_add_stats(struct inode *inode, enum nfs_stat_bytecounters stat, unsigned long addend) +{ + nfs_add_server_stats(NFS_SERVER(inode), stat, addend); +} + static inline struct nfs_iostats *nfs_alloc_iostats(void) { return alloc_percpu(struct nfs_iostats); |