diff options
| author | Dmitry Shmidt <dimitrysh@google.com> | 2016-08-01 15:51:01 -0700 |
|---|---|---|
| committer | Dmitry Shmidt <dimitrysh@google.com> | 2016-08-01 15:57:55 -0700 |
| commit | b558f17a13b10761eb6f838e713425b9e83f8a01 (patch) | |
| tree | 425828a423411d6c65e5b18a3330d244eef987b0 /fs/open.c | |
| parent | 818aa36ea868ba8f2985f9ca0906fd9cba3e437d (diff) | |
| parent | b05965f284db3e086022f4e318e46cb5bffb1376 (diff) | |
Merge tag 'v4.4.16' into android-4.4.y
This is the 4.4.16 stable release
Change-Id: Ibaf7b7e03695e1acebc654a2ca1a4bfcc48fcea4
Diffstat (limited to 'fs/open.c')
| -rw-r--r-- | fs/open.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/fs/open.c b/fs/open.c index b6f1e96a7c0b..157b9940dd73 100644 --- a/fs/open.c +++ b/fs/open.c @@ -840,16 +840,12 @@ EXPORT_SYMBOL(file_path); int vfs_open(const struct path *path, struct file *file, const struct cred *cred) { - struct dentry *dentry = path->dentry; - struct inode *inode = dentry->d_inode; + struct inode *inode = vfs_select_inode(path->dentry, file->f_flags); - file->f_path = *path; - if (dentry->d_flags & DCACHE_OP_SELECT_INODE) { - inode = dentry->d_op->d_select_inode(dentry, file->f_flags); - if (IS_ERR(inode)) - return PTR_ERR(inode); - } + if (IS_ERR(inode)) + return PTR_ERR(inode); + file->f_path = *path; return do_dentry_open(file, inode, NULL, cred); } @@ -995,14 +991,12 @@ struct file *filp_open(const char *filename, int flags, umode_t mode) EXPORT_SYMBOL(filp_open); struct file *file_open_root(struct dentry *dentry, struct vfsmount *mnt, - const char *filename, int flags) + const char *filename, int flags, umode_t mode) { struct open_flags op; - int err = build_open_flags(flags, 0, &op); + int err = build_open_flags(flags, mode, &op); if (err) return ERR_PTR(err); - if (flags & O_CREAT) - return ERR_PTR(-EINVAL); return do_file_open_root(dentry, mnt, filename, &op); } EXPORT_SYMBOL(file_open_root); |
