--- /dev/null
+dnl #
+dnl # 5.0 API change
+dnl #
+dnl # Does timespec_sub() exists? If not, use timespec64_sub().
+dnl #
+AC_DEFUN([SPL_AC_KERNEL_TIMESPEC_SUB], [
+ AC_MSG_CHECKING([whether timespec_sub() exists])
+ SPL_LINUX_TRY_COMPILE([
+ #include <linux/time.h>
+ ],[
+ struct timespec a = {0}, b = {0};
+ timespec_sub(a, b);
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_KERNEL_TIMESPEC_SUB, 1,
+ [kernel has timespec_sub])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+])
SPL_AC_KERNEL_TIMER_FUNCTION_TIMER_LIST
SPL_AC_KERNEL_KTIME_GET_COARSE_REAL_TS64
SPL_AC_KERNEL_TOTALRAM_PAGES_FUNC
+ SPL_AC_KERNEL_TIMESPEC_SUB
])
AC_DEFUN([SPL_AC_MODULE_SYMVERS], [
static const int hz = HZ;
+/* 5.0 kernels no longer have timespec_sub(), only timespec64_sub() */
+#if !defined(HAVE_KERNEL_TIMESPEC_SUB) && defined(HAVE_INODE_TIMESPEC64_TIMES)
+static inline struct timespec timespec_sub(struct timespec a,
+ struct timespec b) {
+ struct timespec64 res;
+ res = timespec64_sub(timespec_to_timespec64(a),
+ timespec_to_timespec64(b));
+ return timespec64_to_timespec(res);
+}
+#endif
+
#define TIMESPEC_OVERFLOW(ts) \
((ts)->tv_sec < TIME_MIN || (ts)->tv_sec > TIME_MAX)
#include <sys/random.h>
#include <sys/thread.h>
#include <sys/vmsystm.h>
+#include <sys/time.h>
#include "splat-internal.h"
#define SPLAT_KMEM_NAME "kmem"