diff options
| author | Eric Biggers <ebiggers@google.com> | 2017-10-09 15:15:38 -0400 |
|---|---|---|
| committer | Theodore Ts'o <tytso@mit.edu> | 2017-10-18 19:52:37 -0400 |
| commit | ffcc41829ae043d0830bcd4536812fec7e098d93 (patch) | |
| tree | dec5c48fa7632fe85d8b639644723d242b07e71a /fs/ext4 | |
| parent | f7293e48bb1d0c482cd706deb1256a6be718f4f5 (diff) | |
fscrypt: remove unneeded empty fscrypt_operations structs
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>
Diffstat (limited to 'fs/ext4')
| -rw-r--r-- | fs/ext4/super.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index bc63cdf194e3..04f3670748e7 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
| @@ -1244,9 +1244,6 @@ static const struct fscrypt_operations ext4_cryptops = { | |||
| 1244 | .empty_dir = ext4_empty_dir, | 1244 | .empty_dir = ext4_empty_dir, |
| 1245 | .max_namelen = ext4_max_namelen, | 1245 | .max_namelen = ext4_max_namelen, |
| 1246 | }; | 1246 | }; |
| 1247 | #else | ||
| 1248 | static const struct fscrypt_operations ext4_cryptops = { | ||
| 1249 | }; | ||
| 1250 | #endif | 1247 | #endif |
| 1251 | 1248 | ||
| 1252 | #ifdef CONFIG_QUOTA | 1249 | #ifdef CONFIG_QUOTA |
| @@ -3998,7 +3995,9 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
| 3998 | sb->s_op = &ext4_sops; | 3995 | sb->s_op = &ext4_sops; |
| 3999 | sb->s_export_op = &ext4_export_ops; | 3996 | sb->s_export_op = &ext4_export_ops; |
| 4000 | sb->s_xattr = ext4_xattr_handlers; | 3997 | sb->s_xattr = ext4_xattr_handlers; |
| 3998 | #ifdef CONFIG_EXT4_FS_ENCRYPTION | ||
| 4001 | sb->s_cop = &ext4_cryptops; | 3999 | sb->s_cop = &ext4_cryptops; |
| 4000 | #endif | ||
| 4002 | #ifdef CONFIG_QUOTA | 4001 | #ifdef CONFIG_QUOTA |
| 4003 | sb->dq_op = &ext4_quota_operations; | 4002 | sb->dq_op = &ext4_quota_operations; |
| 4004 | if (ext4_has_feature_quota(sb)) | 4003 | if (ext4_has_feature_quota(sb)) |
