summaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-06-22 12:40:19 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-14 16:33:39 +0400
commit30d904947459cca2beb69e0110716f5248b31f2a (patch)
tree024e2a913266377d234147b14b7eb37017546173 /fs/open.c
parenta4a3bdd778715999ddfeefdc52ab76254580fa76 (diff)
downloadlinux-30d904947459cca2beb69e0110716f5248b31f2a.tar.bz2
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,
* If the open callback is set to NULL, then the standard f_op->open()
* filesystem callback is substituted.
*/
-struct file *finish_open(struct opendata *od, struct dentry *dentry,
- int (*open)(struct inode *, struct file *),
- int *opened)
+int finish_open(struct file *file, struct dentry *dentry,
+ int (*open)(struct inode *, struct file *),
+ int *opened)
{
struct file *res;
BUG_ON(*opened & FILE_OPENED); /* once it's opened, it's opened */
- mntget(od->filp->f_path.mnt);
+ mntget(file->f_path.mnt);
dget(dentry);
- res = do_dentry_open(dentry, od->filp->f_path.mnt, od->filp, open, current_cred());
- if (!IS_ERR(res))
+ res = do_dentry_open(dentry, file->f_path.mnt, file, open, current_cred());
+ if (!IS_ERR(res)) {
*opened |= FILE_OPENED;
+ return 0;
+ }
- return res;
+ return PTR_ERR(res);
}
EXPORT_SYMBOL(finish_open);
@@ -808,9 +810,9 @@ EXPORT_SYMBOL(finish_open);
* This can be used to set the result of a successful lookup in ->atomic_open().
* The filesystem's atomic_open() method shall return NULL after calling this.
*/
-void finish_no_open(struct opendata *od, struct dentry *dentry)
+void finish_no_open(struct file *file, struct dentry *dentry)
{
- od->filp->f_path.dentry = dentry;
+ file->f_path.dentry = dentry;
}
EXPORT_SYMBOL(finish_no_open);