bcachefs: don't call bch2_bucket_seq_cleanup from journal_buf_switch
authorKent Overstreet <kent.overstreet@gmail.com>
Sun, 22 Jul 2018 02:57:20 +0000 (22:57 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:08 +0000 (17:08 -0400)
commitc6923995296e5f06a47aa36e684ef0eccd17adea
treed2d2dd9ad4fc9846b79b56544c7714e397f79579
parent8bb4dff72d07f4f46e5627870a9614c4cee5a1bb
bcachefs: don't call bch2_bucket_seq_cleanup from journal_buf_switch

journal_buf_switch is called from the foreground when getting a journal
reservation and thus is somewhat latency sensitive;
bch2_bucket_seq_cleanup has to run infrequently but is a bit expensive
when it does run.

Call it from the journal write path instead, and punt the journal write
to worqueue context.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/bcachefs.h
fs/bcachefs/buckets.c
fs/bcachefs/buckets_types.h
fs/bcachefs/journal.c
fs/bcachefs/journal_io.c