diff options
author | Chunwei Chen <[email protected]> | 2014-02-25 17:32:21 +0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2014-04-14 13:27:56 -0700 |
commit | 0b75bdb369df4e0dab96b2778a6421773268df21 (patch) | |
tree | 2b8184592909819f2657e96f6090b9410c76be64 /module/zfs/vdev_cache.c | |
parent | 888f7141a3fcb73e2ec254de7628eee12022c4fc (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/vdev_cache.c')
-rw-r--r-- | module/zfs/vdev_cache.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/module/zfs/vdev_cache.c b/module/zfs/vdev_cache.c index ffd50ec2f..d1ee9afd9 100644 --- a/module/zfs/vdev_cache.c +++ b/module/zfs/vdev_cache.c @@ -123,9 +123,9 @@ vdev_cache_lastused_compare(const void *a1, const void *a2) const vdev_cache_entry_t *ve1 = a1; const vdev_cache_entry_t *ve2 = a2; - if (ve1->ve_lastused < ve2->ve_lastused) + if (ddi_time_before(ve1->ve_lastused, ve2->ve_lastused)) return (-1); - if (ve1->ve_lastused > ve2->ve_lastused) + if (ddi_time_after(ve1->ve_lastused, ve2->ve_lastused)) return (1); /* |