summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/alloc_foreground.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-08-01 20:06:45 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:10:09 -0400
commitbf5a261c7af80a2ac10bcc3ce0382cb238eccb8b (patch)
treeba891c5c8486cc26935c90b4c899baf1ae86af9d /fs/bcachefs/alloc_foreground.c
parent7904c82ceae963b0f89e96a49dc714adffe3adc6 (diff)
downloadlinux-bf5a261c7af80a2ac10bcc3ce0382cb238eccb8b.tar.gz
linux-bf5a261c7af80a2ac10bcc3ce0382cb238eccb8b.tar.bz2
linux-bf5a261c7af80a2ac10bcc3ce0382cb238eccb8b.zip
bcachefs: Assorted fixes for clang
clang had a few more warnings about enum conversion, and also didn't like the opts.c initializer. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/alloc_foreground.c')
-rw-r--r--fs/bcachefs/alloc_foreground.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/bcachefs/alloc_foreground.c b/fs/bcachefs/alloc_foreground.c
index fcb7311b1844..1f4c5b38562d 100644
--- a/fs/bcachefs/alloc_foreground.c
+++ b/fs/bcachefs/alloc_foreground.c
@@ -1042,8 +1042,12 @@ static bool should_drop_bucket(struct open_bucket *ob, struct bch_fs *c,
unsigned i;
if (!drop && ob->ec) {
+ unsigned nr_blocks;
+
mutex_lock(&ob->ec->lock);
- for (i = 0; i < ob->ec->new_stripe.key.v.nr_blocks; i++) {
+ nr_blocks = bkey_i_to_stripe(&ob->ec->new_stripe.key)->v.nr_blocks;
+
+ for (i = 0; i < nr_blocks; i++) {
if (!ob->ec->blocks[i])
continue;