From 0b90a24e11484548801a30a6ad4bbafc0b3d682f Mon Sep 17 00:00:00 2001 From: David Sterba Date: Sat, 30 Aug 2014 15:27:00 -0300 Subject: [PATCH] btrfs-progs: add options to tune units for fi df output The size unit format is a longstanding annoyance. This patch is based on the work of Nils and Alexandre and enhances the options. It's possible to select raw bytes, SI-based or IEC-based compact units (human frientdly) or a fixed base from kilobytes to terabytes. The default is compact human readable IEC-based, no change to current version. CC: Nils Steinger CC: Alexandre Oliva Reviewed-by: Hugo Mills Signed-off-by: David Sterba --- Documentation/btrfs-filesystem.txt | 25 +++++++++++- cmds-filesystem.c | 79 +++++++++++++++++++++++++++++++++----- utils.c | 52 +++++++++++++++++++------ utils.h | 30 +++++++++++---- 4 files changed, 155 insertions(+), 31 deletions(-) diff --git a/Documentation/btrfs-filesystem.txt b/Documentation/btrfs-filesystem.txt index b0d5820..6e63d2c 100644 --- a/Documentation/btrfs-filesystem.txt +++ b/Documentation/btrfs-filesystem.txt @@ -17,8 +17,31 @@ resizing, defragment. SUBCOMMAND ---------- -*df* [...]:: +*df* [options] :: Show space usage information for a mount point. ++ +`Options` ++ +-b|--raw:::: +raw numbers in bytes, without the 'B' suffix +-h:::: +print human friendly numbers, base 1024, this is the default +-H:::: +print human friendly numbers, base 1000 +--iec:::: +select the 1024 base for the following options, according to the IEC standard +--si:::: +select the 1000 base for the following options, according to the SI standard +-k|--kbytes:::: +show sizes in KiB, or kB with --si +-m|--mbytes:::: +show sizes in MiB, or mB with --si +-g|--gbytes:::: +show sizes in GiB, or gB with --si +-t|--tbytes:::: +show sizes in TiB, or tB with --si + +If conflicting options are passed, the last one takes precedence. *show* [--mounted|--all-devices||||