Skip to content

Commit c3abc29

Browse files
committed
gfs2: Remove unnecessary gfs2_rlist_alloc parameter
The state parameter of gfs2_rlist_alloc is set to LM_ST_EXCLUSIVE in all calls, so remove it and hardcode that state in gfs2_rlist_alloc instead. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Signed-off-by: Bob Peterson <rpeterso@redhat.com> Reviewed-by: Steven Whitehouse <swhiteho@redhat.com>
1 parent ec23df2 commit c3abc29

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

fs/gfs2/dir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2021,7 +2021,7 @@ static int leaf_dealloc(struct gfs2_inode *dip, u32 index, u32 len,
20212021
l_blocks++;
20222022
}
20232023

2024-
gfs2_rlist_alloc(&rlist, LM_ST_EXCLUSIVE);
2024+
gfs2_rlist_alloc(&rlist);
20252025

20262026
for (x = 0; x < rlist.rl_rgrps; x++) {
20272027
struct gfs2_rgrpd *rgd = gfs2_glock2rgrp(rlist.rl_ghs[x].gh_gl);

fs/gfs2/rgrp.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2668,13 +2668,12 @@ void gfs2_rlist_add(struct gfs2_inode *ip, struct gfs2_rgrp_list *rlist,
26682668
* gfs2_rlist_alloc - all RGs have been added to the rlist, now allocate
26692669
* and initialize an array of glock holders for them
26702670
* @rlist: the list of resource groups
2671-
* @state: the lock state to acquire the RG lock in
26722671
*
26732672
* FIXME: Don't use NOFAIL
26742673
*
26752674
*/
26762675

2677-
void gfs2_rlist_alloc(struct gfs2_rgrp_list *rlist, unsigned int state)
2676+
void gfs2_rlist_alloc(struct gfs2_rgrp_list *rlist)
26782677
{
26792678
unsigned int x;
26802679

@@ -2683,7 +2682,7 @@ void gfs2_rlist_alloc(struct gfs2_rgrp_list *rlist, unsigned int state)
26832682
GFP_NOFS | __GFP_NOFAIL);
26842683
for (x = 0; x < rlist->rl_rgrps; x++)
26852684
gfs2_holder_init(rlist->rl_rgd[x]->rd_gl,
2686-
state, 0,
2685+
LM_ST_EXCLUSIVE, 0,
26872686
&rlist->rl_ghs[x]);
26882687
}
26892688

fs/gfs2/rgrp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ struct gfs2_rgrp_list {
6767

6868
extern void gfs2_rlist_add(struct gfs2_inode *ip, struct gfs2_rgrp_list *rlist,
6969
u64 block);
70-
extern void gfs2_rlist_alloc(struct gfs2_rgrp_list *rlist, unsigned int state);
70+
extern void gfs2_rlist_alloc(struct gfs2_rgrp_list *rlist);
7171
extern void gfs2_rlist_free(struct gfs2_rgrp_list *rlist);
7272
extern u64 gfs2_ri_total(struct gfs2_sbd *sdp);
7373
extern void gfs2_rgrp_dump(struct seq_file *seq, const struct gfs2_glock *gl);

fs/gfs2/xattr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,7 @@ static int ea_dealloc_indirect(struct gfs2_inode *ip)
12991299
else
13001300
goto out;
13011301

1302-
gfs2_rlist_alloc(&rlist, LM_ST_EXCLUSIVE);
1302+
gfs2_rlist_alloc(&rlist);
13031303

13041304
for (x = 0; x < rlist.rl_rgrps; x++) {
13051305
struct gfs2_rgrpd *rgd = gfs2_glock2rgrp(rlist.rl_ghs[x].gh_gl);

0 commit comments

Comments
 (0)