mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
bcachefs: Don't hardcode BTREE_ID_EXTENTS
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
a7451c4292
commit
ab5c63f5dd
2 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue