md: use time_after_eq() instead of jiffies judgment
PATCH 1/1 md: use time_after_eq() instead of jiffies judgment
From: Wang Qing <[email protected]>
It is better to use time_xxx() directly instead of jiffies judgment for understanding.
Signed-off-by Wang Qing <[email protected]>
--- drivers/md/dm-writecache.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/md/dm-writecache.c +3 -2
@@ -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"
@@ -1971,8 +1972,8 @@ 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) &&
Signature · 1 line
2.7.4