[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20230706093035.35685-1-zhangzehao@vivo.com>
Date: Thu, 6 Jul 2023 17:30:35 +0800
From: Zehao Zhang <zhangzehao@...o.com>
To: agk@...hat.com, snitzer@...nel.org
Cc: dm-devel@...hat.com, linux-kernel@...r.kernel.org,
Zehao Zhang <zhangzehao@...o.com>
Subject: [PATCH] dm: Convert to use time_after_eq macro
Use time_after_eq macro instead of opening it for readability.
Signed-off-by: Zehao Zhang <zhangzehao@...o.com>
---
drivers/md/dm-writecache.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c
index 074cb785eafc..0527d328b6f4 100644
--- a/drivers/md/dm-writecache.c
+++ b/drivers/md/dm-writecache.c
@@ -16,6 +16,7 @@
#include <linux/pfn_t.h>
#include <linux/libnvdimm.h>
#include <linux/delay.h>
+#include <linux/jiffies.h>
#include "dm-io-tracker.h"
#define DM_MSG_PREFIX "writecache"
@@ -1994,8 +1995,9 @@ static void writecache_writeback(struct work_struct *work)
while (!list_empty(&wc->lru) &&
(wc->writeback_all ||
wc->freelist_size + wc->writeback_size <= wc->freelist_low_watermark ||
- (jiffies - container_of(wc->lru.prev, struct wc_entry, lru)->age >=
- wc->max_age - wc->max_age / MAX_AGE_DIV))) {
+ (time_after_eq(jiffies,
+ container_of(wc->lru.prev, struct wc_entry, lru)->age +
+ (wc->max_age - wc->max_age / MAX_AGE_DIV))))) {
n_walked++;
if (unlikely(n_walked > WRITEBACK_LATENCY) &&
--
2.35.3
Powered by blists - more mailing lists