|
36 | 36 |
|
37 | 37 | static const char * const balance_cmd_group_usage[] = {
|
38 | 38 | "btrfs balance <command> [options] <path>",
|
39 |
| - "btrfs balance <path> (deprecated, use 'btrfs balance start')", |
40 | 39 | NULL
|
41 | 40 | };
|
42 | 41 |
|
@@ -862,37 +861,4 @@ static const struct cmd_group balance_cmd_group = {
|
862 | 861 | }
|
863 | 862 | };
|
864 | 863 |
|
865 |
| -static int cmd_balance(const struct cmd_struct *cmd, int argc, char **argv) |
866 |
| -{ |
867 |
| - bool old_syntax = true; |
868 |
| - |
869 |
| - /* |
870 |
| - * Exclude all valid subcommands from being potentially confused as path |
871 |
| - * for the obsolete syntax: btrfs balance <path> |
872 |
| - */ |
873 |
| - if (argc == 2) { |
874 |
| - for (int i = 0; balance_cmd_group.commands[i] != NULL; i++) { |
875 |
| - if (strcmp(argv[1], balance_cmd_group.commands[i]->token) == 0) { |
876 |
| - old_syntax = false; |
877 |
| - break; |
878 |
| - } |
879 |
| - } |
880 |
| - } else { |
881 |
| - old_syntax = false; |
882 |
| - } |
883 |
| - |
884 |
| - if (old_syntax) { |
885 |
| - struct btrfs_ioctl_balance_args args; |
886 |
| - |
887 |
| - warning("deprecated syntax, please use 'btrfs balance start'"); |
888 |
| - memset(&args, 0, sizeof(args)); |
889 |
| - args.flags |= BTRFS_BALANCE_TYPE_MASK; |
890 |
| - |
891 |
| - /* No enqueueing supported for the obsolete syntax */ |
892 |
| - return do_balance(argv[1], &args, 0, false); |
893 |
| - } |
894 |
| - |
895 |
| - return handle_command_group(cmd, argc, argv); |
896 |
| -} |
897 |
| - |
898 |
| -DEFINE_COMMAND(balance, "balance", cmd_balance, NULL, &balance_cmd_group, 0); |
| 864 | +DEFINE_GROUP_COMMAND_TOKEN(balance); |
0 commit comments