summaryrefslogtreecommitdiff
path: root/libbcachefs/alloc_foreground.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-08-01 20:18:33 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-08-01 22:13:03 -0400
commit87179c7a6e2a210ea57951d444a3055e883d08fa (patch)
tree3445e8b5d6724518cbc6f659f9d0b0ff59b08bfa /libbcachefs/alloc_foreground.c
parent2d7982de784b24e24baa20eee0a97dea451b8fa7 (diff)
Update bcachefs sources to 33a60d9b05 bcachefs: Assorted fixes for clang
Diffstat (limited to 'libbcachefs/alloc_foreground.c')
-rw-r--r--libbcachefs/alloc_foreground.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libbcachefs/alloc_foreground.c b/libbcachefs/alloc_foreground.c
index fcb7311b..1f4c5b38 100644
--- a/libbcachefs/alloc_foreground.c
+++ b/libbcachefs/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;