diff options
Diffstat (limited to 'fs/bcachefs/ec.c')
-rw-r--r-- | fs/bcachefs/ec.c | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/fs/bcachefs/ec.c b/fs/bcachefs/ec.c index e7f517af6715..c2840cb674b2 100644 --- a/fs/bcachefs/ec.c +++ b/fs/bcachefs/ec.c @@ -35,8 +35,6 @@ #include <linux/raid/pq.h> #include <linux/raid/xor.h> -static bool bch2_stripe_is_open(struct bch_fs *, u64); - static void raid5_recov(unsigned disks, unsigned failed_idx, size_t size, void **data) { @@ -388,20 +386,11 @@ int bch2_trigger_stripe(struct btree_trans *trans, new_s->nr_redundant != old_s->nr_redundant)); if (flags & BTREE_TRIGGER_transactional) { - u64 old_lru_pos = stripe_lru_pos(old_s); - u64 new_lru_pos = stripe_lru_pos(new_s); - - if (new_lru_pos == STRIPE_LRU_POS_EMPTY && - !bch2_stripe_is_open(c, idx)) { - _new.k->type = KEY_TYPE_deleted; - set_bkey_val_u64s(_new.k, 0); - new_s = NULL; - new_lru_pos = 0; - } - int ret = bch2_lru_change(trans, - BCH_LRU_STRIPE_FRAGMENTATION, idx, - old_lru_pos, new_lru_pos); + BCH_LRU_STRIPE_FRAGMENTATION, + idx, + stripe_lru_pos(old_s), + stripe_lru_pos(new_s)); if (ret) return ret; } @@ -1778,14 +1767,7 @@ static int __get_existing_stripe(struct btree_trans *trans, { struct bch_fs *c = trans->c; - /* - * We require an intent lock here until we have the stripe open, for - * exclusion with bch2_trigger_stripe() - which will delete empty - * stripes if they're not open, but it can't actually open them: - */ - CLASS(btree_iter, iter)(trans, BTREE_ID_stripes, POS(0, idx), - BTREE_ITER_intent| - BTREE_ITER_nopreserve); + CLASS(btree_iter, iter)(trans, BTREE_ID_stripes, POS(0, idx), BTREE_ITER_nopreserve); struct bkey_s_c k = bch2_btree_iter_peek_slot(&iter); int ret = bkey_err(k); if (ret) |