mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
synced 2024-12-04 01:24:20 +08:00
btrfs-progs: fi usage: print ratio of used/total for each chunk type
This is based on idea from Stanislaw Gruszka to print the ratio, originally suggested for the 'fi df', but we don't want to add new things there and let people use 'fi us' instead. The new output fits there and is printed by default without options: Example output: $ btrfs fi us /mnt [...] Data,single: Size:339.00GiB, Used:172.05GiB (50.75%) Metadata,single: Size:7.00GiB, Used:3.41GiB (48.70%) System,single: Size:32.00MiB, Used:64.00KiB (0.20%) Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
a855c63625
commit
ca210687f8
@ -932,8 +932,10 @@ static void _cmd_filesystem_usage_linear(unsigned unit_mode,
|
|||||||
r_mode,
|
r_mode,
|
||||||
pretty_size_mode(sargs->spaces[i].total_bytes,
|
pretty_size_mode(sargs->spaces[i].total_bytes,
|
||||||
unit_mode));
|
unit_mode));
|
||||||
printf("Used:%s\n",
|
printf("Used:%s (%.2f%%)\n",
|
||||||
pretty_size_mode(sargs->spaces[i].used_bytes, unit_mode));
|
pretty_size_mode(sargs->spaces[i].used_bytes, unit_mode),
|
||||||
|
100.0f * sargs->spaces[i].used_bytes /
|
||||||
|
(sargs->spaces[i].total_bytes + 1));
|
||||||
print_chunk_device(flags, info_ptr, info_count,
|
print_chunk_device(flags, info_ptr, info_count,
|
||||||
device_info_ptr, device_info_count, unit_mode);
|
device_info_ptr, device_info_count, unit_mode);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user