* [PATCH] btrfs-progs: qgroup: Remove support for specifying inherit type
@ 2017-12-19 10:53 Qu Wenruo
2017-12-20 0:34 ` Misono, Tomohiro
0 siblings, 1 reply; 3+ messages in thread
From: Qu Wenruo @ 2017-12-19 10:53 UTC (permalink / raw)
To: linux-btrfs; +Cc: dsterba
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 <wqu@suse.com>
---
cmds-subvolume.c | 21 ---------------------
qgroup.c | 42 ------------------------------------------
qgroup.h | 3 ---
3 files changed, 66 deletions(-)
diff --git a/cmds-subvolume.c b/cmds-subvolume.c
index dc626a6495e5..e0839da7d8f8 100644
--- a/cmds-subvolume.c
+++ b/cmds-subvolume.c
@@ -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);
}
diff --git a/qgroup.c b/qgroup.c
index 156825fd431d..e9158a260251 100644
--- a/qgroup.c
+++ b/qgroup.c
@@ -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;
-}
diff --git a/qgroup.h b/qgroup.h
index 875fbdf37f5f..3fc57123dc2d 100644
--- a/qgroup.h
+++ b/qgroup.h
@@ -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
--
2.15.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] btrfs-progs: qgroup: Remove support for specifying inherit type
2017-12-19 10:53 [PATCH] btrfs-progs: qgroup: Remove support for specifying inherit type Qu Wenruo
@ 2017-12-20 0:34 ` Misono, Tomohiro
2017-12-20 0:41 ` Qu Wenruo
0 siblings, 1 reply; 3+ messages in thread
From: Misono, Tomohiro @ 2017-12-20 0:34 UTC (permalink / raw)
To: Qu Wenruo, linux-btrfs; +Cc: dsterba
On 2017/12/19 19:53, Qu Wenruo wrote:
> 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 <wqu@suse.com>
> ---
> cmds-subvolume.c | 21 ---------------------
> qgroup.c | 42 ------------------------------------------
> qgroup.h | 3 ---
> 3 files changed, 66 deletions(-)
>
> diff --git a/cmds-subvolume.c b/cmds-subvolume.c
> index dc626a6495e5..e0839da7d8f8 100644
> --- a/cmds-subvolume.c
> +++ b/cmds-subvolume.c
> @@ -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) {
No harm, but we should remove "c:" from getopt() too.
Tomohiro
> @@ -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);
> }
> diff --git a/qgroup.c b/qgroup.c
> index 156825fd431d..e9158a260251 100644
> --- a/qgroup.c
> +++ b/qgroup.c
> @@ -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;
> -}
> diff --git a/qgroup.h b/qgroup.h
> index 875fbdf37f5f..3fc57123dc2d 100644
> --- a/qgroup.h
> +++ b/qgroup.h
> @@ -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
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] btrfs-progs: qgroup: Remove support for specifying inherit type
2017-12-20 0:34 ` Misono, Tomohiro
@ 2017-12-20 0:41 ` Qu Wenruo
0 siblings, 0 replies; 3+ messages in thread
From: Qu Wenruo @ 2017-12-20 0:41 UTC (permalink / raw)
To: Misono, Tomohiro, Qu Wenruo, linux-btrfs; +Cc: dsterba
[-- Attachment #1.1: Type: text/plain, Size: 3974 bytes --]
On 2017年12月20日 08:34, Misono, Tomohiro wrote:
> On 2017/12/19 19:53, Qu Wenruo wrote:
>> 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 <wqu@suse.com>
>> ---
>> cmds-subvolume.c | 21 ---------------------
>> qgroup.c | 42 ------------------------------------------
>> qgroup.h | 3 ---
>> 3 files changed, 66 deletions(-)
>>
>> diff --git a/cmds-subvolume.c b/cmds-subvolume.c
>> index dc626a6495e5..e0839da7d8f8 100644
>> --- a/cmds-subvolume.c
>> +++ b/cmds-subvolume.c
>> @@ -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) {
>
> No harm, but we should remove "c:" from getopt() too.
> Tomohiro
Oh, I forgot that.
Thanks for pointing this out,
Qu
>
>> @@ -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);
>> }
>> diff --git a/qgroup.c b/qgroup.c
>> index 156825fd431d..e9158a260251 100644
>> --- a/qgroup.c
>> +++ b/qgroup.c
>> @@ -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;
>> -}
>> diff --git a/qgroup.h b/qgroup.h
>> index 875fbdf37f5f..3fc57123dc2d 100644
>> --- a/qgroup.h
>> +++ b/qgroup.h
>> @@ -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 majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 520 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-12-20 0:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-19 10:53 [PATCH] btrfs-progs: qgroup: Remove support for specifying inherit type Qu Wenruo
2017-12-20 0:34 ` Misono, Tomohiro
2017-12-20 0:41 ` Qu Wenruo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox