diff options
author | David Howells <dhowells@redhat.com> | 2018-04-06 16:17:24 +0300 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2018-04-09 23:53:54 +0300 |
commit | d55b4da4331efdfe2be1bcc7bc217bd3f7c47870 (patch) | |
tree | 05318157503c9621feda308c0ef95bc2ffce36f7 /fs/afs/internal.h | |
parent | 888b33846111927d94dee6d8187c72515160edd3 (diff) | |
download | linux-d55b4da4331efdfe2be1bcc7bc217bd3f7c47870.tar.xz |
afs: Introduce a statistics proc file
Introduce a proc file that displays a bunch of statistics for the AFS
filesystem in the current network namespace.
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/afs/internal.h')
-rw-r--r-- | fs/afs/internal.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/fs/afs/internal.h b/fs/afs/internal.h index 27150bbc50d8..ca65f121d2cc 100644 --- a/fs/afs/internal.h +++ b/fs/afs/internal.h @@ -257,9 +257,15 @@ struct afs_net { struct mutex lock_manager_mutex; /* Misc */ - struct proc_dir_entry *proc_afs; /* /proc/net/afs directory */ + struct proc_dir_entry *proc_afs; /* /proc/net/afs directory */ struct afs_sysnames *sysnames; rwlock_t sysnames_lock; + + /* Statistics counters */ + atomic_t n_lookup; /* Number of lookups done */ + atomic_t n_reval; /* Number of dentries needing revalidation */ + atomic_t n_inval; /* Number of invalidations by the server */ + atomic_t n_read_dir; /* Number of directory pages read */ }; extern const char afs_init_sysname[]; @@ -777,6 +783,13 @@ static inline void afs_put_net(struct afs_net *net) { } +static inline void __afs_stat(atomic_t *s) +{ + atomic_inc(s); +} + +#define afs_stat_v(vnode, n) __afs_stat(&afs_v2net(vnode)->n) + /* * misc.c */ |