Skip to content

Commit b5c3dcd

Browse files
alanskindKent Overstreet
authored andcommitted
bcachefs: Convert open-coded lock_graph_pop_all to helper
Signed-off-by: Alan Huang <mmpgouride@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent 0ef9ab3 commit b5c3dcd

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

fs/bcachefs/btree_locking.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,7 @@ static noinline int break_cycle(struct lock_graph *g, struct printbuf *cycle)
229229
ret = abort_lock(g, abort);
230230
out:
231231
if (ret)
232-
while (g->nr)
233-
lock_graph_up(g);
232+
lock_graph_pop_all(g);
234233
return ret;
235234
}
236235

@@ -252,8 +251,7 @@ static int lock_graph_descend(struct lock_graph *g, struct btree_trans *trans,
252251
if (orig_trans->lock_may_not_fail)
253252
return 0;
254253

255-
while (g->nr)
256-
lock_graph_up(g);
254+
lock_graph_pop_all(g);
257255

258256
if (cycle)
259257
return 0;

0 commit comments

Comments
 (0)