diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-03-29 13:10:36 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:58 -0400 |
commit | 6bdefe9c3900b3bb7a028486423520cdc975d9a8 (patch) | |
tree | b6c65237048bc4ed45e4b7d9cefbe837e2d32c6a /fs/bcachefs | |
parent | 4f77dcde2841e43e4c5fe9f178a64ec40be72e17 (diff) | |
download | linux-stable-6bdefe9c3900b3bb7a028486423520cdc975d9a8.tar.gz linux-stable-6bdefe9c3900b3bb7a028486423520cdc975d9a8.tar.bz2 linux-stable-6bdefe9c3900b3bb7a028486423520cdc975d9a8.zip |
bcachefs: Use BTREE_ITER_INTENT in ec_stripe_update_extent()
This adds a flags param to bch2_backpointer_get_key() so that we can
pass BTREE_ITER_INTENT, since ec_stripe_update_extent() is updating the
extent immediately.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs')
-rw-r--r-- | fs/bcachefs/backpointers.c | 7 | ||||
-rw-r--r-- | fs/bcachefs/backpointers.h | 3 | ||||
-rw-r--r-- | fs/bcachefs/ec.c | 3 | ||||
-rw-r--r-- | fs/bcachefs/move.c | 4 |
4 files changed, 10 insertions, 7 deletions
diff --git a/fs/bcachefs/backpointers.c b/fs/bcachefs/backpointers.c index 740084b3ff12..9121fae0fd6c 100644 --- a/fs/bcachefs/backpointers.c +++ b/fs/bcachefs/backpointers.c @@ -420,7 +420,8 @@ struct bkey_s_c bch2_backpointer_get_key(struct btree_trans *trans, struct btree_iter *iter, struct bpos bucket, u64 bp_offset, - struct bch_backpointer bp) + struct bch_backpointer bp, + unsigned iter_flags) { struct bch_fs *c = trans->c; struct bkey_s_c k; @@ -430,7 +431,7 @@ struct bkey_s_c bch2_backpointer_get_key(struct btree_trans *trans, bp.pos, 0, min(bp.level, c->btree_roots[bp.btree_id].level), - 0); + iter_flags); k = bch2_btree_iter_peek_slot(iter); if (bkey_err(k)) { bch2_trans_iter_exit(trans, iter); @@ -976,7 +977,7 @@ static int check_one_backpointer(struct btree_trans *trans, bbpos_cmp(pos, end) > 0) return 0; - k = bch2_backpointer_get_key(trans, &iter, bucket, *bp_offset, bp); + k = bch2_backpointer_get_key(trans, &iter, bucket, *bp_offset, bp, 0); ret = bkey_err(k); if (ret == -BCH_ERR_backpointer_to_overwritten_btree_node) return 0; diff --git a/fs/bcachefs/backpointers.h b/fs/bcachefs/backpointers.h index d0ba5d8596c5..ce75b8f50241 100644 --- a/fs/bcachefs/backpointers.h +++ b/fs/bcachefs/backpointers.h @@ -128,7 +128,8 @@ static inline void bch2_extent_ptr_to_bp(struct bch_fs *c, int bch2_get_next_backpointer(struct btree_trans *, struct bpos, int, u64 *, struct bch_backpointer *, unsigned); struct bkey_s_c bch2_backpointer_get_key(struct btree_trans *, struct btree_iter *, - struct bpos, u64, struct bch_backpointer); + struct bpos, u64, struct bch_backpointer, + unsigned); struct btree *bch2_backpointer_get_node(struct btree_trans *, struct btree_iter *, struct bpos, u64, struct bch_backpointer); diff --git a/fs/bcachefs/ec.c b/fs/bcachefs/ec.c index a444f6d513e5..d295e5401c7a 100644 --- a/fs/bcachefs/ec.c +++ b/fs/bcachefs/ec.c @@ -925,7 +925,8 @@ static int ec_stripe_update_extent(struct btree_trans *trans, return -EIO; } - k = bch2_backpointer_get_key(trans, &iter, bucket, *bp_offset, bp); + k = bch2_backpointer_get_key(trans, &iter, bucket, *bp_offset, bp, + BTREE_ITER_INTENT); ret = bkey_err(k); if (ret) return ret; diff --git a/fs/bcachefs/move.c b/fs/bcachefs/move.c index 9717fdce3ba5..be14d3737027 100644 --- a/fs/bcachefs/move.c +++ b/fs/bcachefs/move.c @@ -678,7 +678,7 @@ failed_to_evacuate: break; k = bch2_backpointer_get_key(trans, &iter, - bucket, bp_offset, bp); + bucket, bp_offset, bp, 0); ret = bkey_err(k); if (bch2_err_matches(ret, BCH_ERR_transaction_restart)) continue; @@ -767,7 +767,7 @@ int __bch2_evacuate_bucket(struct btree_trans *trans, unsigned i = 0; k = bch2_backpointer_get_key(trans, &iter, - bucket, bp_offset, bp); + bucket, bp_offset, bp, 0); ret = bkey_err(k); if (bch2_err_matches(ret, BCH_ERR_transaction_restart)) continue; |