summaryrefslogtreecommitdiffstats
path: root/fs/fscache
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2021-10-20 23:06:16 +0100
committerDavid Howells <dhowells@redhat.com>2022-01-07 09:22:19 +0000
commit8e7a867bb7309fbf47e8c2a68798b919fc02523f (patch)
tree8b8f3580cb0008126c6492f168750b75d9824d1c /fs/fscache
parentcdf262f29488e6c3432911ec487ea41918fcbcd7 (diff)
downloadlinux-8e7a867bb7309fbf47e8c2a68798b919fc02523f.tar.bz2
fscache: Provide read/write stat counters for the cache
Provide read/write stat counters for the cache backend to use. Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819609532.215744.10821082637727410554.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906912598.143852.12960327989649429069.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967113830.1823006.3222957649202368162.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021517502.640689.6077928311710357342.stgit@warthog.procyon.org.uk/ # v4
Diffstat (limited to 'fs/fscache')
-rw-r--r--fs/fscache/stats.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/fscache/stats.c b/fs/fscache/stats.c
index cdbb672a274f..db42beb1ba3f 100644
--- a/fs/fscache/stats.c
+++ b/fs/fscache/stats.c
@@ -35,6 +35,11 @@ atomic_t fscache_n_relinquishes;
atomic_t fscache_n_relinquishes_retire;
atomic_t fscache_n_relinquishes_dropped;
+atomic_t fscache_n_read;
+EXPORT_SYMBOL(fscache_n_read);
+atomic_t fscache_n_write;
+EXPORT_SYMBOL(fscache_n_write);
+
/*
* display the general statistics
*/
@@ -72,6 +77,10 @@ int fscache_stats_show(struct seq_file *m, void *v)
atomic_read(&fscache_n_relinquishes_retire),
atomic_read(&fscache_n_relinquishes_dropped));
+ seq_printf(m, "IO : rd=%u wr=%u\n",
+ atomic_read(&fscache_n_read),
+ atomic_read(&fscache_n_write));
+
netfs_stats_show(m);
return 0;
}