add missing units to --examine

Within the output of "mdadm --examine", there are three sizes reported
on adjacent lines. For example:

$ sudo mdadm --examine /dev/md3
[...]
 Avail Dev Size : 17580545024 (8383.06 GiB 9001.24 GB)
     Array Size : 17580417024 (16765.99 GiB 18002.35 GB)
  Used Dev Size : 11720278016 (5588.66 GiB 6000.78 GB)
[...]

This can be confusing, since the first and third line are in 512-byte
sectors, and the second is in KiB.

Add units to avoid ambiguity.

(I don't particularly like the "KiB" notation, but it is at least
unambiguous.)

Signed-off-by: Corey Hickey <bugfood-c@fatooh.org>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
This commit is contained in:
Corey Hickey 2019-02-11 17:42:27 -08:00 committed by Jes Sorensen
parent 2b57e4fe04
commit 227aeaa872
1 changed files with 3 additions and 3 deletions

View File

@ -360,7 +360,7 @@ static void examine_super1(struct supertype *st, char *homehost)
printf(" Raid Level : %s\n", c?c:"-unknown-");
printf(" Raid Devices : %d\n", __le32_to_cpu(sb->raid_disks));
printf("\n");
printf(" Avail Dev Size : %llu%s\n",
printf(" Avail Dev Size : %llu sectors%s\n",
(unsigned long long)__le64_to_cpu(sb->data_size),
human_size(__le64_to_cpu(sb->data_size)<<9));
if (__le32_to_cpu(sb->level) > 0) {
@ -378,11 +378,11 @@ static void examine_super1(struct supertype *st, char *homehost)
if (ddsks) {
long long asize = __le64_to_cpu(sb->size);
asize = (asize << 9) * ddsks / ddsks_denom;
printf(" Array Size : %llu%s\n",
printf(" Array Size : %llu KiB%s\n",
asize >> 10, human_size(asize));
}
if (sb->size != sb->data_size)
printf(" Used Dev Size : %llu%s\n",
printf(" Used Dev Size : %llu sectors%s\n",
(unsigned long long)__le64_to_cpu(sb->size),
human_size(__le64_to_cpu(sb->size)<<9));
}