Commit 0a0d9f55 authored by Bob Peterson's avatar Bob Peterson Committed by Andreas Gruenbacher

gfs2: simplify the logic in gfs2_evict_inode

Now that we've factored out the deleted and undeleted dinode cases
in gfs2_evict_inode, we can greatly simplify the logic. Now the
function is easy to read and understand.
Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
parent d90be6ab
......@@ -1496,16 +1496,11 @@ static void gfs2_evict_inode(struct inode *inode)
ret = evict_should_delete(inode, &gh);
if (ret == SHOULD_DEFER_EVICTION)
goto out;
if (ret == SHOULD_NOT_DELETE_DINODE)
goto out_truncate;
ret = evict_unlinked_inode(inode);
goto out_unlock;
out_truncate:
ret = evict_linked_inode(inode);
if (ret == SHOULD_DELETE_DINODE)
ret = evict_unlinked_inode(inode);
else
ret = evict_linked_inode(inode);
out_unlock:
if (gfs2_rs_active(&ip->i_res))
gfs2_rs_deltree(&ip->i_res);
......
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