btrfs-progs: rename the qgroup structs to match the kernel

Now that the libbtrfs stuff has it's own local copy of ctree.h and
ioctl.h, let's rename these qgroup struct members to match the kernel
names, this way it'll make it easier to sync the kernel code into
btrfs-progs.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Josef Bacik 2023-04-19 17:13:50 -04:00 committed by David Sterba
parent 6636d9a6e2
commit bee10e7fc9
4 changed files with 64 additions and 70 deletions

View File

@ -870,12 +870,12 @@ static struct qgroup_count *alloc_count(struct btrfs_disk_key *key,
c->key = *key;
item = &c->diskinfo;
item->referenced = btrfs_qgroup_info_referenced(leaf, disk);
item->referenced = btrfs_qgroup_info_rfer(leaf, disk);
item->referenced_compressed =
btrfs_qgroup_info_referenced_compressed(leaf, disk);
item->exclusive = btrfs_qgroup_info_exclusive(leaf, disk);
btrfs_qgroup_info_rfer_cmpr(leaf, disk);
item->exclusive = btrfs_qgroup_info_excl(leaf, disk);
item->exclusive_compressed =
btrfs_qgroup_info_exclusive_compressed(leaf, disk);
btrfs_qgroup_info_excl_cmpr(leaf, disk);
INIT_LIST_HEAD(&c->groups);
INIT_LIST_HEAD(&c->members);
INIT_LIST_HEAD(&c->bad_list);
@ -1594,14 +1594,14 @@ static int repair_qgroup_info(struct btrfs_fs_info *info,
btrfs_set_qgroup_info_generation(path.nodes[0], info_item,
trans->transid);
btrfs_set_qgroup_info_referenced(path.nodes[0], info_item,
btrfs_set_qgroup_info_rfer(path.nodes[0], info_item,
count->info.referenced);
btrfs_set_qgroup_info_referenced_compressed(path.nodes[0], info_item,
btrfs_set_qgroup_info_rfer_cmpr(path.nodes[0], info_item,
count->info.referenced_compressed);
btrfs_set_qgroup_info_exclusive(path.nodes[0], info_item,
btrfs_set_qgroup_info_excl(path.nodes[0], info_item,
count->info.exclusive);
btrfs_set_qgroup_info_exclusive_compressed(path.nodes[0], info_item,
btrfs_set_qgroup_info_excl_cmpr(path.nodes[0], info_item,
count->info.exclusive_compressed);
btrfs_mark_buffer_dirty(path.nodes[0]);

View File

@ -807,12 +807,11 @@ static int update_qgroup_info(int fd, struct qgroup_lookup *qgroup_lookup, u64 q
return PTR_ERR(bq);
bq->info.generation = btrfs_stack_qgroup_info_generation(info);
bq->info.referenced = btrfs_stack_qgroup_info_referenced(info);
bq->info.referenced = btrfs_stack_qgroup_info_rfer(info);
bq->info.referenced_compressed =
btrfs_stack_qgroup_info_referenced_compressed(info);
bq->info.exclusive = btrfs_stack_qgroup_info_exclusive(info);
bq->info.exclusive_compressed =
btrfs_stack_qgroup_info_exclusive_compressed(info);
btrfs_stack_qgroup_info_rfer_cmpr(info);
bq->info.exclusive = btrfs_stack_qgroup_info_excl(info);
bq->info.exclusive_compressed = btrfs_stack_qgroup_info_excl_cmpr(info);
return 0;
}
@ -828,13 +827,10 @@ static int update_qgroup_limit(int fd, struct qgroup_lookup *qgroup_lookup,
return PTR_ERR(bq);
bq->limit.flags = btrfs_stack_qgroup_limit_flags(limit);
bq->limit.max_referenced =
btrfs_stack_qgroup_limit_max_referenced(limit);
bq->limit.max_exclusive =
btrfs_stack_qgroup_limit_max_exclusive(limit);
bq->limit.rsv_referenced =
btrfs_stack_qgroup_limit_rsv_referenced(limit);
bq->limit.rsv_exclusive = btrfs_stack_qgroup_limit_rsv_exclusive(limit);
bq->limit.max_referenced = btrfs_stack_qgroup_limit_max_rfer(limit);
bq->limit.max_exclusive = btrfs_stack_qgroup_limit_max_excl(limit);
bq->limit.rsv_referenced = btrfs_stack_qgroup_limit_rsv_rfer(limit);
bq->limit.rsv_exclusive = btrfs_stack_qgroup_limit_rsv_excl(limit);
return 0;
}

View File

@ -1103,10 +1103,10 @@ struct btrfs_free_space_info {
struct btrfs_qgroup_info_item {
__le64 generation;
__le64 referenced;
__le64 referenced_compressed;
__le64 exclusive;
__le64 exclusive_compressed;
__le64 rfer;
__le64 rfer_cmpr;
__le64 excl;
__le64 excl_cmpr;
} __attribute__ ((__packed__));
/* flags definition for qgroup limits */
@ -1119,10 +1119,10 @@ struct btrfs_qgroup_info_item {
struct btrfs_qgroup_limit_item {
__le64 flags;
__le64 max_referenced;
__le64 max_exclusive;
__le64 rsv_referenced;
__le64 rsv_exclusive;
__le64 max_rfer;
__le64 max_excl;
__le64 rsv_rfer;
__le64 rsv_excl;
} __attribute__ ((__packed__));
struct btrfs_space_info {
@ -2466,48 +2466,48 @@ BTRFS_SETGET_STACK_FUNCS(stack_qgroup_status_rescan,
/* btrfs_qgroup_info_item */
BTRFS_SETGET_FUNCS(qgroup_info_generation, struct btrfs_qgroup_info_item,
generation, 64);
BTRFS_SETGET_FUNCS(qgroup_info_referenced, struct btrfs_qgroup_info_item,
referenced, 64);
BTRFS_SETGET_FUNCS(qgroup_info_referenced_compressed,
struct btrfs_qgroup_info_item, referenced_compressed, 64);
BTRFS_SETGET_FUNCS(qgroup_info_exclusive, struct btrfs_qgroup_info_item,
exclusive, 64);
BTRFS_SETGET_FUNCS(qgroup_info_exclusive_compressed,
struct btrfs_qgroup_info_item, exclusive_compressed, 64);
BTRFS_SETGET_FUNCS(qgroup_info_rfer, struct btrfs_qgroup_info_item,
rfer, 64);
BTRFS_SETGET_FUNCS(qgroup_info_rfer_cmpr,
struct btrfs_qgroup_info_item, rfer_cmpr, 64);
BTRFS_SETGET_FUNCS(qgroup_info_excl, struct btrfs_qgroup_info_item,
excl, 64);
BTRFS_SETGET_FUNCS(qgroup_info_excl_cmpr,
struct btrfs_qgroup_info_item, excl_cmpr, 64);
BTRFS_SETGET_STACK_FUNCS(stack_qgroup_info_generation,
struct btrfs_qgroup_info_item, generation, 64);
BTRFS_SETGET_STACK_FUNCS(stack_qgroup_info_referenced,
struct btrfs_qgroup_info_item, referenced, 64);
BTRFS_SETGET_STACK_FUNCS(stack_qgroup_info_referenced_compressed,
struct btrfs_qgroup_info_item, referenced_compressed, 64);
BTRFS_SETGET_STACK_FUNCS(stack_qgroup_info_exclusive,
struct btrfs_qgroup_info_item, exclusive, 64);
BTRFS_SETGET_STACK_FUNCS(stack_qgroup_info_exclusive_compressed,
struct btrfs_qgroup_info_item, exclusive_compressed, 64);
BTRFS_SETGET_STACK_FUNCS(stack_qgroup_info_rfer,
struct btrfs_qgroup_info_item, rfer, 64);
BTRFS_SETGET_STACK_FUNCS(stack_qgroup_info_rfer_cmpr,
struct btrfs_qgroup_info_item, rfer_cmpr, 64);
BTRFS_SETGET_STACK_FUNCS(stack_qgroup_info_excl,
struct btrfs_qgroup_info_item, excl, 64);
BTRFS_SETGET_STACK_FUNCS(stack_qgroup_info_excl_cmpr,
struct btrfs_qgroup_info_item, excl_cmpr, 64);
/* btrfs_qgroup_limit_item */
BTRFS_SETGET_FUNCS(qgroup_limit_flags, struct btrfs_qgroup_limit_item,
flags, 64);
BTRFS_SETGET_FUNCS(qgroup_limit_max_referenced, struct btrfs_qgroup_limit_item,
max_referenced, 64);
BTRFS_SETGET_FUNCS(qgroup_limit_max_exclusive, struct btrfs_qgroup_limit_item,
max_exclusive, 64);
BTRFS_SETGET_FUNCS(qgroup_limit_rsv_referenced, struct btrfs_qgroup_limit_item,
rsv_referenced, 64);
BTRFS_SETGET_FUNCS(qgroup_limit_rsv_exclusive, struct btrfs_qgroup_limit_item,
rsv_exclusive, 64);
BTRFS_SETGET_FUNCS(qgroup_limit_max_rfer, struct btrfs_qgroup_limit_item,
max_rfer, 64);
BTRFS_SETGET_FUNCS(qgroup_limit_max_excl, struct btrfs_qgroup_limit_item,
max_excl, 64);
BTRFS_SETGET_FUNCS(qgroup_limit_rsv_rfer, struct btrfs_qgroup_limit_item,
rsv_rfer, 64);
BTRFS_SETGET_FUNCS(qgroup_limit_rsv_excl, struct btrfs_qgroup_limit_item,
rsv_excl, 64);
BTRFS_SETGET_STACK_FUNCS(stack_qgroup_limit_flags,
struct btrfs_qgroup_limit_item, flags, 64);
BTRFS_SETGET_STACK_FUNCS(stack_qgroup_limit_max_referenced,
struct btrfs_qgroup_limit_item, max_referenced, 64);
BTRFS_SETGET_STACK_FUNCS(stack_qgroup_limit_max_exclusive,
struct btrfs_qgroup_limit_item, max_exclusive, 64);
BTRFS_SETGET_STACK_FUNCS(stack_qgroup_limit_rsv_referenced,
struct btrfs_qgroup_limit_item, rsv_referenced, 64);
BTRFS_SETGET_STACK_FUNCS(stack_qgroup_limit_rsv_exclusive,
struct btrfs_qgroup_limit_item, rsv_exclusive, 64);
BTRFS_SETGET_STACK_FUNCS(stack_qgroup_limit_max_rfer,
struct btrfs_qgroup_limit_item, max_rfer, 64);
BTRFS_SETGET_STACK_FUNCS(stack_qgroup_limit_max_excl,
struct btrfs_qgroup_limit_item, max_excl, 64);
BTRFS_SETGET_STACK_FUNCS(stack_qgroup_limit_rsv_rfer,
struct btrfs_qgroup_limit_item, rsv_rfer, 64);
BTRFS_SETGET_STACK_FUNCS(stack_qgroup_limit_rsv_excl,
struct btrfs_qgroup_limit_item, rsv_excl, 64);
/* btrfs_balance_item */
BTRFS_SETGET_FUNCS(balance_item_flags, struct btrfs_balance_item, flags, 64);

View File

@ -1089,12 +1089,10 @@ static void print_qgroup_info(struct extent_buffer *eb, int slot)
"\t\treferenced %llu referenced_compressed %llu\n"
"\t\texclusive %llu exclusive_compressed %llu\n",
(unsigned long long)btrfs_qgroup_info_generation(eb, qg_info),
(unsigned long long)btrfs_qgroup_info_referenced(eb, qg_info),
(unsigned long long)btrfs_qgroup_info_referenced_compressed(eb,
qg_info),
(unsigned long long)btrfs_qgroup_info_exclusive(eb, qg_info),
(unsigned long long)btrfs_qgroup_info_exclusive_compressed(eb,
qg_info));
(unsigned long long)btrfs_qgroup_info_rfer(eb, qg_info),
(unsigned long long)btrfs_qgroup_info_rfer_cmpr(eb, qg_info),
(unsigned long long)btrfs_qgroup_info_excl(eb, qg_info),
(unsigned long long)btrfs_qgroup_info_excl_cmpr(eb, qg_info));
}
static void print_qgroup_limit(struct extent_buffer *eb, int slot)
@ -1106,10 +1104,10 @@ static void print_qgroup_limit(struct extent_buffer *eb, int slot)
"\t\tmax_referenced %lld max_exclusive %lld\n"
"\t\trsv_referenced %lld rsv_exclusive %lld\n",
(unsigned long long)btrfs_qgroup_limit_flags(eb, qg_limit),
(long long)btrfs_qgroup_limit_max_referenced(eb, qg_limit),
(long long)btrfs_qgroup_limit_max_exclusive(eb, qg_limit),
(long long)btrfs_qgroup_limit_rsv_referenced(eb, qg_limit),
(long long)btrfs_qgroup_limit_rsv_exclusive(eb, qg_limit));
(long long)btrfs_qgroup_limit_max_rfer(eb, qg_limit),
(long long)btrfs_qgroup_limit_max_excl(eb, qg_limit),
(long long)btrfs_qgroup_limit_rsv_rfer(eb, qg_limit),
(long long)btrfs_qgroup_limit_rsv_excl(eb, qg_limit));
}
static void print_persistent_item(struct extent_buffer *eb, void *ptr,