]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
fscrypt: remove unneeded empty fscrypt_operations structs
authorEric Biggers <ebiggers@google.com>
Mon, 9 Oct 2017 19:15:38 +0000 (12:15 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 18 Oct 2017 23:52:37 +0000 (19:52 -0400)
In the case where a filesystem has been configured without encryption
support, there is no longer any need to initialize ->s_cop at all, since
none of the methods are ever called.

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Acked-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/super.c
fs/f2fs/super.c
fs/ubifs/super.c

index bc63cdf194e39c58ae1222edbc12dc879040cfe1..04f3670748e70863f600460297ffd7eb5618d43a 100644 (file)
@@ -1244,9 +1244,6 @@ static const struct fscrypt_operations ext4_cryptops = {
        .empty_dir              = ext4_empty_dir,
        .max_namelen            = ext4_max_namelen,
 };
-#else
-static const struct fscrypt_operations ext4_cryptops = {
-};
 #endif
 
 #ifdef CONFIG_QUOTA
@@ -3998,7 +3995,9 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
        sb->s_op = &ext4_sops;
        sb->s_export_op = &ext4_export_ops;
        sb->s_xattr = ext4_xattr_handlers;
+#ifdef CONFIG_EXT4_FS_ENCRYPTION
        sb->s_cop = &ext4_cryptops;
+#endif
 #ifdef CONFIG_QUOTA
        sb->dq_op = &ext4_quota_operations;
        if (ext4_has_feature_quota(sb))
index 1cb41f711ab8f1cdcc4b061b8425a8d4d1629ab7..c1c7183b35275f89b0666aebb74d51adcd6fe95c 100644 (file)
@@ -1597,9 +1597,6 @@ static const struct fscrypt_operations f2fs_cryptops = {
        .empty_dir      = f2fs_empty_dir,
        .max_namelen    = f2fs_max_namelen,
 };
-#else
-static const struct fscrypt_operations f2fs_cryptops = {
-};
 #endif
 
 static struct inode *f2fs_nfs_get_inode(struct super_block *sb,
@@ -2318,7 +2315,9 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
 #endif
 
        sb->s_op = &f2fs_sops;
+#ifdef CONFIG_F2FS_FS_ENCRYPTION
        sb->s_cop = &f2fs_cryptops;
+#endif
        sb->s_xattr = f2fs_xattr_handlers;
        sb->s_export_op = &f2fs_export_ops;
        sb->s_magic = F2FS_SUPER_MAGIC;
index adaca60888360634fe2de7261a32cc927f851079..7503e7cdf8702a61ce91576316bfce10bd63e113 100644 (file)
@@ -2007,11 +2007,6 @@ static struct ubifs_info *alloc_ubifs_info(struct ubi_volume_desc *ubi)
        return c;
 }
 
-#ifndef CONFIG_UBIFS_FS_ENCRYPTION
-const struct fscrypt_operations ubifs_crypt_operations = {
-};
-#endif
-
 static int ubifs_fill_super(struct super_block *sb, void *data, int silent)
 {
        struct ubifs_info *c = sb->s_fs_info;
@@ -2054,7 +2049,9 @@ static int ubifs_fill_super(struct super_block *sb, void *data, int silent)
                sb->s_maxbytes = c->max_inode_sz = MAX_LFS_FILESIZE;
        sb->s_op = &ubifs_super_operations;
        sb->s_xattr = ubifs_xattr_handlers;
+#ifdef CONFIG_UBIFS_FS_ENCRYPTION
        sb->s_cop = &ubifs_crypt_operations;
+#endif
 
        mutex_lock(&c->umount_mutex);
        err = mount_ubifs(c);