From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757656Ab2DYMo1 (ORCPT ); Wed, 25 Apr 2012 08:44:27 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:54819 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757349Ab2DYMoY (ORCPT ); Wed, 25 Apr 2012 08:44:24 -0400 From: Miklos Szeredi To: viro@ZenIV.linux.org.uk Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, hch@infradead.org, torvalds@linux-foundation.org, mszeredi@suse.cz Subject: [PATCH 13/16] vfs: nameidata_to_filp(): inline __dentry_open() Date: Wed, 25 Apr 2012 14:44:14 +0200 Message-Id: <1335357857-16416-14-git-send-email-miklos@szeredi.hu> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1335357857-16416-1-git-send-email-miklos@szeredi.hu> References: <1335357857-16416-1-git-send-email-miklos@szeredi.hu> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miklos Szeredi Copy __dentry_open() into nameidata_to_filp(). Signed-off-by: Miklos Szeredi --- fs/open.c | 20 ++++++++++++++++++-- 1 files changed, 18 insertions(+), 2 deletions(-) diff --git a/fs/open.c b/fs/open.c index e1448cd..161c15f 100644 --- a/fs/open.c +++ b/fs/open.c @@ -818,9 +818,25 @@ struct file *nameidata_to_filp(struct nameidata *nd) /* Has the filesystem initialised the file for us? */ if (filp->f_path.dentry == NULL) { + struct file *res; + path_get(&nd->path); - filp = __dentry_open(nd->path.dentry, nd->path.mnt, filp, - NULL, cred); + res = do_dentry_open(nd->path.dentry, nd->path.mnt, + filp, NULL, cred); + if (!IS_ERR(res)) { + int error; + + BUG_ON(res != filp); + + error = open_check_o_direct(filp); + if (error) { + fput(filp); + filp = ERR_PTR(error); + } + } else { + put_filp(filp); + filp = res; + } } return filp; } -- 1.7.7