Skip to contentSkip to conversation

fs, fscrypt: only define ->s_cop when FS_ENCRYPTION is enabled

PATCH New Eric Biggers 1 participant 1 message Feb 22, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs, fscrypt: only define ->s_cop when FS_ENCRYPTION is enabled

From: Eric Biggers <[email protected]>

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.

---
 include/linux/fs.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/fs.h +2 -2
index 2a815560fda0..ae0dae78d1c6 100644
@@ -1361,9 +1361,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;
Signature · 1 line
2.16.1.291.g4437f3f132-goog