gfs2: Call gfs2_queue_verify_delete from gfs2_evict_inode
Move calls to gfs2_queue_verify_delete() into gfs2_evict_inode(). Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
This commit is contained in:
parent
0baa10b60c
commit
8c21c2c71e
2 changed files with 10 additions and 12 deletions
|
@ -959,10 +959,9 @@ static void gfs2_glock_poke(struct gfs2_glock *gl)
|
||||||
gfs2_holder_uninit(&gh);
|
gfs2_holder_uninit(&gh);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool gfs2_try_evict(struct gfs2_glock *gl)
|
static void gfs2_try_evict(struct gfs2_glock *gl)
|
||||||
{
|
{
|
||||||
struct gfs2_inode *ip;
|
struct gfs2_inode *ip;
|
||||||
bool evicted = false;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If there is contention on the iopen glock and we have an inode, try
|
* If there is contention on the iopen glock and we have an inode, try
|
||||||
|
@ -997,9 +996,7 @@ static bool gfs2_try_evict(struct gfs2_glock *gl)
|
||||||
gfs2_glock_poke(ip->i_gl);
|
gfs2_glock_poke(ip->i_gl);
|
||||||
iput(&ip->i_inode);
|
iput(&ip->i_inode);
|
||||||
}
|
}
|
||||||
evicted = !ip;
|
|
||||||
}
|
}
|
||||||
return evicted;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool gfs2_queue_try_to_evict(struct gfs2_glock *gl)
|
bool gfs2_queue_try_to_evict(struct gfs2_glock *gl)
|
||||||
|
@ -1048,13 +1045,7 @@ static void delete_work_func(struct work_struct *work)
|
||||||
* care about compatibility with such nodes, we can skip this
|
* care about compatibility with such nodes, we can skip this
|
||||||
* step entirely.
|
* step entirely.
|
||||||
*/
|
*/
|
||||||
if (gfs2_try_evict(gl)) {
|
gfs2_try_evict(gl);
|
||||||
if (!test_bit(SDF_KILL, &sdp->sd_flags)) {
|
|
||||||
gfs2_glock_hold(gl);
|
|
||||||
if (!gfs2_queue_verify_delete(gl, true))
|
|
||||||
gfs2_glock_put(gl);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (verify_delete) {
|
if (verify_delete) {
|
||||||
|
|
|
@ -1499,8 +1499,15 @@ static void gfs2_evict_inode(struct inode *inode)
|
||||||
|
|
||||||
gfs2_holder_mark_uninitialized(&gh);
|
gfs2_holder_mark_uninitialized(&gh);
|
||||||
behavior = evict_should_delete(inode, &gh);
|
behavior = evict_should_delete(inode, &gh);
|
||||||
if (behavior == EVICT_SHOULD_DEFER_DELETE)
|
if (behavior == EVICT_SHOULD_DEFER_DELETE &&
|
||||||
|
!test_bit(SDF_KILL, &sdp->sd_flags)) {
|
||||||
|
struct gfs2_glock *io_gl = ip->i_iopen_gh.gh_gl;
|
||||||
|
|
||||||
|
gfs2_glock_hold(io_gl);
|
||||||
|
if (!gfs2_queue_verify_delete(io_gl, true))
|
||||||
|
gfs2_glock_put(io_gl);
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
if (behavior == EVICT_SHOULD_DELETE)
|
if (behavior == EVICT_SHOULD_DELETE)
|
||||||
ret = evict_unlinked_inode(inode);
|
ret = evict_unlinked_inode(inode);
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Reference in a new issue