btrfs_set_header_nritems(buf, nritems);
csum_tree_block_size(buf, BTRFS_CRC32_SIZE, 0);
ret = pwrite(fd, buf->data, leafsize, blocks[3]);
+ BUG_ON(ret != leafsize);
/* create the device tree */
memset(buf->data+sizeof(struct btrfs_header), 0,
btrfs_set_header_nritems(buf, nritems);
csum_tree_block_size(buf, BTRFS_CRC32_SIZE, 0);
ret = pwrite(fd, buf->data, leafsize, blocks[4]);
+ BUG_ON(ret != leafsize);
/* create the FS root */
memset(buf->data+sizeof(struct btrfs_header), 0,