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)
committerJeffrey Altman <jaltman@your-file-system.com>
Thu, 8 Jan 2015 11:43:12 +0000 (06:43 -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.

Change-Id: I711a5a3a89af6e0055381dfd4474ddca2868bb9c
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>

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

index c760eb6..6e14777 100644 (file)
@@ -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])
index 57f6ea7..497b1ef 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 f0269b3..9dd55b3 100644 (file)
@@ -713,7 +713,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],
                        [])
@@ -727,6 +731,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],