]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
bcachefs: Convert open-coded lock_graph_pop_all to helper
authorAlan Huang <mmpgouride@gmail.com>
Wed, 2 Oct 2024 19:06:30 +0000 (03:06 +0800)
committerKent Overstreet <kent.overstreet@linux.dev>
Tue, 14 Jan 2025 15:45:08 +0000 (10:45 -0500)
Signed-off-by: Alan Huang <mmpgouride@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_locking.c

index 771d531d6533f2c693b0d20b33ff32f52d350f8b..8174799dd4b314a97aee16bf7e2759302912b662 100644 (file)
@@ -229,8 +229,7 @@ static noinline int break_cycle(struct lock_graph *g, struct printbuf *cycle)
        ret = abort_lock(g, abort);
 out:
        if (ret)
-               while (g->nr)
-                       lock_graph_up(g);
+               lock_graph_pop_all(g);
        return ret;
 }
 
@@ -252,8 +251,7 @@ static int lock_graph_descend(struct lock_graph *g, struct btree_trans *trans,
                if (orig_trans->lock_may_not_fail)
                        return 0;
 
-               while (g->nr)
-                       lock_graph_up(g);
+               lock_graph_pop_all(g);
 
                if (cycle)
                        return 0;