summaryrefslogtreecommitdiff
path: root/fs/bcachefs/buckets.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-02-09 19:20:57 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:15 -0400
commit3577df5f7f25f6669c4b53e76cf159d550a0fd83 (patch)
tree03bbca1bf2983e2ff5e571b14fa7454d8b53c003 /fs/bcachefs/buckets.c
parent3e0745e28363c1675a05775425312c049d5857b3 (diff)
downloadlwn-3577df5f7f25f6669c4b53e76cf159d550a0fd83.tar.gz
lwn-3577df5f7f25f6669c4b53e76cf159d550a0fd83.zip
bcachefs: serialize persistent_reserved
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/buckets.c')
-rw-r--r--fs/bcachefs/buckets.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c
index f65132a0ebf4..d2e047ee29cf 100644
--- a/fs/bcachefs/buckets.c
+++ b/fs/bcachefs/buckets.c
@@ -123,6 +123,9 @@ void bch2_fs_usage_initialize(struct bch_fs *c)
nr = sizeof(struct bch_fs_usage) / sizeof(u64) + c->replicas.nr;
usage = (void *) bch2_acc_percpu_u64s((void *) c->usage[0], nr);
+ for (i = 0; i < BCH_REPLICAS_MAX; i++)
+ usage->s.reserved += usage->persistent_reserved[i];
+
for (i = 0; i < c->replicas.nr; i++) {
struct bch_replicas_entry *e =
cpu_replicas_entry(&c->replicas, i);