[PATCH] xfs: remove the unnecessary variable error in xfs_trans_unreserve_and_mod_sb

xiakaixu1987
2020-09-16T16:22:27Z

From: Kaixu Xia <kaixuxia@tencent.com>

We can do the assert directly for the return value of xfs_mod_fdblocks()
function, and the variable error is unnecessary, so remove it.

Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
---
fs/xfs/xfs_trans.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
index d33d0ba6f3bd..caa207220e2c 100644
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
@@ -573,7 +573,6 @@ xfs_trans_unreserve_and_mod_sb(
int64_t rtxdelta = 0;
int64_t idelta = 0;
int64_t ifreedelta = 0;
- int error;

/* calculate deltas */
if (tp->t_blk_res > 0)
@@ -596,10 +595,8 @@ xfs_trans_unreserve_and_mod_sb(
}

/* apply the per-cpu counters */
- if (blkdelta) {
- error = xfs_mod_fdblocks(mp, blkdelta, rsvd);
- ASSERT(!error);
- }
+ if (blkdelta)
+ ASSERT(!xfs_mod_fdblocks(mp, blkdelta, rsvd));

if (idelta) {
percpu_counter_add_batch(&mp->m_icount, idelta,
--
2.20.0