]) # LIBCFS_I_UID_READ
#
-# LIBCFS_SOCK_ALLOC_FILE
-#
-# FC18 3.7.2-201 unexport sock_map_fd() change to
-# use sock_alloc_file().
-# upstream commit 56b31d1c9f1e6a3ad92e7bfe252721e05d92b285
-#
-AC_DEFUN([LIBCFS_SOCK_ALLOC_FILE], [
-LB_CHECK_EXPORT([sock_alloc_file], [net/socket.c], [
- LB_CHECK_COMPILE([if 'sock_alloc_file' takes 3 arguments],
- sock_alloc_file_3args, [
- #include <linux/net.h>
- ],[
- sock_alloc_file(NULL, 0, NULL);
- ],[
- AC_DEFINE(HAVE_SOCK_ALLOC_FILE_3ARGS, 1,
- [sock_alloc_file takes 3 arguments])
- ],[
- AC_DEFINE(HAVE_SOCK_ALLOC_FILE, 1,
- [sock_alloc_file is exported])
- ])
-])
-]) # LIBCFS_SOCK_ALLOC_FILE
-
-#
# LIBCFS_HAVE_CRC32
#
AC_DEFUN([LIBCFS_HAVE_CRC32], [
#
# Linux kernel 3.12 introduced struct kernel_param_ops
# This has been backported to all lustre supported
-# clients expect RHEL6. We have to handle the differences.
+# clients except RHEL6. We have to handle the differences.
#
AC_DEFUN([LIBCFS_KERNEL_PARAM_OPS],[
LB_CHECK_COMPILE([does 'struct kernel_param_ops' exist],
#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])
#include <linux/mmzone.h>
#include <linux/shrinker.h>
],[
- ((struct shrinker*)0)->count_objects(NULL, NULL);
+ struct shrinker shrinker;
+
+ shrinker.count_objects = NULL;
],[
AC_DEFINE(HAVE_SHRINKER_COUNT, 1,
[shrinker has count_objects member])
#include <linux/hrtimer.h>
#include <linux/ktime.h>
],[
+ ktime_t now = ktime_set(0, 0);
struct timespec64 ts;
- ktime_t now;
ts = ktime_to_timespec64(now);
],[
timespec64_sub, [
#include <linux/time.h>
],[
- struct timespec64 later,earlier,diff;
+ struct timespec64 later = { }, earlier = { }, diff;
diff = timespec64_sub(later, earlier);
],[
#include <linux/wait.h>
],[
wait_queue_entry_t e;
+
+ e.flags = 0;
],[
AC_DEFINE(HAVE_WAIT_QUEUE_ENTRY, 1,
['wait_queue_entry_t' is available])
]) # LIBCFS_NEW_KERNEL_WRITE
#
+# LIBCFS_TIMER_SETUP
+#
+# Kernel version 4.15 commit e99e88a9d2b067465adaa9c111ada99a041bef9a
+# setup_timer() was replaced by timer_setup(), where the callback
+# argument is the structure already holding the struct timer_list.
+#
+AC_DEFUN([LIBCFS_TIMER_SETUP], [
+LB_CHECK_COMPILE([if setup_timer has been replaced with timer_setup],
+timer_setup, [
+ #include <linux/timer.h>
+],[
+ timer_setup(NULL, NULL, 0);
+],[
+ AC_DEFINE(HAVE_TIMER_SETUP, 1,
+ [timer_setup has replaced setup_timer])
+])
+]) # LIBCFS_TIMER_SETUP
+
+#
# LIBCFS_PROG_LINUX
#
# LibCFS linux kernel checks
# 3.5
LIBCFS_PROCESS_NAMESPACE
LIBCFS_I_UID_READ
-# 3.7
-LIBCFS_SOCK_ALLOC_FILE
# 3.8
LIBCFS_HAVE_CRC32
LIBCFS_ENABLE_CRC32_ACCEL
LIBCFS_WAIT_QUEUE_ENTRY
# 4.14
LIBCFS_NEW_KERNEL_WRITE
+# 4.15
+LIBCFS_TIMER_SETUP
]) # LIBCFS_PROG_LINUX
#