@@ -1143,7 +1143,7 @@ static int gfs2_unlink(struct inode *dir, struct dentry *dentry)
11431143 struct gfs2_sbd * sdp = GFS2_SB (dir );
11441144 struct inode * inode = d_inode (dentry );
11451145 struct gfs2_inode * ip = GFS2_I (inode );
1146- struct gfs2_holder ghs [ 3 ] ;
1146+ struct gfs2_holder d_gh , r_gh , gh ;
11471147 struct gfs2_rgrpd * rgd ;
11481148 int error ;
11491149
@@ -1153,21 +1153,21 @@ static int gfs2_unlink(struct inode *dir, struct dentry *dentry)
11531153
11541154 error = - EROFS ;
11551155
1156- gfs2_holder_init (dip -> i_gl , LM_ST_EXCLUSIVE , 0 , ghs );
1157- gfs2_holder_init (ip -> i_gl , LM_ST_EXCLUSIVE , 0 , ghs + 1 );
1156+ gfs2_holder_init (dip -> i_gl , LM_ST_EXCLUSIVE , 0 , & d_gh );
1157+ gfs2_holder_init (ip -> i_gl , LM_ST_EXCLUSIVE , 0 , & gh );
11581158
11591159 rgd = gfs2_blk2rgrpd (sdp , ip -> i_no_addr , 1 );
11601160 if (!rgd )
11611161 goto out_inodes ;
11621162
1163- gfs2_holder_init (rgd -> rd_gl , LM_ST_EXCLUSIVE , LM_FLAG_NODE_SCOPE , ghs + 2 );
1163+ gfs2_holder_init (rgd -> rd_gl , LM_ST_EXCLUSIVE , LM_FLAG_NODE_SCOPE , & r_gh );
11641164
11651165
1166- error = gfs2_glock_nq (ghs ); /* parent */
1166+ error = gfs2_glock_nq (& d_gh );
11671167 if (error )
11681168 goto out_parent ;
11691169
1170- error = gfs2_glock_nq (ghs + 1 ); /* child */
1170+ error = gfs2_glock_nq (& gh );
11711171 if (error )
11721172 goto out_child ;
11731173
@@ -1181,7 +1181,7 @@ static int gfs2_unlink(struct inode *dir, struct dentry *dentry)
11811181 goto out_rgrp ;
11821182 }
11831183
1184- error = gfs2_glock_nq (ghs + 2 ); /* rgrp */
1184+ error = gfs2_glock_nq (& r_gh ); /* rgrp */
11851185 if (error )
11861186 goto out_rgrp ;
11871187
@@ -1197,16 +1197,16 @@ static int gfs2_unlink(struct inode *dir, struct dentry *dentry)
11971197 gfs2_trans_end (sdp );
11981198
11991199out_gunlock :
1200- gfs2_glock_dq (ghs + 2 );
1200+ gfs2_glock_dq (& r_gh );
12011201out_rgrp :
1202- gfs2_glock_dq (ghs + 1 );
1202+ gfs2_glock_dq (& gh );
12031203out_child :
1204- gfs2_glock_dq (ghs );
1204+ gfs2_glock_dq (& d_gh );
12051205out_parent :
1206- gfs2_holder_uninit (ghs + 2 );
1206+ gfs2_holder_uninit (& r_gh );
12071207out_inodes :
1208- gfs2_holder_uninit (ghs + 1 );
1209- gfs2_holder_uninit (ghs );
1208+ gfs2_holder_uninit (& gh );
1209+ gfs2_holder_uninit (& d_gh );
12101210 return error ;
12111211}
12121212
0 commit comments