summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-06-10 06:48:09 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-14 16:33:45 +0400
commite45198a6ac24bd2c4ad4a43b670c2f1a23dd2df3 (patch)
treed44f4217a8a556ac9ebb11cfc41c0e148fb1084c
parent2675a4eb6a9f1240098721c8a84ede28abd9d7b3 (diff)
make finish_no_open() return int
namely, 1 ;-) That's what we want to return from ->atomic_open() instances after finish_no_open(). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/9p/vfs_inode.c6
-rw-r--r--fs/9p/vfs_inode_dotl.c6
-rw-r--r--fs/ceph/dir.c6
-rw-r--r--fs/cifs/dir.c3
-rw-r--r--fs/fuse/dir.c3
-rw-r--r--fs/nfs/dir.c3
-rw-r--r--fs/open.c3
-rw-r--r--include/linux/fs.h2
8 files changed, 12 insertions, 20 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 2b05651e0c3d..eae476fb401c 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -878,10 +878,8 @@ v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry,
}
/* Only creates */
- if (!(flags & O_CREAT) || dentry->d_inode) {
- finish_no_open(file, res);
- return 1;
- }
+ if (!(flags & O_CREAT) || dentry->d_inode)
+ return finish_no_open(file, res);
err = 0;
fid = NULL;
diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c
index cfaebdef9743..1ee10c89df97 100644
--- a/fs/9p/vfs_inode_dotl.c
+++ b/fs/9p/vfs_inode_dotl.c
@@ -268,10 +268,8 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,
}
/* Only creates */
- if (!(flags & O_CREAT) || dentry->d_inode) {
- finish_no_open(file, res);
- return 1;
- }
+ if (!(flags & O_CREAT) || dentry->d_inode)
+ return finish_no_open(file, res);
v9ses = v9fs_inode2v9ses(dir);
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index 80c848e05390..d42eee1c5de3 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -662,10 +662,8 @@ int ceph_atomic_open(struct inode *dir, struct dentry *dentry,
}
/* We don't deal with positive dentries here */
- if (dentry->d_inode) {
- finish_no_open(file, res);
- return 1;
- }
+ if (dentry->d_inode)
+ return finish_no_open(file, res);
*opened |= FILE_CREATED;
err = ceph_lookup_open(dir, dentry, file, flags, mode, opened);
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index c00c192f17e9..e8c53c80dbd5 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -405,8 +405,7 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
if (IS_ERR(res))
return PTR_ERR(res);
- finish_no_open(file, res);
- return 1;
+ return finish_no_open(file, res);
}
rc = check_name(direntry);
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 110db5425dc1..ccdab3ac4223 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -509,8 +509,7 @@ mknod:
if (err)
goto out_dput;
no_open:
- finish_no_open(file, res);
- return 1;
+ return finish_no_open(file, res);
}
/*
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index dafc86c1c35e..f167c7a1d67b 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1505,8 +1505,7 @@ no_open:
if (IS_ERR(res))
goto out;
- finish_no_open(file, res);
- return 1;
+ return finish_no_open(file, res);
}
static int nfs4_lookup_revalidate(struct dentry *dentry, struct nameidata *nd)
diff --git a/fs/open.c b/fs/open.c
index fc829d6c3a4b..d51c1b71b062 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -810,9 +810,10 @@ 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 file *file, struct dentry *dentry)
+int finish_no_open(struct file *file, struct dentry *dentry)
{
file->f_path.dentry = dentry;
+ return 1;
}
EXPORT_SYMBOL(finish_no_open);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 1dcc75c95763..17ee20dba86c 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2071,7 +2071,7 @@ enum {
extern int finish_open(struct file *file, struct dentry *dentry,
int (*open)(struct inode *, struct file *),
int *opened);
-extern void finish_no_open(struct file *file, struct dentry *dentry);
+extern int finish_no_open(struct file *file, struct dentry *dentry);
/* fs/ioctl.c */