Commit 4fc7ec31 authored by Bob Peterson's avatar Bob Peterson Committed by Andreas Gruenbacher

gfs2: Use resource group glock sharing

This patch takes advantage of the new glock holder sharing feature for
resource groups.  We have already introduced local resource group
locking in a previous patch, so competing accesses of local processes
are already under control.
Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
parent 06e908cd
...@@ -1538,7 +1538,7 @@ static int sweep_bh_for_rgrps(struct gfs2_inode *ip, struct gfs2_holder *rd_gh, ...@@ -1538,7 +1538,7 @@ static int sweep_bh_for_rgrps(struct gfs2_inode *ip, struct gfs2_holder *rd_gh,
goto out; goto out;
} }
ret = gfs2_glock_nq_init(rgd->rd_gl, LM_ST_EXCLUSIVE, ret = gfs2_glock_nq_init(rgd->rd_gl, LM_ST_EXCLUSIVE,
0, rd_gh); LM_FLAG_NODE_SCOPE, rd_gh);
if (ret) if (ret)
goto out; goto out;
......
...@@ -1145,7 +1145,7 @@ static int gfs2_unlink(struct inode *dir, struct dentry *dentry) ...@@ -1145,7 +1145,7 @@ static int gfs2_unlink(struct inode *dir, struct dentry *dentry)
if (!rgd) if (!rgd)
goto out_inodes; goto out_inodes;
gfs2_holder_init(rgd->rd_gl, LM_ST_EXCLUSIVE, 0, ghs + 2); gfs2_holder_init(rgd->rd_gl, LM_ST_EXCLUSIVE, LM_FLAG_NODE_SCOPE, ghs + 2);
error = gfs2_glock_nq(ghs); /* parent */ error = gfs2_glock_nq(ghs); /* parent */
...@@ -1450,8 +1450,8 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry, ...@@ -1450,8 +1450,8 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
error = -ENOENT; error = -ENOENT;
goto out_gunlock; goto out_gunlock;
} }
error = gfs2_glock_nq_init(nrgd->rd_gl, LM_ST_EXCLUSIVE, 0, error = gfs2_glock_nq_init(nrgd->rd_gl, LM_ST_EXCLUSIVE,
&rd_gh); LM_FLAG_NODE_SCOPE, &rd_gh);
if (error) if (error)
goto out_gunlock; goto out_gunlock;
} }
......
...@@ -1442,7 +1442,8 @@ int gfs2_fitrim(struct file *filp, void __user *argp) ...@@ -1442,7 +1442,8 @@ int gfs2_fitrim(struct file *filp, void __user *argp)
while (1) { while (1) {
ret = gfs2_glock_nq_init(rgd->rd_gl, LM_ST_EXCLUSIVE, 0, &gh); ret = gfs2_glock_nq_init(rgd->rd_gl, LM_ST_EXCLUSIVE,
LM_FLAG_NODE_SCOPE, &gh);
if (ret) if (ret)
goto out; goto out;
...@@ -2055,7 +2056,7 @@ int gfs2_inplace_reserve(struct gfs2_inode *ip, struct gfs2_alloc_parms *ap) ...@@ -2055,7 +2056,7 @@ int gfs2_inplace_reserve(struct gfs2_inode *ip, struct gfs2_alloc_parms *ap)
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
struct gfs2_rgrpd *begin = NULL; struct gfs2_rgrpd *begin = NULL;
struct gfs2_blkreserv *rs = &ip->i_res; struct gfs2_blkreserv *rs = &ip->i_res;
int error = 0, flags = 0; int error = 0, flags = LM_FLAG_NODE_SCOPE;
bool rg_locked; bool rg_locked;
u64 last_unlinked = NO_BLOCK; u64 last_unlinked = NO_BLOCK;
u32 target = ap->target; u32 target = ap->target;
...@@ -2736,9 +2737,8 @@ void gfs2_rlist_alloc(struct gfs2_rgrp_list *rlist) ...@@ -2736,9 +2737,8 @@ void gfs2_rlist_alloc(struct gfs2_rgrp_list *rlist)
sizeof(struct gfs2_holder), sizeof(struct gfs2_holder),
GFP_NOFS | __GFP_NOFAIL); GFP_NOFS | __GFP_NOFAIL);
for (x = 0; x < rlist->rl_rgrps; x++) for (x = 0; x < rlist->rl_rgrps; x++)
gfs2_holder_init(rlist->rl_rgd[x]->rd_gl, gfs2_holder_init(rlist->rl_rgd[x]->rd_gl, LM_ST_EXCLUSIVE,
LM_ST_EXCLUSIVE, 0, LM_FLAG_NODE_SCOPE, &rlist->rl_ghs[x]);
&rlist->rl_ghs[x]);
} }
/** /**
......
...@@ -1229,7 +1229,8 @@ static int gfs2_dinode_dealloc(struct gfs2_inode *ip) ...@@ -1229,7 +1229,8 @@ static int gfs2_dinode_dealloc(struct gfs2_inode *ip)
goto out_qs; goto out_qs;
} }
error = gfs2_glock_nq_init(rgd->rd_gl, LM_ST_EXCLUSIVE, 0, &gh); error = gfs2_glock_nq_init(rgd->rd_gl, LM_ST_EXCLUSIVE,
LM_FLAG_NODE_SCOPE, &gh);
if (error) if (error)
goto out_qs; goto out_qs;
......
...@@ -259,7 +259,8 @@ static int ea_dealloc_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh, ...@@ -259,7 +259,8 @@ static int ea_dealloc_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh,
return -EIO; return -EIO;
} }
error = gfs2_glock_nq_init(rgd->rd_gl, LM_ST_EXCLUSIVE, 0, &rg_gh); error = gfs2_glock_nq_init(rgd->rd_gl, LM_ST_EXCLUSIVE,
LM_FLAG_NODE_SCOPE, &rg_gh);
if (error) if (error)
return error; return error;
...@@ -1385,7 +1386,8 @@ static int ea_dealloc_block(struct gfs2_inode *ip) ...@@ -1385,7 +1386,8 @@ static int ea_dealloc_block(struct gfs2_inode *ip)
return -EIO; return -EIO;
} }
error = gfs2_glock_nq_init(rgd->rd_gl, LM_ST_EXCLUSIVE, 0, &gh); error = gfs2_glock_nq_init(rgd->rd_gl, LM_ST_EXCLUSIVE,
LM_FLAG_NODE_SCOPE, &gh);
if (error) if (error)
return error; return error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment