summaryrefslogtreecommitdiff
path: root/disk-io.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-04-04 15:42:17 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2008-04-04 15:42:17 -0400
commita37e1e720451664477b030242616b3e48d31013e (patch)
treee47d2a0956b071d1483427bae0f4e90e8a32cf55 /disk-io.c
parenta57a255e442c8d8d3c1c28780af84483c3b5ec21 (diff)
Recow all roots at the end of mkfs
The mkfs code bootstraps the filesystem on a single device. Once the raid block groups are setup, it needs to recow all of the blocks so that each tree is properly allocated.
Diffstat (limited to 'disk-io.c')
-rw-r--r--disk-io.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/disk-io.c b/disk-io.c
index 204abe08..ccc2f35d 100644
--- a/disk-io.c
+++ b/disk-io.c
@@ -33,6 +33,7 @@
#include "transaction.h"
#include "crc32c.h"
#include "utils.h"
+#include "print-tree.h"
static int check_tree_block(struct btrfs_root *root, struct extent_buffer *buf)
{
@@ -481,16 +482,13 @@ struct btrfs_root *open_ctree_fd(int fp, const char *path, u64 sb_bytenr)
BUG_ON(ret);
}
+ memset(fs_info, 0, sizeof(*fs_info));
fs_info->fp = fs_devices->lowest_bdev;
- fs_info->running_transaction = NULL;
fs_info->fs_root = root;
fs_info->tree_root = tree_root;
fs_info->extent_root = extent_root;
- fs_info->extent_ops = NULL;
- fs_info->priv_data = NULL;
fs_info->chunk_root = chunk_root;
fs_info->dev_root = dev_root;
- fs_info->force_system_allocs = 0;
extent_io_tree_init(&fs_info->extent_cache);
extent_io_tree_init(&fs_info->free_space_cache);
@@ -584,6 +582,11 @@ struct btrfs_root *open_ctree_fd(int fp, const char *path, u64 sb_bytenr)
root->ref_cows = 1;
fs_info->generation = btrfs_super_generation(disk_super) + 1;
btrfs_read_block_groups(root);
+
+ fs_info->data_alloc_profile = (u64)-1;
+ fs_info->metadata_alloc_profile = (u64)-1;
+ fs_info->system_alloc_profile = fs_info->metadata_alloc_profile;
+
return root;
}