fs, fscrypt: only define ->s_cop when FS_ENCRYPTION is enabled
authorEric Biggers <ebiggers@google.com>
Mon, 30 Apr 2018 22:51:35 +0000 (15:51 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 20 May 2018 20:20:59 +0000 (16:20 -0400)
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 <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
include/linux/fs.h

index 760d8da1b6c7dc8b6d16703e1f65de918ec8460e..8e2460694c3ae2d63f2058bdeebcc44bf5d08b9d 100644 (file)
@@ -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;