btrfs-progs: fi-usage: fix RAID10 raw disk usage
commit96af160a0111546f1a7dbad172c8802ca8309e21
authorHans van Kranenburg <hans@knorrie.org>
Sat, 2 Jun 2018 21:26:41 +0000 (2 23:26 +0200)
committerDavid Sterba <dsterba@suse.com>
Thu, 7 Jun 2018 14:37:40 +0000 (7 16:37 +0200)
treec310e5fc75b2de68dafa044b54c8b089b161907e
parent9ff39d48aafe83bd250d557180f931fd774a2586
btrfs-progs: fi-usage: fix RAID10 raw disk usage

In case of RAID10, fi usage is reporting half the amount of allocated
space and twice the amount of unallocated disk space. Let's fix this.

For example, a RAID10 chunk of 3GiB with num_stripes 6, half of the
stripes (dev extents) are a mirror of the other half, so the 3GiB of
actual data has to be divided by 3, and not 6 to get the size of each of
those device extents.

Signed-off-by: Hans van Kranenburg <hans@knorrie.org>
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-fi-usage.c