summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/super.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2025-05-17 15:05:26 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2025-05-21 20:15:04 -0400
commit15f969326ee296f7b7faf7704105a99fa02c288d (patch)
tree30c25795e64cb003c9613494bfbe16c3eee43d0a /fs/bcachefs/super.c
parentbcachefs: Run recovery passes asynchronously (diff)
downloadlinux-15f969326ee296f7b7faf7704105a99fa02c288d.tar.gz
linux-15f969326ee296f7b7faf7704105a99fa02c288d.zip
bcachefs: Improve bucket_bitmap code
Add some more helpers, and mismatches is now a superset of the empty bitmap - simplifies most checks. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/super.c')
-rw-r--r--fs/bcachefs/super.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c
index 170b0f26c018..24658bf450ab 100644
--- a/fs/bcachefs/super.c
+++ b/fs/bcachefs/super.c
@@ -1366,8 +1366,8 @@ static void bch2_dev_free(struct bch_dev *ca)
if (ca->kobj.state_in_sysfs)
kobject_del(&ca->kobj);
- for (unsigned i = 0; i < ARRAY_SIZE(ca->bucket_backpointer_mismatches); i++)
- bch2_bucket_bitmap_free(&ca->bucket_backpointer_mismatches[i]);
+ bch2_bucket_bitmap_free(&ca->bucket_backpointer_mismatch);
+ bch2_bucket_bitmap_free(&ca->bucket_backpointer_empty);
bch2_free_super(&ca->disk_sb);
bch2_dev_allocator_background_exit(ca);
@@ -1499,8 +1499,8 @@ static struct bch_dev *__bch2_dev_alloc(struct bch_fs *c,
atomic_long_set(&ca->ref, 1);
#endif
- for (unsigned i = 0; i < ARRAY_SIZE(ca->bucket_backpointer_mismatches); i++)
- mutex_init(&ca->bucket_backpointer_mismatches[i].lock);
+ mutex_init(&ca->bucket_backpointer_mismatch.lock);
+ mutex_init(&ca->bucket_backpointer_empty.lock);
bch2_dev_allocator_background_init(ca);