summaryrefslogtreecommitdiff
path: root/fs/bcachefs/ec.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-12-16 22:30:09 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2024-01-01 11:47:42 -0500
commit80eab7a7c2808f84e56ba1f2f1408a16c46d3bdc (patch)
tree44a8e33d297d74e2c1fb4cebcb17b68c5de575a0 /fs/bcachefs/ec.c
parentc47e8bfbb76991c7ea5feae4b21539c36d1200be (diff)
bcachefs: for_each_btree_key() now declares loop iter
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/ec.c')
-rw-r--r--fs/bcachefs/ec.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/fs/bcachefs/ec.c b/fs/bcachefs/ec.c
index 6cbc1d8a3ab5..fc1563f6273f 100644
--- a/fs/bcachefs/ec.c
+++ b/fs/bcachefs/ec.c
@@ -1826,14 +1826,7 @@ void bch2_fs_ec_flush(struct bch_fs *c)
int bch2_stripes_read(struct bch_fs *c)
{
- struct btree_iter iter;
- struct bkey_s_c k;
- const struct bch_stripe *s;
- struct stripe *m;
- unsigned i;
- int ret;
-
- ret = bch2_trans_run(c,
+ int ret = bch2_trans_run(c,
for_each_btree_key(trans, iter, BTREE_ID_stripes, POS_MIN,
BTREE_ITER_PREFETCH, k, ({
if (k.k->type != KEY_TYPE_stripe)
@@ -1843,16 +1836,16 @@ int bch2_stripes_read(struct bch_fs *c)
if (ret)
break;
- s = bkey_s_c_to_stripe(k).v;
+ const struct bch_stripe *s = bkey_s_c_to_stripe(k).v;
- m = genradix_ptr(&c->stripes, k.k->p.offset);
+ struct stripe *m = genradix_ptr(&c->stripes, k.k->p.offset);
m->sectors = le16_to_cpu(s->sectors);
m->algorithm = s->algorithm;
m->nr_blocks = s->nr_blocks;
m->nr_redundant = s->nr_redundant;
m->blocks_nonempty = 0;
- for (i = 0; i < s->nr_blocks; i++)
+ for (unsigned i = 0; i < s->nr_blocks; i++)
m->blocks_nonempty += !!stripe_blockcount_get(s, i);
bch2_stripes_heap_insert(c, m, k.k->p.offset);