bcachefs: bch2_journal_halt() now takes journal lock
authorKent Overstreet <kent.overstreet@gmail.com>
Mon, 28 Feb 2022 21:21:07 +0000 (16:21 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:26 +0000 (17:09 -0400)
commitdfc0f7ea00a71e12772d174e5f070dd5b1bf8981
tree7dec51b65566d2e2c265eb57a17a36ff311d00ac
parentfbec3b8800ac8244ce751d0ba5b83d94ee48fc76
bcachefs: bch2_journal_halt() now takes journal lock

This change is prep work for moving some work from
__journal_entry_close() to journal_entry_open(): without this change,
journal_entry_open() doesn't know if it's going to be able to open a new
journal entry until the cmpxchg loop, meaning it can't create the new
journal pin entry and update other global state because those have to be
done prior to the cmpxchg opening the new journal entry.

Fortunately, we don't call bch2_journal_halt() from interrupt context.

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