Whamcloud - gitweb
LU-6399 lnet: socket cleanup
[fs/lustre-release.git] / libcfs / autoconf / lustre-libcfs.m4
index 21c8208..4774cac 100644 (file)
@@ -239,30 +239,6 @@ i_uid_read, [
 ]) # 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], [
@@ -316,7 +292,7 @@ ktime_get_ts64, [
 #
 # 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],
@@ -324,6 +300,8 @@ 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])
@@ -417,7 +395,9 @@ shrinker_count_objects, [
        #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])
@@ -538,8 +518,8 @@ ktime_to_timespec64, [
        #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);
 ],[
@@ -556,7 +536,7 @@ LB_CHECK_COMPILE([does function 'timespec64_sub' exist],
 timespec64_sub, [
        #include <linux/time.h>
 ],[
-       struct timespec64 later,earlier,diff;
+       struct timespec64 later = { }, earlier = { }, diff;
 
        diff = timespec64_sub(later, earlier);
 ],[
@@ -845,6 +825,8 @@ wait_queue_entry, [
        #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])
@@ -876,6 +858,25 @@ EXTRA_KCFLAGS="$tmp_flags"
 ]) # 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
@@ -904,8 +905,6 @@ LIBCFS_REINIT_COMPLETION
 # 3.5
 LIBCFS_PROCESS_NAMESPACE
 LIBCFS_I_UID_READ
-# 3.7
-LIBCFS_SOCK_ALLOC_FILE
 # 3.8
 LIBCFS_HAVE_CRC32
 LIBCFS_ENABLE_CRC32_ACCEL
@@ -960,6 +959,8 @@ LIBCFS_SCHED_HEADERS
 LIBCFS_WAIT_QUEUE_ENTRY
 # 4.14
 LIBCFS_NEW_KERNEL_WRITE
+# 4.15
+LIBCFS_TIMER_SETUP
 ]) # LIBCFS_PROG_LINUX
 
 #