diff options
Diffstat (limited to 'fs/bcachefs/btree_locking.h')
-rw-r--r-- | fs/bcachefs/btree_locking.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/fs/bcachefs/btree_locking.h b/fs/bcachefs/btree_locking.h index d599008c5fc1..5c6b758070e1 100644 --- a/fs/bcachefs/btree_locking.h +++ b/fs/bcachefs/btree_locking.h @@ -58,7 +58,8 @@ static inline void mark_btree_node_unlocked(struct btree_path *path, path->nodes_intent_locked &= ~(1 << level); } -static inline void mark_btree_node_locked(struct btree_path *path, +static inline void mark_btree_node_locked(struct btree_trans *trans, + struct btree_path *path, unsigned level, enum six_lock_type type) { @@ -68,12 +69,19 @@ static inline void mark_btree_node_locked(struct btree_path *path, path->nodes_locked |= 1 << level; path->nodes_intent_locked |= type << level; +#ifdef CONFIG_BCACHEFS_DEBUG + path->ip_locked = _RET_IP_; + BUG_ON(trans->in_traverse_all && + trans->traverse_all_idx != U8_MAX && + path->sorted_idx > trans->paths[trans->traverse_all_idx].sorted_idx); +#endif } -static inline void mark_btree_node_intent_locked(struct btree_path *path, +static inline void mark_btree_node_intent_locked(struct btree_trans *trans, + struct btree_path *path, unsigned level) { - mark_btree_node_locked(path, level, SIX_LOCK_intent); + mark_btree_node_locked(trans, path, level, SIX_LOCK_intent); } static inline enum six_lock_type __btree_lock_want(struct btree_path *path, int level) @@ -112,6 +120,9 @@ static inline void __bch2_btree_path_unlock(struct btree_path *path) while (path->nodes_locked) btree_node_unlock(path, __ffs(path->nodes_locked)); +#ifdef CONFIG_BCACHEFS_DEBUG + path->ip_locked = 0; +#endif } static inline enum bch_time_stats lock_to_time_stat(enum six_lock_type type) |