From: Eric Biggers Date: Mon, 30 Apr 2018 22:51:35 +0000 (-0700) Subject: fs, fscrypt: only define ->s_cop when FS_ENCRYPTION is enabled X-Git-Tag: v4.18-rc1~141^2~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbbc3fb663947764d338c305087322a646298894;p=thirdparty%2Fkernel%2Flinux.git fs, fscrypt: only define ->s_cop when FS_ENCRYPTION is enabled Now that filesystems only set and use their fscrypt_operations when they are built with encryption support, we can remove ->s_cop from 'struct super_block' when FS_ENCRYPTION is disabled. This saves a few bytes on some kernels and also makes it consistent with ->i_crypt_info. Signed-off-by: Eric Biggers Signed-off-by: Theodore Ts'o --- diff --git a/include/linux/fs.h b/include/linux/fs.h index 760d8da1b6c7d..8e2460694c3ae 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1364,9 +1364,9 @@ struct super_block { void *s_security; #endif const struct xattr_handler **s_xattr; - +#if IS_ENABLED(CONFIG_FS_ENCRYPTION) const struct fscrypt_operations *s_cop; - +#endif struct hlist_bl_head s_roots; /* alternate root dentries for NFS */ struct list_head s_mounts; /* list of mounts; _not_ for fs use */ struct block_device *s_bdev;