Re: [PATCH v4 12/46] btrfs: add inode encryption contexts

Eric Biggers
2023-12-05T05:22:35Z

On Fri, Dec 01, 2023 at 05:11:09PM -0500, Josef Bacik wrote:
> From: Omar Sandoval <osandov@osandov.com>
>
> In order to store encryption information for directories, symlinks,
> etc., fscrypt stores a context item with each encrypted non-regular
> inode. fscrypt provides an arbitrary blob for the filesystem to store,
> and it does not clearly fit into an existing structure, so this goes in
> a new item type.
>

It's actually regular files too, right?

> diff --git a/include/uapi/linux/btrfs_tree.h b/include/uapi/linux/btrfs_tree.h
> index d24e8e121507..08f561da33cd 100644
> --- a/include/uapi/linux/btrfs_tree.h
> +++ b/include/uapi/linux/btrfs_tree.h
> @@ -164,6 +164,8 @@
> #define BTRFS_VERITY_DESC_ITEM_KEY 36
> #define BTRFS_VERITY_MERKLE_ITEM_KEY 37
>
> +#define BTRFS_FSCRYPT_CTX_ITEM_KEY 41

Maybe call this BTRFS_FSCRYPT_INODE_CTX_ITEM_KEY?

- Eric