Linux_5.0: replaced current_kernel_time with ktime_get_coarse_real_ts64
[openafs.git] / src / cf / linux-test4.m4
index ed759e1..cf82056 100644 (file)
@@ -149,6 +149,16 @@ AC_DEFUN([LINUX_KERNEL_POSIX_LOCK_FILE_WAIT_ARG], [
                       [])
 ])
 
+AC_DEFUN([LINUX_KERNEL_PAGEVEC_INIT_COLD_ARG], [
+  AC_CHECK_LINUX_BUILD([for 2nd argument in pagevec_init found in pre-4.15 kernels],
+                      [ac_cv_linux_kernel_pagevec_init_cold_arg],
+                      [#include <linux/pagevec.h>],
+                      [pagevec_init(0,0);],
+                      [PAGEVEC_INIT_COLD_ARG],
+                      [define if your kernel uses 2 arguments for pagevec_init],
+                      [])
+])
+
 AC_DEFUN([LINUX_KERNEL_SOCK_CREATE], [
   AC_CHECK_LINUX_BUILD([for 5th argument in sock_create found in some SELinux kernels],
                       [ac_cv_linux_kernel_sock_create_v],
@@ -173,7 +183,22 @@ AC_DEFUN([LINUX_INODE_SETATTR_RETURN_TYPE], [
                       [])
 ])
 
-
+AC_DEFUN([LINUX_IATTR_64BIT_TIME], [
+  AC_CHECK_LINUX_BUILD([whether struct iattr->ia_ctime takes struct timespec64 or 32-bit struct timespec],
+                       [ac_cv_linux_func_iattr_ctime_takes_timespec64],
+                       [#include <linux/fs.h>
+                        #include <linux/timekeeping.h>],
+                       [struct iattr _attrs;
+                       #if defined(HAVE_LINUX_KTIME_GET_COARSE_REAL_TS64)
+                        ktime_get_coarse_real_ts64(&_attrs.ia_ctime);
+                       #else
+                        _attrs.ia_ctime = current_kernel_time64();
+                       #endif
+                       ],
+                       [IATTR_TAKES_64BIT_TIME],
+                       [define if struct iattr->ia_ctime takes struct timespec64],
+                       [])
+])
 
 AC_DEFUN([LINUX_AOP_WRITEBACK_CONTROL], [
   AC_CHECK_LINUX_BUILD([whether aop.writepage takes a writeback_control],
@@ -799,3 +824,15 @@ AC_DEFUN([LINUX_D_INVALIDATE_IS_VOID], [
                       [define if your d_invalidate returns void],
                       [])
 ])
+
+AC_DEFUN([LINUX_KERNEL_READ_OFFSET_IS_LAST], [
+  AC_CHECK_LINUX_BUILD([whether offset is the last argument to kernel_read],
+                       [ac_cv_linux_func_kernel_read_offset_is_last],
+                       [#include <linux/fs.h>],
+                       [
+                       ssize_t kernel_read(struct file *, void *, size_t, loff_t *);
+                       ],
+                       [KERNEL_READ_OFFSET_IS_LAST],
+                       [define if your kernel_read has offset as the last argument],
+                       [])
+])