Linux: d_alias becomes d_u.d_alias
authorMarc Dionne <marc.dionne@your-file-system.com>
Thu, 18 Dec 2014 12:13:46 +0000 (07:13 -0500)
committerStephan Wiesand <stephan.wiesand@desy.de>
Fri, 23 Jan 2015 07:45:43 +0000 (02:45 -0500)
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.

Reviewed-on: http://gerrit.openafs.org/11642
Reviewed-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Michael Laß <lass@mail.uni-paderborn.de>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit d6f29679098aff171e69511823b340ccf28e5c31)

Change-Id: Ifb6199aa7fa922e64540d9fad1d2d79facbb9761
Reviewed-on: http://gerrit.openafs.org/11659
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

acinclude.m4
src/afs/LINUX/osi_compat.h
src/cf/linux-test4.m4

index 785eead..fc665d5 100644 (file)
@@ -836,6 +836,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])
index 26673a7..b98e980 100644 (file)
@@ -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) {
index 34c5d4d..5f5ec5c 100644 (file)
@@ -723,7 +723,11 @@ AC_DEFUN([LINUX_D_ALIAS_IS_HLIST], [
                        [#include <linux/fs.h>],
                        [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],
                        [])
@@ -737,6 +741,9 @@ AC_DEFUN([LINUX_HLIST_ITERATOR_NO_NODE], [
                        #include <linux/fs.h>],
                        [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],