mirror of
https://github.com/kdave/btrfs-progs
synced 2025-02-18 02:36:56 +00:00
btrfs-progs: add prefixes to exported qgroup helpers
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
353b55a5cf
commit
49671bf29e
@ -1362,7 +1362,7 @@ out:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int qgroup_inherit_size(struct btrfs_qgroup_inherit *p)
|
int btrfs_qgroup_inherit_size(struct btrfs_qgroup_inherit *p)
|
||||||
{
|
{
|
||||||
return sizeof(*p) + sizeof(p->qgroups[0]) *
|
return sizeof(*p) + sizeof(p->qgroups[0]) *
|
||||||
(p->num_qgroups + 2 * p->num_ref_copies +
|
(p->num_qgroups + 2 * p->num_ref_copies +
|
||||||
@ -1404,7 +1404,7 @@ qgroup_inherit_realloc(struct btrfs_qgroup_inherit **inherit, int n, int pos)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int qgroup_inherit_add_group(struct btrfs_qgroup_inherit **inherit, char *arg)
|
int btrfs_qgroup_inherit_add_group(struct btrfs_qgroup_inherit **inherit, char *arg)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
u64 qgroupid = parse_qgroupid_or_path(arg);
|
u64 qgroupid = parse_qgroupid_or_path(arg);
|
||||||
@ -1426,7 +1426,7 @@ int qgroup_inherit_add_group(struct btrfs_qgroup_inherit **inherit, char *arg)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int qgroup_inherit_add_copy(struct btrfs_qgroup_inherit **inherit, char *arg,
|
int btrfs_qgroup_inherit_add_copy(struct btrfs_qgroup_inherit **inherit, char *arg,
|
||||||
int type)
|
int type)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -91,9 +91,9 @@ struct btrfs_qgroup_stats {
|
|||||||
struct btrfs_qgroup_limit limit;
|
struct btrfs_qgroup_limit limit;
|
||||||
};
|
};
|
||||||
|
|
||||||
int qgroup_inherit_size(struct btrfs_qgroup_inherit *p);
|
int btrfs_qgroup_inherit_size(struct btrfs_qgroup_inherit *p);
|
||||||
int qgroup_inherit_add_group(struct btrfs_qgroup_inherit **inherit, char *arg);
|
int btrfs_qgroup_inherit_add_group(struct btrfs_qgroup_inherit **inherit, char *arg);
|
||||||
int qgroup_inherit_add_copy(struct btrfs_qgroup_inherit **inherit, char *arg,
|
int btrfs_qgroup_inherit_add_copy(struct btrfs_qgroup_inherit **inherit, char *arg,
|
||||||
int type);
|
int type);
|
||||||
int btrfs_qgroup_query(int fd, u64 qgroupid, struct btrfs_qgroup_stats *stats);
|
int btrfs_qgroup_query(int fd, u64 qgroupid, struct btrfs_qgroup_stats *stats);
|
||||||
|
|
||||||
|
@ -115,14 +115,14 @@ static int cmd_subvol_create(const struct cmd_struct *cmd,
|
|||||||
|
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'c':
|
case 'c':
|
||||||
res = qgroup_inherit_add_copy(&inherit, optarg, 0);
|
res = btrfs_qgroup_inherit_add_copy(&inherit, optarg, 0);
|
||||||
if (res) {
|
if (res) {
|
||||||
retval = res;
|
retval = res;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'i':
|
case 'i':
|
||||||
res = qgroup_inherit_add_group(&inherit, optarg);
|
res = btrfs_qgroup_inherit_add_group(&inherit, optarg);
|
||||||
if (res) {
|
if (res) {
|
||||||
retval = res;
|
retval = res;
|
||||||
goto out;
|
goto out;
|
||||||
@ -179,7 +179,7 @@ static int cmd_subvol_create(const struct cmd_struct *cmd,
|
|||||||
memset(&args, 0, sizeof(args));
|
memset(&args, 0, sizeof(args));
|
||||||
strncpy_null(args.name, newname);
|
strncpy_null(args.name, newname);
|
||||||
args.flags |= BTRFS_SUBVOL_QGROUP_INHERIT;
|
args.flags |= BTRFS_SUBVOL_QGROUP_INHERIT;
|
||||||
args.size = qgroup_inherit_size(inherit);
|
args.size = btrfs_qgroup_inherit_size(inherit);
|
||||||
args.qgroup_inherit = inherit;
|
args.qgroup_inherit = inherit;
|
||||||
|
|
||||||
res = ioctl(fddst, BTRFS_IOC_SUBVOL_CREATE_V2, &args);
|
res = ioctl(fddst, BTRFS_IOC_SUBVOL_CREATE_V2, &args);
|
||||||
@ -748,14 +748,14 @@ static int cmd_subvol_snapshot(const struct cmd_struct *cmd,
|
|||||||
|
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'c':
|
case 'c':
|
||||||
res = qgroup_inherit_add_copy(&inherit, optarg, 0);
|
res = btrfs_qgroup_inherit_add_copy(&inherit, optarg, 0);
|
||||||
if (res) {
|
if (res) {
|
||||||
retval = res;
|
retval = res;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'i':
|
case 'i':
|
||||||
res = qgroup_inherit_add_group(&inherit, optarg);
|
res = btrfs_qgroup_inherit_add_group(&inherit, optarg);
|
||||||
if (res) {
|
if (res) {
|
||||||
retval = res;
|
retval = res;
|
||||||
goto out;
|
goto out;
|
||||||
@ -765,7 +765,7 @@ static int cmd_subvol_snapshot(const struct cmd_struct *cmd,
|
|||||||
readonly = 1;
|
readonly = 1;
|
||||||
break;
|
break;
|
||||||
case 'x':
|
case 'x':
|
||||||
res = qgroup_inherit_add_copy(&inherit, optarg, 1);
|
res = btrfs_qgroup_inherit_add_copy(&inherit, optarg, 1);
|
||||||
if (res) {
|
if (res) {
|
||||||
retval = res;
|
retval = res;
|
||||||
goto out;
|
goto out;
|
||||||
@ -846,7 +846,7 @@ static int cmd_subvol_snapshot(const struct cmd_struct *cmd,
|
|||||||
args.fd = fd;
|
args.fd = fd;
|
||||||
if (inherit) {
|
if (inherit) {
|
||||||
args.flags |= BTRFS_SUBVOL_QGROUP_INHERIT;
|
args.flags |= BTRFS_SUBVOL_QGROUP_INHERIT;
|
||||||
args.size = qgroup_inherit_size(inherit);
|
args.size = btrfs_qgroup_inherit_size(inherit);
|
||||||
args.qgroup_inherit = inherit;
|
args.qgroup_inherit = inherit;
|
||||||
}
|
}
|
||||||
strncpy_null(args.name, newname);
|
strncpy_null(args.name, newname);
|
||||||
|
Loading…
Reference in New Issue
Block a user