From c4a94ae3da7c666d5d5230897a3f6d1e9d8d8b55 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Fri, 31 Jan 2020 13:26:05 -0500 Subject: [PATCH] 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: Kent Overstreet Signed-off-by: Kent Overstreet --- fs/bcachefs/btree_iter.c | 4 ++-- fs/bcachefs/btree_update_leaf.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c index f7623a71b768..f002ddc18cbb 100644 --- a/fs/bcachefs/btree_iter.c +++ b/fs/bcachefs/btree_iter.c @@ -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; diff --git a/fs/bcachefs/btree_update_leaf.c b/fs/bcachefs/btree_update_leaf.c index 9cf7075dd265..11bd0558ebd5 100644 --- a/fs/bcachefs/btree_update_leaf.c +++ b/fs/bcachefs/btree_update_leaf.c @@ -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);