@@ -11271,7 +11271,7 @@ static bool is_super_size_valid(struct btrfs_fs_info *fs_info)
struct btrfs_device *dev;
struct list_head *dev_list = &fs_info->fs_devices->devices;
u64 total_bytes = 0;
- u64 super_bytes = btrfs_super_total_bytes(fs_info->super_copy);
+ u64 super_bytes = btrfs_stack_super_total_bytes(fs_info->super_copy);
list_for_each_entry(dev, dev_list, dev_list)
total_bytes += dev->total_bytes;
@@ -390,7 +390,7 @@ static void dump_superblock(struct btrfs_super_block *sb, int full)
printf("log_root_level\t\t%llu\n",
(unsigned long long)btrfs_stack_super_log_root_level(sb));
printf("total_bytes\t\t%llu\n",
- (unsigned long long)btrfs_super_total_bytes(sb));
+ (unsigned long long)btrfs_stack_super_total_bytes(sb));
printf("bytes_used\t\t%llu\n",
(unsigned long long)btrfs_super_bytes_used(sb));
printf("sectorsize\t\t%llu\n",
@@ -575,7 +575,7 @@ no_node:
print_old_roots(info->super_copy);
printf("total bytes %llu\n",
- (unsigned long long)btrfs_super_total_bytes(info->super_copy));
+ (unsigned long long)btrfs_stack_super_total_bytes(info->super_copy));
printf("bytes used %llu\n",
(unsigned long long)btrfs_super_bytes_used(info->super_copy));
uuidbuf[BTRFS_UUID_UNPARSED_SIZE - 1] = '\0';
@@ -120,7 +120,7 @@ static int setup_temp_super(int fd, struct btrfs_mkfs_config *cfg,
btrfs_set_stack_super_generation(super, 1);
btrfs_set_stack_super_root(super, root_bytenr);
btrfs_set_stack_super_chunk_root(super, chunk_bytenr);
- btrfs_set_super_total_bytes(super, cfg->num_bytes);
+ btrfs_set_stack_super_total_bytes(super, cfg->num_bytes);
/*
* Temporary filesystem will only have 6 tree roots:
* chunk tree, root tree, extent_tree, device tree, fs tree
@@ -2184,7 +2184,7 @@ BTRFS_SETGET_STACK_FUNCS(stack_super_log_root_transid, struct btrfs_super_block,
log_root_transid, 64);
BTRFS_SETGET_STACK_FUNCS(stack_super_log_root_level, struct btrfs_super_block,
log_root_level, 8);
-BTRFS_SETGET_STACK_FUNCS(super_total_bytes, struct btrfs_super_block,
+BTRFS_SETGET_STACK_FUNCS(stack_super_total_bytes, struct btrfs_super_block,
total_bytes, 64);
BTRFS_SETGET_STACK_FUNCS(super_bytes_used, struct btrfs_super_block,
bytes_used, 64);
@@ -1358,7 +1358,7 @@ static int check_super(struct btrfs_super_block *sb, unsigned sbflags)
error("sectorsize unaligned: %u", btrfs_super_sectorsize(sb));
goto error_out;
}
- if (btrfs_super_total_bytes(sb) == 0) {
+ if (btrfs_stack_super_total_bytes(sb) == 0) {
error("invalid total_bytes 0");
goto error_out;
}
@@ -3400,7 +3400,7 @@ int btrfs_make_block_groups(struct btrfs_trans_handle *trans,
block_group_cache = &fs_info->block_group_cache;
chunk_objectid = BTRFS_FIRST_CHUNK_TREE_OBJECTID;
- total_bytes = btrfs_super_total_bytes(fs_info->super_copy);
+ total_bytes = btrfs_stack_super_total_bytes(fs_info->super_copy);
group_align = 64 * fs_info->sectorsize;
cur_start = 0;
@@ -164,7 +164,7 @@ int make_btrfs(int fd, struct btrfs_mkfs_config *cfg)
btrfs_set_stack_super_generation(&super, 1);
btrfs_set_stack_super_root(&super, cfg->blocks[MKFS_ROOT_TREE]);
btrfs_set_stack_super_chunk_root(&super, cfg->blocks[MKFS_CHUNK_TREE]);
- btrfs_set_super_total_bytes(&super, num_bytes);
+ btrfs_set_stack_super_total_bytes(&super, num_bytes);
btrfs_set_super_bytes_used(&super, 6 * cfg->nodesize);
btrfs_set_super_sectorsize(&super, cfg->sectorsize);
super.__unused_leafsize = cpu_to_le32(cfg->nodesize);
@@ -1938,7 +1938,8 @@ raid_groups:
printf("Node size: %u\n", nodesize);
printf("Sector size: %u\n", sectorsize);
printf("Filesystem size: %s\n",
- pretty_size(btrfs_super_total_bytes(fs_info->super_copy)));
+ pretty_size(btrfs_stack_super_total_bytes(
+ fs_info->super_copy)));
printf("Block group profiles:\n");
if (allocation.data)
printf(" Data: %-8s %16s\n",
@@ -228,8 +228,9 @@ int btrfs_add_to_fsid(struct btrfs_trans_handle *trans,
if (ret)
goto out;
- fs_total_bytes = btrfs_super_total_bytes(super) + device_total_bytes;
- btrfs_set_super_total_bytes(super, fs_total_bytes);
+ fs_total_bytes = btrfs_stack_super_total_bytes(super) +
+ device_total_bytes;
+ btrfs_set_stack_super_total_bytes(super, fs_total_bytes);
num_devs = btrfs_super_num_devices(super) + 1;
btrfs_set_super_num_devices(super, num_devs);
@@ -951,7 +951,8 @@ int btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
}
/* we don't want a chunk larger than 10% of the FS */
- percent_max = div_factor(btrfs_super_total_bytes(info->super_copy), 1);
+ percent_max = div_factor(btrfs_stack_super_total_bytes(
+ info->super_copy), 1);
max_chunk_size = min(percent_max, max_chunk_size);
again:
@@ -2438,7 +2439,7 @@ int btrfs_fix_super_size(struct btrfs_fs_info *fs_info)
struct btrfs_device *device;
struct list_head *dev_list = &fs_info->fs_devices->devices;
u64 total_bytes = 0;
- u64 old_bytes = btrfs_super_total_bytes(fs_info->super_copy);
+ u64 old_bytes = btrfs_stack_super_total_bytes(fs_info->super_copy);
int ret;
list_for_each_entry(device, dev_list, dev_list) {
@@ -2458,7 +2459,7 @@ int btrfs_fix_super_size(struct btrfs_fs_info *fs_info)
if (total_bytes == old_bytes)
return 0;
- btrfs_set_super_total_bytes(fs_info->super_copy, total_bytes);
+ btrfs_set_stack_super_total_bytes(fs_info->super_copy, total_bytes);
/* Commit transaction to update all super blocks */
trans = btrfs_start_transaction(fs_info->tree_root, 1);
The super_total_bytes set/get function defined by BTRFS_SETGET_STACK_FUNCS macro is missing the prefix stack. Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com> --- cmds-check.c | 2 +- cmds-inspect-dump-super.c | 2 +- cmds-inspect-dump-tree.c | 2 +- convert/common.c | 2 +- ctree.h | 2 +- disk-io.c | 2 +- extent-tree.c | 2 +- mkfs/common.c | 2 +- mkfs/main.c | 3 ++- utils.c | 5 +++-- volumes.c | 7 ++++--- 11 files changed, 17 insertions(+), 14 deletions(-)