diff options
author | Eric Biggers <ebiggers@google.com> | 2017-04-04 17:39:41 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2017-04-30 01:26:34 -0400 |
commit | cd39e4bac11125bc32ba6101b1ceb46ef773f4b6 (patch) | |
tree | 11f17b3e501c7bf09dee2fcc06ea38751e7fa7f3 /fs/crypto/keyinfo.c | |
parent | 39da7c509acff13fc8cb12ec1bb20337c988ed36 (diff) |
fscrypt: remove unnecessary checks for NULL operations
The functions in fs/crypto/*.c are only called by filesystems configured
with encryption support. Since the ->get_context(), ->set_context(),
and ->empty_dir() operations are always provided in that case (and must
be, otherwise there would be no way to get/set encryption policies, or
in the case of ->get_context() even access encrypted files at all),
there is no need to check for these operations being NULL and we can
remove these unneeded checks.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/crypto/keyinfo.c')
-rw-r--r-- | fs/crypto/keyinfo.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/fs/crypto/keyinfo.c b/fs/crypto/keyinfo.c index 8cdfddce2b34..179e578b875b 100644 --- a/fs/crypto/keyinfo.c +++ b/fs/crypto/keyinfo.c | |||
@@ -183,9 +183,6 @@ int fscrypt_get_encryption_info(struct inode *inode) | |||
183 | if (res) | 183 | if (res) |
184 | return res; | 184 | return res; |
185 | 185 | ||
186 | if (!inode->i_sb->s_cop->get_context) | ||
187 | return -EOPNOTSUPP; | ||
188 | |||
189 | res = inode->i_sb->s_cop->get_context(inode, &ctx, sizeof(ctx)); | 186 | res = inode->i_sb->s_cop->get_context(inode, &ctx, sizeof(ctx)); |
190 | if (res < 0) { | 187 | if (res < 0) { |
191 | if (!fscrypt_dummy_context_enabled(inode) || | 188 | if (!fscrypt_dummy_context_enabled(inode) || |