Whamcloud - gitweb
Branch b1_6
authoradilger <adilger>
Thu, 24 Jan 2008 23:58:38 +0000 (23:58 +0000)
committeradilger <adilger>
Thu, 24 Jan 2008 23:58:38 +0000 (23:58 +0000)
Allow newer ldiskfs with d_rehash_cond() and d_move_locked() to build
against older kernels with the older __d_rehash() and __d_move() functions.

Minor reformatting of configure.ac to match GNU autoconf coding style.
http://www.gnu.org/software/autoconf/manual/html_node/Coding-Style.html

b=14714
i=scjody

ldiskfs/configure.ac
ldiskfs/kernel_patches/patches/iopen-2.6-rhel4.patch
ldiskfs/kernel_patches/patches/iopen-2.6.22-vanilla.patch

index 5c170c1..322b6c4 100644 (file)
@@ -36,15 +36,10 @@ esac
 
 AC_MSG_CHECKING([whether to build kernel modules])
 AC_ARG_ENABLE([modules],
-       AC_HELP_STRING([--disable-modules],
-                       [disable building of Lustre kernel modules]),
-       [],[
-               LC_TARGET_SUPPORTED([
-                       enable_modules='yes'
-               ],[
-                       enable_modules='no'
-               ])
-       ])
+             AC_HELP_STRING([--disable-modules],
+                            [disable building of Lustre kernel modules]),[],
+                            [LC_TARGET_SUPPORTED([enable_modules='yes'],
+                            [enable_modules='no'])])
 AC_MSG_RESULT([$enable_modules])
 
 if test x$enable_modules = xyes ; then
@@ -67,8 +62,9 @@ AC_SUBST(LDISKFSDIR)
 
 AC_MSG_CHECKING([whether to enable quilt for making ldiskfs])
 AC_ARG_ENABLE([quilt],
-               AC_HELP_STRING([--disable-quilt],[disable use of quilt for ldiskfs]),
-               [],[enable_quilt='yes'])
+             AC_HELP_STRING([--disable-quilt],
+                            [disable use of quilt for ldiskfs]),[],
+                            [enable_quilt='yes'])
 AC_MSG_RESULT([$enable_quilt])
 
 AC_PATH_PROG(PATCH, patch, [no])
@@ -107,6 +103,30 @@ AC_SUBST(LDISKFS_SERIES)
 
 AC_SUBST(ac_configure_args)
 
+LB_CHECK_SYMBOL_EXPORT([d_rehash_cond],
+                      [fs/dcache.c],
+                      [AC_DEFINE(HAVE_D_REHASH_COND, 1,
+                                 [d_rehash_cond is exported by the kernel])],
+                                 [])
+
+LB_CHECK_SYMBOL_EXPORT([__d_rehash],
+                      [fs/dcache.c],
+                      [AC_DEFINE(HAVE___D_REHASH, 1,
+                                 [__d_rehash is exported by the kernel])],
+                                 [])
+
+LB_CHECK_SYMBOL_EXPORT([d_move_locked],
+                      [fs/dcache.c],
+                      [AC_DEFINE(HAVE_D_MOVE_LOCKED, 1,
+                                 [d_move_locked is exported by the kernel])],
+                                 [])
+
+LB_CHECK_SYMBOL_EXPORT([__d_move],
+                      [fs/dcache.c],
+                      [AC_DEFINE(HAVE___D_MOVE, 1,
+                                 [__d_move exported by the kernel])],
+                                 [])
+
 LB_CONFIG_FILES
 AC_CONFIG_FILES([ldiskfs/autoMakefile ldiskfs/Makefile])
 
index 39ebb39..2f015bb 100644 (file)
@@ -319,7 +319,7 @@ Index: linux-stage/fs/ext3/iopen.h
 ===================================================================
 --- linux-stage.orig/fs/ext3/iopen.h   2005-02-25 14:41:01.017787968 +0200
 +++ linux-stage/fs/ext3/iopen.h        2005-02-25 14:41:01.045783712 +0200
-@@ -0,0 +1,15 @@
+@@ -0,0 +1,23 @@
 +/*
 + * iopen.h
 + *
@@ -335,6 +335,13 @@ Index: linux-stage/fs/ext3/iopen.h
 +extern int ext3_iopen_get_inode(struct inode *inode);
 +extern struct dentry *iopen_connect_dentry(struct dentry *dentry,
 +                                         struct inode *inode, int rehash);
++
++#if !defined(HAVE_D_REHASH_COND) && defined(HAVE___D_REHASH)
++#define d_rehash_cond(dentry, lock) __d_rehash(dentry, lock)
++#endif
++
++#if !defined(HAVE_D_MOVE_LOCKED) && defined(HAVE_d_move_locked(dentry, lock) __d_move(dentry, lock)
++#endif
 Index: linux-stage/fs/ext3/namei.c
 ===================================================================
 --- linux-stage.orig/fs/ext3/namei.c   2005-02-25 14:37:28.975023368 +0200
index a01a018..ce80837 100644 (file)
@@ -116,7 +116,7 @@ Index: linux-2.6.16.27-0.9/fs/ext3/iopen.c
 +      list_add(&dentry->d_alias, &inode->i_dentry);   /* d_instantiate */
 +      dentry->d_inode = inode;
 +
-+      d_rehash_cond(dentry, 0);       /* d_rehash */
++      d_rehash_cond(dentry, 0);
 +      spin_unlock(&dcache_lock);
 +
 +      return NULL;
@@ -177,7 +177,7 @@ Index: linux-2.6.16.27-0.9/fs/ext3/iopen.c
 +      dentry->d_inode = inode;
 +do_rehash:
 +      if (rehash)
-+              d_rehash_cond(dentry, 0);       /* d_rehash */
++              d_rehash_cond(dentry, 0);
 +      spin_unlock(&dcache_lock);
 +
 +      return NULL;