Block headers now store the chunk tree uuid
Chunk items records the device uuid for each stripes
Device extent items record better back refs to the chunk tree
Block groups record better back refs to the chunk tree
The chunk tree format has also changed. The objectid of BTRFS_CHUNK_ITEM_KEY
used to be the logical offset of the chunk. Now it is a chunk tree id,
with the logical offset being stored in the offset field of the key.
This allows a single chunk tree to record multiple logical address spaces,
upping the number of bytes indexed by a chunk tree from 2^64 to
2^128.
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.
mkfs.btrfs --data {raid0,raid1,single}
mkfs.btrfs --metadata {raid0,raid1,single}
In single mode, no extra duplication or striping is done.
In raid0 mode, blocks are spread across all of the available devices
In raid1 mode, blocks are mirrored across two devices.
For metadata, if raid1 is used and there is only one device, the
metadata is duplicated on that single spindle.
The defaults are raid0 for data and raid1 for metadata
This saves from the blunder of formatting a live mounted filesystem.
This can be extended to get the mount flags of the filesystem
mounted.
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@gmail.com>
This adds support for keeping track of the number of blocks used by
root_item's. This makes it so that mkfs lays down the "default" subvol with
the correct block accounting in place. Thank you,