diff options
author | Philip Laube <philip.laube.dev@xyz.de> | 2023-12-06 19:29:26 +0100 |
---|---|---|
committer | Philip Laube <philip.laube.dev@xyz.de> | 2023-12-07 20:47:09 +0100 |
commit | 5bc5fc621a5d51f472ef325963798616e9bcce95 (patch) | |
tree | 120e8794b5a15a13818e821108a5e050755fa5d3 | |
parent | 5d892680cf493bef7cbff46676711bda0461612e (diff) |
cmd_fs: calculate size based on bucket count for data types BCH_DATA_free, BCH_DATA_need_discard and BCH_DATA_need_inc_gens
Signed-off-by: Philip Laube <philip.laube.dev@xyz.de>
-rw-r--r-- | cmd_fs.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -39,10 +39,22 @@ static void dev_usage_type_to_text(struct printbuf *out, struct bch_ioctl_dev_usage_v2 *u, enum bch_data_type type) { + u64 sectors = 0; + switch (type) { + case BCH_DATA_free: + case BCH_DATA_need_discard: + case BCH_DATA_need_gc_gens: + /* sectors are 0 for these types so calculate sectors for them */ + sectors = u->d[type].buckets * u->bucket_size; + break; + default: + sectors = u->d[type].sectors; + } + __dev_usage_type_to_text(out, bch2_data_types[type], u->bucket_size, u->d[type].buckets, - u->d[type].sectors, + sectors, u->d[type].fragmented); } |