Skip to content

Commit 716c3be

Browse files
adam900710kdave
authored andcommitted
btrfs-progs: move block-group-tree out of experimental features
The feedback from the community on block group tree is very positive, the only complain is, end users need to recompile btrfs-progs with experimental features to enjoy the new feature. So let's move it out of experimental features and let more people enjoy faster mount speed. Also change the option of btrfstune, from `-b` to `--enable-block-group-tree` to avoid short option. Reviewed-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 4dbe66c commit 716c3be

File tree

5 files changed

+22
-15
lines changed

5 files changed

+22
-15
lines changed

Documentation/btrfs-man5.rst

+6
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ big_metadata
6666
the filesystem uses *nodesize* for metadata blocks, this can be bigger than the
6767
page size
6868

69+
block_group_tree
70+
(since: 6.1)
71+
72+
block group item representation using a dedicated b-tree, this can greatly
73+
reduce mount time for large filesystems
74+
6975
compress_lzo
7076
(since: 2.6.38)
7177

Documentation/btrfstune.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ means. Please refer to the *FILESYSTEM FEATURES* in :doc:`btrfs(5)<btrfs-man5>`
2424
OPTIONS
2525
-------
2626

27-
-b
28-
(since kernel 6.1, needs experimental build of btrfs-progs)
27+
--enable-block-group-tree
28+
(since kernel 6.1)
2929
Enable block group tree feature (greatly reduce mount time),
3030
enabled by mkfs feature *block-group-tree*.
3131

Documentation/mkfs.btrfs.rst

+5
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,11 @@ free-space-tree
284284
Enable the free space tree (mount option *space_cache=v2*) for persisting the
285285
free space cache.
286286

287+
block-group-tree
288+
(kernel support since 6.1)
289+
290+
Enable the block group tree to greatly reduce mount time for large filesystems.
291+
287292
BLOCK GROUPS, CHUNKS, RAID
288293
--------------------------
289294

common/fsfeatures.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ static const struct btrfs_feature mkfs_features[] = {
171171
.desc = "support zoned devices"
172172
},
173173
#endif
174-
#if EXPERIMENTAL
175174
{
176175
.name = "block-group-tree",
177176
.compat_ro_flag = BTRFS_FEATURE_COMPAT_RO_BLOCK_GROUP_TREE,
@@ -181,6 +180,7 @@ static const struct btrfs_feature mkfs_features[] = {
181180
VERSION_NULL(default),
182181
.desc = "block group tree to reduce mount time"
183182
},
183+
#if EXPERIMENTAL
184184
{
185185
.name = "extent-tree-v2",
186186
.incompat_flag = BTRFS_FEATURE_INCOMPAT_EXTENT_TREE_V2,
@@ -222,7 +222,6 @@ static const struct btrfs_feature runtime_features[] = {
222222
VERSION_TO_STRING2(default, 5,15),
223223
.desc = "free space tree (space_cache=v2)"
224224
},
225-
#if EXPERIMENTAL
226225
{
227226
.name = "block-group-tree",
228227
.compat_ro_flag = BTRFS_FEATURE_COMPAT_RO_BLOCK_GROUP_TREE,
@@ -232,7 +231,6 @@ static const struct btrfs_feature runtime_features[] = {
232231
VERSION_NULL(default),
233232
.desc = "block group tree to reduce mount time"
234233
},
235-
#endif
236234
/* Keep this one last */
237235
{
238236
.name = "list-all",

tune/main.c

+8-10
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ static const char * const tune_usage[] = {
7070
OPTLINE("-x", "enable skinny metadata extent refs (mkfs: skinny-metadata)"),
7171
OPTLINE("-n", "enable no-holes feature (mkfs: no-holes, more efficient sparse file representation)"),
7272
OPTLINE("-S <0|1>", "set/unset seeding status of a device"),
73+
OPTLINE("--enable-block-group-tree", "enable block group tree (mkfs: block-group-tree, for less mount time)"),
7374
"",
7475
"UUID changes:",
7576
OPTLINE("-u", "rewrite fsid, use a random one"),
@@ -84,7 +85,6 @@ static const char * const tune_usage[] = {
8485
"",
8586
"EXPERIMENTAL FEATURES:",
8687
OPTLINE("--csum CSUM", "switch checksum for data and metadata to CSUM"),
87-
OPTLINE("-b", "enable block group tree (mkfs: block-group-tree, for less mount time)"),
8888
#endif
8989
NULL
9090
};
@@ -113,27 +113,22 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[])
113113
btrfs_config_init();
114114

115115
while(1) {
116-
enum { GETOPT_VAL_CSUM = GETOPT_VAL_FIRST };
116+
enum { GETOPT_VAL_CSUM = GETOPT_VAL_FIRST,
117+
GETOPT_VAL_ENABLE_BLOCK_GROUP_TREE };
117118
static const struct option long_options[] = {
118119
{ "help", no_argument, NULL, GETOPT_VAL_HELP},
120+
{ "enable-block-group-tree", no_argument, NULL,
121+
GETOPT_VAL_ENABLE_BLOCK_GROUP_TREE},
119122
#if EXPERIMENTAL
120123
{ "csum", required_argument, NULL, GETOPT_VAL_CSUM },
121124
#endif
122125
{ NULL, 0, NULL, 0 }
123126
};
124-
#if EXPERIMENTAL
125-
int c = getopt_long(argc, argv, "S:rxfuU:nmM:b", long_options, NULL);
126-
#else
127127
int c = getopt_long(argc, argv, "S:rxfuU:nmM:", long_options, NULL);
128-
#endif
129128

130129
if (c < 0)
131130
break;
132131
switch(c) {
133-
case 'b':
134-
btrfs_warn_experimental("Feature: conversion to block-group-tree");
135-
to_bg_tree = true;
136-
break;
137132
case 'S':
138133
seeding_flag = 1;
139134
seeding_value = arg_strtou64(optarg);
@@ -167,6 +162,9 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[])
167162
ctree_flags |= OPEN_CTREE_IGNORE_FSID_MISMATCH;
168163
change_metadata_uuid = 1;
169164
break;
165+
case GETOPT_VAL_ENABLE_BLOCK_GROUP_TREE:
166+
to_bg_tree = true;
167+
break;
170168
#if EXPERIMENTAL
171169
case GETOPT_VAL_CSUM:
172170
btrfs_warn_experimental(

0 commit comments

Comments
 (0)