mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-17 11:55:19 +00:00
2f2f6bfe17
The new '-b' option will be responsible for converting to block group tree compat ro feature. The workflow looks like this for new convert: - Setting CHANGING_BG_TREE flag And initialize fs_info->last_converted_bg_bytenr value to (u64)-1. Any bg with bytenr >= last_converted_bg_bytenr will have its bg item update go to the new root (bg tree). - Iterate each block group by their bytenr in descending order This involves: * Delete the old bg item from the old tree (extent tree) * Update last_converted_bg_bytenr to the bytenr of the bg * Add the new bg item into the new tree (bg tree) * If we have converted a bunch of bgs, commit current transaction - Clear CHANGING_BG_TREE flag And set the new BLOCK_GROUP_TREE compat ro flag and commit. And since we're doing the convert in multiple transactions, we also need to resume from last interrupted convert. In that case, we just grab the last unconverted bg, and start from it. And to co-operate with the new kernel requirement for both no-holes and free-space-tree features, the convert tool will check for free-space-tree feature. If not enabled, will error out with an error message to how to continue (by mounting with "-o space_cache=v2"). For missing no-holes feature, we just need to set the flag during convert. Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> |
||
---|---|---|
.. | ||
backref.c | ||
backref.h | ||
ctree.c | ||
ctree.h | ||
delayed-ref.c | ||
delayed-ref.h | ||
dir-item.c | ||
disk-io.c | ||
disk-io.h | ||
extent_io.c | ||
extent_io.h | ||
extent-tree.c | ||
file-item.c | ||
file.c | ||
free-space-cache.c | ||
free-space-cache.h | ||
free-space-tree.c | ||
free-space-tree.h | ||
inode-item.c | ||
inode.c | ||
print-tree.c | ||
print-tree.h | ||
root-tree.c | ||
send.h | ||
transaction.c | ||
transaction.h | ||
ulist.c | ||
ulist.h | ||
uuid-tree.c | ||
volumes.c | ||
volumes.h | ||
zoned.c | ||
zoned.h |