Linux 3.9: hlist iterator change
authorMarc Dionne <marc.c.dionne@gmail.com>
Wed, 6 Mar 2013 01:54:50 +0000 (20:54 -0500)
committerDerrick Brashear <shadow@your-file-system.com>
Wed, 20 Mar 2013 15:12:51 +0000 (08:12 -0700)
hlist iterators have been reworked to not require a temporary
node parameter.

Change-Id: Ibea1295163bd39ff2901a2194aa46c3d342f5128
Reviewed-on: http://gerrit.openafs.org/9403
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

acinclude.m4
src/afs/LINUX/osi_vnodeops.c
src/cf/linux-test4.m4

index 9835c70..d84bce5 100644 (file)
@@ -1012,6 +1012,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 LINUX_KMAP_ATOMIC_TAKES_NO_KM_TYPE
                 LINUX_DENTRY_OPEN_TAKES_PATH
                 LINUX_D_ALIAS_IS_HLIST
+                LINUX_HLIST_ITERATOR_NO_NODE
                 LINUX_IOP_I_CREATE_TAKES_BOOL
                 LINUX_DOP_D_REVALIDATE_TAKES_UNSIGNED
                 LINUX_IOP_LOOKUP_TAKES_UNSIGNED
index f37a098..cc6775d 100644 (file)
@@ -804,7 +804,7 @@ canonical_dentry(struct inode *ip)
 {
     struct vcache *vcp = VTOAFS(ip);
     struct dentry *first = NULL, *ret = NULL, *cur;
-#if defined(D_ALIAS_IS_HLIST)
+#if defined(D_ALIAS_IS_HLIST) && !defined(HLIST_ITERATOR_NO_NODE)
     struct hlist_node *p;
 #endif
 
@@ -827,7 +827,11 @@ canonical_dentry(struct inode *ip)
 # endif
 
 #if defined(D_ALIAS_IS_HLIST)
+# if defined(HLIST_ITERATOR_NO_NODE)
+    hlist_for_each_entry(cur, &ip->i_dentry, d_alias) {
+# else
     hlist_for_each_entry(cur, p, &ip->i_dentry, d_alias) {
+# endif
 #else
     list_for_each_entry_reverse(cur, &ip->i_dentry, d_alias) {
 #endif
index 63aab1d..ab6da1d 100644 (file)
@@ -718,6 +718,21 @@ AC_DEFUN([LINUX_D_ALIAS_IS_HLIST], [
 ])
 
 
+AC_DEFUN([LINUX_HLIST_ITERATOR_NO_NODE], [
+  AC_CHECK_LINUX_BUILD([whether hlist iterators don't need a node parameter],
+                       [ac_cv_linux_hlist_takes_no_node],
+                       [#include <linux/list.h>
+                       #include <linux/fs.h>],
+                       [struct dentry *d = NULL, *cur;
+                       struct inode *ip;
+                       hlist_for_each_entry(cur, &ip->i_dentry, d_alias) { }
+                       ],
+                       [HLIST_ITERATOR_NO_NODE],
+                       [define if hlist iterators don't need a node parameter],
+                       [])
+])
+
+
 AC_DEFUN([LINUX_IOP_I_CREATE_TAKES_BOOL], [
   AC_CHECK_LINUX_BUILD([whether inode_operations.create takes a bool],
                        [ac_cv_linux_func_i_create_takes_bool],