Skip to content

Commit 3d0258b

Browse files
author
Andreas Gruenbacher
committed
gfs2: Clean up initialization of "ip" in gfs2_create_inode
Initialize variable "ip" earlier so that it can be used interchangeably with "inode" everywhere. Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent 761fdbb commit 3d0258b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/gfs2/inode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,12 +659,12 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
659659
error = -ENOMEM;
660660
if (!inode)
661661
goto fail_gunlock;
662+
ip = GFS2_I(inode);
662663

663664
error = posix_acl_create(dir, &mode, &default_acl, &acl);
664665
if (error)
665666
goto fail_gunlock;
666667

667-
ip = GFS2_I(inode);
668668
error = gfs2_qa_get(ip);
669669
if (error)
670670
goto fail_free_acls;
@@ -821,7 +821,7 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
821821
if (!free_vfs_inode)
822822
mark_inode_dirty(inode);
823823
set_bit(free_vfs_inode ? GIF_FREE_VFS_INODE : GIF_ALLOC_FAILED,
824-
&GFS2_I(inode)->i_flags);
824+
&ip->i_flags);
825825
if (inode->i_state & I_NEW)
826826
iget_failed(inode);
827827
else

0 commit comments

Comments
 (0)