current_kernel_time() is no longer provided in the 4.20 kernel.
Add a shim that calls the correct "get current time" function.
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
--- /dev/null
+dnl #
+dnl # 4.20: Kernel removes current_kernel_time()
+dnl #
+AC_DEFUN([SPL_AC_KERNEL_CURRENT_KERNEL_TIME],
+ [AC_MSG_CHECKING([whether current_kernel_time() exists])
+ SPL_LINUX_TRY_COMPILE([
+ #include <linux/ktime.h>
+ ], [
+ struct timespec t __attribute__ ((unused)) = current_kernel_time();
+ ], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_KERNEL_CURRENT_TIME, 1, [current_kernel_time() exists])
+ ], [
+ AC_MSG_RESULT(no)
+ ])
+])
SPL_AC_KERNEL_KTIME_GET_COARSE_REAL_TS64
SPL_AC_KERNEL_TOTALRAM_PAGES_FUNC
SPL_AC_KERNEL_TIMESPEC_SUB
+ SPL_AC_KERNEL_CURRENT_KERNEL_TIME
])
AC_DEFUN([SPL_AC_MODULE_SYMVERS], [
#include <linux/module.h>
#include <linux/time.h>
+#include <linux/ktime.h>
#include <sys/types.h>
#include <sys/timer.h>
#endif
}
+/*
+ * 4.20 kernels no longer have current_kernel_time(), only
+ * current_kernel_time64().
+ */
+#if !defined(HAVE_KERNEL_CURRENT_TIME) && defined(HAVE_INODE_TIMESPEC64_TIMES)
+static inline struct timespec current_kernel_time(void)
+{
+ struct timespec64 ts;
+ gethrestime(&ts);
+ return timespec64_to_timespec(ts);
+}
+#endif
+
static inline time_t
gethrestime_sec(void)
{