summaryrefslogtreecommitdiffstats
path: root/fs/crypto/policy.c
diff options
context:
space:
mode:
authorEric Biggers2017-10-09 21:15:36 +0200
committerTheodore Ts'o2017-10-19 01:52:36 +0200
commite0428a266d5a29a3c2eec287fcd49be9e8e2468e (patch)
tree0ecedc8aa9793db447da6abdb31506229f582a50 /fs/crypto/policy.c
parentfs, fscrypt: add an S_ENCRYPTED inode flag (diff)
downloadkernel-qcow2-linux-e0428a266d5a29a3c2eec287fcd49be9e8e2468e.tar.gz
kernel-qcow2-linux-e0428a266d5a29a3c2eec287fcd49be9e8e2468e.tar.xz
kernel-qcow2-linux-e0428a266d5a29a3c2eec287fcd49be9e8e2468e.zip
fscrypt: switch from ->is_encrypted() to IS_ENCRYPTED()
IS_ENCRYPTED() now gives the same information as i_sb->s_cop->is_encrypted() but is more efficient, since IS_ENCRYPTED() is just a simple flag check. Prepare to remove ->is_encrypted() by switching all callers to IS_ENCRYPTED(). 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/crypto/policy.c')
-rw-r--r--fs/crypto/policy.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/crypto/policy.c b/fs/crypto/policy.c
index ce07a86200f3..6a63b8a0d46c 100644
--- a/fs/crypto/policy.c
+++ b/fs/crypto/policy.c
@@ -109,7 +109,7 @@ int fscrypt_ioctl_get_policy(struct file *filp, void __user *arg)
struct fscrypt_policy policy;
int res;
- if (!inode->i_sb->s_cop->is_encrypted(inode))
+ if (!IS_ENCRYPTED(inode))
return -ENODATA;
res = inode->i_sb->s_cop->get_context(inode, &ctx, sizeof(ctx));
@@ -166,11 +166,11 @@ int fscrypt_has_permitted_context(struct inode *parent, struct inode *child)
return 1;
/* No restrictions if the parent directory is unencrypted */
- if (!cops->is_encrypted(parent))
+ if (!IS_ENCRYPTED(parent))
return 1;
/* Encrypted directories must not contain unencrypted files */
- if (!cops->is_encrypted(child))
+ if (!IS_ENCRYPTED(child))
return 0;
/*