bcachefs: Optimize bch2_dev_usage_read()
authorKent Overstreet <kent.overstreet@linux.dev>
Fri, 21 Oct 2022 18:01:19 +0000 (14:01 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:44 +0000 (17:09 -0400)
commited80c5699a23c4005ba8e81d4b8fb3e1b922fa40
tree3c2dd5e984480c39efbaa6ea19011bacbeec10d1
parent2d485df3da368193dafc78be933669d427b7ddf7
bcachefs: Optimize bch2_dev_usage_read()

 - add bch2_dev_usage_read_fast(), which doesn't return by value -
   bch_dev_usage is big enough that we don't want the silent memcpy
 - tweak the allocation path to only call bch2_dev_usage_read() once per
   bucket allocated

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