forked from pool/openafs
074981dc71
- apply upstream-patches for kernel 6.6: * 5b647bf.diff * 6413fdb.diff * 4f1d810.diff - replace upstream-patch for kernel 6.5 474750a.diff by correct commit 6de0a64.diffa for branch openafs-stable-1_8_x OBS-URL: https://build.opensuse.org/request/show/1126478 OBS-URL: https://build.opensuse.org/package/show/filesystems/openafs?expand=0&rev=113
98 lines
3.4 KiB
Diff
98 lines
3.4 KiB
Diff
From 6413fdbc913834f2884989e5811841f4ccea2b5f Mon Sep 17 00:00:00 2001
|
|
From: Cheyenne Wills <cwills@sinenomine.net>
|
|
Date: Thu, 05 Oct 2023 14:44:49 -0600
|
|
Subject: [PATCH] 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>
|
|
---
|
|
|
|
diff --git a/src/afs/LINUX/osi_machdep.h b/src/afs/LINUX/osi_machdep.h
|
|
index 2220e05..f9ceb35 100644
|
|
--- a/src/afs/LINUX/osi_machdep.h
|
|
+++ b/src/afs/LINUX/osi_machdep.h
|
|
@@ -118,6 +118,17 @@
|
|
}
|
|
#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 fb62752..932fd9d 100644
|
|
--- a/src/afs/LINUX/osi_vnodeops.c
|
|
+++ b/src/afs/LINUX/osi_vnodeops.c
|
|
@@ -1144,8 +1144,7 @@
|
|
* 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 105e58c..dc26b60 100644
|
|
--- a/src/cf/linux-kernel-func.m4
|
|
+++ b/src/cf/linux-kernel-func.m4
|
|
@@ -238,6 +238,12 @@
|
|
#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"],
|