Skip to content

Commit 761fdbb

Browse files
author
Andreas Gruenbacher
committed
gfs2: Get rid of ghs[] in gfs2_create_inode
In gfs2_create_inode, get rid of the ghs array in favor of two separate variables. This makes the code much less irritating. Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent 35c23fb commit 761fdbb

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

fs/gfs2/inode.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
599599
{
600600
const struct qstr *name = &dentry->d_name;
601601
struct posix_acl *default_acl, *acl;
602-
struct gfs2_holder ghs[2];
602+
struct gfs2_holder d_gh, gh;
603603
struct inode *inode = NULL;
604604
struct gfs2_inode *dip = GFS2_I(dir), *ip;
605605
struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode);
@@ -620,10 +620,10 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
620620
if (error)
621621
goto fail;
622622

623-
error = gfs2_glock_nq_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, ghs);
623+
error = gfs2_glock_nq_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, &d_gh);
624624
if (error)
625625
goto fail;
626-
gfs2_holder_mark_uninitialized(ghs + 1);
626+
gfs2_holder_mark_uninitialized(&gh);
627627

628628
error = create_ok(dip, name, mode);
629629
if (error)
@@ -645,7 +645,7 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
645645
else
646646
error = finish_no_open(file, NULL);
647647
}
648-
gfs2_glock_dq_uninit(ghs);
648+
gfs2_glock_dq_uninit(&d_gh);
649649
goto fail;
650650
} else if (error != -ENOENT) {
651651
goto fail_gunlock;
@@ -734,7 +734,7 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
734734
if (error)
735735
goto fail_gunlock2;
736736

737-
error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_SKIP, ghs + 1);
737+
error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_SKIP, &gh);
738738
if (error)
739739
goto fail_gunlock3;
740740

@@ -788,9 +788,9 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
788788
file->f_mode |= FMODE_CREATED;
789789
error = finish_open(file, dentry, gfs2_open_common);
790790
}
791-
gfs2_glock_dq_uninit(ghs);
791+
gfs2_glock_dq_uninit(&d_gh);
792792
gfs2_qa_put(ip);
793-
gfs2_glock_dq_uninit(ghs + 1);
793+
gfs2_glock_dq_uninit(&gh);
794794
gfs2_glock_put(io_gl);
795795
gfs2_qa_put(dip);
796796
unlock_new_inode(inode);
@@ -815,7 +815,7 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
815815
posix_acl_release(acl);
816816
fail_gunlock:
817817
gfs2_dir_no_add(&da);
818-
gfs2_glock_dq_uninit(ghs);
818+
gfs2_glock_dq_uninit(&d_gh);
819819
if (!IS_ERR_OR_NULL(inode)) {
820820
clear_nlink(inode);
821821
if (!free_vfs_inode)
@@ -827,8 +827,8 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
827827
else
828828
iput(inode);
829829
}
830-
if (gfs2_holder_initialized(ghs + 1))
831-
gfs2_glock_dq_uninit(ghs + 1);
830+
if (gfs2_holder_initialized(&gh))
831+
gfs2_glock_dq_uninit(&gh);
832832
fail:
833833
gfs2_qa_put(dip);
834834
return error;

0 commit comments

Comments
 (0)