diff options
author | Bob Peterson <rpeterso@redhat.com> | 2020-09-16 08:50:44 -0500 |
---|---|---|
committer | Andreas Gruenbacher <agruenba@redhat.com> | 2020-10-14 23:54:42 +0200 |
commit | 0a0d9f55c211d7a03b8ec5ad2d8f5b3062b4387c (patch) | |
tree | 9aacf05e4128a3757c7c4ffb01528bbd9091fffc /fs/gfs2 | |
parent | d90be6ab9ad76d4f5492e15b73b9cca5cbb03f91 (diff) | |
download | linux-0a0d9f55c211d7a03b8ec5ad2d8f5b3062b4387c.tar.gz linux-0a0d9f55c211d7a03b8ec5ad2d8f5b3062b4387c.tar.bz2 linux-0a0d9f55c211d7a03b8ec5ad2d8f5b3062b4387c.zip |
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: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r-- | fs/gfs2/super.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index ba31952e21b9..3d9daac44e1c 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -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); |