diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2012-05-21 17:30:17 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-06-01 12:12:01 -0400 |
commit | 91daee988db38b0207eec719a3160b163c077007 (patch) | |
tree | 932e374dc322cb2ecd4d343c9c4a52b0d62467ff /fs/open.c | |
parent | 78f71eff3c274f3907f4aa1bbe3267281ba1c603 (diff) | |
download | linux-3.10-91daee988db38b0207eec719a3160b163c077007.tar.gz linux-3.10-91daee988db38b0207eec719a3160b163c077007.tar.bz2 linux-3.10-91daee988db38b0207eec719a3160b163c077007.zip |
vfs: nameidata_to_filp(): inline __dentry_open()
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>
Diffstat (limited to 'fs/open.c')
-rw-r--r-- | fs/open.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/fs/open.c b/fs/open.c index 511c548b099..9fd34b76b95 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; } |