summarylogtreecommitdiffstats
path: root/0008-Linux-6.6-convert-to-ctime-accessor-functions.patch
diff options
context:
space:
mode:
authorMichael Laß2023-11-08 19:02:43 +0100
committerMichael Laß2023-11-08 19:02:43 +0100
commit9b730cd33f59e6465ff0d8ac246aea9571eae504 (patch)
treea7e763b4c991452fcfa06a7fab5715f504b604da /0008-Linux-6.6-convert-to-ctime-accessor-functions.patch
parent6b339a1c90ed04dc908bf59d3b4e5b8ce43f50bf (diff)
downloadaur-9b730cd33f59e6465ff0d8ac246aea9571eae504.tar.gz
Prepare for Linux 6.6
Diffstat (limited to '0008-Linux-6.6-convert-to-ctime-accessor-functions.patch')
-rw-r--r--0008-Linux-6.6-convert-to-ctime-accessor-functions.patch105
1 files changed, 105 insertions, 0 deletions
diff --git a/0008-Linux-6.6-convert-to-ctime-accessor-functions.patch b/0008-Linux-6.6-convert-to-ctime-accessor-functions.patch
new file mode 100644
index 000000000000..482fe7f2bb97
--- /dev/null
+++ b/0008-Linux-6.6-convert-to-ctime-accessor-functions.patch
@@ -0,0 +1,105 @@
+From 381607a5840eac886bbc6737e19acf5b942fe671 Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Thu, 5 Oct 2023 14:44:49 -0600
+Subject: [PATCH 8/9] Linux 6.6: convert to ctime accessor functions
+
+The Linux 6.6 commit "fs: add ctime accessors infrastructure"
+(9b6304c1d5) added accessor functions for an inode's ctime member.
+A follow on commit "fs: rename i_ctime field to __i_ctime" (13bc244578)
+changed the name of the inode member ctime to __i_ctime to indicate it's
+a private member.
+
+Add an autoconf test for the ctime accessor function
+'inode_set_ctime()'.
+
+Add an afs_inode_set_ctime to LINUX/osi_machdep.h that is either defined
+as a macro to Linux's inode_set_ctime, or implements a static inline
+function to set a inode's ctime.
+
+Convert the setting of an inode's ctime to use afs_inode_set_ctime().
+
+For more information behind the Linux change, see the commit message
+for:
+ "Merge tag 'v6.6-vfs.ctime'
+ of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs" (615e95831)
+
+Reviewed-on: https://gerrit.openafs.org/15560
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
+Tested-by: Mark Vitale <mvitale@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 072c7934cd1b99052882f02294f7036d422b6cf1)
+
+ Conflicts:
+ src/cf/linux-kernel-func.m4 (context)
+
+Change-Id: I729408d12a7946f5778b036ca7e2c14299f3ce8e
+Reviewed-on: https://gerrit.openafs.org/15589
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
+Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
+(cherry picked from commit 6413fdbc913834f2884989e5811841f4ccea2b5f)
+---
+ src/afs/LINUX/osi_machdep.h | 11 +++++++++++
+ src/afs/LINUX/osi_vnodeops.c | 3 +--
+ src/cf/linux-kernel-func.m4 | 6 ++++++
+ 3 files changed, 18 insertions(+), 2 deletions(-)
+
+diff --git a/src/afs/LINUX/osi_machdep.h b/src/afs/LINUX/osi_machdep.h
+index 2220e0530..f9ceb359e 100644
+--- a/src/afs/LINUX/osi_machdep.h
++++ b/src/afs/LINUX/osi_machdep.h
+@@ -118,6 +118,17 @@ osi_GetTime(osi_timeval32_t *atv)
+ }
+ #endif
+
++#if defined(HAVE_LINUX_INODE_SET_CTIME)
++# define afs_inode_set_ctime(inode, sec, nsec) inode_set_ctime((inode), (sec), (nsec))
++#else
++static inline void
++afs_inode_set_ctime(struct inode *inode, time64_t sec, long nsec)
++{
++ inode->i_ctime.tv_sec = sec;
++ inode->i_ctime.tv_nsec = nsec;
++}
++#endif
++
+ #undef gop_lookupname
+ #define gop_lookupname osi_lookupname
+
+diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
+index 4e33a189e..1eb99d1d4 100644
+--- a/src/afs/LINUX/osi_vnodeops.c
++++ b/src/afs/LINUX/osi_vnodeops.c
+@@ -1144,8 +1144,7 @@ vattr2inode(struct inode *ip, struct vattr *vp)
+ * any time the sysname list changes.
+ */
+ ip->i_mtime.tv_nsec = afs_sysnamegen;
+- ip->i_ctime.tv_sec = vp->va_ctime.tv_sec;
+- ip->i_ctime.tv_nsec = 0;
++ afs_inode_set_ctime(ip, vp->va_ctime.tv_sec, 0);
+ }
+
+ /* afs_notify_change
+diff --git a/src/cf/linux-kernel-func.m4 b/src/cf/linux-kernel-func.m4
+index 105e58cce..dc26b6056 100644
+--- a/src/cf/linux-kernel-func.m4
++++ b/src/cf/linux-kernel-func.m4
+@@ -238,6 +238,12 @@ AC_CHECK_LINUX_FUNC([wrap_directory_iterator],
+ #include <linux/fs.h>],
+ [(void)wrap_directory_iterator(NULL, NULL, NULL);])
+
++dnl Linux 6.6 requires the use of a getter/setter for accessing a inode's
++dnl ctime member. Test for the setter inode_set_ctime
++AC_CHECK_LINUX_FUNC([inode_set_ctime],
++ [#include <linux/fs.h>],
++ [inode_set_ctime(NULL, 0, 0);])
++
+ dnl Consequences - things which get set as a result of the
+ dnl above tests
+ AS_IF([test "x$ac_cv_linux_func_d_alloc_anon" = "xno"],
+--
+2.42.1
+