btrfs-progs: cleanup filesystem/device usage code
authorDavid Sterba <dsterba@suse.cz>
Fri, 25 Apr 2014 17:39:11 +0000 (19:39 +0200)
committerDavid Sterba <dsterba@suse.cz>
Thu, 4 Dec 2014 15:48:11 +0000 (16:48 +0100)
commit0c67867530f6dd706eaa41a6eaa44245a3252a90
tree1e558b5887f65f1ffd27888e31737dd3fc005289
parent6312ac884361f719936cb25188fc6f91a28b905b
btrfs-progs: cleanup filesystem/device usage code

The main point of this is to load the device and chunk infos at one
place and pass down to the printers. The EPERM is handled separately, in
case kernel does not give us all the information about chunks or
devices, but we want to warn and print at least something.

For non-root users, 'filesystem usage' prints only the overall stats and
warns about RAID5/6.

The sole cleanup changes affect mostly the modified code and the related
functions, should be reasonably small.

Signed-off-by: David Sterba <dsterba@suse.cz>
cmds-device.c
cmds-fi-disk_usage.c
cmds-fi-disk_usage.h