ext4: remove unnecessary check in ext4_mb_new_blocks

1. remove unnecessary ac check:
We always go to out tag before ac is successfully allocated, then we can
move out tag after free of ac and remove NULL check of ac.

2. remove unnecessary *errp check:
We always go to errout tag if *errp is non-zero, then we can move errout
tag into error handle if *errp is non-zero.

Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Link: https://lore.kernel.org/r/20230303172120.3800725-12-shikemeng@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
Kemeng Shi 2023-03-04 01:21:11 +08:00 committed by Theodore Ts'o
parent 285164b801
commit aaae558dae

View File

@ -5642,16 +5642,15 @@ repeat:
*errp = -ENOSPC; *errp = -ENOSPC;
} }
errout:
if (*errp) { if (*errp) {
errout:
ac->ac_b_ex.fe_len = 0; ac->ac_b_ex.fe_len = 0;
ar->len = 0; ar->len = 0;
ext4_mb_show_ac(ac); ext4_mb_show_ac(ac);
} }
ext4_mb_release_context(ac); ext4_mb_release_context(ac);
kmem_cache_free(ext4_ac_cachep, ac);
out: out:
if (ac)
kmem_cache_free(ext4_ac_cachep, ac);
if (inquota && ar->len < inquota) if (inquota && ar->len < inquota)
dquot_free_block(ar->inode, EXT4_C2B(sbi, inquota - ar->len)); dquot_free_block(ar->inode, EXT4_C2B(sbi, inquota - ar->len));
if (!ar->len) { if (!ar->len) {