From 104c69745fdf7e5f8aa022f60bc9d568987bd8b8 Mon Sep 17 00:00:00 2001 From: Daniel Hill Date: Tue, 15 Mar 2022 21:36:33 +1300 Subject: bcachefs: Add persistent counters This adds a new superblock field for persisting counters and adds a sysfs interface in counters/ exposing these counters. The superblock field is ignored by older versions letting us avoid an on disk version bump. Each sysfs file outputs a counter that tracks since filesystem creation and a counter for the current mount session. Signed-off-by: Daniel Hill Signed-off-by: Kent Overstreet --- fs/bcachefs/move.c | 1 + 1 file changed, 1 insertion(+) (limited to 'fs/bcachefs/move.c') diff --git a/fs/bcachefs/move.c b/fs/bcachefs/move.c index 2cb8775b4ed7..a852e07affdc 100644 --- a/fs/bcachefs/move.c +++ b/fs/bcachefs/move.c @@ -575,6 +575,7 @@ static int bch2_move_extent(struct btree_trans *trans, atomic64_inc(&ctxt->stats->keys_moved); atomic64_add(k.k->size, &ctxt->stats->sectors_moved); + this_cpu_add(c->counters[BCH_COUNTER_io_move], k.k->size); trace_move_extent(k.k); -- cgit v1.2.3