@@ -1069,12 +1069,13 @@ again:
del_nr++;
if (key.type == BTRFS_EXTENT_ITEM_KEY ||
key.type == BTRFS_METADATA_ITEM_KEY) {
- old_val = btrfs_super_bytes_used(fs_info->super_copy);
+ old_val = btrfs_stack_super_bytes_used(
+ fs_info->super_copy);
if (key.type == BTRFS_METADATA_ITEM_KEY)
old_val += fs_info->nodesize;
else
old_val += key.offset;
- btrfs_set_super_bytes_used(fs_info->super_copy,
+ btrfs_set_stack_super_bytes_used(fs_info->super_copy,
old_val);
}
}
@@ -392,7 +392,7 @@ static void dump_superblock(struct btrfs_super_block *sb, int full)
printf("total_bytes\t\t%llu\n",
(unsigned long long)btrfs_stack_super_total_bytes(sb));
printf("bytes_used\t\t%llu\n",
- (unsigned long long)btrfs_super_bytes_used(sb));
+ (unsigned long long)btrfs_stack_super_bytes_used(sb));
printf("sectorsize\t\t%llu\n",
(unsigned long long)btrfs_super_sectorsize(sb));
printf("nodesize\t\t%llu\n",
@@ -577,7 +577,7 @@ no_node:
printf("total bytes %llu\n",
(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));
+ (unsigned long long)btrfs_stack_super_bytes_used(info->super_copy));
uuidbuf[BTRFS_UUID_UNPARSED_SIZE - 1] = '\0';
uuid_unparse(info->super_copy->fsid, uuidbuf);
printf("uuid %s\n", uuidbuf);
@@ -126,7 +126,7 @@ static int setup_temp_super(int fd, struct btrfs_mkfs_config *cfg,
* chunk tree, root tree, extent_tree, device tree, fs tree
* and csum tree.
*/
- btrfs_set_super_bytes_used(super, 6 * cfg->nodesize);
+ btrfs_set_stack_super_bytes_used(super, 6 * cfg->nodesize);
btrfs_set_super_sectorsize(super, cfg->sectorsize);
super->__unused_leafsize = cpu_to_le32(cfg->nodesize);
btrfs_set_super_nodesize(super, cfg->nodesize);
@@ -2186,7 +2186,7 @@ BTRFS_SETGET_STACK_FUNCS(stack_super_log_root_level, struct btrfs_super_block,
log_root_level, 8);
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,
+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,
sectorsize, 32);
@@ -1362,8 +1362,9 @@ static int check_super(struct btrfs_super_block *sb, unsigned sbflags)
error("invalid total_bytes 0");
goto error_out;
}
- if (btrfs_super_bytes_used(sb) < 6 * btrfs_super_nodesize(sb)) {
- error("invalid bytes_used %llu", btrfs_super_bytes_used(sb));
+ if (btrfs_stack_super_bytes_used(sb) < 6 * btrfs_super_nodesize(sb)) {
+ error("invalid bytes_used %llu",
+ btrfs_stack_super_bytes_used(sb));
goto error_out;
}
if ((btrfs_super_stripesize(sb) != 4096)
@@ -1935,12 +1935,12 @@ static int update_block_group(struct btrfs_trans_handle *trans,
u64 end;
/* block accounting for super block */
- old_val = btrfs_super_bytes_used(info->super_copy);
+ old_val = btrfs_stack_super_bytes_used(info->super_copy);
if (alloc)
old_val += num_bytes;
else
old_val -= num_bytes;
- btrfs_set_super_bytes_used(info->super_copy, old_val);
+ btrfs_set_stack_super_bytes_used(info->super_copy, old_val);
/* block accounting for root item */
old_val = btrfs_stack_root_used(&root->root_item);
@@ -3911,7 +3911,7 @@ int btrfs_fix_block_accounting(struct btrfs_trans_handle *trans,
}
path.slots[0]++;
}
- btrfs_set_super_bytes_used(root->fs_info->super_copy, bytes_used);
+ btrfs_set_stack_super_bytes_used(root->fs_info->super_copy, bytes_used);
ret = 0;
out:
btrfs_release_path(&path);
@@ -165,7 +165,7 @@ int make_btrfs(int fd, struct btrfs_mkfs_config *cfg)
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_stack_super_total_bytes(&super, num_bytes);
- btrfs_set_super_bytes_used(&super, 6 * cfg->nodesize);
+ btrfs_set_stack_super_bytes_used(&super, 6 * cfg->nodesize);
btrfs_set_super_sectorsize(&super, cfg->sectorsize);
super.__unused_leafsize = cpu_to_le32(cfg->nodesize);
btrfs_set_super_nodesize(&super, cfg->nodesize);
@@ -78,7 +78,7 @@ static int create_metadata_block_groups(struct btrfs_root *root, int mixed,
trans = btrfs_start_transaction(root, 1);
BUG_ON(IS_ERR(trans));
- bytes_used = btrfs_super_bytes_used(fs_info->super_copy);
+ bytes_used = btrfs_stack_super_bytes_used(fs_info->super_copy);
root->fs_info->system_allocs = 1;
ret = btrfs_make_block_group(trans, fs_info, bytes_used,
@@ -130,7 +130,8 @@ static int device_list_add(const char *path,
return -ENOMEM;
}
device->total_devs = btrfs_super_num_devices(disk_super);
- device->super_bytes_used = btrfs_super_bytes_used(disk_super);
+ device->super_bytes_used =
+ btrfs_stack_super_bytes_used(disk_super);
device->total_bytes =
btrfs_stack_device_total_bytes(&disk_super->dev_item);
device->bytes_used =
The super_bytes_used 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 | 5 +++-- cmds-inspect-dump-super.c | 2 +- cmds-inspect-dump-tree.c | 2 +- convert/common.c | 2 +- ctree.h | 2 +- disk-io.c | 5 +++-- extent-tree.c | 6 +++--- mkfs/common.c | 2 +- mkfs/main.c | 2 +- volumes.c | 3 ++- 10 files changed, 17 insertions(+), 14 deletions(-)