bcachefs: bch2_trans_run()
authorKent Overstreet <kent.overstreet@gmail.com>
Thu, 14 Jul 2022 06:08:58 +0000 (02:08 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:36 +0000 (17:09 -0400)
commitdadecd02c49c7bb14c04445fc514c394e28c1ae3
tree13c5f6470106c8a9ee7d0cfac9e466279e96d984
parent326568f18cb57ed95a420361da9a64330e122cda
bcachefs: bch2_trans_run()

This adds a new helper, bch2_trans_run(), that runs a function with a
btree_transaction context but without handling transaction restarts.
We're adding checks for nested transaction restart handling: when an
inner transaction handles a transaction restart it will still have to
return it to the outer transaction, or else assertions will be popped in
the outer transaction.

But some places don't need restart handling at the outer scope, so this
helper does what they need.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/btree_update.h
fs/bcachefs/buckets.c
fs/bcachefs/journal.c