btrfs-progs: enable negative numbers for unallocated device space
authorDavid Sterba <dsterba@suse.com>
Tue, 3 Jan 2017 17:26:43 +0000 (18:26 +0100)
committerDavid Sterba <dsterba@suse.com>
Wed, 25 Jan 2017 08:47:35 +0000 (09:47 +0100)
commitf49fb67a2552c14e4194b97ce34d3fbf5389a1ce
tree39f19935bbb53d21cd8c86c185bfd5bc82d19515
parent72ae343f772120ec52533e071e8bea58fd76ad3a
btrfs-progs: enable negative numbers for unallocated device space

The unallocated space is not calculated correctly when a device
deltion/replace is in progress. This appears as huge number, EiB-sized.
It's really a negative number, because we don't have entire information
available and mixing numbers that do and don't take the deleted device
size into account.

We have to query search ioctl to retrieve the missing information, also
this requires root access for the ioctl, so we still need a workaround
for non-root case. Here the negative numbers seem to be a bit more
practical than EiB numbers.

Signed-off-by: David Sterba <dsterba@suse.com>
cmds-fi-usage.c