Useful debugging function.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
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)
{
__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