Whamcloud - gitweb
b=21951 2.6.32-fc13 patchless client support for HEAD
[fs/lustre-release.git] / lustre / autoconf / lustre-core.m4
index 11e6569..c1b447e 100644 (file)
@@ -8,7 +8,7 @@
 AC_DEFUN([LC_CONFIG_SRCDIR],
 [AC_CONFIG_SRCDIR([lustre/obdclass/obdo.c])
 libcfs_is_module=yes
-ldiskfs_is_ext4=yes
+ldiskfs_is_ext4=no
 ])
 
 #
@@ -421,6 +421,7 @@ AC_DEFUN([LC_POSIX_ACL_XATTR_H],
 [LB_CHECK_FILE([$LINUX/include/linux/posix_acl_xattr.h],[
         AC_MSG_CHECKING([if linux/posix_acl_xattr.h can be compiled])
         LB_LINUX_TRY_COMPILE([
+                #include <linux/fs.h>
                 #include <linux/posix_acl_xattr.h>
         ],[],[
                 AC_MSG_RESULT([yes])
@@ -431,19 +432,7 @@ AC_DEFUN([LC_POSIX_ACL_XATTR_H],
         ])
 $1
 ],[
-AC_MSG_RESULT([no])
-])
-])
-
-#
-# LC_EXPORT___IGET
-# starting from 2.6.19 linux kernel exports __iget()
-#
-AC_DEFUN([LC_EXPORT___IGET],
-[LB_CHECK_SYMBOL_EXPORT([__iget],
-[fs/inode.c],[
-        AC_DEFINE(HAVE_EXPORT___IGET, 1, [kernel exports __iget])
-],[
+        AC_MSG_RESULT([no])
 ])
 ])
 
@@ -688,6 +677,26 @@ LB_LINUX_TRY_COMPILE([
 ])
 
 #
+# LC_D_OBTAIN_ALIAS
+# starting from 2.6.18 kernel don't export do_kern_mount
+# and want to use vfs_kern_mount instead.
+#
+AC_DEFUN([LC_D_OBTAIN_ALIAS],
+[AC_MSG_CHECKING([d_obtain_alias exist in kernel])
+LB_LINUX_TRY_COMPILE([
+        #include <linux/dcache.h>
+],[
+        d_obtain_alias(NULL);
+],[
+        AC_DEFINE(HAVE_D_OBTAIN_ALIAS, 1,
+                [d_obtain_alias exist in kernel])
+        AC_MSG_RESULT([yes])
+],[
+        AC_MSG_RESULT([no])
+])
+])
+
+#
 # LC_INVALIDATEPAGE_RETURN_INT
 # 2.6.17 changes return type for invalidatepage to 'void' from 'int'
 #
@@ -853,26 +862,28 @@ LB_LINUX_TRY_COMPILE([
 ])
 
 # LC_CANCEL_DIRTY_PAGE
-# 2.6.20 introduse cancel_dirty_page instead of
-# clear_page_dirty.
+# 2.6.20 introduced cancel_dirty_page instead of clear_page_dirty.
 AC_DEFUN([LC_CANCEL_DIRTY_PAGE],
-[AC_MSG_CHECKING([kernel has cancel_dirty_page])
-LB_LINUX_TRY_COMPILE([
-        #include <linux/mm.h>
-        #include <linux/page-flags.h>
+        [AC_MSG_CHECKING([kernel has cancel_dirty_page])
+        # the implementation of cancel_dirty_page in OFED 1.4.1's SLES10 SP2
+        # backport is broken, so ignore it
+        if test -f $OFED_BACKPORT_PATH/linux/mm.h &&
+           test "$(sed -ne '/^static inline void cancel_dirty_page(struct page \*page, unsigned int account_size)$/,/^}$/p' $OFED_BACKPORT_PATH/linux/mm.h | md5sum)" = "c518cb32d6394760c5bca14cb7538d3e  -"; then
+                AC_MSG_RESULT(no)
+        else
+                LB_LINUX_TRY_COMPILE([
+                        #include <linux/mm.h>
+                        #include <linux/page-flags.h>
 ],[
-        /* tmp workaround for broken OFED 1.4.1 at SLES10 */
-        #if defined(CONFIG_SLE_VERSION) && CONFIG_SLE_VERSION == 10 && defined(_BACKPORT_LINUX_MM_H_)
-        #error badly implementation of cancel_dirty_pages
-        #endif
-        cancel_dirty_page(NULL, 0);
+                        cancel_dirty_page(NULL, 0);
 ],[
-        AC_MSG_RESULT(yes)
-        AC_DEFINE(HAVE_CANCEL_DIRTY_PAGE, 1,
-                  [kernel has cancel_dirty_page instead of clear_page_dirty])
+                        AC_MSG_RESULT(yes)
+                        AC_DEFINE(HAVE_CANCEL_DIRTY_PAGE, 1,
+                                  [kernel has cancel_dirty_page instead of clear_page_dirty])
 ],[
-        AC_MSG_RESULT(no)
+                        AC_MSG_RESULT(no)
 ])
+        fi
 ])
 
 #
@@ -1375,7 +1386,7 @@ EXTRA_KCFLAGS="$tmp_flags"
 AC_DEFUN([LC_CONST_ACL_SIZE],
 [AC_MSG_CHECKING([calc acl size])
 tmp_flags="$CFLAGS"
-CFLAGS="$CFLAGS -I$LINUX/include -I$LINUX_OBJ/include -I$LINUX_OBJ/include2 $EXTRA_KCFLAGS"
+CFLAGS="$CFLAGS -I$LINUX/include -I$LINUX_OBJ/include -I$LINUX_OBJ/include2 -I$LINUX/arch/`uname -m|sed -e 's/ppc.*/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include $EXTRA_KCFLAGS"
 AC_TRY_RUN([
 #define __KERNEL__
 #include <linux/autoconf.h>
@@ -1793,6 +1804,39 @@ AC_DEFUN([LC_LINUX_FIEMAP_H],
 [])
 ])
 
+# LC_LOCK_MAP_ACQUIRE
+# after 2.6.27 lock_map_acquire replaces lock_acquire
+AC_DEFUN([LC_LOCK_MAP_ACQUIRE],
+[AC_MSG_CHECKING([if lock_map_acquire is defined])
+LB_LINUX_TRY_COMPILE([
+        #include <linux/lockdep.h>
+],[
+        lock_map_acquire(NULL);
+],[
+        AC_MSG_RESULT(yes)
+        AC_DEFINE(HAVE_LOCK_MAP_ACQUIRE, 1,
+                [lock_map_acquire is defined])
+],[
+        AC_MSG_RESULT(no)
+])
+])
+
+# 2.6.31 replaces blk_queue_hardsect_size by blk_queue_logical_block_size function
+AC_DEFUN([LC_BLK_QUEUE_LOG_BLK_SIZE],
+[AC_MSG_CHECKING([if blk_queue_logical_block_size is defined])
+LB_LINUX_TRY_COMPILE([
+        #include <linux/blkdev.h>
+],[
+        blk_queue_logical_block_size(NULL, 0);
+],[
+        AC_MSG_RESULT(yes)
+        AC_DEFINE(HAVE_BLK_QUEUE_LOG_BLK_SIZE, 1,
+                  [blk_queue_logical_block_size is defined])
+],[
+        AC_MSG_RESULT(no)
+])
+])
+
 #
 # LC_PROG_LINUX
 #
@@ -1933,6 +1977,7 @@ AC_DEFUN([LC_PROG_LINUX],
          LC_QUOTA_ON_5ARGS
          LC_QUOTA_OFF_3ARGS
          LC_VFS_DQ_OFF
+         LC_LOCK_MAP_ACQUIRE
 
          # 2.6.27.15-2 sles11
          LC_BI_HW_SEGMENTS
@@ -1940,6 +1985,9 @@ AC_DEFUN([LC_PROG_LINUX],
          LC_VFS_SYMLINK_5ARGS
          LC_SB_ANY_QUOTA_ACTIVE
          LC_SB_HAS_QUOTA_ACTIVE
+
+         # 2.6.31
+         LC_BLK_QUEUE_LOG_BLK_SIZE
 ])
 
 #
@@ -1997,6 +2045,63 @@ if test x$enable_liblustre_acl = xyes ; then
   AC_DEFINE(LIBLUSTRE_POSIX_ACL, 1, Liblustre Support ACL-enabled MDS)
 fi
 
+# 2.6.29 change prepare/commit_write to write_begin/end
+AC_DEFUN([LC_WRITE_BEGIN_END],
+[AC_MSG_CHECKING([if kernel has .write_begin/end])
+LB_LINUX_TRY_COMPILE([
+        #include <linux/fs.h>
+        #include <linux/pagemap.h>
+#ifdef HAVE_LINUX_MMTYPES_H
+        #include <linux/mm_types.h>
+#endif
+],[
+        struct address_space_operations aops;
+        struct page *page;
+
+        aops.write_begin = NULL;
+        aops.write_end = NULL;
+        page = grab_cache_page_write_begin(NULL, 0, 0);
+], [
+        AC_MSG_RESULT([yes])
+        AC_DEFINE(HAVE_KERNEL_WRITE_BEGIN_END, 1,
+                [kernel has .write_begin/end])
+],[
+        AC_MSG_RESULT([no])
+])
+])
+
+# 2.6.29 blkdev_put has 2 arguments
+AC_DEFUN([LC_BLKDEV_PUT_2ARGS],
+[AC_MSG_CHECKING([blkdev_put needs 2 parameters])
+LB_LINUX_TRY_COMPILE([
+        #include <linux/fs.h>
+],[
+        blkdev_put(NULL, 0);
+],[
+        AC_DEFINE(HAVE_BLKDEV_PUT_2ARGS, 1,
+                [blkdev_put needs 2 paramters])
+        AC_MSG_RESULT([yes])
+],[
+        AC_MSG_RESULT([no])
+])
+])
+
+# 2.6.29 dentry_open has 4 arguments
+AC_DEFUN([LC_DENTRY_OPEN_4ARGS],
+[AC_MSG_CHECKING([dentry_open needs 4 parameters])
+LB_LINUX_TRY_COMPILE([
+        #include <linux/fs.h>
+],[
+        dentry_open(NULL, NULL, 0, NULL);
+],[
+        AC_DEFINE(HAVE_DENTRY_OPEN_4ARGS, 1,
+                [dentry_open needs 4 paramters])
+        AC_MSG_RESULT([yes])
+],[
+        AC_MSG_RESULT([no])
+])
+])
+
 #
 # --enable-mpitest
 #
@@ -2361,6 +2466,12 @@ if test x$enable_lu_ref = xyes ; then
         AC_DEFINE([USE_LU_REF], 1, [enable lu_ref reference tracking code])
 fi
 
+         #2.6.29
+         LC_WRITE_BEGIN_END
+         LC_D_OBTAIN_ALIAS
+         LC_BLKDEV_PUT_2ARGS
+         LC_DENTRY_OPEN_4ARGS
+
 ])
 
 #
@@ -2401,14 +2512,12 @@ lustre/include/Makefile
 lustre/include/lustre_ver.h
 lustre/include/linux/Makefile
 lustre/include/lustre/Makefile
-lustre/kernel_patches/targets/2.6-vanilla.target
-lustre/kernel_patches/targets/2.6-rhel4.target
 lustre/kernel_patches/targets/2.6-rhel5.target
-lustre/kernel_patches/targets/2.6-fc5.target
-lustre/kernel_patches/targets/2.6-patchless.target
 lustre/kernel_patches/targets/2.6-sles10.target
 lustre/kernel_patches/targets/2.6-sles11.target
 lustre/kernel_patches/targets/2.6-oel5.target
+lustre/kernel_patches/targets/2.6-fc11.target
+lustre/kernel_patches/targets/2.6-fc12.target
 lustre/ldlm/Makefile
 lustre/fid/Makefile
 lustre/fid/autoMakefile
@@ -2464,11 +2573,6 @@ lustre/tests/Makefile
 lustre/tests/mpi/Makefile
 lustre/utils/Makefile
 lustre/utils/gss/Makefile
+lustre/obdclass/darwin/Makefile
 ])
-case $lb_target_os in
-        darwin)
-                AC_CONFIG_FILES([ lustre/obdclass/darwin/Makefile ])
-                ;;
-esac
-
 ])