From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Biggers Subject: [PATCH 19/25] f2fs: switch to fscrypt_prepare_lookup() Date: Wed, 20 Sep 2017 15:45:59 -0700 Message-ID: <20170920224605.22030-20-ebiggers3@gmail.com> References: <20170920224605.22030-1-ebiggers3@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtps (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.89) (envelope-from ) id 1dunm2-0000aI-30 for linux-f2fs-devel@lists.sourceforge.net; Wed, 20 Sep 2017 22:47:18 +0000 Received: from mail-pf0-f194.google.com ([209.85.192.194]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:AES128-SHA:128) (Exim 4.76) id 1dunm1-0004u2-9s for linux-f2fs-devel@lists.sourceforge.net; Wed, 20 Sep 2017 22:47:18 +0000 Received: by mail-pf0-f194.google.com with SMTP id g65so1725873pfe.1 for ; Wed, 20 Sep 2017 15:47:17 -0700 (PDT) In-Reply-To: <20170920224605.22030-1-ebiggers3@gmail.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net To: linux-fscrypt@vger.kernel.org Cc: "Theodore Y . Ts'o" , Eric Biggers , Michael Halcrow , linux-f2fs-devel@lists.sourceforge.net, linux-mtd@lists.infradead.org, linux-fsdevel@vger.kernel.org, Jaegeuk Kim , linux-ext4@vger.kernel.org From: Eric Biggers Signed-off-by: Eric Biggers --- fs/f2fs/namei.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index 80bcf2185fd8..f4b99f1468d8 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c @@ -335,20 +335,9 @@ static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry, int err = 0; unsigned int root_ino = F2FS_ROOT_INO(F2FS_I_SB(dir)); - if (f2fs_encrypted_inode(dir)) { - int res = fscrypt_get_encryption_info(dir); - - /* - * DCACHE_ENCRYPTED_WITH_KEY is set if the dentry is - * created while the directory was encrypted and we - * don't have access to the key. - */ - if (fscrypt_has_encryption_key(dir)) - fscrypt_set_encrypted_dentry(dentry); - fscrypt_set_d_op(dentry); - if (res && res != -ENOKEY) - return ERR_PTR(res); - } + err = fscrypt_prepare_lookup(dir, dentry, flags); + if (err) + return ERR_PTR(err); if (dentry->d_name.len > F2FS_NAME_LEN) return ERR_PTR(-ENAMETOOLONG); -- 2.14.1.821.g8fa685d3b7-goog ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot