GFS2: gfs2_atomic_open(): simplify the use of finish_no_open()
authorAl Viro <viro@ZenIV.linux.org.uk>
Wed, 19 Nov 2014 19:35:58 +0000 (19:35 +0000)
committerSteven Whitehouse <swhiteho@redhat.com>
Thu, 20 Nov 2014 11:18:08 +0000 (11:18 +0000)
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>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/inode.c

index 9e8545bbc55c96cbee4ae6e0643431f4033f5fbc..9054002ebe70dceb3b1483be3fbd54ea15f2e06a 100644 (file)
@@ -1245,11 +1245,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;
        }