]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
fscrypt: add support for info in fs-specific part of inode
authorEric Biggers <ebiggers@kernel.org>
Sun, 10 Aug 2025 07:56:55 +0000 (00:56 -0700)
committerChristian Brauner <brauner@kernel.org>
Thu, 21 Aug 2025 11:58:07 +0000 (13:58 +0200)
commit93221de31a8df6710e02328f82dc68d7ab4ad9e6
tree58fb3fbe56a4672cee0f9db091dc651ca8bf8094
parent6c9468aad215a198742c8375b0415e42521c905c
fscrypt: add support for info in fs-specific part of inode

Add an inode_info_offs field to struct fscrypt_operations, and update
fs/crypto/ to support it.  When set to a nonzero value, it specifies the
offset to the fscrypt_inode_info pointer within the filesystem-specific
part of the inode structure, to be used instead of inode::i_crypt_info.

Since this makes inode::i_crypt_info no longer necessarily used, update
comments that mentioned it.

This is a prerequisite for a later commit that removes
inode::i_crypt_info, saving memory and improving cache efficiency with
filesystems that don't support fscrypt.

Co-developed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Link: https://lore.kernel.org/20250810075706.172910-3-ebiggers@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/crypto/fscrypt_private.h
fs/crypto/keysetup.c
include/linux/fscrypt.h