Skip to content

Commit 2d08478

Browse files
andypriceAndreas Gruenbacher
authored andcommitted
gfs2: Remove ghs[] from gfs2_link
Replace the 2-item array with two variables for readability. Signed-off-by: Andrew Price <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent 8dc1496 commit 2d08478

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

fs/gfs2/inode.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
941941
struct gfs2_sbd *sdp = GFS2_SB(dir);
942942
struct inode *inode = d_inode(old_dentry);
943943
struct gfs2_inode *ip = GFS2_I(inode);
944-
struct gfs2_holder ghs[2];
944+
struct gfs2_holder d_gh, gh;
945945
struct buffer_head *dibh;
946946
struct gfs2_diradd da = { .bh = NULL, .save_loc = 1, };
947947
int error;
@@ -953,14 +953,14 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
953953
if (error)
954954
return error;
955955

956-
gfs2_holder_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, ghs);
957-
gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, ghs + 1);
956+
gfs2_holder_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, &d_gh);
957+
gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh);
958958

959-
error = gfs2_glock_nq(ghs); /* parent */
959+
error = gfs2_glock_nq(&d_gh);
960960
if (error)
961961
goto out_parent;
962962

963-
error = gfs2_glock_nq(ghs + 1); /* child */
963+
error = gfs2_glock_nq(&gh);
964964
if (error)
965965
goto out_child;
966966

@@ -1046,13 +1046,13 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
10461046
gfs2_quota_unlock(dip);
10471047
out_gunlock:
10481048
gfs2_dir_no_add(&da);
1049-
gfs2_glock_dq(ghs + 1);
1049+
gfs2_glock_dq(&gh);
10501050
out_child:
1051-
gfs2_glock_dq(ghs);
1051+
gfs2_glock_dq(&d_gh);
10521052
out_parent:
10531053
gfs2_qa_put(dip);
1054-
gfs2_holder_uninit(ghs);
1055-
gfs2_holder_uninit(ghs + 1);
1054+
gfs2_holder_uninit(&d_gh);
1055+
gfs2_holder_uninit(&gh);
10561056
return error;
10571057
}
10581058

0 commit comments

Comments
 (0)