summaryrefslogtreecommitdiff
path: root/c_src/cmd_fs.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2025-08-06 13:09:03 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2025-08-06 13:09:03 -0400
commit06c8b3dd639430cfb4999be19b8554bafd55940d (patch)
tree708c58beeb0cd2277d84ed8d61ffeb41b91f6f9a /c_src/cmd_fs.c
parent6abef4e0ed442cf7fc51d2d3771f3b3a456491fc (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.c5
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,