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
This commit is contained in:
Brian Behlendorf
2020-02-26 12:42:33 -08:00
committed by Tony Hutter
parent cf2a3464e9
commit ba2cf53545
4 changed files with 62 additions and 25 deletions
+5
View File
@@ -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);
}