From 96aedd11217f805895afebd4725d4cabec1839c5 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Thu, 24 Jun 2021 23:04:59 +0200 Subject: [PATCH] btrfs-progs: fi usage: swap order of Used and zoned information The Used and Free should be together, while all the device information is in the first section. Example: Overall: Device size: 128.00GiB Device allocated: 24.00GiB Device unallocated: 104.00GiB Device missing: 0.00B Device zone unusable: 5.13MiB Device zone size: 256.00MiB Used: 213.33MiB Free (estimated): 111.79GiB (min: 111.79GiB) Free (statfs, df): 111.79GiB Data ratio: 1.00 Metadata ratio: 1.00 Global reserve: 25.58MiB (used: 16.00KiB) Multiple profiles: no Signed-off-by: David Sterba --- cmds/filesystem-usage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmds/filesystem-usage.c b/cmds/filesystem-usage.c index eb661544..50d8995e 100644 --- a/cmds/filesystem-usage.c +++ b/cmds/filesystem-usage.c @@ -621,8 +621,6 @@ static int print_filesystem_usage_overall(int fd, struct chunk_info *chunkinfo, pretty_size_mode(r_total_unused, unit_mode | UNITS_NEGATIVE)); printf(" Device missing:\t\t%*s\n", width, pretty_size_mode(r_total_missing, unit_mode)); - printf(" Used:\t\t\t%*s\n", width, - pretty_size_mode(r_total_used, unit_mode)); ret = ioctl(fd, BTRFS_IOC_GET_FEATURES, &feature_flags); if (ret == 0 && (feature_flags.incompat_flags & BTRFS_FEATURE_INCOMPAT_ZONED)) { u64 zone_size; @@ -633,6 +631,8 @@ static int print_filesystem_usage_overall(int fd, struct chunk_info *chunkinfo, printf(" Device zone size:\t\t%*s\n", width, pretty_size_mode(zone_size, unit_mode)); } + printf(" Used:\t\t\t%*s\n", width, + pretty_size_mode(r_total_used, unit_mode)); printf(" Free (estimated):\t\t%*s\t(", width, pretty_size_mode(free_estimated, unit_mode));