diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-06-22 04:40:19 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-07-14 08:33:39 -0400 |
commit | 30d904947459cca2beb69e0110716f5248b31f2a (patch) | |
tree | 024e2a913266377d234147b14b7eb37017546173 /fs/open.c | |
parent | a4a3bdd778715999ddfeefdc52ab76254580fa76 (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.c | 20 |
1 files changed, 11 insertions, 9 deletions
@@ -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 | */ |
784 | struct file *finish_open(struct opendata *od, struct dentry *dentry, | 784 | int 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 | } |
800 | EXPORT_SYMBOL(finish_open); | 802 | EXPORT_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 | */ |
811 | void finish_no_open(struct opendata *od, struct dentry *dentry) | 813 | void 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 | } |
815 | EXPORT_SYMBOL(finish_no_open); | 817 | EXPORT_SYMBOL(finish_no_open); |
816 | 818 | ||