Commit 91daee98 authored by Miklos Szeredi's avatar Miklos Szeredi Committed by Al Viro

vfs: nameidata_to_filp(): inline __dentry_open()

Copy __dentry_open() into nameidata_to_filp().
Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 78f71eff
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment