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 <tuxoko@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #2142
This commit is contained in:
Chunwei Chen
2014-02-25 17:32:21 +08:00
committed by Brian Behlendorf
parent 888f7141a3
commit 0b75bdb369
6 changed files with 22 additions and 10 deletions
+3 -2
View File
@@ -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