diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2025-08-06 13:09:03 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-08-06 13:09:03 -0400 |
commit | 06c8b3dd639430cfb4999be19b8554bafd55940d (patch) | |
tree | 708c58beeb0cd2277d84ed8d61ffeb41b91f6f9a /c_src/cmd_fs.c | |
parent | 6abef4e0ed442cf7fc51d2d3771f3b3a456491fc (diff) |
cmd_fs_usage: BCH_DATA_unstriped isn't a real bucket type
BCH_DATA_unstriped tracks unstriped data in stripe member buckets, it
double counts a portion of BCH_DATA_stripe.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'c_src/cmd_fs.c')
-rw-r--r-- | c_src/cmd_fs.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/c_src/cmd_fs.c b/c_src/cmd_fs.c index 4eca866a..d13c7e71 100644 --- a/c_src/cmd_fs.c +++ b/c_src/cmd_fs.c @@ -52,10 +52,9 @@ static void dev_usage_to_text(struct printbuf *out, struct bch_ioctl_dev_usage_v2 *u = bchu_dev_usage(fs, d->idx); u64 used = 0, capacity = u->nr_buckets * u->bucket_size; - for (unsigned type = 0; type < u->nr_data_types; type++) { - if (!data_type_is_empty(type)) + for (unsigned type = 0; type < u->nr_data_types; type++) + if (type != BCH_DATA_unstriped) used += u->d[type].sectors; - } prt_printf(out, "%s (device %u):\t%s\r%s\r %02u%%\n", d->label ?: "(no label)", d->idx, |