From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ny.voidptr.de ([5.45.110.253]:35437 "EHLO ny.voidptr.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754251AbaHNVOK (ORCPT ); Thu, 14 Aug 2014 17:14:10 -0400 From: Nils Steinger To: linux-btrfs@vger.kernel.org Cc: Nils Steinger Subject: [PATCH v2] Add options to use a fixed unit for `filesystem df` instead of determining it automatically. Date: Thu, 14 Aug 2014 23:13:38 +0200 Message-Id: <1408050818-17184-2-git-send-email-nst@voidptr.de> In-Reply-To: <1408050818-17184-1-git-send-email-nst@voidptr.de> References: <1408044261-11234-1-git-send-email-nst@voidptr.de> <1408050818-17184-1-git-send-email-nst@voidptr.de> Sender: linux-btrfs-owner@vger.kernel.org List-ID: The automatic unit selection makes parsing the output of `filesystem df` unnecessarily difficult. Using the new options -b, -k, -m, and -g, the output unit can be set to bytes, kibi-, mebi-, and gibibytes respectively. Signed-off-by: Nils Steinger --- v2: Add options to btrfs-filesystem man page. Also removed invalid "[...]" placeholder in the process. Documentation/btrfs-filesystem.txt | 14 ++++++++- cmds-filesystem.c | 62 +++++++++++++++++++++++++++++++++----- utils.c | 30 ++++++++++++++++++ utils.h | 8 +++++ 4 files changed, 106 insertions(+), 8 deletions(-) diff --git a/Documentation/btrfs-filesystem.txt b/Documentation/btrfs-filesystem.txt index 0ee79cb..404474d 100644 --- a/Documentation/btrfs-filesystem.txt +++ b/Documentation/btrfs-filesystem.txt @@ -17,8 +17,20 @@ resizing, defragment. SUBCOMMAND ---------- -*df* [...]:: +*df* [-b|-k|-m|-g] :: Show space usage information for a mount point. ++ +By default, all values are scaled to the shortest three digit unit. You can +use the following options to set a fixed unit for all values: ++ +-b:::: +Display all values in bytes. +-k:::: +Display all values in kibibytes. +-m:::: +Display all values in mebibytes. +-g:::: +Display all values in gibibytes. *show* [--mounted|--all-devices||||