summaryrefslogtreecommitdiff
path: root/fs/bcachefs/alloc_foreground.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-06-15 00:51:20 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:34 +0300
commit30f0349d62429effd729ae9272c6fb57f47d1436 (patch)
tree7a7e0227b9877102e4f8f603d0ae5ff971f39074 /fs/bcachefs/alloc_foreground.c
parent8f7f566f5774d36196bfa87bc097522fd497d4dc (diff)
downloadlinux-30f0349d62429effd729ae9272c6fb57f47d1436.tar.xz
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>
Diffstat (limited to 'fs/bcachefs/alloc_foreground.c')
-rw-r--r--fs/bcachefs/alloc_foreground.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/alloc_foreground.c b/fs/bcachefs/alloc_foreground.c
index ef8f10a51489..174b3a745ab8 100644
--- a/fs/bcachefs/alloc_foreground.c
+++ b/fs/bcachefs/alloc_foreground.c
@@ -526,7 +526,7 @@ static struct open_bucket *bch2_bucket_alloc_trans(struct btree_trans *trans,
bool waiting = false;
again:
usage = bch2_dev_usage_read(ca);
- avail = __dev_buckets_available(ca, usage,reserve);
+ avail = dev_buckets_free(ca, usage,reserve);
if (usage.d[BCH_DATA_need_discard].buckets > avail)
bch2_do_discards(c);