summaryrefslogtreecommitdiff
path: root/fs/bcachefs/alloc_foreground.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/bcachefs/alloc_foreground.c')
-rw-r--r--fs/bcachefs/alloc_foreground.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/bcachefs/alloc_foreground.c b/fs/bcachefs/alloc_foreground.c
index 8d1c7797f25a..ce365fec7f41 100644
--- a/fs/bcachefs/alloc_foreground.c
+++ b/fs/bcachefs/alloc_foreground.c
@@ -268,7 +268,6 @@ static struct open_bucket *__try_alloc_bucket(struct bch_fs *c, struct bch_dev *
spin_unlock(&c->freelist_lock);
- trace_and_count(c, bucket_alloc, ca, bch2_alloc_reserves[reserve]);
return ob;
}
@@ -575,7 +574,10 @@ err:
if (!ob)
ob = ERR_PTR(-BCH_ERR_no_buckets_found);
- if (IS_ERR(ob))
+ if (!IS_ERR(ob))
+ trace_and_count(c, bucket_alloc, ca, bch2_alloc_reserves[reserve],
+ may_alloc_partial, ob->bucket);
+ else
trace_and_count(c, bucket_alloc_fail,
ca, bch2_alloc_reserves[reserve],
usage.d[BCH_DATA_free].buckets,