Skip to content

Commit

Permalink
vfs: nameidata_to_filp(): inline __dentry_open()
Browse files Browse the repository at this point in the history
Copy __dentry_open() into nameidata_to_filp().

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Miklos Szeredi authored and Al Viro committed Jun 1, 2012
1 parent 78f71ef commit 91daee9
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions fs/open.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 91daee9

Please sign in to comment.