aboutsummaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-06-26 13:58:53 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-22 16:01:29 -0400
commit765927b2d508712d320c8934db963bbe14c3fcec (patch)
tree97acdb14fae285764def396c4ed01d4d5c93e76a /fs/open.c
parentbf349a447059656ebe63fb4fd1ccb27ac1da22ad (diff)
switch dentry_open() to struct path, make it grab references itself
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/fs/open.c b/fs/open.c
index 75bea868ef8a..1e914b397e12 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -766,11 +766,7 @@ int finish_no_open(struct file *file, struct dentry *dentry)
766} 766}
767EXPORT_SYMBOL(finish_no_open); 767EXPORT_SYMBOL(finish_no_open);
768 768
769/* 769struct file *dentry_open(const struct path *path, int flags,
770 * dentry_open() will have done dput(dentry) and mntput(mnt) if it returns an
771 * error.
772 */
773struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags,
774 const struct cred *cred) 770 const struct cred *cred)
775{ 771{
776 int error; 772 int error;
@@ -779,19 +775,16 @@ struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags,
779 validate_creds(cred); 775 validate_creds(cred);
780 776
781 /* We must always pass in a valid mount pointer. */ 777 /* We must always pass in a valid mount pointer. */
782 BUG_ON(!mnt); 778 BUG_ON(!path->mnt);
783 779
784 error = -ENFILE; 780 error = -ENFILE;
785 f = get_empty_filp(); 781 f = get_empty_filp();
786 if (f == NULL) { 782 if (f == NULL)
787 dput(dentry);
788 mntput(mnt);
789 return ERR_PTR(error); 783 return ERR_PTR(error);
790 }
791 784
792 f->f_flags = flags; 785 f->f_flags = flags;
793 f->f_path.mnt = mnt; 786 f->f_path = *path;
794 f->f_path.dentry = dentry; 787 path_get(&f->f_path);
795 error = do_dentry_open(f, NULL, cred); 788 error = do_dentry_open(f, NULL, cred);
796 if (!error) { 789 if (!error) {
797 error = open_check_o_direct(f); 790 error = open_check_o_direct(f);