ubifs: switch to fscrypt_prepare_lookup()
authorEric Biggers <ebiggers@google.com>
Wed, 29 Nov 2017 20:43:16 +0000 (12:43 -0800)
committerRichard Weinberger <richard@nod.at>
Wed, 17 Jan 2018 20:48:04 +0000 (21:48 +0100)
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
fs/ubifs/dir.c

index 7bf847d79b4a3457510c26dfdfd16d380b61c715..a2ea4856e67b127e97b56d505f2b694df1f57d1a 100644 (file)
@@ -220,20 +220,9 @@ static struct dentry *ubifs_lookup(struct inode *dir, struct dentry *dentry,
 
        dbg_gen("'%pd' in dir ino %lu", dentry, dir->i_ino);
 
-       if (ubifs_crypt_is_encrypted(dir)) {
-               err = fscrypt_get_encryption_info(dir);
-
-               /*
-                * DCACHE_ENCRYPTED_WITH_KEY is set if the dentry is
-                * created while the directory was encrypted and we
-                * have access to the key.
-                */
-               if (fscrypt_has_encryption_key(dir))
-                       fscrypt_set_encrypted_dentry(dentry);
-               fscrypt_set_d_op(dentry);
-               if (err && err != -ENOKEY)
-                       return ERR_PTR(err);
-       }
+       err = fscrypt_prepare_lookup(dir, dentry, flags);
+       if (err)
+               return ERR_PTR(err);
 
        err = fscrypt_setup_filename(dir, &dentry->d_name, 1, &nm);
        if (err)