From: Xianting Tian Date: Mon, 19 Oct 2020 14:43:49 +0800 Subject: [Cluster-devel] [PATCH] gfs2: use helper macro abs() Message-ID: <20201019064349.48828-1-tian.xianting@h3c.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Use helper macro abs() to simplify the "x >= y || x <= -y" cmp. Signed-off-by: Xianting Tian --- fs/gfs2/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index 9f4d9e7be..05eb709de 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -304,7 +304,7 @@ void gfs2_statfs_change(struct gfs2_sbd *sdp, s64 total, s64 free, if (sdp->sd_args.ar_statfs_percent) { x = 100 * l_sc->sc_free; y = m_sc->sc_free * sdp->sd_args.ar_statfs_percent; - if (x >= y || x <= -y) + if (abs(x) >= y) need_sync = 1; } spin_unlock(&sdp->sd_statfs_spin); -- 2.17.1