bcachefs: Go RW before bch2_check_lrus()
authorKent Overstreet <kent.overstreet@gmail.com>
Thu, 21 Apr 2022 17:13:57 +0000 (13:13 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:32 +0000 (17:09 -0400)
commit1cab5a82cc67a09705fbe0607e6ab751f6663524
tree3937f33e238033aa482a14cced3369ed5cdbc44b
parent104c69745fdf7e5f8aa022f60bc9d568987bd8b8
bcachefs: Go RW before bch2_check_lrus()

btree updates before going RW are expensive if they're in random order,
since they use the list of keys for journal replay to insert, which is
just a gap buffer.

This patch improves the bucket invalidate path so that if
bch2_check_lrus() hasn't finished it only prints warnings instead of
doing an emergency shutdown, which means we can now set BCH_FS_MAY_GO_RW
before bch2_check_lrus().

Also, the filesystem state bits are reorganized a bit.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/alloc_background.c
fs/bcachefs/bcachefs.h
fs/bcachefs/lru.c
fs/bcachefs/recovery.c