gfs2_atomic_open(): simplify the use of finish_no_open()
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 19 Nov 2014 02:10:23 +0000 (21:10 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 19 Nov 2014 17:57:21 +0000 (12:57 -0500)
In ->atomic_open(inode, dentry, file, opened) calling finish_no_open(file, NULL)
is equivalent to dget(dentry); return finish_no_open(file, dentry);

No need to open-code that...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/gfs2/inode.c

index ce0cf9ad5f970988fb2e536fb37fef54cbb8e4b4..6e2917433170501f6b988649b6ce1c2f233700c2 100644 (file)
@@ -1249,11 +1249,8 @@ static int gfs2_atomic_open(struct inode *dir, struct dentry *dentry,
        if (d != NULL)
                dentry = d;
        if (dentry->d_inode) {
-               if (!(*opened & FILE_OPENED)) {
-                       if (d == NULL)
-                               dget(dentry);
-                       return finish_no_open(file, dentry);
-               }
+               if (!(*opened & FILE_OPENED))
+                       return finish_no_open(file, d);
                dput(d);
                return 0;
        }