]) # LIBCFS_KTIME_GET_REAL_SECONDS
#
-# Kernel version 3.17 created ktime_get_ns wrapper
+# Kernel version 3.17 created ktime_get_real_ns wrapper
#
AC_DEFUN([LIBCFS_KTIME_GET_REAL_NS],[
LB_CHECK_COMPILE([does function 'ktime_get_real_ns' exist],
-ktime_get_ns, [
+ktime_get_real_ns, [
#include <linux/ktime.h>
],[
u64 nanoseconds;
nanoseconds = ktime_get_real_ns();
-],[
- AC_DEFINE(HAVE_KTIME_GET_REAL_NS, 1,
- ['ktime_get_real_ns' is available])
+],[],[
+ AC_DEFINE(NEED_KTIME_GET_REAL_NS, 1,
+ ['ktime_get_real_ns' is not available])
])
]) # LIBCFS_KTIME_GET_REAL_NS
time64_t ktime_get_seconds(void);
#endif /* HAVE_KTIME_GET_SECONDS */
-#ifndef HAVE_KTIME_GET_REAL_NS
+#ifdef NEED_KTIME_GET_REAL_NS
static inline u64 ktime_get_real_ns(void)
{
return ktime_to_ns(ktime_get_real());
}
-#endif /* HAVE_KTIME_GET_NS */
+#endif /* NEED_KTIME_GET_REAL_NS */
static inline int cfs_time_before(cfs_time_t t1, cfs_time_t t2)
{
#ifdef HAVE_COMPAT_RDMA
#include <linux/compat-2.6.h>
+
+#ifdef LINUX_3_17_COMPAT_H
+#undef NEED_KTIME_GET_REAL_NS
+#endif
+
#endif
#include <linux/version.h>