@@ -1475,7 +1475,7 @@ open_ctree_with_broken_chunk(struct recover_control *rc)
}
memcpy(fs_info->fsid, &disk_super->fsid, BTRFS_FSID_SIZE);
- fs_info->sectorsize = btrfs_super_sectorsize(disk_super);
+ fs_info->sectorsize = btrfs_stack_super_sectorsize(disk_super);
fs_info->nodesize = btrfs_super_nodesize(disk_super);
fs_info->stripesize = btrfs_super_stripesize(disk_super);
@@ -1534,7 +1534,7 @@ static int recover_prepare(struct recover_control *rc, char *path)
goto out_close_fd;
}
- rc->sectorsize = btrfs_super_sectorsize(sb);
+ rc->sectorsize = btrfs_stack_super_sectorsize(sb);
rc->nodesize = btrfs_super_nodesize(sb);
rc->generation = btrfs_stack_super_generation(sb);
rc->chunk_root_generation = btrfs_stack_super_chunk_root_generation(sb);
@@ -394,7 +394,7 @@ static void dump_superblock(struct btrfs_super_block *sb, int full)
printf("bytes_used\t\t%llu\n",
(unsigned long long)btrfs_stack_super_bytes_used(sb));
printf("sectorsize\t\t%llu\n",
- (unsigned long long)btrfs_super_sectorsize(sb));
+ (unsigned long long)btrfs_stack_super_sectorsize(sb));
printf("nodesize\t\t%llu\n",
(unsigned long long)btrfs_super_nodesize(sb));
printf("leafsize (deprecated)\t\t%u\n",
@@ -127,7 +127,7 @@ static int setup_temp_super(int fd, struct btrfs_mkfs_config *cfg,
* and csum tree.
*/
btrfs_set_stack_super_bytes_used(super, 6 * cfg->nodesize);
- btrfs_set_super_sectorsize(super, cfg->sectorsize);
+ btrfs_set_stack_super_sectorsize(super, cfg->sectorsize);
super->__unused_leafsize = cpu_to_le32(cfg->nodesize);
btrfs_set_super_nodesize(super, cfg->nodesize);
btrfs_set_super_stripesize(super, cfg->stripesize);
@@ -2188,7 +2188,7 @@ BTRFS_SETGET_STACK_FUNCS(stack_super_total_bytes, struct btrfs_super_block,
total_bytes, 64);
BTRFS_SETGET_STACK_FUNCS(stack_super_bytes_used, struct btrfs_super_block,
bytes_used, 64);
-BTRFS_SETGET_STACK_FUNCS(super_sectorsize, struct btrfs_super_block,
+BTRFS_SETGET_STACK_FUNCS(stack_super_sectorsize, struct btrfs_super_block,
sectorsize, 32);
BTRFS_SETGET_STACK_FUNCS(super_nodesize, struct btrfs_super_block,
nodesize, 32);
@@ -1162,7 +1162,7 @@ static struct btrfs_fs_info *__open_ctree_fd(int fp, const char *path,
}
memcpy(fs_info->fsid, &disk_super->fsid, BTRFS_FSID_SIZE);
- fs_info->sectorsize = btrfs_super_sectorsize(disk_super);
+ fs_info->sectorsize = btrfs_stack_super_sectorsize(disk_super);
fs_info->nodesize = btrfs_super_nodesize(disk_super);
fs_info->stripesize = btrfs_super_stripesize(disk_super);
@@ -1349,13 +1349,14 @@ static int check_super(struct btrfs_super_block *sb, unsigned sbflags)
error("nodesize unaligned: %u", btrfs_super_nodesize(sb));
goto error_out;
}
- if (btrfs_super_sectorsize(sb) < 4096) {
+ if (btrfs_stack_super_sectorsize(sb) < 4096) {
error("sectorsize too small: %u < 4096",
- btrfs_super_sectorsize(sb));
+ btrfs_stack_super_sectorsize(sb));
goto error_out;
}
- if (!IS_ALIGNED(btrfs_super_sectorsize(sb), 4096)) {
- error("sectorsize unaligned: %u", btrfs_super_sectorsize(sb));
+ if (!IS_ALIGNED(btrfs_stack_super_sectorsize(sb), 4096)) {
+ error("sectorsize unaligned: %u",
+ btrfs_stack_super_sectorsize(sb));
goto error_out;
}
if (btrfs_stack_super_total_bytes(sb) == 0) {
@@ -1368,7 +1369,8 @@ static int check_super(struct btrfs_super_block *sb, unsigned sbflags)
goto error_out;
}
if ((btrfs_super_stripesize(sb) != 4096)
- && (btrfs_super_stripesize(sb) != btrfs_super_sectorsize(sb))) {
+ && (btrfs_super_stripesize(sb) !=
+ btrfs_stack_super_sectorsize(sb))) {
error("invalid stripesize %u", btrfs_super_stripesize(sb));
goto error_out;
}
@@ -1090,7 +1090,7 @@ static void update_super_old(u8 *buffer)
struct btrfs_super_block *super = (struct btrfs_super_block *)buffer;
struct btrfs_chunk *chunk;
struct btrfs_disk_key *key;
- u32 sectorsize = btrfs_super_sectorsize(super);
+ u32 sectorsize = btrfs_stack_super_sectorsize(super);
u64 flags = btrfs_stack_super_flags(super);
flags |= BTRFS_SUPER_FLAG_METADUMP;
@@ -166,7 +166,7 @@ int make_btrfs(int fd, struct btrfs_mkfs_config *cfg)
btrfs_set_stack_super_chunk_root(&super, cfg->blocks[MKFS_CHUNK_TREE]);
btrfs_set_stack_super_total_bytes(&super, num_bytes);
btrfs_set_stack_super_bytes_used(&super, 6 * cfg->nodesize);
- btrfs_set_super_sectorsize(&super, cfg->sectorsize);
+ btrfs_set_stack_super_sectorsize(&super, cfg->sectorsize);
super.__unused_leafsize = cpu_to_le32(cfg->nodesize);
btrfs_set_super_nodesize(&super, cfg->nodesize);
btrfs_set_super_stripesize(&super, cfg->stripesize);
The super_sectorsize 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> --- chunk-recover.c | 4 ++-- cmds-inspect-dump-super.c | 2 +- convert/common.c | 2 +- ctree.h | 2 +- disk-io.c | 14 ++++++++------ image/main.c | 2 +- mkfs/common.c | 2 +- 7 files changed, 15 insertions(+), 13 deletions(-)