summaryrefslogtreecommitdiff
path: root/extent-tree.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2013-03-06 17:32:51 +0100
committerDavid Sterba <dsterba@suse.cz>2013-03-10 16:12:21 +0100
commitdd21bc16ad9bfd87df9311b39dad425ee533eb78 (patch)
tree0d8cd4e374eaeb0dd30f6aa4603d7d6a073280b4 /extent-tree.c
parentfc61b53da8dba69d2a150ca4fa8faca62c978221 (diff)
btrfs-progs: separate super_copy out of fs_info
Allocate fs_info::super_copy dynamically of full BTRFS_SUPER_INFO_SIZE and use it directly for saving superblock to disk. This fixes incorrect superblock checksum after mkfs. Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'extent-tree.c')
-rw-r--r--extent-tree.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/extent-tree.c b/extent-tree.c
index 85f5670d..da93cb17 100644
--- a/extent-tree.c
+++ b/extent-tree.c
@@ -1830,12 +1830,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_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_super_bytes_used(info->super_copy, old_val);
/* block accounting for root item */
old_val = btrfs_root_used(&root->root_item);
@@ -3216,7 +3216,7 @@ int btrfs_make_block_groups(struct btrfs_trans_handle *trans,
extent_root = root->fs_info->extent_root;
block_group_cache = &root->fs_info->block_group_cache;
chunk_objectid = BTRFS_FIRST_CHUNK_TREE_OBJECTID;
- total_bytes = btrfs_super_total_bytes(&root->fs_info->super_copy);
+ total_bytes = btrfs_super_total_bytes(root->fs_info->super_copy);
group_align = 64 * root->sectorsize;
cur_start = 0;
@@ -3451,7 +3451,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_super_bytes_used(root->fs_info->super_copy, bytes_used);
btrfs_release_path(root, &path);
return 0;
}