btrfs-progs: print-tree: follow the supported flags when printing flags

Currently we put EXTENT_TREE_V2 incompat flag entry under EXPERIMENTAL
features, thus at compile time, incompat_flags_array[] is determined at
compile time.

But the truth is, we have @supported_flags for __print_readable_flag(),
which is already defined based on EXPERIMENTAL flag.

Thus for __print_readable_flag(), we can always include the entry for
EXTENT_TREE_V2, and only print the flag if it's in the @supported_flags

By this, we can remove one EXPERIMENTAL ifdef.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Qu Wenruo 2022-10-11 19:25:12 +08:00 committed by David Sterba
parent 55438f3930
commit 720819745c

View File

@ -1689,9 +1689,7 @@ static struct readable_flag_entry incompat_flags_array[] = {
DEF_INCOMPAT_FLAG_ENTRY(METADATA_UUID),
DEF_INCOMPAT_FLAG_ENTRY(RAID1C34),
DEF_INCOMPAT_FLAG_ENTRY(ZONED),
#if EXPERIMENTAL
DEF_INCOMPAT_FLAG_ENTRY(EXTENT_TREE_V2),
#endif
};
static const int incompat_flags_num = sizeof(incompat_flags_array) /
sizeof(struct readable_flag_entry);
@ -1731,7 +1729,7 @@ static void __print_readable_flag(u64 flag, struct readable_flag_entry *array,
printf("\t\t\t( ");
for (i = 0; i < array_size; i++) {
entry = array + i;
if (flag & entry->bit) {
if ((flag & supported_flags) && (flag & entry->bit)) {
if (first)
printf("%s ", entry->output);
else