diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-03-28 06:51:47 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 23:08:19 +0200 |
commit | f13f5a8c836f55c6b7b0a58cb26245282f67527c (patch) | |
tree | db3999f72c60b2f41def6faabb32452473133d5c /fs/bcachefs/bset.c | |
parent | bcachefs: Sort updates in bch2_trans_update() (diff) | |
download | linux-f13f5a8c836f55c6b7b0a58cb26245282f67527c.tar.xz linux-f13f5a8c836f55c6b7b0a58cb26245282f67527c.zip |
bcachefs: move some checks to expensive_debug_checks
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bset.c')
-rw-r--r-- | fs/bcachefs/bset.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/bcachefs/bset.c b/fs/bcachefs/bset.c index ac84aac4a263..68442a26756f 100644 --- a/fs/bcachefs/bset.c +++ b/fs/bcachefs/bset.c @@ -1023,7 +1023,7 @@ struct bkey_packed *bch2_bkey_prev_filter(struct btree *b, k = p; } - if (IS_ENABLED(CONFIG_BCACHEFS_DEBUG)) { + if (btree_keys_expensive_checks(b)) { BUG_ON(ret >= orig_k); for (i = ret ? bkey_next(ret) : btree_bkey_first(b, t); @@ -1644,10 +1644,11 @@ static inline void __bch2_btree_node_iter_advance(struct btree_node_iter *iter, void bch2_btree_node_iter_advance(struct btree_node_iter *iter, struct btree *b) { -#ifdef CONFIG_BCACHEFS_DEBUG - bch2_btree_node_iter_verify(iter, b); - bch2_btree_node_iter_next_check(iter, b); -#endif + if (btree_keys_expensive_checks(b)) { + bch2_btree_node_iter_verify(iter, b); + bch2_btree_node_iter_next_check(iter, b); + } + __bch2_btree_node_iter_advance(iter, b); } @@ -1710,7 +1711,7 @@ found: iter->data[0].k = __btree_node_key_to_offset(b, prev); iter->data[0].end = end; out: - if (IS_ENABLED(CONFIG_BCACHEFS_DEBUG)) { + if (btree_keys_expensive_checks(b)) { struct btree_node_iter iter2 = *iter; if (prev) |