btrfs-progs: scrub status: with --si, show rate in metric units

This makes btrfs scrub status --si show the Rate in metric units as well.

Before:

Total to scrub:   877.65GB
Rate:             609.22MiB/s

After:

Total to scrub:   877.65GB
Rate:             638.81MB/s

Pull-request: #832
Author: Ivan Kozik <ivan@ludios.org>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Ivan Kozik 2024-07-01 05:09:41 +00:00 committed by David Sterba
parent 5c32511a5c
commit ec3c842859
1 changed files with 2 additions and 2 deletions

View File

@ -220,10 +220,10 @@ static void print_scrub_summary(struct btrfs_scrub_progress *p, struct scrub_sta
pr_verbose(LOG_DEFAULT, "\n");
} else {
pr_verbose(LOG_DEFAULT, "Rate: %s/s",
pretty_size(bytes_per_sec));
pretty_size_mode(bytes_per_sec, unit_mode));
if (limit > 1)
pr_verbose(LOG_DEFAULT, " (limit %s/s)",
pretty_size(limit));
pretty_size_mode(limit, unit_mode));
else if (limit == 1)
pr_verbose(LOG_DEFAULT, " (some device limits set)");
pr_verbose(LOG_DEFAULT, "\n");