summaryrefslogtreecommitdiffstats
path: root/module/zfs/arc.c
diff options
context:
space:
mode:
authorChunwei Chen <[email protected]>2014-02-25 17:32:21 +0800
committerBrian Behlendorf <[email protected]>2014-04-14 13:27:56 -0700
commit0b75bdb369df4e0dab96b2778a6421773268df21 (patch)
tree2b8184592909819f2657e96f6090b9410c76be64 /module/zfs/arc.c
parent888f7141a3fcb73e2ec254de7628eee12022c4fc (diff)
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 <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #2142
Diffstat (limited to 'module/zfs/arc.c')
-rw-r--r--module/zfs/arc.c5
1 files changed, 3 insertions, 2 deletions
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