mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-30 02:34:14 +03:00
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:
committed by
Brian Behlendorf
parent
888f7141a3
commit
0b75bdb369
@@ -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);
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user