diff options
author | Brian Behlendorf <behlendorf1@llnl.gov> | 2020-02-26 12:42:33 -0800 |
---|---|---|
committer | Brian Behlendorf <behlendorf1@llnl.gov> | 2020-02-27 09:30:45 -0800 |
commit | ff5587d651371ab496f7962e85fe2c337fdb8a59 (patch) | |
tree | af153a78cdb364c0236df2ce0b19e411bcefa06e /include | |
parent | 28caa74b196553aaafda6d0a881668735d627d82 (diff) |
Linux 5.6 compat: ktime_get_raw_ts64()
The getrawmonotonic() and getrawmonotonic64() interfaces have been
fully retired. Update gethrtime() to use the replacement interface
ktime_get_raw_ts64() which was introduced in the 4.18 kernel.
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #10052
Closes #10064
Diffstat (limited to 'include')
-rw-r--r-- | include/os/linux/spl/sys/time.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/os/linux/spl/sys/time.h b/include/os/linux/spl/sys/time.h index 312415b7b..56fd725c0 100644 --- a/include/os/linux/spl/sys/time.h +++ b/include/os/linux/spl/sys/time.h @@ -105,8 +105,13 @@ gethrestime_sec(void) static inline hrtime_t gethrtime(void) { +#if defined(HAVE_KTIME_GET_RAW_TS64) + struct timespec64 ts; + ktime_get_raw_ts64(&ts); +#else struct timespec ts; getrawmonotonic(&ts); +#endif return (((hrtime_t)ts.tv_sec * NSEC_PER_SEC) + ts.tv_nsec); } |