From 79e534def94d25e84ef528b84690a622e1156eda Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Mon, 23 Aug 2021 16:14:55 -0400 Subject: [PATCH] btrfs-progs: add the incompat flag for extent tree v2 I will have a lot of preparatory patches to reduce the review pain of this large feature. In order to enable that work define the incompat flag. Once all of the work lands to support the feature there will be a patch to actually enable us to select it and manipulate file systems with that incompat flag set. Signed-off-by: Josef Bacik Signed-off-by: David Sterba --- kernel-shared/ctree.h | 1 + mkfs/main.c | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/kernel-shared/ctree.h b/kernel-shared/ctree.h index 3cca6032..fb918aba 100644 --- a/kernel-shared/ctree.h +++ b/kernel-shared/ctree.h @@ -496,6 +496,7 @@ struct btrfs_super_block { #define BTRFS_FEATURE_INCOMPAT_METADATA_UUID (1ULL << 10) #define BTRFS_FEATURE_INCOMPAT_RAID1C34 (1ULL << 11) #define BTRFS_FEATURE_INCOMPAT_ZONED (1ULL << 12) +#define BTRFS_FEATURE_INCOMPAT_EXTENT_TREE_V2 (1ULL << 13) #define BTRFS_FEATURE_COMPAT_SUPP 0ULL diff --git a/mkfs/main.c b/mkfs/main.c index bf274ea3..f5319ed2 100644 --- a/mkfs/main.c +++ b/mkfs/main.c @@ -251,9 +251,11 @@ static int recow_roots(struct btrfs_trans_handle *trans, ret = __recow_root(trans, info->csum_root); if (ret) return ret; - ret = __recow_root(trans, info->free_space_root); - if (ret) - return ret; + if (info->free_space_root) { + ret = __recow_root(trans, info->free_space_root); + if (ret) + return ret; + } return 0; }