bcachefs: Simplify for_each_btree_key()

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2021-03-04 22:11:28 -05:00 committed by Kent Overstreet
parent 7d6f07edc2
commit 27ace9cc01

View File

@ -243,11 +243,9 @@ static inline int bkey_err(struct bkey_s_c k)
_start, _flags, _k, _ret) \
for ((_iter) = bch2_trans_get_iter((_trans), (_btree_id), \
(_start), (_flags)), \
(_ret) = PTR_ERR_OR_ZERO(((_k) = \
__bch2_btree_iter_peek(_iter, _flags)).k); \
!_ret && (_k).k; \
(_ret) = PTR_ERR_OR_ZERO(((_k) = \
__bch2_btree_iter_next(_iter, _flags)).k))
(_k) = __bch2_btree_iter_peek(_iter, _flags); \
!((_ret) = bkey_err(_k)) && (_k).k; \
(_k) = __bch2_btree_iter_next(_iter, _flags))
#define for_each_btree_key_continue(_iter, _flags, _k, _ret) \
for ((_k) = __bch2_btree_iter_peek(_iter, _flags); \