Add msec/usec/nsec to tick convertors
Add wrappers for the Solaris MSEC_TO_TICK, USEC_TO_TICK, and NSEC_TO_TICK conversion functions. They are mapped directly to their Linux counterparts with the exception of NSEC_TO_TICK can cannot use usecs_to_jiffies() because it is not exported by the kernel. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
parent
8bbda8df3e
commit
f6437b60c2
|
@ -37,5 +37,10 @@
|
|||
|
||||
#define delay(ticks) schedule_timeout((long)(ticks))
|
||||
|
||||
#define SEC_TO_TICK(sec) ((sec) * HZ)
|
||||
#define MSEC_TO_TICK(ms) msecs_to_jiffies(ms)
|
||||
#define USEC_TO_TICK(us) usecs_to_jiffies(us)
|
||||
#define NSEC_TO_TICK(ns) usecs_to_jiffies(ns / NSEC_PER_USEC)
|
||||
|
||||
#endif /* _SPL_TIMER_H */
|
||||
|
||||
|
|
Loading…
Reference in New Issue