aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorRob Norris <[email protected]>2023-12-16 22:31:32 +1100
committerBrian Behlendorf <[email protected]>2023-12-21 11:03:08 -0800
commit3c13601a12b1739d09cec36eb5057b24141b4ae7 (patch)
tree8ba76a7660345e84a39948a8bb4c69542322dce5 /config
parentb3626f0a3576152256bbbd7fedab90e063037ba1 (diff)
linux 6.7 compat: use inode atime/mtime accessors
6.6 made i_ctime inaccessible; 6.7 has done the same for i_atime and i_mtime. This extends the method used for ctime in b37f29341 to atime and mtime as well. Signed-off-by: Rob Norris <[email protected]> Sponsored-by: https://github.com/sponsors/robn
Diffstat (limited to 'config')
-rw-r--r--config/kernel-inode-times.m478
1 files changed, 78 insertions, 0 deletions
diff --git a/config/kernel-inode-times.m4 b/config/kernel-inode-times.m4
index aae95abf1..4d861596e 100644
--- a/config/kernel-inode-times.m4
+++ b/config/kernel-inode-times.m4
@@ -52,6 +52,48 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_TIMES], [
memset(&ip, 0, sizeof(ip));
inode_set_ctime_to_ts(&ip, ts);
])
+
+ dnl #
+ dnl # 6.7 API change
+ dnl # i_atime/i_mtime no longer directly accessible, must use
+ dnl # inode_get_mtime(ip), inode_set_mtime*(ip) to
+ dnl # read/write.
+ dnl #
+ ZFS_LINUX_TEST_SRC([inode_get_atime], [
+ #include <linux/fs.h>
+ ],[
+ struct inode ip;
+
+ memset(&ip, 0, sizeof(ip));
+ inode_get_atime(&ip);
+ ])
+ ZFS_LINUX_TEST_SRC([inode_get_mtime], [
+ #include <linux/fs.h>
+ ],[
+ struct inode ip;
+
+ memset(&ip, 0, sizeof(ip));
+ inode_get_mtime(&ip);
+ ])
+
+ ZFS_LINUX_TEST_SRC([inode_set_atime_to_ts], [
+ #include <linux/fs.h>
+ ],[
+ struct inode ip;
+ struct timespec64 ts = {0};
+
+ memset(&ip, 0, sizeof(ip));
+ inode_set_atime_to_ts(&ip, ts);
+ ])
+ ZFS_LINUX_TEST_SRC([inode_set_mtime_to_ts], [
+ #include <linux/fs.h>
+ ],[
+ struct inode ip;
+ struct timespec64 ts = {0};
+
+ memset(&ip, 0, sizeof(ip));
+ inode_set_mtime_to_ts(&ip, ts);
+ ])
])
AC_DEFUN([ZFS_AC_KERNEL_INODE_TIMES], [
@@ -90,4 +132,40 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_TIMES], [
],[
AC_MSG_RESULT(no)
])
+
+ AC_MSG_CHECKING([whether inode_get_atime() exists])
+ ZFS_LINUX_TEST_RESULT([inode_get_atime], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_INODE_GET_ATIME, 1,
+ [inode_get_atime() exists in linux/fs.h])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+
+ AC_MSG_CHECKING([whether inode_set_atime_to_ts() exists])
+ ZFS_LINUX_TEST_RESULT([inode_set_atime_to_ts], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_INODE_SET_ATIME_TO_TS, 1,
+ [inode_set_atime_to_ts() exists in linux/fs.h])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+
+ AC_MSG_CHECKING([whether inode_get_mtime() exists])
+ ZFS_LINUX_TEST_RESULT([inode_get_mtime], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_INODE_GET_MTIME, 1,
+ [inode_get_mtime() exists in linux/fs.h])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+
+ AC_MSG_CHECKING([whether inode_set_mtime_to_ts() exists])
+ ZFS_LINUX_TEST_RESULT([inode_set_mtime_to_ts], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_INODE_SET_MTIME_TO_TS, 1,
+ [inode_set_mtime_to_ts() exists in linux/fs.h])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
])