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 /include/sys/zfs_context.h | |
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 'include/sys/zfs_context.h')
-rw-r--r-- | include/sys/zfs_context.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/sys/zfs_context.h b/include/sys/zfs_context.h index fa12cea53..1861b845d 100644 --- a/include/sys/zfs_context.h +++ b/include/sys/zfs_context.h @@ -584,6 +584,16 @@ extern vnode_t *rootdir; #define ddi_get_lbolt64() (gethrtime() >> 23) #define hz 119 /* frequency when using gethrtime() >> 23 for lbolt */ +#define ddi_time_before(a, b) (a < b) +#define ddi_time_after(a, b) ddi_time_before(b, a) +#define ddi_time_before_eq(a, b) (!ddi_time_after(a, b)) +#define ddi_time_after_eq(a, b) ddi_time_before_eq(b, a) + +#define ddi_time_before64(a, b) (a < b) +#define ddi_time_after64(a, b) ddi_time_before64(b, a) +#define ddi_time_before_eq64(a, b) (!ddi_time_after64(a, b)) +#define ddi_time_after_eq64(a, b) ddi_time_before_eq64(b, a) + extern void delay(clock_t ticks); #define SEC_TO_TICK(sec) ((sec) * hz) |