summaryrefslogtreecommitdiff
path: root/fs/bcachefs/buckets.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-02-28 22:37:21 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2024-07-14 19:00:14 -0400
commit6af91147b6b90552cdf1dd400eeb9da66920f3ce (patch)
tree3d9f5d24b1a060094fbcd95c06ddfd77a93c692e /fs/bcachefs/buckets.c
parent6675c37662341cf1a2e3b502a4dafbf7571978b2 (diff)
bcachefs: bch_acct_btree
Add counters for how much disk space we're using per btree. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/buckets.c')
-rw-r--r--fs/bcachefs/buckets.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c
index caa79e84f2cc..e4a9bd29e93c 100644
--- a/fs/bcachefs/buckets.c
+++ b/fs/bcachefs/buckets.c
@@ -798,6 +798,16 @@ static int __trigger_extent(struct btree_trans *trans,
return ret;
}
+ if (level) {
+ struct disk_accounting_pos acc_btree_key = {
+ .type = BCH_DISK_ACCOUNTING_btree,
+ .btree.id = btree_id,
+ };
+ ret = bch2_disk_accounting_mod(trans, &acc_btree_key, &replicas_sectors, 1, gc);
+ if (ret)
+ return ret;
+ }
+
return 0;
}