aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/namei.c
diff options
context:
space:
mode:
authorChandan Rajendra <chandan@linux.vnet.ibm.com>2018-12-12 04:50:11 -0500
committerTheodore Ts'o <tytso@mit.edu>2019-01-23 23:56:43 -0500
commit62230e0d702f613e2f93e9c3ffd2893b36eff2db (patch)
treed0d4289fdb1d21868261dfae97f8da6bbaae672f /fs/f2fs/namei.c
parent592ddec7578a33fb6b3e2ba78aed91614bbb30e2 (diff)
f2fs: use IS_ENCRYPTED() to check encryption status
This commit removes the f2fs specific f2fs_encrypted_inode() and makes use of the generic IS_ENCRYPTED() macro to check for the encryption status of an inode. Acked-by: Chao Yu <yuchao0@huawei.com> Reviewed-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com> Signed-off-by: Eric Biggers <ebiggers@google.com>
Diffstat (limited to 'fs/f2fs/namei.c')
-rw-r--r--fs/f2fs/namei.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index 62d9829f3a6a..e967d27c1a89 100644
--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -75,7 +75,7 @@ static struct inode *f2fs_new_inode(struct inode *dir, umode_t mode)
75 set_inode_flag(inode, FI_NEW_INODE); 75 set_inode_flag(inode, FI_NEW_INODE);
76 76
77 /* If the directory encrypted, then we should encrypt the inode. */ 77 /* If the directory encrypted, then we should encrypt the inode. */
78 if ((f2fs_encrypted_inode(dir) || DUMMY_ENCRYPTION_ENABLED(sbi)) && 78 if ((IS_ENCRYPTED(dir) || DUMMY_ENCRYPTION_ENABLED(sbi)) &&
79 f2fs_may_encrypt(inode)) 79 f2fs_may_encrypt(inode))
80 f2fs_set_encrypted_inode(inode); 80 f2fs_set_encrypted_inode(inode);
81 81
@@ -476,7 +476,7 @@ static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry,
476 if (err) 476 if (err)
477 goto out_iput; 477 goto out_iput;
478 } 478 }
479 if (f2fs_encrypted_inode(dir) && 479 if (IS_ENCRYPTED(dir) &&
480 (S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode)) && 480 (S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode)) &&
481 !fscrypt_has_permitted_context(dir, inode)) { 481 !fscrypt_has_permitted_context(dir, inode)) {
482 f2fs_msg(inode->i_sb, KERN_WARNING, 482 f2fs_msg(inode->i_sb, KERN_WARNING,
@@ -803,7 +803,7 @@ static int f2fs_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode)
803 if (unlikely(f2fs_cp_error(sbi))) 803 if (unlikely(f2fs_cp_error(sbi)))
804 return -EIO; 804 return -EIO;
805 805
806 if (f2fs_encrypted_inode(dir) || DUMMY_ENCRYPTION_ENABLED(sbi)) { 806 if (IS_ENCRYPTED(dir) || DUMMY_ENCRYPTION_ENABLED(sbi)) {
807 int err = fscrypt_get_encryption_info(dir); 807 int err = fscrypt_get_encryption_info(dir);
808 if (err) 808 if (err)
809 return err; 809 return err;