bcachefs: bch2_bucket_alloc_trans_early -> for_each_btree_key_norestart
authorKent Overstreet <kent.overstreet@gmail.com>
Sun, 17 Jul 2022 06:46:46 +0000 (02:46 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:37 +0000 (17:09 -0400)
commitdb346e7120a6dec1534184ea2abf9d22edbb9b8a
tree69e6546af12bec5c6228188afb4c912c71751fab
parent7903e3d2d7e5266dde40c9db746fafb078f84f4f
bcachefs: bch2_bucket_alloc_trans_early -> for_each_btree_key_norestart

Nested btree transactions require special care, and an upcoming patch is
going to add assertions to that effect. We don't want to be using them
unnecessarily, so this patch switches bch2_bucket_trans_early() to not
handle transaction restarts.

This patch also adds a cursor so that on transaction restart we can
continue scanning from where the previous search for an empty bucket
left off.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/alloc_foreground.c