aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2017-05-10 09:30:48 -0700
committerGitHub <[email protected]>2017-05-10 09:30:48 -0700
commit2946a1a15aab874107b4425513c1bf805e730803 (patch)
tree21b3f8b56ed293b626eefc6549aeb74342ae3eb5 /config
parenta3eeab2de68670a4481eab3d086982aff23b6906 (diff)
Linux 4.12 compat: CURRENT_TIME removed
Linux 4.9 added current_time() as the preferred interface to get the filesystem time. CURRENT_TIME was retired in Linux 4.12. Reviewed-by: Chunwei Chen <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #6114
Diffstat (limited to 'config')
-rw-r--r--config/kernel-current-time.m419
-rw-r--r--config/kernel.m41
2 files changed, 20 insertions, 0 deletions
diff --git a/config/kernel-current-time.m4 b/config/kernel-current-time.m4
new file mode 100644
index 000000000..2ede9ff38
--- /dev/null
+++ b/config/kernel-current-time.m4
@@ -0,0 +1,19 @@
+dnl #
+dnl # 4.9, current_time() added
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_CURRENT_TIME],
+ [AC_MSG_CHECKING([whether current_time() exists])
+ ZFS_LINUX_TRY_COMPILE_SYMBOL([
+ #include <linux/fs.h>
+ ], [
+ struct inode ip;
+ struct timespec now __attribute__ ((unused));
+
+ now = current_time(&ip);
+ ], [current_time], [fs/inode.c], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_CURRENT_TIME, 1, [current_time() exists])
+ ], [
+ AC_MSG_RESULT(no)
+ ])
+])
diff --git a/config/kernel.m4 b/config/kernel.m4
index 57dad7b3a..c96c8b17f 100644
--- a/config/kernel.m4
+++ b/config/kernel.m4
@@ -118,6 +118,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
ZFS_AC_KERNEL_MODULE_PARAM_CALL_CONST
ZFS_AC_KERNEL_RENAME_WANTS_FLAGS
ZFS_AC_KERNEL_HAVE_GENERIC_SETXATTR
+ ZFS_AC_KERNEL_CURRENT_TIME
AS_IF([test "$LINUX_OBJ" != "$LINUX"], [
KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ"