Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / autoconf / lustre-core.m4
index 551de56..d6c7843 100644 (file)
@@ -147,6 +147,30 @@ fi
 ])
 
 #
+# LC_HEADER_LDISKFS_XATTR
+#
+# CHAOS kernel-devel package will not include fs/ldiskfs/xattr.h
+#
+AC_DEFUN([LC_HEADER_LDISKFS_XATTR],
+[AC_MSG_CHECKING([if ldiskfs has xattr.h header])
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-I$LINUX/fs -I$LDISKFS_DIR -I$LDISKFS_DIR/ldiskfs"
+LB_LINUX_TRY_COMPILE([
+       #include <ldiskfs/xattr.h>
+],[
+        ldiskfs_xattr_get(NULL, 0, "", NULL, 0);
+        ldiskfs_xattr_set_handle(NULL, NULL, 0, "", NULL, 0, 0);
+
+],[
+       AC_MSG_RESULT([yes])
+       AC_DEFINE(HAVE_LDISKFS_XATTR_H, 1, [ldiskfs/xattr.h found])
+],[
+       AC_MSG_RESULT([no])
+])
+EXTRA_KCFLAGS="$tmp_flags"
+])
+
+#
 # LC_CONFIG_HEALTH_CHECK_WRITE
 #
 # Turn off the actual write to the disk
@@ -1296,6 +1320,27 @@ LB_LINUX_TRY_COMPILE([
 ])
 ])
 
+#
+# LC_FUNC_F_OP_FLOCK
+#
+# rhel4.2 kernel has f_op->flock field
+#
+AC_DEFUN([LC_FUNC_F_OP_FLOCK],
+[AC_MSG_CHECKING([if struct file_operations has flock field])
+LB_LINUX_TRY_COMPILE([
+        #include <linux/fs.h>
+],[
+        struct file_operations ll_file_operations_flock;
+        ll_file_operations_flock.flock = NULL;
+],[
+        AC_DEFINE(HAVE_F_OP_FLOCK, 1,
+                [struct file_operations has flock field])
+        AC_MSG_RESULT([yes])
+],[
+        AC_MSG_RESULT([no])
+])
+])
+
 # vfs_symlink seems to have started out with 3 args until 2.6.7 where a
 # "mode" argument was added, but then again, in some later version it was
 # removed
@@ -1350,6 +1395,23 @@ AC_DEFUN([LC_LINUX_FIEMAP_H],
 [])
 ])
 
+# 2.6.17 super_block use s_vfs_rename_mutex instead of s_vfs_rename_sem
+AC_DEFUN([LC_VFS_RENAME_MUTEX],
+[AC_MSG_CHECKING([super_block has s_vfs_rename_mutex])
+LB_LINUX_TRY_COMPILE([
+        #include <linux/fs.h>
+],[
+        struct super_block sb;
+        mutex_lock(&sb.s_vfs_rename_mutex);
+],[
+        AC_DEFINE(HAVE_VFS_RENAME_MUTEX, 1,
+                [super_block has s_vfs_rename_mutex])
+        AC_MSG_RESULT([yes])
+],[
+        AC_MSG_RESULT([no])
+])
+])
+
 #
 # LC_PROG_LINUX
 #
@@ -1379,6 +1441,7 @@ AC_DEFUN([LC_PROG_LINUX],
          LC_EXPORT___D_MOVE
          LC_EXPORT_NODE_TO_CPUMASK
 
+         LC_HEADER_LDISKFS_XATTR
          LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP
          LC_STRUCT_STATFS
          LC_FILEMAP_POPULATE
@@ -1396,6 +1459,7 @@ AC_DEFUN([LC_PROG_LINUX],
          LC_CONFIG_GSS
          LC_FUNC_MS_FLOCK_LOCK
          LC_FUNC_HAVE_CAN_SLEEP_ARG
+         LC_FUNC_F_OP_FLOCK
          LC_QUOTA_READ
          LC_COOKIE_FOLLOW_LINK
          LC_FUNC_RCU
@@ -1424,6 +1488,7 @@ AC_DEFUN([LC_PROG_LINUX],
          # 2.6.17
          LC_INODE_IPRIVATE
          LC_DQUOTOFF_MUTEX
+         LC_VFS_RENAME_MUTEX
 
          # 2.6.18
          LC_NR_PAGECACHE
@@ -1945,6 +2010,7 @@ 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-oel5.target
 lustre/ldlm/Makefile
 lustre/fid/Makefile
 lustre/fid/autoMakefile