make finish_no_open() return int
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 10 Jun 2012 10:48:09 +0000 (06:48 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 14 Jul 2012 12:33:45 +0000 (16:33 +0400)
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>
fs/9p/vfs_inode.c
fs/9p/vfs_inode_dotl.c
fs/ceph/dir.c
fs/cifs/dir.c
fs/fuse/dir.c
fs/nfs/dir.c
fs/open.c
include/linux/fs.h

index 2b05651e0c3d29f30c057ced8c73c3fd2fae819f..eae476fb401c45222e6e9481cc2a6915548ec93b 100644 (file)
@@ -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;
index cfaebdef9743a96031ad52063dd3b982110bf963..1ee10c89df9747ae5bc33483c5570a58ff33b672 100644 (file)
@@ -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);
 
index 80c848e05390690dcf6055c208b40acad3c7e556..d42eee1c5de3842bbd8e69d12a6d8bb1bcb75147 100644 (file)
@@ -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);
index c00c192f17e97b1a3822936dcd651d1c20e7d39a..e8c53c80dbd5d5cdb6717cf8580001212473afc7 100644 (file)
@@ -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);
index 110db5425dc1483719987899b9c48e8a45c32c60..ccdab3ac422305667324b8fed96496e52abcc706 100644 (file)
@@ -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);
 }
 
 /*
index dafc86c1c35e9df3ce91bf64a649e297b70815bb..f167c7a1d67bd149c978187107b7097c832c9fde 100644 (file)
@@ -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)
index fc829d6c3a4bd7cad48ffd1bbe6cb6249bb61ee6..d51c1b71b062b4457182f9352ec9c78c81e188e5 100644 (file)
--- 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);
 
index 1dcc75c9576340b882b664c908c8adde1688ec25..17ee20dba86cc4710d655099109e3364912cd00f 100644 (file)
@@ -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 */