path: root/cmds-filesystem.c
diff options
authorMark Fasheh <mfasheh@suse.de>2016-01-20 13:49:26 -0800
committerDavid Sterba <dsterba@suse.com>2016-03-14 13:42:47 +0100
commita2e7ff1eae45ad77d80d31d8b793021364573a74 (patch)
tree3449d277507736b67768ef96c7b4f69f91162c03 /cmds-filesystem.c
parentb5e7979ad27146d8f225b3bc7866c1b17942b6a0 (diff)
btrfs-progs: filesystem: add 'du' command
'btrfs du' differs from regular du in that it will work to resolve which blocks are shared between files in its list. This gives the user a more accurate bytecount from which they can make decisions regarding management of their file space. We still print a total number of bytes counted (like regular du), but also print the number of bytes which were found to have been shared amongst the file set provided. From there it becomes trivial to calculate how much space is exclusively owned. Signed-off-by: Mark Fasheh <mfasheh@suse.de> [ rename files to reflect the filesystem command group, add GPL v2 file headers ] Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-filesystem.c')
1 files changed, 2 insertions, 1 deletions
diff --git a/cmds-filesystem.c b/cmds-filesystem.c
index 4c6e856..9e5ccab 100644
--- a/cmds-filesystem.c
+++ b/cmds-filesystem.c
@@ -37,7 +37,7 @@
#include "cmds-fi-usage.h"
#include "list_sort.h"
#include "disk-io.h"
+#include "cmds-fi-du.h"
* for btrfs fi show, we maintain a hash of fsids we've already printed.
@@ -1270,6 +1270,7 @@ static const char filesystem_cmd_group_info[] =
const struct cmd_group filesystem_cmd_group = {
filesystem_cmd_group_usage, filesystem_cmd_group_info, {
{ "df", cmd_filesystem_df, cmd_filesystem_df_usage, NULL, 0 },
+ { "du", cmd_filesystem_du, cmd_filesystem_du_usage, NULL, 0 },
{ "show", cmd_filesystem_show, cmd_filesystem_show_usage, NULL,
0 },
{ "sync", cmd_filesystem_sync, cmd_filesystem_sync_usage, NULL,