We ideally want the buckets used for the extra initial replicas to be
reused right away.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
bkey_on_stack_reassemble(&sk, c, k);
e = bkey_i_to_s_extent(sk.k);
- extent_for_each_ptr(e, ptr) {
- if (ptr->dev == dev)
- ec_ptr = ptr;
- else
- ptr->cached = true;
- }
+ bch2_bkey_drop_ptrs(e.s, ptr, ptr->dev != dev);
+ ec_ptr = (void *) bch2_bkey_has_device(e.s_c, dev);
+ BUG_ON(!ec_ptr);
extent_stripe_ptr_add(e, s, ec_ptr, idx);