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

ext4: move verity info pointer to fs-specific part of inode

Move the fsverity_info pointer into the filesystem-specific part of the
inode by adding the field ext4_inode_info::i_verity_info and configuring
fsverity_operations::inode_info_offs accordingly.

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

Co-developed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Link: https://lore.kernel.org/20250810075706.172910-10-ebiggers@kernel.org
Acked-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Eric Biggers and committed by
Christian Brauner
c9fff804 2a7349ad

+9
+4
fs/ext4/ext4.h
··· 1186 1186 #ifdef CONFIG_FS_ENCRYPTION 1187 1187 struct fscrypt_inode_info *i_crypt_info; 1188 1188 #endif 1189 + 1190 + #ifdef CONFIG_FS_VERITY 1191 + struct fsverity_info *i_verity_info; 1192 + #endif 1189 1193 }; 1190 1194 1191 1195 /*
+3
fs/ext4/super.c
··· 1473 1473 #ifdef CONFIG_FS_ENCRYPTION 1474 1474 ei->i_crypt_info = NULL; 1475 1475 #endif 1476 + #ifdef CONFIG_FS_VERITY 1477 + ei->i_verity_info = NULL; 1478 + #endif 1476 1479 } 1477 1480 1478 1481 static int __init init_inodecache(void)
+2
fs/ext4/verity.c
··· 389 389 } 390 390 391 391 const struct fsverity_operations ext4_verityops = { 392 + .inode_info_offs = (int)offsetof(struct ext4_inode_info, i_verity_info) - 393 + (int)offsetof(struct ext4_inode_info, vfs_inode), 392 394 .begin_enable_verity = ext4_begin_enable_verity, 393 395 .end_enable_verity = ext4_end_enable_verity, 394 396 .get_verity_descriptor = ext4_get_verity_descriptor,