diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-06-10 14:24:38 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-07-14 08:33:52 -0400 |
commit | 2a027e7a1873812240cbdac0f55c4734ff0042a5 (patch) | |
tree | 0442aad91b63d57dcdb9090ce9e0c66cdedad4cb /fs/open.c | |
parent | 96b7e579addd3cdc806c1667bf5b6b126070827c (diff) |
fold __dentry_open() into its sole caller
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/open.c')
-rw-r--r-- | fs/open.c | 33 |
1 files changed, 12 insertions, 21 deletions
@@ -752,26 +752,6 @@ cleanup_file: | |||
752 | return error; | 752 | return error; |
753 | } | 753 | } |
754 | 754 | ||
755 | static struct file *__dentry_open(struct dentry *dentry, struct vfsmount *mnt, | ||
756 | struct file *f, | ||
757 | int (*open)(struct inode *, struct file *), | ||
758 | const struct cred *cred) | ||
759 | { | ||
760 | int error; | ||
761 | error = do_dentry_open(dentry, mnt, f, open, cred); | ||
762 | if (!error) { | ||
763 | error = open_check_o_direct(f); | ||
764 | if (error) { | ||
765 | fput(f); | ||
766 | f = ERR_PTR(error); | ||
767 | } | ||
768 | } else { | ||
769 | put_filp(f); | ||
770 | f = ERR_PTR(error); | ||
771 | } | ||
772 | return f; | ||
773 | } | ||
774 | |||
775 | /** | 755 | /** |
776 | * finish_open - finish opening a file | 756 | * finish_open - finish opening a file |
777 | * @od: opaque open data | 757 | * @od: opaque open data |
@@ -841,7 +821,18 @@ struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags, | |||
841 | } | 821 | } |
842 | 822 | ||
843 | f->f_flags = flags; | 823 | f->f_flags = flags; |
844 | return __dentry_open(dentry, mnt, f, NULL, cred); | 824 | error = do_dentry_open(dentry, mnt, f, NULL, cred); |
825 | if (!error) { | ||
826 | error = open_check_o_direct(f); | ||
827 | if (error) { | ||
828 | fput(f); | ||
829 | f = ERR_PTR(error); | ||
830 | } | ||
831 | } else { | ||
832 | put_filp(f); | ||
833 | f = ERR_PTR(error); | ||
834 | } | ||
835 | return f; | ||
845 | } | 836 | } |
846 | EXPORT_SYMBOL(dentry_open); | 837 | EXPORT_SYMBOL(dentry_open); |
847 | 838 | ||