diff options
Diffstat (limited to 'fs/bcachefs/btree_locking.h')
-rw-r--r-- | fs/bcachefs/btree_locking.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/bcachefs/btree_locking.h b/fs/bcachefs/btree_locking.h index 962fa8f5cf0b..5d9b5f9e3e3b 100644 --- a/fs/bcachefs/btree_locking.h +++ b/fs/bcachefs/btree_locking.h @@ -204,7 +204,7 @@ static inline int __btree_node_lock_nopath(struct btree_trans *trans, { #ifdef CONFIG_LOCKDEP if (!trans->locks_held) { - lock_acquire_exclusive(&trans->dep_map, 0, 0, NULL, ip); + lock_map_acquire(&trans->dep_map); trans->locks_held = true; } #endif @@ -271,6 +271,13 @@ static inline int btree_node_lock(struct btree_trans *trans, EBUG_ON(level >= BTREE_MAX_DEPTH); +#ifdef CONFIG_LOCKDEP + if (!trans->locks_held) { + lock_map_acquire(&trans->dep_map); + trans->locks_held = true; + } +#endif + if (likely(six_trylock_type(&b->lock, type)) || btree_node_lock_increment(trans, b, level, (enum btree_node_locked_type) type) || !(ret = btree_node_lock_nopath(trans, b, type, btree_path_ip_allocated(path)))) { |