diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-03-03 08:03:01 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:09:55 +0300 |
commit | 3329cf1bb91d6293a96cf35ad72b2a2e1e1c0e3d (patch) | |
tree | 4454b632673b2d32057199effc301fc60e7586ef /fs/bcachefs/btree_locking.h | |
parent | 1306f87de399a0c791f03d68b50e03bdb3f409ae (diff) | |
download | linux-3329cf1bb91d6293a96cf35ad72b2a2e1e1c0e3d.tar.xz |
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.h | 8 |
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) { |