[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220621031113.1222877-1-zhangshida@kylinos.cn>
Date: Tue, 21 Jun 2022 11:11:13 +0800
From: Shida Zhang <starzhangzsd@...il.com>
To: djwong@...nel.org
Cc: zhangshida@...inos.cn, starzhangzsd@...il.com,
linux-kernel@...r.kernel.org, linux-xfs@...r.kernel.org
Subject: [PATCH] xfs: return when delta equals 0 in xfs_mod_freecounter
There are cases that xfs_mod_freecounter() will get called when delta
equals 0 while it's unnecessary.
Signed-off-by: Shida Zhang <zhangshida@...inos.cn>
---
fs/xfs/xfs_mount.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index daa8d29c46b4..a3db932fd1fc 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -1129,6 +1129,9 @@ xfs_mod_freecounter(
if (rsvd)
ASSERT(has_resv_pool);
+ if (delta == 0)
+ return 0;
+
if (delta > 0) {
/*
* If the reserve pool is depleted, put blocks back into it
--
2.25.1
Powered by blists - more mailing lists