NFS: add hooks to account for NFSERR_JUKEBOX errors
Make an inode or an nfs_server struct available in the logic that handles JUKEBOX/DELAY type errors so the NFS client can account for them. This patch is split out from the main nfs iostat patch to highlight minor architectural changes required to support this statistic. Test plan: None. Signed-off-by: Chuck Lever <cel@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:

committed by
Trond Myklebust

parent
91d5b47023
commit
006ea73e5f
@@ -103,6 +103,7 @@ enum nfs_stat_eventcounters {
|
||||
NFSIOS_SILLYRENAME,
|
||||
NFSIOS_SHORTREAD,
|
||||
NFSIOS_SHORTWRITE,
|
||||
NFSIOS_DELAY,
|
||||
__NFSIOS_COUNTSMAX,
|
||||
};
|
||||
|
||||
@@ -116,26 +117,36 @@ 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_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(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)
|
||||
{
|
||||
struct nfs_iostats *iostats;
|
||||
int cpu;
|
||||
|
||||
cpu = get_cpu();
|
||||
iostats = per_cpu_ptr(NFS_SERVER(inode)->io_stats, cpu);
|
||||
iostats->bytes[stat] += addend;
|
||||
put_cpu_no_resched();
|
||||
nfs_add_server_stats(NFS_SERVER(inode), stat, addend);
|
||||
}
|
||||
|
||||
static inline struct nfs_iostats *nfs_alloc_iostats(void)
|
||||
|
Reference in New Issue
Block a user