diff mbox series

[RFC,ONLY,03/23] btrfs: add new FT_FSCRYPT flag for directories.

Message ID afe4764f8fb826bc78dec8fdd883e040c8e9f738.1657707686.git.sweettea-kernel@dorminy.me (mailing list archive)
State New, archived
Headers show
Series btrfs: add fscrypt integration | expand

Commit Message

Sweet Tea Dorminy July 13, 2022, 10:29 a.m. UTC
From: Omar Sandoval <osandov@osandov.com>

The new FT_FSCRYPT indicates a (perhaps partially) encrypted directory,
which is orthogonal to file type; therefore, add the new flag, and make
conversion from directory type to file type strip the flag.

Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
---
 include/uapi/linux/btrfs_tree.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/include/uapi/linux/btrfs_tree.h b/include/uapi/linux/btrfs_tree.h
index 15b3f2d43f6c..428ae75b9f73 100644
--- a/include/uapi/linux/btrfs_tree.h
+++ b/include/uapi/linux/btrfs_tree.h
@@ -359,10 +359,12 @@  enum btrfs_csum_type {
 #define BTRFS_FT_SYMLINK	7
 #define BTRFS_FT_XATTR		8
 #define BTRFS_FT_MAX		9
+/* Name is encrypted. */
+#define BTRFS_FT_FSCRYPT_NAME	0x80
 
 static inline __u8 btrfs_dir_flags_to_ftype(__u8 flags)
 {
-	return flags;
+	return flags & ~BTRFS_FT_FSCRYPT_NAME;
 }
 
 /*