Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso...
[linux.git] / fs / crypto / policy.c
index 94becf5a151902e23ab1986d9ff201de60a0ad33..ce07a86200f3344a7e10f24b0beecd8354e9fe21 100644 (file)
@@ -38,12 +38,8 @@ static int create_encryption_context_from_policy(struct inode *inode,
        memcpy(ctx.master_key_descriptor, policy->master_key_descriptor,
                                        FS_KEY_DESCRIPTOR_SIZE);
 
-       if (!fscrypt_valid_contents_enc_mode(
-                               policy->contents_encryption_mode))
-               return -EINVAL;
-
-       if (!fscrypt_valid_filenames_enc_mode(
-                               policy->filenames_encryption_mode))
+       if (!fscrypt_valid_enc_modes(policy->contents_encryption_mode,
+                                    policy->filenames_encryption_mode))
                return -EINVAL;
 
        if (policy->flags & ~FS_POLICY_FLAGS_VALID)