From 3329cf1bb91d6293a96cf35ad72b2a2e1e1c0e3d Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Fri, 3 Mar 2023 00:03:01 -0500 Subject: 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 --- fs/bcachefs/btree_locking.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'fs/bcachefs/btree_locking.h') 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) { -- cgit v1.2.3