btrfs-progs: qgroup: Remove support for specifying inherit type
PATCH 1/1 btrfs-progs: qgroup: Remove support for specifying inherit type
Since kernel is deprecating the support for specifying inherit type, remove the support in btrfs-progs too.
Thankfully, the options for qgroup inheritance is hidden and not documented, so user shouldn't be affected at all.
--- cmds-subvolume.c | 21 --------------------- qgroup.c | 42 ------------------------------------------ qgroup.h | 3 --- 3 files changed, 66 deletions(-)
cmds-subvolume.c +0 -21
@@ -134,13 +134,6 @@ static int cmd_subvol_create(int argc, char **argv)break ;switch (c) { -case 'c' : - res =qgroup_inherit_add_copy (&inherit, optarg,0 ); -if (res) { - retval = res; - goto out; - } -break ;case 'i' : res =qgroup_inherit_add_group (&inherit, optarg);if (res) {
@@ -670,13 +663,6 @@ static int cmd_subvol_snapshot(int argc, char **argv)break ;switch (c) { -case 'c' : - res =qgroup_inherit_add_copy (&inherit, optarg,0 ); -if (res) { - retval = res; - goto out; - } -break ;case 'i' : res =qgroup_inherit_add_group (&inherit, optarg);if (res) {
@@ -687,13 +673,6 @@ static int cmd_subvol_snapshot(int argc, char **argv)case 'r' : readonly =1 ;break ; -case 'x' : - res =qgroup_inherit_add_copy (&inherit, optarg,1 ); -if (res) { - retval = res; - goto out; - } -break ;default :usage (cmd_subvol_snapshot_usage); }
qgroup.c +0 -42
45 lines not on this page · raw message
qgroup.h +0 -3
@@ -92,7 +92,4 @@ int btrfs_qgroup_setup_comparer(struct btrfs_qgroup_comparer_set **comp_set, int is_descending);int qgroup_inherit_size (struct btrfs_qgroup_inherit *p);int qgroup_inherit_add_group (struct btrfs_qgroup_inherit **inherit,char *arg); -int qgroup_inherit_add_copy (struct btrfs_qgroup_inherit **inherit,char *arg, -int type); -#endif
Signature · 1 line
2.15.1
Quoted 21 lines · Qu Wenruo
Since kernel is deprecating the support for specifying inherit type, remove the support in btrfs-progs too.
Thankfully, the options for qgroup inheritance is hidden and not documented, so user shouldn't be affected at all.
Signed-off-by Qu Wenruo <[email protected]>--- cmds-subvolume.c | 21 --------------------- qgroup.c | 42 ------------------------------------------ qgroup.h | 3 --- 3 files changed, 66 deletions(-)cmds-subvolume.c +0
-0@@ -134,13 +134,6 @@ static int cmd_subvol_create(int argc, char **argv)break ;switch (c) {
cmds-subvolume.c static int cmd_subvol_create(int argc, char **argv) · line 139
Quoted 10 lines
cmds-subvolume.c +0
-7-case 'c' : - res =qgroup_inherit_add_copy (&inherit, optarg,0 ); -if (res) { - retval = res; - goto out; - } -break ;case 'i' : res =qgroup_inherit_add_group (&inherit, optarg);if (res) {
No harm, but we should remove "c:" from getopt() too. Tomohiro
Quoted 91 lines
cmds-subvolume.c +0
-14@@ -670,13 +663,6 @@ static int cmd_subvol_snapshot(int argc, char **argv)break ;switch (c) { -case 'c' : - res =qgroup_inherit_add_copy (&inherit, optarg,0 ); -if (res) { - retval = res; - goto out; - } -break ;case 'i' : res =qgroup_inherit_add_group (&inherit, optarg);if (res) {@@ -687,13 +673,6 @@ static int cmd_subvol_snapshot(int argc, char **argv)case 'r' : readonly =1 ;break ; -case 'x' : - res =qgroup_inherit_add_copy (&inherit, optarg,1 ); -if (res) { - retval = res; - goto out; - } -break ;default :usage (cmd_subvol_snapshot_usage); }qgroup.c +0
-42@@ -1310,45 +1310,3 @@ int qgroup_inherit_add_group(struct btrfs_qgroup_inherit **inherit, char *arg)return 0 ; } - -int 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 (arg); - qgroup_dst =parse_qgroupid (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 ; -}qgroup.h +0
-3@@ -92,7 +92,4 @@ int btrfs_qgroup_setup_comparer(struct btrfs_qgroup_comparer_set **comp_set, int is_descending);int qgroup_inherit_size (struct btrfs_qgroup_inherit *p);int qgroup_inherit_add_group (struct btrfs_qgroup_inherit **inherit,char *arg); -int qgroup_inherit_add_copy (struct btrfs_qgroup_inherit **inherit,char *arg, -int type); -#endif
Quoted 21 lines · Tomohiro
Quoted 20 lines · Qu Wenruo
Since kernel is deprecating the support for specifying inherit type, remove the support in btrfs-progs too.
Thankfully, the options for qgroup inheritance is hidden and not documented, so user shouldn't be affected at all.
Signed-off-by Qu Wenruo <[email protected]>--- cmds-subvolume.c | 21 --------------------- qgroup.c | 42 ------------------------------------------ qgroup.h | 3 --- 3 files changed, 66 deletions(-)cmds-subvolume.c +0
-0@@ -134,13 +134,6 @@ static int cmd_subvol_create(int argc, char **argv)break ;
Quoted 14 lines
cmds-subvolume.c static int cmd_subvol_create(int argc, char **argv) · line 139
Quoted 11 lines
cmds-subvolume.c +0
-7switch (c) { -case 'c' : - res =qgroup_inherit_add_copy (&inherit, optarg,0 ); -if (res) { - retval = res; - goto out; - } -break ;case 'i' : res =qgroup_inherit_add_group (&inherit, optarg);if (res) {No harm, but we should remove "c:" from
getopt()too. Tomohiro
Oh, I forgot that.
Thanks for pointing this out,
Qu
Quoted 98 lines
Quoted 85 lines
cmds-subvolume.c +0
-14@@ -670,13 +663,6 @@ static int cmd_subvol_snapshot(int argc, char **argv)break ;switch (c) { -case 'c' : - res =qgroup_inherit_add_copy (&inherit, optarg,0 ); -if (res) { - retval = res; - goto out; - } -break ;case 'i' : res =qgroup_inherit_add_group (&inherit, optarg);if (res) {@@ -687,13 +673,6 @@ static int cmd_subvol_snapshot(int argc, char **argv)case 'r' : readonly =1 ;break ; -case 'x' : - res =qgroup_inherit_add_copy (&inherit, optarg,1 ); -if (res) { - retval = res; - goto out; - } -break ;default :usage (cmd_subvol_snapshot_usage); }qgroup.c +0
-42@@ -1310,45 +1310,3 @@ int qgroup_inherit_add_group(struct btrfs_qgroup_inherit **inherit, char *arg)return 0 ; } - -int 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 (arg); - qgroup_dst =parse_qgroupid (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 ; -}qgroup.h +0
-0qgroup.h int btrfs_qgroup_setup_comparer(struct btrfs_qgroup_comparer_set **comp_set, · line 95
Quoted 7 lines
qgroup.h +0
-3@@ -92,7 +92,4 @@ int btrfs_qgroup_setup_comparer(struct btrfs_qgroup_comparer_set **comp_set, int is_descending);int qgroup_inherit_size (struct btrfs_qgroup_inherit *p);int qgroup_inherit_add_group (struct btrfs_qgroup_inherit **inherit,char *arg); -int qgroup_inherit_add_copy (struct btrfs_qgroup_inherit **inherit,char *arg, -int type); -#endif --
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html