Skip to content

Commit cc36fc2

Browse files
josefbaciksmb49
authored andcommitted
btrfs: add definition for EXTENT_TREE_V2
BugLink: https://bugs.launchpad.net/bugs/2059014 [ Upstream commit 2c7d2a2 ] This adds the initial definition of the EXTENT_TREE_V2 incompat feature flag. This also hides the support behind CONFIG_BTRFS_DEBUG. THIS IS A IN DEVELOPMENT FORMAT CHANGE, DO NOT USE UNLESS YOU ARE A DEVELOPER OR A TESTER. The format is in flux and will be added in stages, any fs will need to be re-made between updates to the format. Signed-off-by: Josef Bacik <[email protected]> Signed-off-by: David Sterba <[email protected]> Stable-dep-of: 7081929 ("btrfs: don't abort filesystem when attempting to snapshot deleted subvolume") Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Manuel Diewald <[email protected]> Signed-off-by: Stefan Bader <[email protected]>
1 parent 146c129 commit cc36fc2

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

fs/btrfs/ctree.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,26 @@ struct btrfs_super_block {
282282
#define BTRFS_FEATURE_COMPAT_RO_SAFE_SET 0ULL
283283
#define BTRFS_FEATURE_COMPAT_RO_SAFE_CLEAR 0ULL
284284

285+
#ifdef CONFIG_BTRFS_DEBUG
286+
/*
287+
* Extent tree v2 supported only with CONFIG_BTRFS_DEBUG
288+
*/
289+
#define BTRFS_FEATURE_INCOMPAT_SUPP \
290+
(BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF | \
291+
BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL | \
292+
BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS | \
293+
BTRFS_FEATURE_INCOMPAT_BIG_METADATA | \
294+
BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO | \
295+
BTRFS_FEATURE_INCOMPAT_COMPRESS_ZSTD | \
296+
BTRFS_FEATURE_INCOMPAT_RAID56 | \
297+
BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF | \
298+
BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA | \
299+
BTRFS_FEATURE_INCOMPAT_NO_HOLES | \
300+
BTRFS_FEATURE_INCOMPAT_METADATA_UUID | \
301+
BTRFS_FEATURE_INCOMPAT_RAID1C34 | \
302+
BTRFS_FEATURE_INCOMPAT_ZONED | \
303+
BTRFS_FEATURE_INCOMPAT_EXTENT_TREE_V2)
304+
#else
285305
#define BTRFS_FEATURE_INCOMPAT_SUPP \
286306
(BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF | \
287307
BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL | \
@@ -296,6 +316,7 @@ struct btrfs_super_block {
296316
BTRFS_FEATURE_INCOMPAT_METADATA_UUID | \
297317
BTRFS_FEATURE_INCOMPAT_RAID1C34 | \
298318
BTRFS_FEATURE_INCOMPAT_ZONED)
319+
#endif
299320

300321
#define BTRFS_FEATURE_INCOMPAT_SAFE_SET \
301322
(BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF)

fs/btrfs/sysfs.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,11 @@ BTRFS_FEAT_ATTR_INCOMPAT(no_holes, NO_HOLES);
283283
BTRFS_FEAT_ATTR_INCOMPAT(metadata_uuid, METADATA_UUID);
284284
BTRFS_FEAT_ATTR_COMPAT_RO(free_space_tree, FREE_SPACE_TREE);
285285
BTRFS_FEAT_ATTR_INCOMPAT(raid1c34, RAID1C34);
286-
/* Remove once support for zoned allocation is feature complete */
287286
#ifdef CONFIG_BTRFS_DEBUG
287+
/* Remove once support for zoned allocation is feature complete */
288288
BTRFS_FEAT_ATTR_INCOMPAT(zoned, ZONED);
289+
/* Remove once support for extent tree v2 is feature complete */
290+
BTRFS_FEAT_ATTR_INCOMPAT(extent_tree_v2, EXTENT_TREE_V2);
289291
#endif
290292
#ifdef CONFIG_FS_VERITY
291293
BTRFS_FEAT_ATTR_COMPAT_RO(verity, VERITY);
@@ -314,6 +316,7 @@ static struct attribute *btrfs_supported_feature_attrs[] = {
314316
BTRFS_FEAT_ATTR_PTR(raid1c34),
315317
#ifdef CONFIG_BTRFS_DEBUG
316318
BTRFS_FEAT_ATTR_PTR(zoned),
319+
BTRFS_FEAT_ATTR_PTR(extent_tree_v2),
317320
#endif
318321
#ifdef CONFIG_FS_VERITY
319322
BTRFS_FEAT_ATTR_PTR(verity),

include/uapi/linux/btrfs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ struct btrfs_ioctl_fs_info_args {
310310
#define BTRFS_FEATURE_INCOMPAT_METADATA_UUID (1ULL << 10)
311311
#define BTRFS_FEATURE_INCOMPAT_RAID1C34 (1ULL << 11)
312312
#define BTRFS_FEATURE_INCOMPAT_ZONED (1ULL << 12)
313+
#define BTRFS_FEATURE_INCOMPAT_EXTENT_TREE_V2 (1ULL << 13)
313314

314315
struct btrfs_ioctl_feature_flags {
315316
__u64 compat_flags;

0 commit comments

Comments
 (0)