diff options
Diffstat (limited to 'fs/open.c')
-rw-r--r-- | fs/open.c | 17 |
1 files changed, 5 insertions, 12 deletions
@@ -766,11 +766,7 @@ int finish_no_open(struct file *file, struct dentry *dentry) | |||
766 | } | 766 | } |
767 | EXPORT_SYMBOL(finish_no_open); | 767 | EXPORT_SYMBOL(finish_no_open); |
768 | 768 | ||
769 | /* | 769 | struct 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 | */ | ||
773 | struct 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); |