summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/super-io.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2020-11-13 18:36:33 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:49 -0400
commitf299d57350b2450c522dc7780400ce811f4847ec (patch)
tree4775bbb7ebd4eff2c44d8144ec85e121bf9e51f0 /fs/bcachefs/super-io.c
parent7bfbbd88024d70947761e482c856522b43a98d87 (diff)
downloadlinux-f299d57350b2450c522dc7780400ce811f4847ec.tar.gz
linux-f299d57350b2450c522dc7780400ce811f4847ec.tar.bz2
linux-f299d57350b2450c522dc7780400ce811f4847ec.zip
bcachefs: Refactor filesystem usage accounting
Various filesystem usage counters are kept in percpu counters, with one set per in flight journal buffer. Right now all the code that deals with it assumes that there's only two buffers/sets of counters, but the number of journal bufs is getting increased to 4 in the next patch - so refactor that code to not assume a constant. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/super-io.c')
-rw-r--r--fs/bcachefs/super-io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/super-io.c b/fs/bcachefs/super-io.c
index 5406315340e1..e25ff75b97f3 100644
--- a/fs/bcachefs/super-io.c
+++ b/fs/bcachefs/super-io.c
@@ -998,7 +998,7 @@ bch2_journal_super_entries_add_common(struct bch_fs *c,
for (i = 0; i < ARRAY_SIZE(c->usage); i++)
bch2_fs_usage_acc_to_base(c, i);
} else {
- bch2_fs_usage_acc_to_base(c, journal_seq & 1);
+ bch2_fs_usage_acc_to_base(c, journal_seq & JOURNAL_BUF_MASK);
}
{