From 0b75bdb369df4e0dab96b2778a6421773268df21 Mon Sep 17 00:00:00 2001 From: Chunwei Chen Date: Tue, 25 Feb 2014 17:32:21 +0800 Subject: Use ddi_time_after and friends to compare time Also, make sure we use clock_t for ddi_get_lbolt to prevent type conversion from screwing things. Signed-off-by: Chunwei Chen Signed-off-by: Brian Behlendorf Closes #2142 --- module/zfs/arc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/zfs/arc.c') diff --git a/module/zfs/arc.c b/module/zfs/arc.c index 00d26592d..518b82efa 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -2480,7 +2480,8 @@ arc_adapt_thread(void) #endif /* !_KERNEL */ /* No recent memory pressure allow the ARC to grow. */ - if (arc_no_grow && ddi_get_lbolt() >= arc_grow_time) + if (arc_no_grow && + ddi_time_after_eq(ddi_get_lbolt(), arc_grow_time)) arc_no_grow = FALSE; arc_adjust_meta(); @@ -2918,7 +2919,7 @@ arc_access(arc_buf_hdr_t *buf, kmutex_t *hash_lock) * but it is still in the cache. Move it to the MFU * state. */ - if (now > buf->b_arc_access + ARC_MINTIME) { + if (ddi_time_after(now, buf->b_arc_access + ARC_MINTIME)) { /* * More than 125ms have passed since we * instantiated this buffer. Move it to the -- cgit v1.2.3