Commit c4a94ae3 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Make BTREE_ITER_IS_EXTENTS private to iter code

Prep work for changing the core btree update path to handle extents like
regular keys; we need to reduce the scope of what BTREE_ITER_IS_EXTENTS
means
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 6a9ec828
......@@ -408,7 +408,7 @@ static void __bch2_btree_iter_verify(struct btree_iter *iter,
* For extents, the iterator may have skipped past deleted keys (but not
* whiteouts)
*/
k = b->c.level || iter->flags & BTREE_ITER_IS_EXTENTS
k = b->c.level || btree_node_type_is_extents(iter->btree_id)
? bch2_btree_node_iter_prev_filter(&tmp, b, KEY_TYPE_discard)
: bch2_btree_node_iter_prev_all(&tmp, b);
if (k && bkey_iter_pos_cmp(b, k, &pos) >= 0) {
......@@ -563,7 +563,7 @@ static void __bch2_btree_node_iter_fix(struct btree_iter *iter,
if (!bch2_btree_node_iter_end(node_iter) &&
iter_current_key_modified &&
(b->c.level ||
(iter->flags & BTREE_ITER_IS_EXTENTS))) {
btree_node_type_is_extents(iter->btree_id))) {
struct bset_tree *t;
struct bkey_packed *k, *k2, *p;
......
......@@ -780,7 +780,7 @@ int bch2_trans_update(struct btree_trans *trans, struct btree_iter *iter,
iter->flags |= BTREE_ITER_KEEP_UNTIL_COMMIT;
if (iter->flags & BTREE_ITER_IS_EXTENTS) {
if (btree_node_type_is_extents(iter->btree_id)) {
iter->pos_after_commit = k->k.p;
iter->flags |= BTREE_ITER_SET_POS_AFTER_COMMIT;
}
......@@ -898,7 +898,7 @@ int bch2_btree_delete_at_range(struct btree_trans *trans,
*/
delete.k.p = iter->pos;
if (iter->flags & BTREE_ITER_IS_EXTENTS) {
if (btree_node_type_is_extents(iter->btree_id)) {
unsigned max_sectors =
KEY_SIZE_MAX & (~0 << trans->c->block_bits);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment