+ AC_HELP_STRING([--enable-panic_dumplog],
+ [enable panic_dumplog]),
+ [], [enable_panic_dumplog="no"])
+AC_MSG_RESULT([$enable_panic_dumplog])
+AS_IF([test "x$enable_panic_dumplog" = xyes],
+ [AC_DEFINE(LNET_DUMP_ON_PANIC, 1, [use dumplog on panic])])
+]) # LIBCFS_CONFIG_PANIC_DUMPLOG
+
+#
+# Kernel version 3.11 introduced ktime_get_ts64
+#
+AC_DEFUN([LIBCFS_KTIME_GET_TS64],[
+LB_CHECK_COMPILE([does function 'ktime_get_ts64' exist],
+ktime_get_ts64, [
+ #include <linux/hrtimer.h>
+ #include <linux/ktime.h>
+],[
+ struct timespec64 *ts = NULL;
+
+ ktime_get_ts64(ts);
+],[
+ AC_DEFINE(HAVE_KTIME_GET_TS64, 1,
+ ['ktime_get_ts64' is available])
+])
+]) # LIBCFS_KTIME_GET_TS64
+
+#
+# Kernel version 3.12-rc4 commit c2d816443ef30 added prepare_to_wait_event()
+#
+AC_DEFUN([LIBCFS_PREPARE_TO_WAIT_EVENT],[
+LB_CHECK_COMPILE([does function 'prepare_to_wait_event' exist],
+prepare_to_wait_event, [
+ #include <linux/wait.h>
+],[
+ prepare_to_wait_event(NULL, NULL, 0);
+],[
+ AC_DEFINE(HAVE_PREPARE_TO_WAIT_EVENT, 1,
+ ['prepare_to_wait_event' is available])
+])
+]) # LIBCFS_PREPARE_TO_WAIT_EVENT
+
+#
+# Linux kernel 3.12 introduced struct kernel_param_ops
+# This has been backported to all lustre supported
+# clients except RHEL6. We have to handle the differences.
+#
+AC_DEFUN([LIBCFS_KERNEL_PARAM_OPS],[
+LB_CHECK_COMPILE([does 'struct kernel_param_ops' exist],
+kernel_param_ops, [
+ #include <linux/module.h>
+],[
+ struct kernel_param_ops ops;
+
+ ops.set = NULL;
+],[
+ AC_DEFINE(HAVE_KERNEL_PARAM_OPS, 1,
+ ['struct kernel_param_ops' is available])
+])
+]) # LIBCFS_KERNEL_PARAM_OPS
+
+#
+# Kernel version 3.12 introduced ktime_add
+#
+AC_DEFUN([LIBCFS_KTIME_ADD],[
+LB_CHECK_COMPILE([does function 'ktime_add' exist],
+ktime_add, [
+ #include <linux/hrtimer.h>
+ #include <linux/ktime.h>
+],[
+ ktime_t start = ktime_set(0, 0);
+ ktime_t end = start;
+ ktime_t total;
+
+ total = ktime_add(start, end);
+],[
+ AC_DEFINE(HAVE_KTIME_ADD, 1,
+ [ktime_add is available])
+])
+]) # LIBCFS_KTIME_ADD
+
+#
+# Kernel version 3.12 introduced ktime_after
+#
+AC_DEFUN([LIBCFS_KTIME_AFTER],[
+LB_CHECK_COMPILE([does function 'ktime_after' exist],
+ktime_after, [
+ #include <linux/hrtimer.h>
+ #include <linux/ktime.h>
+],[
+ ktime_t start = ktime_set(0, 0);
+ ktime_t end = start;
+
+ ktime_after(start, end);
+],[
+ AC_DEFINE(HAVE_KTIME_AFTER, 1,
+ [ktime_after is available])
+])
+]) # LIBCFS_KTIME_AFTER
+
+#
+# Kernel version 3.12 introduced ktime_before
+# See linux commit 67cb9366ff5f99868100198efba5ca88aaa6ad25
+#
+AC_DEFUN([LIBCFS_KTIME_BEFORE],[
+LB_CHECK_COMPILE([does function 'ktime_before' exist],
+ktime_before, [
+ #include <linux/hrtimer.h>
+ #include <linux/ktime.h>
+],[
+ ktime_t start = ktime_set(0, 0);
+ ktime_t end = start;
+
+ ktime_before(start, end);
+],[
+ AC_DEFINE(HAVE_KTIME_BEFORE, 1,
+ [ktime_before is available])
+])
+]) # LIBCFS_KTIME_BEFORE
+
+#
+# Kernel version 3.12 introduced ktime_compare
+#
+AC_DEFUN([LIBCFS_KTIME_COMPARE],[
+LB_CHECK_COMPILE([does function 'ktime_compare' exist],
+ktime_compare, [
+ #include <linux/hrtimer.h>
+ #include <linux/ktime.h>
+],[
+ ktime_t start = ktime_set(0, 0);
+ ktime_t end = start;
+
+ ktime_compare(start, end);
+],[
+ AC_DEFINE(HAVE_KTIME_COMPARE, 1,
+ [ktime_compare is available])
+])
+]) # LIBCFS_KTIME_COMPARE
+
+#
+# FC19 3.12 kernel struct shrinker change
+#
+AC_DEFUN([LIBCFS_SHRINKER_COUNT],[
+LB_CHECK_COMPILE([shrinker has 'count_objects'],
+shrinker_count_objects, [
+ #include <linux/mmzone.h>
+ #include <linux/shrinker.h>