]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
gfs2: Clean up initialization of "ip" in gfs2_create_inode
authorAndreas Gruenbacher <agruenba@redhat.com>
Wed, 2 Nov 2022 17:34:42 +0000 (18:34 +0100)
committerAndreas Gruenbacher <agruenba@redhat.com>
Fri, 2 Dec 2022 14:58:00 +0000 (15:58 +0100)
Initialize variable "ip" earlier so that it can be used interchangeably
with "inode" everywhere.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/inode.c

index 465f1673101fa598a9d8588bd2b5ae92ccee66a7..b91f15abe24e8988af6ba6cc882a8bec1959fffd 100644 (file)
@@ -659,12 +659,12 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
        error = -ENOMEM;
        if (!inode)
                goto fail_gunlock;
+       ip = GFS2_I(inode);
 
        error = posix_acl_create(dir, &mode, &default_acl, &acl);
        if (error)
                goto fail_gunlock;
 
-       ip = GFS2_I(inode);
        error = gfs2_qa_get(ip);
        if (error)
                goto fail_free_acls;
@@ -821,7 +821,7 @@ fail_gunlock:
                if (!free_vfs_inode)
                        mark_inode_dirty(inode);
                set_bit(free_vfs_inode ? GIF_FREE_VFS_INODE : GIF_ALLOC_FAILED,
-                       &GFS2_I(inode)->i_flags);
+                       &ip->i_flags);
                if (inode->i_state & I_NEW)
                        iget_failed(inode);
                else