summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/btree_locking.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-03-03 00:03:01 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:55 -0400
commit3329cf1bb91d6293a96cf35ad72b2a2e1e1c0e3d (patch)
tree4454b632673b2d32057199effc301fc60e7586ef /fs/bcachefs/btree_locking.h
parent1306f87de399a0c791f03d68b50e03bdb3f409ae (diff)
downloadlinux-stable-3329cf1bb91d6293a96cf35ad72b2a2e1e1c0e3d.tar.gz
linux-stable-3329cf1bb91d6293a96cf35ad72b2a2e1e1c0e3d.tar.bz2
linux-stable-3329cf1bb91d6293a96cf35ad72b2a2e1e1c0e3d.zip
bcachefs: Centralize btree node lock initialization
This fixes some confusion in the lockdep code due to initializing btree node/key cache locks with the same lockdep key, but different names. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_locking.h')
-rw-r--r--fs/bcachefs/btree_locking.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/bcachefs/btree_locking.h b/fs/bcachefs/btree_locking.h
index 30c89daa5009..76aac49966fe 100644
--- a/fs/bcachefs/btree_locking.h
+++ b/fs/bcachefs/btree_locking.h
@@ -13,7 +13,13 @@
#include "btree_iter.h"
#include "six.h"
-extern struct lock_class_key bch2_btree_node_lock_key;
+void bch2_btree_lock_init(struct btree_bkey_cached_common *);
+
+#ifdef CONFIG_LOCKDEP
+void bch2_assert_btree_nodes_not_locked(void);
+#else
+static inline void bch2_assert_btree_nodes_not_locked(void) {}
+#endif
static inline bool is_btree_node(struct btree_path *path, unsigned l)
{