aboutsummaryrefslogtreecommitdiffstats
path: root/config/kernel-inode-times.m4
diff options
context:
space:
mode:
authorRob Norris <[email protected]>2023-12-16 22:31:32 +1100
committerBrian Behlendorf <[email protected]>2023-12-20 11:47:40 -0800
commitdb4fc559cc1931b9219e62aa505cd5c51a17b232 (patch)
treedb6be9a516cc31d7539f94b67c9be2e695607570 /config/kernel-inode-times.m4
parent00f40961e0eb7d8bcdb016020f1f2dbe372d3e96 (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. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rob Norris <[email protected]> Sponsored-by: https://github.com/sponsors/robn Closes #15681
Diffstat (limited to 'config/kernel-inode-times.m4')
-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)
+ ])
])