btrfs-progs: tune: rename bgt conversion options

Rename the options so they more accurately reflect what the command is
actually doing. The feature is enabled/disabled in the end but it's not
a simple on/off like for others, the conversion takes time.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2023-04-27 14:21:24 +02:00
parent f560eb4c0b
commit 455b1cf094
3 changed files with 20 additions and 16 deletions

View file

@ -24,16 +24,18 @@ means. Please refer to the *FILESYSTEM FEATURES* in :doc:`btrfs(5)<btrfs-man5>`
OPTIONS
-------
--enable-block-group-tree
(since kernel 6.1)
Enable block group tree feature (greatly reduce mount time),
enabled by mkfs feature *block-group-tree*.
--disable-block-group-tree
--convert-to-block-group-tree
(since kernel 6.1)
Disable block group tree feature and convert the filesystem to extent
tree.
Convert portions of extent tree that tracks block groups to a separate
block gruop tree. This greatly reduces mount time. Can be also enabled
at mkfs time.
--convert-from-block-group-tree
(since kernel 6.1)
Convert block groups tracked in standalone block group tree back to
extent tree and remove 'block-group-tree' feature bit from the filesystem.
-f
Allow dangerous changes, e.g. clear the seeding flag or change fsid.

View file

@ -13,13 +13,13 @@ run_check_umount_test_dev
run_check "$TOP/btrfs" inspect-internal dump-tree "$TEST_DEV"
run_check "$TOP/btrfs" inspect-internal dump-super "$TEST_DEV"
run_check "$TOP/btrfstune" --enable-block-group-tree "$TEST_DEV"
run_check "$TOP/btrfstune" --convert-to-block-group-tree "$TEST_DEV"
_log "=== AFTER CONVERSION ==="
run_check "$TOP/btrfs" inspect-internal dump-tree "$TEST_DEV"
run_check "$TOP/btrfs" inspect-internal dump-super "$TEST_DEV"
run_check "$TOP/btrfs" check "$TEST_DEV"
_log "=== BACK CONVERSION ==="
run_check "$TOP/btrfstune" --disable-block-group-tree "$TEST_DEV"
run_check "$TOP/btrfstune" --convert-from-block-group-tree "$TEST_DEV"
run_check "$TOP/btrfs" inspect-internal dump-tree "$TEST_DEV"
run_check "$TOP/btrfs" inspect-internal dump-super "$TEST_DEV"
run_check "$TOP/btrfs" check "$TEST_DEV"

View file

@ -70,8 +70,10 @@ static const char * const tune_usage[] = {
OPTLINE("-x", "enable skinny metadata extent refs (mkfs: skinny-metadata)"),
OPTLINE("-n", "enable no-holes feature (mkfs: no-holes, more efficient sparse file representation)"),
OPTLINE("-S <0|1>", "set/unset seeding status of a device"),
OPTLINE("--enable-block-group-tree", "enable block group tree (mkfs: block-group-tree, for less mount time)"),
OPTLINE("--disable-block-group-tree", "disable block group tree (mkfs: ^block-group-tree)n"),
OPTLINE("--convert-to-block-group-tree", "convert filesystem to track block groups in "
"the separate block-group-tree instead of extent tree (sets the incompat bit)"),
OPTLINE("--convert-from-block-group-tree",
"convert the block group tree back to extent tree (remove the incompat bit)"),
"",
"UUID changes:",
OPTLINE("-u", "rewrite fsid, use a random one"),
@ -120,9 +122,9 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[])
GETOPT_VAL_DISABLE_BLOCK_GROUP_TREE };
static const struct option long_options[] = {
{ "help", no_argument, NULL, GETOPT_VAL_HELP},
{ "enable-block-group-tree", no_argument, NULL,
{ "convert-to-block-group-tree", no_argument, NULL,
GETOPT_VAL_ENABLE_BLOCK_GROUP_TREE},
{ "disable-block-group-tree", no_argument, NULL,
{ "convert-from-block-group-tree", no_argument, NULL,
GETOPT_VAL_DISABLE_BLOCK_GROUP_TREE},
#if EXPERIMENTAL
{ "csum", required_argument, NULL, GETOPT_VAL_CSUM },
@ -246,7 +248,7 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[])
if (to_bg_tree) {
if (to_extent_tree) {
error("option --enable-block-group-tree conflicts with --disable-block-group-tree");
error("option --convert-to-block-group-tree conflicts with --convert-from-block-group-tree");
ret = 1;
goto out;
}
@ -269,7 +271,7 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[])
}
if (to_extent_tree) {
if (to_bg_tree) {
error("option --enable-block-group-tree conflicts with --disable-block-group-tree");
error("option --convert-to-block-group-tree conflicts with --convert-from-block-group-tree");
ret = 1;
goto out;
}