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

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

authored by

Eric Biggers and committed by
Christian Brauner
1f66cef4 c9fff804

+8
+3
fs/f2fs/f2fs.h
··· 910 910 #ifdef CONFIG_FS_ENCRYPTION 911 911 struct fscrypt_inode_info *i_crypt_info; /* filesystem encryption info */ 912 912 #endif 913 + #ifdef CONFIG_FS_VERITY 914 + struct fsverity_info *i_verity_info; /* filesystem verity info */ 915 + #endif 913 916 }; 914 917 915 918 static inline void get_read_extent_info(struct extent_info *ext,
+3
fs/f2fs/super.c
··· 483 483 #ifdef CONFIG_FS_ENCRYPTION 484 484 fi->i_crypt_info = NULL; 485 485 #endif 486 + #ifdef CONFIG_FS_VERITY 487 + fi->i_verity_info = NULL; 488 + #endif 486 489 } 487 490 488 491 #ifdef CONFIG_QUOTA
+2
fs/f2fs/verity.c
··· 287 287 } 288 288 289 289 const struct fsverity_operations f2fs_verityops = { 290 + .inode_info_offs = (int)offsetof(struct f2fs_inode_info, i_verity_info) - 291 + (int)offsetof(struct f2fs_inode_info, vfs_inode), 290 292 .begin_enable_verity = f2fs_begin_enable_verity, 291 293 .end_enable_verity = f2fs_end_enable_verity, 292 294 .get_verity_descriptor = f2fs_get_verity_descriptor,