bcachefs: bch2_trans_locked()
Useful debugging function. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
40a44873a5
commit
13bc41a715
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user