From: Miklos Szeredi Date: Mon, 21 May 2012 15:30:17 +0000 (+0200) Subject: vfs: nameidata_to_filp(): inline __dentry_open() X-Git-Tag: upstream/snapshot3+hdmi~7309^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=91daee988db38b0207eec719a3160b163c077007;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git vfs: nameidata_to_filp(): inline __dentry_open() Copy __dentry_open() into nameidata_to_filp(). Signed-off-by: Miklos Szeredi Signed-off-by: Al Viro --- diff --git a/fs/open.c b/fs/open.c index 511c548..9fd34b7 100644 --- a/fs/open.c +++ b/fs/open.c @@ -828,9 +828,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; }