bcachefs: Split out dev_buckets_free()
authorKent Overstreet <kent.overstreet@gmail.com>
Tue, 14 Jun 2022 21:51:20 +0000 (17:51 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:34 +0000 (17:09 -0400)
commit30f0349d62429effd729ae9272c6fb57f47d1436
tree7a7e0227b9877102e4f8f603d0ae5ff971f39074
parent8f7f566f5774d36196bfa87bc097522fd497d4dc
bcachefs: Split out dev_buckets_free()

Previously, dev_buckets_available() only counted buckets that are
eligible to be allocated right now - i.e. buckets that don't have cached
data, or need discard, or need gc gens, etc.

But most users of this function want to know how many buckets are
eligible to be allocated from without moving data around - copygc,
allocator striping, which means we should be including cached data
buckets etc.

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