summaryrefslogtreecommitdiffstats
path: root/fs/9p/vfs_inode.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-06-22 12:39:14 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-14 16:33:35 +0400
commitd95852777bc8ba6b3ad3397d495c5f9dd8ca8383 (patch)
tree96e9d8b1d33c4f6f7b5ba5be0fa4fd8f77c7a67f /fs/9p/vfs_inode.c
parent3d8a00d2099ebc6d5a6e95fadaf861709d9919a8 (diff)
downloadlinux-stable-d95852777bc8ba6b3ad3397d495c5f9dd8ca8383.tar.gz
linux-stable-d95852777bc8ba6b3ad3397d495c5f9dd8ca8383.tar.bz2
linux-stable-d95852777bc8ba6b3ad3397d495c5f9dd8ca8383.zip
make ->atomic_open() return int
Change of calling conventions: old new NULL 1 file 0 ERR_PTR(-ve) -ve Caller *knows* that struct file *; no need to return it. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/9p/vfs_inode.c')
-rw-r--r--fs/9p/vfs_inode.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index de626b3b342f..62ce8daefa95 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -856,7 +856,7 @@ error:
return ERR_PTR(result);
}
-static struct file *
+static int
v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry,
struct opendata *od, unsigned flags, umode_t mode,
int *opened)
@@ -872,7 +872,7 @@ v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry,
if (d_unhashed(dentry)) {
res = v9fs_vfs_lookup(dir, dentry, NULL);
if (IS_ERR(res))
- return ERR_CAST(res);
+ return PTR_ERR(res);
if (res)
dentry = res;
@@ -881,7 +881,7 @@ v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry,
/* Only creates */
if (!(flags & O_CREAT) || dentry->d_inode) {
finish_no_open(od, res);
- return NULL;
+ return 1;
}
err = 0;
@@ -933,13 +933,11 @@ v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry,
*opened |= FILE_CREATED;
out:
dput(res);
- return filp;
+ return err;
error:
if (fid)
p9_client_clunk(fid);
-
- filp = ERR_PTR(err);
goto out;
}