@@ -355,7 +355,7 @@ static void dump_superblock(struct btrfs_super_block *sb, int full)
s = (char *) &sb->magic;
for (i = 0; i < 8; i++)
putchar(isprint(s[i]) ? s[i] : '.');
- if (btrfs_super_magic(sb) == BTRFS_MAGIC)
+ if (btrfs_stack_super_magic(sb) == BTRFS_MAGIC)
printf(" [match]\n");
else
printf(" [DON'T MATCH]\n");
@@ -478,7 +478,7 @@ static int load_and_dump_sb(char *filename, int fd, u64 sb_bytenr, int full,
}
printf("superblock: bytenr=%llu, device=%s\n", sb_bytenr, filename);
printf("---------------------------------------------------------\n");
- if (btrfs_super_magic(sb) != BTRFS_MAGIC && !force) {
+ if (btrfs_stack_super_magic(sb) != BTRFS_MAGIC && !force) {
error("bad magic on superblock on %s at %llu",
filename, (unsigned long long)sb_bytenr);
} else {
@@ -116,7 +116,7 @@ static int setup_temp_super(int fd, struct btrfs_mkfs_config *cfg,
btrfs_set_stack_super_bytenr(super, cfg->super_bytenr);
btrfs_set_stack_super_num_devices(super, 1);
- btrfs_set_super_magic(super, BTRFS_MAGIC_PARTIAL);
+ btrfs_set_stack_super_magic(super, BTRFS_MAGIC_PARTIAL);
btrfs_set_stack_super_generation(super, 1);
btrfs_set_stack_super_root(super, root_bytenr);
btrfs_set_stack_super_chunk_root(super, chunk_bytenr);
@@ -2211,7 +2211,8 @@ BTRFS_SETGET_STACK_FUNCS(stack_super_cache_generation, struct btrfs_super_block,
BTRFS_SETGET_STACK_FUNCS(stack_super_uuid_tree_generation,
struct btrfs_super_block,
uuid_tree_generation, 64);
-BTRFS_SETGET_STACK_FUNCS(super_magic, struct btrfs_super_block, magic, 64);
+BTRFS_SETGET_STACK_FUNCS(stack_super_magic, struct btrfs_super_block, magic,
+ 64);
static inline int btrfs_super_csum_size(struct btrfs_super_block *s)
{
@@ -1283,8 +1283,8 @@ static int check_super(struct btrfs_super_block *sb, unsigned sbflags)
u16 csum_type;
int csum_size;
- if (btrfs_super_magic(sb) != BTRFS_MAGIC) {
- if (btrfs_super_magic(sb) == BTRFS_MAGIC_PARTIAL) {
+ if (btrfs_stack_super_magic(sb) != BTRFS_MAGIC) {
+ if (btrfs_stack_super_magic(sb) == BTRFS_MAGIC_PARTIAL) {
if (!(sbflags & SBREAD_PARTIAL)) {
error("superblock magic doesn't match");
return -EIO;
@@ -1477,7 +1477,7 @@ int btrfs_read_dev_super(int fd, struct btrfs_super_block *sb, u64 sb_bytenr,
if (btrfs_stack_super_bytenr(buf) != bytenr)
continue;
/* if magic is NULL, the device was removed */
- if (btrfs_super_magic(buf) == 0 && i == 0)
+ if (btrfs_stack_super_magic(buf) == 0 && i == 0)
break;
if (check_super(buf, sbflags))
continue;
@@ -1657,7 +1657,7 @@ int close_ctree_fs_info(struct btrfs_fs_info *fs_info)
}
if (fs_info->finalize_on_close) {
- btrfs_set_super_magic(fs_info->super_copy, BTRFS_MAGIC);
+ btrfs_set_stack_super_magic(fs_info->super_copy, BTRFS_MAGIC);
root->fs_info->finalize_on_close = 0;
ret = write_all_supers(fs_info);
if (ret)
@@ -160,7 +160,7 @@ int make_btrfs(int fd, struct btrfs_mkfs_config *cfg)
btrfs_set_stack_super_bytenr(&super, cfg->blocks[MKFS_SUPER_BLOCK]);
btrfs_set_stack_super_num_devices(&super, 1);
- btrfs_set_super_magic(&super, BTRFS_MAGIC_PARTIAL);
+ btrfs_set_stack_super_magic(&super, BTRFS_MAGIC_PARTIAL);
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]);
@@ -1045,8 +1045,8 @@ int btrfs_device_already_in_root(struct btrfs_root *root, int fd,
* Accept devices from the same filesystem, allow partially created
* structures.
*/
- if (btrfs_super_magic(disk_super) != BTRFS_MAGIC &&
- btrfs_super_magic(disk_super) != BTRFS_MAGIC_PARTIAL)
+ if (btrfs_stack_super_magic(disk_super) != BTRFS_MAGIC &&
+ btrfs_stack_super_magic(disk_super) != BTRFS_MAGIC_PARTIAL)
goto brelse;
if (!memcmp(disk_super->fsid, root->fs_info->super_copy->fsid,
The super_magic 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-inspect-dump-super.c | 4 ++-- convert/common.c | 2 +- ctree.h | 3 ++- disk-io.c | 8 ++++---- mkfs/common.c | 2 +- utils.c | 4 ++-- 6 files changed, 12 insertions(+), 11 deletions(-)