summaryrefslogtreecommitdiff
path: root/libbcachefs/bset.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2017-12-13 16:01:18 -0500
committerKent Overstreet <kent.overstreet@gmail.com>2017-12-13 16:12:38 -0500
commitea83a3985d28372d56ec7cea6e73907551869f63 (patch)
tree42b8b0d3da3b1fa96eb4400455559e60a78c4294 /libbcachefs/bset.h
parentf2feceddae6f3bd3722247f3458860b955f539bc (diff)
Update bcachefs sources to e57b5958cf bcachefs: fix for building in userspace
Diffstat (limited to 'libbcachefs/bset.h')
-rw-r--r--libbcachefs/bset.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/libbcachefs/bset.h b/libbcachefs/bset.h
index a1337bf8..c195cd91 100644
--- a/libbcachefs/bset.h
+++ b/libbcachefs/bset.h
@@ -146,6 +146,17 @@
* first key in that range of bytes again.
*/
+extern bool bch2_expensive_debug_checks;
+
+static inline bool btree_keys_expensive_checks(const struct btree *b)
+{
+#ifdef CONFIG_BCACHEFS_DEBUG
+ return bch2_expensive_debug_checks || *b->expensive_debug_checks;
+#else
+ return false;
+#endif
+}
+
struct btree_node_iter;
struct btree_node_iter_set;
@@ -188,7 +199,7 @@ bkey_unpack_key_format_checked(const struct btree *b,
compiled_unpack_fn unpack_fn = b->aux_data;
unpack_fn(&dst, src);
- if (IS_ENABLED(CONFIG_BCACHEFS_DEBUG)) {
+ if (btree_keys_expensive_checks(b)) {
struct bkey dst2 = __bch2_bkey_unpack_key(&b->format, src);
/*
@@ -260,17 +271,6 @@ static inline struct bkey_s __bkey_disassemble(struct btree *b,
#define for_each_bset(_b, _t) \
for (_t = (_b)->set; _t < (_b)->set + (_b)->nsets; _t++)
-extern bool bch2_expensive_debug_checks;
-
-static inline bool btree_keys_expensive_checks(struct btree *b)
-{
-#ifdef CONFIG_BCACHEFS_DEBUG
- return bch2_expensive_debug_checks || *b->expensive_debug_checks;
-#else
- return false;
-#endif
-}
-
static inline bool bset_has_ro_aux_tree(struct bset_tree *t)
{
return bset_aux_tree_type(t) == BSET_RO_AUX_TREE;