From d6f29679098aff171e69511823b340ccf28e5c31 Mon Sep 17 00:00:00 2001 From: Marc Dionne Date: Thu, 18 Dec 2014 07:13:46 -0500 Subject: [PATCH] Linux: d_alias becomes d_u.d_alias MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The fields in struct dentry are re-arranged so that d_alias shares space wth d_rcu inside the d_u union. Some references need to change from d_alias to d_u.d_alias. The kernel change was introduced for 3.19 but was also backported to the 3.18 stable series in 3.18.1, so this commit is required for 3.19 and current 3.18 kernels. Change-Id: I711a5a3a89af6e0055381dfd4474ddca2868bb9c Reviewed-on: http://gerrit.openafs.org/11642 Reviewed-by: Anders Kaseorg Reviewed-by: Michael Laß Reviewed-by: Daria Brashear Tested-by: BuildBot --- acinclude.m4 | 1 + src/afs/LINUX/osi_compat.h | 4 ++++ src/cf/linux-test4.m4 | 9 ++++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/acinclude.m4 b/acinclude.m4 index c760eb6f4..6e14777bc 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -901,6 +901,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) [backing-dev.h]) AC_CHECK_LINUX_STRUCT([cred], [session_keyring], [cred.h]) AC_CHECK_LINUX_STRUCT([ctl_table], [ctl_name], [sysctl.h]) + AC_CHECK_LINUX_STRUCT([dentry], [d_u.d_alias], [dcache.h]) AC_CHECK_LINUX_STRUCT([dentry_operations], [d_automount], [dcache.h]) AC_CHECK_LINUX_STRUCT([inode], [i_alloc_sem], [fs.h]) AC_CHECK_LINUX_STRUCT([inode], [i_blkbits], [fs.h]) diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h index 57f6ea773..497b1efa4 100644 --- a/src/afs/LINUX/osi_compat.h +++ b/src/afs/LINUX/osi_compat.h @@ -37,6 +37,10 @@ typedef struct vfs_path afs_linux_path_t; typedef struct path afs_linux_path_t; #endif +#if defined(STRUCT_DENTRY_HAS_D_U_D_ALIAS) +# define d_alias d_u.d_alias +#endif + #ifndef HAVE_LINUX_DO_SYNC_READ static inline int do_sync_read(struct file *fp, char *buf, size_t count, loff_t *offp) { diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index f0269b380..9dd55b3f9 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -713,7 +713,11 @@ AC_DEFUN([LINUX_D_ALIAS_IS_HLIST], [ [#include ], [struct dentry *d = NULL; struct hlist_node *hn = NULL; - d->d_alias = *hn;], + #if defined(STRUCT_DENTRY_HAS_D_U_D_ALIAS) + d->d_u.d_alias = *hn; + #else + d->d_alias = *hn; + #endif], [D_ALIAS_IS_HLIST], [define if dentry->d_alias is an hlist], []) @@ -727,6 +731,9 @@ AC_DEFUN([LINUX_HLIST_ITERATOR_NO_NODE], [ #include ], [struct dentry *d = NULL, *cur; struct inode *ip; + #if defined(STRUCT_DENTRY_HAS_D_U_D_ALIAS) + # define d_alias d_u.d_alias + #endif hlist_for_each_entry(cur, &ip->i_dentry, d_alias) { } ], [HLIST_ITERATOR_NO_NODE], -- 2.39.5