bcachefs: Fix bch2_btree_cache_scan()
authorKent Overstreet <kent.overstreet@gmail.com>
Tue, 28 Dec 2021 03:11:54 +0000 (22:11 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:55 +0000 (17:08 -0400)
commitc043a3303c11cdf53ee98db67cee11931b626e22
tree02923ad08073d428d469cfbd3d91ab31e885f065
parent9620c3ec2fa83e18f52e99b3dd2e8451446ca17e
bcachefs: Fix bch2_btree_cache_scan()

It was counting nodes on the freed list that it skips - because we want
to leave a few so that btree splits don't touch the allocator - as nodes
that it touched, meaning that if it was called with <= 3 nodes to
reclaim, and those nodes were on the freed list, it would never do any
work.

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