aboutsummaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-06-22 04:40:19 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-14 08:33:39 -0400
commit30d904947459cca2beb69e0110716f5248b31f2a (patch)
tree024e2a913266377d234147b14b7eb37017546173 /fs/open.c
parenta4a3bdd778715999ddfeefdc52ab76254580fa76 (diff)
kill struct opendata
Just pass struct file *. Methods are happier that way... There's no need to return struct file * from finish_open() now, so let it return int. Next: saner prototypes for parts in namei.c Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/fs/open.c b/fs/open.c
index 2b1654d8bfbd..fc829d6c3a4b 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -781,21 +781,23 @@ static struct file *__dentry_open(struct dentry *dentry, struct vfsmount *mnt,
781 * If the open callback is set to NULL, then the standard f_op->open() 781 * If the open callback is set to NULL, then the standard f_op->open()
782 * filesystem callback is substituted. 782 * filesystem callback is substituted.
783 */ 783 */
784struct file *finish_open(struct opendata *od, struct dentry *dentry, 784int finish_open(struct file *file, struct dentry *dentry,
785 int (*open)(struct inode *, struct file *), 785 int (*open)(struct inode *, struct file *),
786 int *opened) 786 int *opened)
787{ 787{
788 struct file *res; 788 struct file *res;
789 BUG_ON(*opened & FILE_OPENED); /* once it's opened, it's opened */ 789 BUG_ON(*opened & FILE_OPENED); /* once it's opened, it's opened */
790 790
791 mntget(od->filp->f_path.mnt); 791 mntget(file->f_path.mnt);
792 dget(dentry); 792 dget(dentry);
793 793
794 res = do_dentry_open(dentry, od->filp->f_path.mnt, od->filp, open, current_cred()); 794 res = do_dentry_open(dentry, file->f_path.mnt, file, open, current_cred());
795 if (!IS_ERR(res)) 795 if (!IS_ERR(res)) {
796 *opened |= FILE_OPENED; 796 *opened |= FILE_OPENED;
797 return 0;
798 }
797 799
798 return res; 800 return PTR_ERR(res);
799} 801}
800EXPORT_SYMBOL(finish_open); 802EXPORT_SYMBOL(finish_open);
801 803
@@ -808,9 +810,9 @@ EXPORT_SYMBOL(finish_open);
808 * This can be used to set the result of a successful lookup in ->atomic_open(). 810 * This can be used to set the result of a successful lookup in ->atomic_open().
809 * The filesystem's atomic_open() method shall return NULL after calling this. 811 * The filesystem's atomic_open() method shall return NULL after calling this.
810 */ 812 */
811void finish_no_open(struct opendata *od, struct dentry *dentry) 813void finish_no_open(struct file *file, struct dentry *dentry)
812{ 814{
813 od->filp->f_path.dentry = dentry; 815 file->f_path.dentry = dentry;
814} 816}
815EXPORT_SYMBOL(finish_no_open); 817EXPORT_SYMBOL(finish_no_open);
816 818