summaryrefslogtreecommitdiff
path: root/cmds-filesystem.c
diff options
context:
space:
mode:
authorGoffredo Baroncelli <kreijack@libero.it>2014-02-13 20:19:01 +0100
committerDavid Sterba <dsterba@suse.cz>2014-12-04 16:48:09 +0100
commite12e91e8596de39802d30753a8afaf5be9e86fd3 (patch)
tree8373136801fd0fcc6e5a0f645f2feab1d65538d4 /cmds-filesystem.c
parent3d1ed6d152107b03c26935a8486af47e22685150 (diff)
btrfs-progs: Enhance the command btrfs filesystem df
Enhance the command "btrfs filesystem df" to show space usage information for a mount point(s). It shows also an estimation of the space available, on the basis of the current one used. Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it> [code moved under #if 0 instead of deletion] Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'cmds-filesystem.c')
-rw-r--r--cmds-filesystem.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmds-filesystem.c b/cmds-filesystem.c
index d3d744e0..b39424bf 100644
--- a/cmds-filesystem.c
+++ b/cmds-filesystem.c
@@ -36,6 +36,7 @@
#include "volumes.h"
#include "version.h"
#include "commands.h"
+#include "cmds-fi-disk_usage.h"
#include "list_sort.h"
#include "disk-io.h"
@@ -121,6 +122,7 @@ static const char * const filesystem_cmd_group_usage[] = {
NULL
};
+#if 0
static const char * const cmd_df_usage[] = {
"btrfs filesystem df [options] <path>",
"Show space usage information for a mount point",
@@ -135,6 +137,7 @@ static const char * const cmd_df_usage[] = {
"-t|--tbytes show sizes in TiB, or TB with --si",
NULL
};
+#endif
static int get_df(int fd, struct btrfs_ioctl_space_args **sargs_ret)
{
@@ -184,6 +187,7 @@ static int get_df(int fd, struct btrfs_ioctl_space_args **sargs_ret)
return 0;
}
+#if 0
static void print_df(struct btrfs_ioctl_space_args *sargs, unsigned unit_mode)
{
u64 i;
@@ -277,6 +281,7 @@ static int cmd_df(int argc, char **argv)
close_file_or_dir(fd, dirstream);
return !!ret;
}
+#endif
static int match_search_item_kernel(__u8 *fsid, char *mnt, char *label,
char *search)
@@ -1286,7 +1291,7 @@ static int cmd_label(int argc, char **argv)
const struct cmd_group filesystem_cmd_group = {
filesystem_cmd_group_usage, NULL, {
- { "df", cmd_df, cmd_df_usage, NULL, 0 },
+ { "df", cmd_filesystem_df, cmd_filesystem_df_usage, NULL, 0 },
{ "show", cmd_show, cmd_show_usage, NULL, 0 },
{ "sync", cmd_sync, cmd_sync_usage, NULL, 0 },
{ "defragment", cmd_defrag, cmd_defrag_usage, NULL, 0 },