aboutsummaryrefslogtreecommitdiffstats
path: root/cmds-device.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2014-04-24 18:32:27 +0200
committerDavid Sterba <dsterba@suse.cz>2014-12-04 16:48:11 +0100
commitc7b5293d8d7e3cd5c883a11f979c391fdb45230b (patch)
treecfaa3061aff52f680a012b363a902e9ae9e9e6b8 /cmds-device.c
parent78f2bb9e8d89f60a9c6fbc447ebc1789ed9f3643 (diff)
downloadbtrfs-progs-c7b5293d8d7e3cd5c883a11f979c391fdb45230b.tar.gz
btrfs-progs-c7b5293d8d7e3cd5c883a11f979c391fdb45230b.tar.xz
btrfs-progs-c7b5293d8d7e3cd5c883a11f979c391fdb45230b.zip
btrfs-progs: Print more info about device sizes
The entire device size may not be available to the filesystem, eg. if it's modified via resize. Print this information if it can be obtained from the DEV_INFO ioctl. Print the device ID on the same line as the device name and move size to the next line. Sample: /dev/sda7, ID: 3 Device size: 10.00GiB FS occupied: 5.00GiB Data,RAID10: 512.00MiB Metadata,RAID10: 512.00MiB System,RAID10: 4.00MiB Unallocated: 9.00GiB Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'cmds-device.c')
-rw-r--r--cmds-device.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmds-device.c b/cmds-device.c
index 2fe33eb..546db6d 100644
--- a/cmds-device.c
+++ b/cmds-device.c
@@ -474,9 +474,9 @@ static int _cmd_device_usage(int fd, char *path, int mode)
}
for (i = 0; i < device_info_count; i++) {
- printf("%s\t%10s\n", device_info_ptr[i].path,
- df_pretty_sizes(device_info_ptr[i].size, mode));
-
+ printf("%s, ID: %llu\n", device_info_ptr[i].path,
+ device_info_ptr[i].devid);
+ print_device_sizes(fd, &device_info_ptr[i], mode);
print_device_chunks(fd, device_info_ptr[i].devid,
device_info_ptr[i].size,
info_ptr, info_count,