SHA256
1
0
forked from pool/openafs
openafs/7cae97b.diff
Christof Hanke cfa65eea8c Accepting request 1170220 from home:hauky:branches:filesystems
- update to openafs-1.8.11
- apply upstream patches for kernel 6.8
  * 056a7a8.diff
  * 05ac614.diff
  * 073adec.diff
  * 0d9f6cf.diff
  * 0e983a9.diff
  * 112fb94.diff
  * 1e1bf8e.diff
  * 2056ce8.diff
  * 5312d06.diff
  * 67e48c8.diff
  * 6b20756.diff
  * 743d72f.diff
  * 7cae97b.diff
  * 81b910a.diff
  * 87ab04a.diff
  * 9f052c1.diff
  * a14a9ad.diff
  * a87845d.diff
  * aae8b00.diff
  * b77b304.diff
  * d1c89ac.diff
  * d9f3a2c.diff
  * db91384.diff
  * dffd0e1.diff
  * e0f425a.diff
  * e157f8f.diff
  * e428053.diff
  * ef7b8c5.diff
  * f5bafb0.diff
  * fca6fd9.diff

OBS-URL: https://build.opensuse.org/request/show/1170220
OBS-URL: https://build.opensuse.org/package/show/filesystems/openafs?expand=0&rev=123
2024-04-26 04:08:22 +00:00

67 lines
2.4 KiB
Diff

From 7cae97b86fbcc4a53967927d6c2cae9dcbc6ac4d Mon Sep 17 00:00:00 2001
From: Cheyenne Wills <cwills@sinenomine.net>
Date: Mon, 12 Feb 2024 12:31:30 -0700
Subject: [PATCH] Linux 6.8: use hlist iteration for dentry children
Linux 6.8 commit 'dentry: switch the lists of children to hlist'
(da549bdd15) replaces the dentry lists d_subdirs/d_child with the hlist
d_children/d_sib.
Add an autoconf test for a d_children member in the dentry structure.
Define a macro that uses the applicable Linux function for iterating
over a dentry's children.
Reviewed-on: https://gerrit.openafs.org/15632
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 8e0bbe6a07523dd2e7efb3c9d1b4ad9e19fc9bb7)
Change-Id: Ief4c334c4ef3e54822e068dcdf654541e86b9176
---
diff --git a/src/afs/LINUX/osi_vcache.c b/src/afs/LINUX/osi_vcache.c
index 897fd37..43644f4 100644
--- a/src/afs/LINUX/osi_vcache.c
+++ b/src/afs/LINUX/osi_vcache.c
@@ -15,6 +15,14 @@
#include "osi_compat.h"
+#if defined(STRUCT_DENTRY_HAS_D_CHILDREN)
+# define afs_for_each_child(child, parent) \
+ hlist_for_each_entry((child), &(parent)->d_children, d_sib)
+#else
+# define afs_for_each_child(child, parent) \
+ list_for_each_entry((child), &(parent)->d_subdirs, d_child)
+#endif
+
static void
TryEvictDirDentries(struct inode *inode)
{
@@ -312,7 +320,7 @@
* because 'dp' is an ancestor of 'child'.
*/
struct dentry *child;
- list_for_each_entry(child, &dp->d_subdirs, d_child) {
+ afs_for_each_child(child, dp) {
spin_lock(&child->d_lock);
child->d_time = 0;
spin_unlock(&child->d_lock);
diff --git a/src/cf/linux-kernel-struct.m4 b/src/cf/linux-kernel-struct.m4
index 2824ec1..5cd346f 100644
--- a/src/cf/linux-kernel-struct.m4
+++ b/src/cf/linux-kernel-struct.m4
@@ -17,6 +17,9 @@
dnl linux 2.6.16 moved dentry->d_child to dentry->d_u.d_child
dnl linux 3.19 moved it back to dentry->d_child
AC_CHECK_LINUX_STRUCT([dentry], [d_u.d_child], [dcache.h])
+dnl linux 6.8 uses hlist for dentry children and renamed
+dnl d_subdirs/d_child to d_childern/d_sib
+AC_CHECK_LINUX_STRUCT([dentry], [d_children], [dcache.h])
AC_CHECK_LINUX_STRUCT([dentry_operations], [d_automount], [dcache.h])
AC_CHECK_LINUX_STRUCT([group_info], [gid], [cred.h])
AC_CHECK_LINUX_STRUCT([inode], [i_alloc_sem], [fs.h])