diff --git a/cmds/qgroup.c b/cmds/qgroup.c index 20cc14aa..72d68d91 100644 --- a/cmds/qgroup.c +++ b/cmds/qgroup.c @@ -1687,47 +1687,6 @@ int btrfs_qgroup_inherit_add_group(struct btrfs_qgroup_inherit **inherit, char * return 0; } -int btrfs_qgroup_inherit_add_copy(struct btrfs_qgroup_inherit **inherit, char *arg, - int type) -{ - int ret; - u64 qgroup_src; - u64 qgroup_dst; - char *p; - int pos = 0; - - p = strchr(arg, ':'); - if (!p) { -bad: - error("invalid copy specification, missing separator :"); - return -EINVAL; - } - *p = 0; - qgroup_src = parse_qgroupid_or_path(arg); - qgroup_dst = parse_qgroupid_or_path(p + 1); - *p = ':'; - - if (!qgroup_src || !qgroup_dst) - goto bad; - - if (*inherit) - pos = (*inherit)->num_qgroups + - (*inherit)->num_ref_copies * 2 * type; - - ret = qgroup_inherit_realloc(inherit, 2, pos); - if (ret) - return ret; - - (*inherit)->qgroups[pos++] = qgroup_src; - (*inherit)->qgroups[pos++] = qgroup_dst; - - if (!type) - ++(*inherit)->num_ref_copies; - else - ++(*inherit)->num_excl_copies; - - return 0; -} static const char * const qgroup_cmd_group_usage[] = { "btrfs qgroup [options] ", NULL diff --git a/cmds/qgroup.h b/cmds/qgroup.h index db48c0c2..1fc10722 100644 --- a/cmds/qgroup.h +++ b/cmds/qgroup.h @@ -38,8 +38,6 @@ struct btrfs_qgroup_stats { int btrfs_qgroup_inherit_size(struct btrfs_qgroup_inherit *p); int btrfs_qgroup_inherit_add_group(struct btrfs_qgroup_inherit **inherit, char *arg); -int btrfs_qgroup_inherit_add_copy(struct btrfs_qgroup_inherit **inherit, char *arg, - int type); int btrfs_qgroup_query(int fd, u64 qgroupid, struct btrfs_qgroup_stats *stats); #endif diff --git a/cmds/subvolume.c b/cmds/subvolume.c index 30ddf178..00c5eacf 100644 --- a/cmds/subvolume.c +++ b/cmds/subvolume.c @@ -281,13 +281,6 @@ static int cmd_subvolume_create(const struct cmd_struct *cmd, int argc, char **a break; switch (c) { - case 'c': - ret = btrfs_qgroup_inherit_add_copy(&inherit, optarg, 0); - if (ret) { - retval = ret; - goto out; - } - break; case 'i': ret = btrfs_qgroup_inherit_add_group(&inherit, optarg); if (ret) { @@ -685,18 +678,11 @@ static int cmd_subvolume_snapshot(const struct cmd_struct *cmd, int argc, char * memset(&args, 0, sizeof(args)); optind = 0; while (1) { - int c = getopt(argc, argv, "c:i:r"); + int c = getopt(argc, argv, "i:r"); if (c < 0) break; switch (c) { - case 'c': - res = btrfs_qgroup_inherit_add_copy(&inherit, optarg, 0); - if (res) { - retval = res; - goto out; - } - break; case 'i': res = btrfs_qgroup_inherit_add_group(&inherit, optarg); if (res) { @@ -707,13 +693,6 @@ static int cmd_subvolume_snapshot(const struct cmd_struct *cmd, int argc, char * case 'r': readonly = true; break; - case 'x': - res = btrfs_qgroup_inherit_add_copy(&inherit, optarg, 1); - if (res) { - retval = res; - goto out; - } - break; default: usage_unknown_option(cmd, argv); }