@@ -143,6 +143,16 @@ static const struct btrfs_feature mkfs_features[] = {
.desc = "new extent tree format"
},
#endif
+ {
+ .name = "encrypt",
+ .flag = BTRFS_FEATURE_INCOMPAT_FSCRYPT,
+ .sysfs_name = "fscrypt",
+ VERSION_TO_STRING2(compat, 5,19),
+ VERSION_NULL(safe),
+ VERSION_NULL(default),
+ .desc = "fs-level encryption"
+ },
+
/* Keep this one last */
{
.name = "list-all",
@@ -508,6 +508,7 @@ BUILD_ASSERT(sizeof(struct btrfs_super_block) == BTRFS_SUPER_INFO_SIZE);
#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_INCOMPAT_FSCRYPT (1ULL << 14)
#define BTRFS_FEATURE_COMPAT_SUPP 0ULL
@@ -536,7 +537,8 @@ BUILD_ASSERT(sizeof(struct btrfs_super_block) == BTRFS_SUPER_INFO_SIZE);
BTRFS_FEATURE_INCOMPAT_RAID1C34 | \
BTRFS_FEATURE_INCOMPAT_METADATA_UUID | \
BTRFS_FEATURE_INCOMPAT_ZONED | \
- BTRFS_FEATURE_INCOMPAT_EXTENT_TREE_V2)
+ BTRFS_FEATURE_INCOMPAT_EXTENT_TREE_V2 | \
+ BTRFS_FEATURE_INCOMPAT_FSCRYPT)
#else
#define BTRFS_FEATURE_INCOMPAT_SUPP \
(BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF | \
@@ -277,6 +277,8 @@ struct btrfs_ioctl_fs_info_args {
#define BTRFS_FEATURE_INCOMPAT_RAID1C34 (1ULL << 11)
#define BTRFS_FEATURE_INCOMPAT_ZONED (1ULL << 12)
+#define BTRFS_FEATURE_INCOMPAT_FSCRYPT (1ULL << 14)
+
struct btrfs_ioctl_feature_flags {
__u64 compat_flags;
__u64 compat_ro_flags;
Add the new FSCRYPT feature flag and mkfs option. For now, claim 5.19 as the earliest version with this, though the actual kernel version will need fixing up when it actually gets in. Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me> --- common/fsfeatures.c | 10 ++++++++++ kernel-shared/ctree.h | 4 +++- libbtrfsutil/btrfs.h | 2 ++ 3 files changed, 15 insertions(+), 1 deletion(-)