Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ceph: move crypt info pointer to fs-specific part of inode

Move the fscrypt_inode_info pointer into the filesystem-specific part of
the inode by adding the field ceph_inode_info::i_crypt_info and
configuring fscrypt_operations::inode_info_offs accordingly.

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-7-ebiggers@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Eric Biggers and committed by
Christian Brauner
bbe395de e1add70a

+4
+2
fs/ceph/crypto.c
··· 133 133 } 134 134 135 135 static struct fscrypt_operations ceph_fscrypt_ops = { 136 + .inode_info_offs = (int)offsetof(struct ceph_inode_info, i_crypt_info) - 137 + (int)offsetof(struct ceph_inode_info, netfs.inode), 136 138 .needs_bounce_pages = 1, 137 139 .get_context = ceph_crypt_get_context, 138 140 .set_context = ceph_crypt_set_context,
+1
fs/ceph/inode.c
··· 665 665 ci->i_work_mask = 0; 666 666 memset(&ci->i_btime, '\0', sizeof(ci->i_btime)); 667 667 #ifdef CONFIG_FS_ENCRYPTION 668 + ci->i_crypt_info = NULL; 668 669 ci->fscrypt_auth = NULL; 669 670 ci->fscrypt_auth_len = 0; 670 671 #endif
+1
fs/ceph/super.h
··· 463 463 unsigned long i_work_mask; 464 464 465 465 #ifdef CONFIG_FS_ENCRYPTION 466 + struct fscrypt_inode_info *i_crypt_info; 466 467 u32 fscrypt_auth_len; 467 468 u32 fscrypt_file_len; 468 469 u8 *fscrypt_auth;