Commit 13bc41a7 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: bch2_trans_locked()

Useful debugging function.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 40a44873
......@@ -207,6 +207,7 @@ void bch2_path_put(struct btree_trans *, struct btree_path *, bool);
int bch2_trans_relock(struct btree_trans *);
void bch2_trans_unlock(struct btree_trans *);
bool bch2_trans_locked(struct btree_trans *);
static inline bool trans_was_restarted(struct btree_trans *trans, u32 restart_count)
{
......
......@@ -666,6 +666,16 @@ void bch2_trans_unlock(struct btree_trans *trans)
__bch2_btree_path_unlock(trans, path);
}
bool bch2_trans_locked(struct btree_trans *trans)
{
struct btree_path *path;
trans_for_each_path(trans, path)
if (path->nodes_locked)
return true;
return false;
}
/* Debug */
#ifdef CONFIG_BCACHEFS_DEBUG
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment