]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bcachefs: fix bch2_dev_usage_full_read_fast()
authorKent Overstreet <kent.overstreet@linux.dev>
Sun, 13 Apr 2025 18:53:34 +0000 (14:53 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 13 Apr 2025 18:54:34 +0000 (14:54 -0400)
One reference to bch_dev_usage wasn't updated, which meant we weren't
reading the full bch_dev_usage_full - oops.

Fixes: 955ba7b5ea03 ("bcachefs: bch_dev_usage_full")
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/buckets.c
fs/bcachefs/buckets.h

index fea61e60a9eea8980f907be514b58fae1ddb645d..4ef261e8db4f5cce6394886ce56c7ed3e58eca1b 100644 (file)
@@ -37,7 +37,8 @@ void bch2_dev_usage_read_fast(struct bch_dev *ca, struct bch_dev_usage *usage)
 void bch2_dev_usage_full_read_fast(struct bch_dev *ca, struct bch_dev_usage_full *usage)
 {
        memset(usage, 0, sizeof(*usage));
-       acc_u64s_percpu((u64 *) usage, (u64 __percpu *) ca->usage, dev_usage_u64s());
+       acc_u64s_percpu((u64 *) usage, (u64 __percpu *) ca->usage,
+                       sizeof(struct bch_dev_usage_full) / sizeof(u64));
 }
 
 static u64 reserve_factor(u64 r)
index 1c38b165f48b09fbe259466869cacd1ef1140992..8d75b27a141885fcc07493b93637c267f53e709a 100644 (file)
@@ -242,11 +242,6 @@ static inline u64 dev_buckets_available(struct bch_dev *ca,
 
 /* Filesystem usage: */
 
-static inline unsigned dev_usage_u64s(void)
-{
-       return sizeof(struct bch_dev_usage) / sizeof(u64);
-}
-
 struct bch_fs_usage_short
 bch2_fs_usage_read_short(struct bch_fs *);