diff options
author | Chris Mason <chris.mason@oracle.com> | 2012-02-05 10:14:09 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2012-02-05 10:14:09 -0500 |
commit | e89c970f597bd8a7984aad89245e158fb82f512e (patch) | |
tree | 38e6307b0a902ce9c77d641dff468ac8a9968e81 /cmds-filesystem.c | |
parent | 8358341fdcc0504f16ac9fbc7ac63c095c5eb187 (diff) | |
parent | 6ffdac5e77017cd6d73dd79344eb37da8d1766d0 (diff) | |
download | btrfs-progs-e89c970f597bd8a7984aad89245e158fb82f512e.tar.gz |
Merge branch 'restriper' of git://github.com/idryomov/btrfs-progs
Diffstat (limited to 'cmds-filesystem.c')
-rw-r--r-- | cmds-filesystem.c | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/cmds-filesystem.c b/cmds-filesystem.c index 828ca0c..a2efb93 100644 --- a/cmds-filesystem.c +++ b/cmds-filesystem.c @@ -453,42 +453,6 @@ static int cmd_defrag(int argc, char **argv) return errors + 20; } -static const char * const cmd_balance_usage[] = { - "btrfs filesystem balance <path>", - "Balance the chunks across the device", - NULL -}; - -static int cmd_balance(int argc, char **argv) -{ - int fdmnt, ret=0, e; - struct btrfs_ioctl_vol_args args; - char *path; - - if (check_argc_exact(argc, 2)) - usage(cmd_balance_usage); - - path = argv[1]; - - fdmnt = open_file_or_dir(path); - if (fdmnt < 0) { - fprintf(stderr, "ERROR: can't access to '%s'\n", path); - return 12; - } - - memset(&args, 0, sizeof(args)); - ret = ioctl(fdmnt, BTRFS_IOC_BALANCE, &args); - e = errno; - close(fdmnt); - if(ret<0){ - fprintf(stderr, "ERROR: error during balancing '%s' - %s\n", - path, strerror(e)); - - return 19; - } - return 0; -} - static const char * const cmd_resize_usage[] = { "btrfs filesystem resize [+/-]<newsize>[gkm]|max <path>", "Resize a filesystem", @@ -559,7 +523,7 @@ const struct cmd_group filesystem_cmd_group = { { "show", cmd_show, cmd_show_usage, NULL, 0 }, { "sync", cmd_sync, cmd_sync_usage, NULL, 0 }, { "defragment", cmd_defrag, cmd_defrag_usage, NULL, 0 }, - { "balance", cmd_balance, cmd_balance_usage, NULL, 0 }, + { "balance", cmd_balance, NULL, &balance_cmd_group, 1 }, { "resize", cmd_resize, cmd_resize_usage, NULL, 0 }, { "label", cmd_label, cmd_label_usage, NULL, 0 }, { 0, 0, 0, 0, 0 }, |