uuid_generate(super.dev_item.uuid);
uuid_generate(chunk_tree_uuid);
+ cfg->blocks[0] = BTRFS_SUPER_INFO_OFFSET;
+ for (i = 1; i < 7; i++) {
+ cfg->blocks[i] = BTRFS_SUPER_INFO_OFFSET + 1024 * 1024 +
+ cfg->nodesize * i;
+ }
+
btrfs_set_super_bytenr(&super, cfg->blocks[0]);
btrfs_set_super_num_devices(&super, 1);
btrfs_set_super_magic(&super, BTRFS_MAGIC_PARTIAL);
u64 features;
/* Size of the filesystem in bytes */
u64 num_bytes;
- /* Logical addresses of superblock [0] and other tree roots */
- u64 blocks[8];
/* Output fields, set during creation */
+
+ /* Logical addresses of superblock [0] and other tree roots */
+ u64 blocks[8];
char fs_uuid[BTRFS_UUID_UNPARSED_SIZE];
char chunk_uuid[BTRFS_UUID_UNPARSED_SIZE];
char *label = NULL;
u64 block_count = 0;
u64 dev_block_count = 0;
- u64 blocks[7];
u64 alloc_start = 0;
u64 metadata_profile = 0;
u64 data_profile = 0;
exit(1);
}
- blocks[0] = BTRFS_SUPER_INFO_OFFSET;
- for (i = 1; i < 7; i++) {
- blocks[i] = BTRFS_SUPER_INFO_OFFSET + 1024 * 1024 +
- nodesize * i;
- }
-
if (group_profile_max_safe_loss(metadata_profile) <
group_profile_max_safe_loss(data_profile)){
warning("metadata has lower redundancy than data!\n");
mkfs_cfg.label = label;
memcpy(mkfs_cfg.fs_uuid, fs_uuid, sizeof(mkfs_cfg.fs_uuid));
- memcpy(mkfs_cfg.blocks, blocks, sizeof(blocks));
mkfs_cfg.num_bytes = dev_block_count;
mkfs_cfg.nodesize = nodesize;
mkfs_cfg.sectorsize = sectorsize;