Skip to content

Commit

Permalink
fscrypt: remove unneeded empty fscrypt_operations structs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ebiggers authored and moetayuko committed Jan 7, 2018
1 parent bb14e98 commit 95f0f0f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions fs/f2fs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1791,9 +1791,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,
Expand Down Expand Up @@ -2526,7 +2523,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;
Expand Down

0 comments on commit 95f0f0f

Please sign in to comment.