btrfs-progs/mkfs
Boris Burkov 92d92e99b7 btrfs-progs: mkfs: support free space tree as -R option
Add a runtime feature (-R) flag for the free space tree. A filesystem
that is mkfs'd with -R free-space-tree then mounted with no options has
the same contents as one mkfs'd without the option, then mounted with
'-o space_cache=v2'.

The only tricky thing is in exactly how to call the tree creation code.
Using btrfs_create_free_space_tree as is did not quite work, because an
extra reference to the eb (root->commit_root) is leaked, which mkfs
complains about with a warning. I opted to follow how the uuid tree is
created by adding it to the dirty roots list for cleanup by
commit_tree_roots in commit_transaction. As a result,
btrfs_create_free_space_tree no longer exactly matches the version in
the kernel sources.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Boris Burkov <boris@bur.io>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-09-08 22:06:04 +02:00
..
Makefile btrfs-progs: build: add stub makefile to image and mkfs 2019-07-04 15:36:01 +02:00
common.c btrfs-progs: move volumes.c to kernel-shared/ 2020-08-31 17:01:06 +02:00
common.h btrfs-progs: mkfs: switch to single as default profile for multiple-devices 2020-07-21 12:28:05 +02:00
main.c btrfs-progs: mkfs: support free space tree as -R option 2020-09-08 22:06:04 +02:00
rootdir.c btrfs-progs: move volumes.c to kernel-shared/ 2020-08-31 17:01:06 +02:00
rootdir.h