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

bcachefs: Don't hardcode BTREE_ID_EXTENTS

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent a7451c42
......@@ -1114,7 +1114,7 @@ static inline void bch2_btree_iter_checks(struct btree_iter *iter,
{
EBUG_ON(iter->btree_id >= BTREE_ID_NR);
EBUG_ON(!!(iter->flags & BTREE_ITER_IS_EXTENTS) !=
(iter->btree_id == BTREE_ID_EXTENTS &&
(btree_node_type_is_extents(iter->btree_id) &&
type != BTREE_ITER_NODES));
bch2_btree_trans_verify_locks(iter->trans);
......@@ -1590,7 +1590,7 @@ static inline void bch2_btree_iter_init(struct btree_trans *trans,
struct bch_fs *c = trans->c;
unsigned i;
if (btree_id == BTREE_ID_EXTENTS &&
if (btree_node_type_is_extents(btree_id) &&
!(flags & BTREE_ITER_NODES))
flags |= BTREE_ITER_IS_EXTENTS;
......
......@@ -156,7 +156,7 @@ static inline struct bpos btree_type_successor(enum btree_id id,
if (id == BTREE_ID_INODES) {
pos.inode++;
pos.offset = 0;
} else if (id != BTREE_ID_EXTENTS) {
} else if (!btree_node_type_is_extents(id)) {
pos = bkey_successor(pos);
}
......@@ -169,7 +169,7 @@ static inline struct bpos btree_type_predecessor(enum btree_id id,
if (id == BTREE_ID_INODES) {
--pos.inode;
pos.offset = 0;
} else /* if (id != BTREE_ID_EXTENTS) */ {
} else {
pos = bkey_predecessor(pos);
}
......
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