])
#
-# LC_FUNC_RELEASEPAGE_WITH_GFP
-#
-# 2.6.9 ->releasepage() takes a gfp_t arg
-# This kernel defines gfp_t (HAS_GFP_T) but doesn't use it for this function,
-# while others either don't have gfp_t or pass gfp_t as the parameter.
-#
-AC_DEFUN([LC_FUNC_RELEASEPAGE_WITH_GFP],
-[AC_MSG_CHECKING([if releasepage has a gfp_t parameter])
-RELEASEPAGE_WITH_GFP="$(grep -c 'releasepage.*gfp_t' $LINUX/include/linux/fs.h)"
-if test "$RELEASEPAGE_WITH_GFP" != 0 ; then
- AC_DEFINE(HAVE_RELEASEPAGE_WITH_GFP, 1,
- [releasepage with gfp_t parameter])
- AC_MSG_RESULT([yes])
-else
- AC_MSG_RESULT([no])
-fi
-])
-
-
-
-#
# only for Lustre-patched kernels
#
AC_DEFUN([LC_LUSTRE_VERSION_H],
#
# LC_FUNC_DEV_SET_RDONLY
#
-# check for the old-style dev_set_rdonly which took an extra "devno" param
-# and can only set a single device to discard writes at one time
+# check whether dev_set_rdonly is exported. This is needed until we
+# have another mechanism to fence IO from the underlying device.
#
AC_DEFUN([LC_FUNC_DEV_SET_RDONLY],
-[AC_MSG_CHECKING([if kernel has new dev_set_rdonly])
-LB_LINUX_TRY_COMPILE([
- #include <linux/fs.h>
- #include <linux/blkdev.h>
-],[
- #ifndef HAVE_CLEAR_RDONLY_ON_PUT
- #error needs to be patched by lustre kernel patches from Lustre version 1.4.3 or above.
- #endif
-],[
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_DEV_SET_RDONLY, 1, [kernel has new dev_set_rdonly])
+[LB_CHECK_SYMBOL_EXPORT([dev_set_rdonly],
+[block/ll_rw_block.c,block/blk-core.c],[
+ AC_DEFINE(HAVE_DEV_SET_RDONLY, 1, [kernel exports dev_set_rdonly])
],[
- AC_MSG_ERROR([no, Linux kernel source needs to be patches by lustre
-kernel patches from Lustre version 1.4.3 or above.])
+ AC_MSG_WARN([kernel missing dev_set_rdonly patch for testing])
])
])
fi
])
-# truncate_complete_page() was exported from RHEL5/SLES10/SLES11
+# truncate_complete_page() was exported from RHEL5/SLES10, but not in SLES11 SP0 (2.6.27)
# remove_from_page_cache() was exported between 2.6.35 and 2.6.38
# delete_from_page_cache() is exported from 2.6.39
AC_DEFUN([LC_EXPORT_TRUNCATE_COMPLETE],
[kernel export delete_from_page_cache])])
])
-AC_DEFUN([LC_EXPORT_TRUNCATE_RANGE],
-[LB_CHECK_SYMBOL_EXPORT([truncate_inode_pages_range],
-[mm/truncate.c],[
-AC_DEFINE(HAVE_TRUNCATE_RANGE, 1,
- [kernel export truncate_inode_pages_range])
-],[
-])
-])
-
AC_DEFUN([LC_EXPORT_D_REHASH_COND],
[LB_CHECK_SYMBOL_EXPORT([d_rehash_cond],
[fs/dcache.c],[
])
#
-# LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP
-#
-# Check for our patched grab_cache_page_nowait_gfp() function
-# after 2.6.29 we can emulate this using add_to_page_cache_lru()
-#
-AC_DEFUN([LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP],
-[LB_CHECK_SYMBOL_EXPORT([grab_cache_page_nowait_gfp],
-[mm/filemap.c],[
- AC_DEFINE(HAVE_GRAB_CACHE_PAGE_NOWAIT_GFP, 1,
- [kernel exports grab_cache_page_nowait_gfp])
- ],
- [LB_CHECK_SYMBOL_EXPORT([add_to_page_cache_lru],
- [mm/filemap.c],[
- AC_DEFINE(HAVE_ADD_TO_PAGE_CACHE_LRU, 1,
- [kernel exports add_to_page_cache_lru])
- ],[
- ])
- ])
-])
-
-#
-# LC_STRUCT_STATFS
-#
-# AIX does not have statfs.f_namelen
-#
-AC_DEFUN([LC_STRUCT_STATFS],
-[AC_MSG_CHECKING([if struct statfs has a f_namelen field])
-LB_LINUX_TRY_COMPILE([
- #include <linux/vfs.h>
-],[
- struct statfs sfs;
- sfs.f_namelen = 1;
-],[
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_STATFS_NAMELEN, 1, [struct statfs has a namelen field])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
#
# between 2.6.5 - 2.6.22 filemap_populate is exported in some kernels
#
])
#
-# added in 2.6.15
-#
-AC_DEFUN([LC_D_ADD_UNIQUE],
-[AC_MSG_CHECKING([for d_add_unique])
-LB_LINUX_TRY_COMPILE([
- #include <linux/dcache.h>
-],[
- d_add_unique(NULL, NULL);
-],[
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_D_ADD_UNIQUE, 1, [Kernel has d_add_unique])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-#
# added in 2.6.17
#
AC_DEFUN([LC_BIT_SPINLOCK_H],
])
#
-# After 2.6.26 we no longer have xattr_acl.h
-#
-AC_DEFUN([LC_XATTR_ACL],
-[LB_CHECK_FILE([$LINUX/include/linux/xattr_acl.h],[
- AC_MSG_CHECKING([if xattr_acl.h can be compiled])
- LB_LINUX_TRY_COMPILE([
- #include <linux/xattr_acl.h>
- ],[],[
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_XATTR_ACL, 1, [Kernel has xattr_acl])
- ],[
- AC_MSG_RESULT([no])
- ])
-],
-[])
-])
-
+# LC_CONST_ACL_SIZE
#
-# After 2.6.16 the xattr_acl API is removed, and posix_acl is used instead
-#
-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])
- AC_DEFINE(HAVE_LINUX_POSIX_ACL_XATTR_H, 1, [linux/posix_acl_xattr.h found])
-
- ],[
- AC_MSG_RESULT([no])
- ])
-$1
-],[
- AC_MSG_RESULT([no])
-])
-])
-
AC_DEFUN([LC_CONST_ACL_SIZE],
[AC_MSG_CHECKING([calc acl size])
tmp_flags="$CFLAGS"
// block include
#define __LINUX_POSIX_ACL_H
- # ifdef CONFIG_FS_POSIX_ACL
- # ifdef HAVE_XATTR_ACL
- # include <linux/xattr_acl.h>
- # endif
- # ifdef HAVE_LINUX_POSIX_ACL_XATTR_H
- # include <linux/posix_acl_xattr.h>
- # endif
- # endif
-
- #include <lustre_acl.h>
+ #ifdef CONFIG_FS_POSIX_ACL
+ # include <linux/posix_acl_xattr.h>
+ #endif
#include <stdio.h>
int main(void)
{
- int size = mds_xattr_acl_size(LUSTRE_POSIX_ACL_MAX_ENTRIES);
+ /* LUSTRE_POSIX_ACL_MAX_ENTRIES = 32 */
+ int size = posix_acl_xattr_size(32);
FILE *f = fopen("acl.size","w+");
fprintf(f,"%d", size);
fclose(f);
EXTRA_KCFLAGS="$tmp_flags"
])
-# LC_EXPORT_SYNCHRONIZE_RCU
-# after 2.6.12 synchronize_rcu is preferred over synchronize_kernel
-AC_DEFUN([LC_EXPORT_SYNCHRONIZE_RCU],
-[LB_CHECK_SYMBOL_EXPORT([synchronize_rcu],
-[kernel/rcupdate.c],[
- AC_DEFINE(HAVE_SYNCHRONIZE_RCU, 1,
- [in 2.6.12 synchronize_rcu preferred over synchronize_kernel])
-],[
-])
-])
-
# 2.6.15
# LC_INODE_I_MUTEX
])
])
-# 2.6.25
-
-# 2.6.25 change define to inline
-AC_DEFUN([LC_MAPPING_CAP_WRITEBACK_DIRTY],
-[AC_MSG_CHECKING([if kernel have mapping_cap_writeback_dirty])
-LB_LINUX_TRY_COMPILE([
- #include <linux/backing-dev.h>
-],[
- #ifndef mapping_cap_writeback_dirty
- mapping_cap_writeback_dirty(NULL);
- #endif
-],[
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_MAPPING_CAP_WRITEBACK_DIRTY, 1,
- [kernel have mapping_cap_writeback_dirty])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
# 2.6.26
# 2.6.26 isn't export set_fs_pwd and change paramter in fs struct
])
])
-# sles10 sp2 need 5 parameter for vfs_symlink
-AC_DEFUN([LC_VFS_SYMLINK_5ARGS],
-[AC_MSG_CHECKING([vfs_symlink need 5 parameter])
-LB_LINUX_TRY_COMPILE([
- #include <linux/fs.h>
-],[
- struct inode *dir = NULL;
- struct dentry *dentry = NULL;
- struct vfsmount *mnt = NULL;
- const char * path = NULL;
- vfs_symlink(dir, dentry, mnt, path, 0);
-],[
- AC_DEFINE(HAVE_VFS_SYMLINK_5ARGS, 1,
- [vfs_symlink need 5 parameteres])
- AC_MSG_RESULT([yes])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
# 2.6.27 sles11 has sb_any_quota_active
AC_DEFUN([LC_SB_ANY_QUOTA_ACTIVE],
[AC_MSG_CHECKING([Kernel has sb_any_quota_active])
# 2.6.32
+# 2.6.32 changes cache_detail's member cache_request to cache_upcall
+# in kernel commit bc74b4f5e63a09fb78e245794a0de1e5a2716bbe
+AC_DEFUN([LC_CACHE_UPCALL],
+[AC_MSG_CHECKING([if cache_detail has cache_upcall field])
+ LB_LINUX_TRY_COMPILE([
+ #include <linux/sunrpc/cache.h>
+ ],[
+ struct cache_detail cd;
+ cd.cache_upcall = NULL;
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_CACHE_UPCALL, 1,
+ [cache_detail has cache_upcall field])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+])
+
# 2.6.32 add a limits member in struct request_queue.
AC_DEFUN([LC_REQUEST_QUEUE_LIMITS],
[AC_MSG_CHECKING([if request_queue has a limits field])
# LC_D_OBTAIN_ALIAS
# starting from 2.6.28 kernel replaces d_alloc_anon() with
# d_obtain_alias() for getting anonymous dentries
+# RHEL5(2.6.18) has d_obtain_alias but SLES11SP0(2.6.27) not
#
AC_DEFUN([LC_D_OBTAIN_ALIAS],
[AC_MSG_CHECKING([d_obtain_alias exist in kernel])
])
#
+# LC_EXPORT_GENERIC_ERROR_REMOVE_PAGE
+#
+AC_DEFUN([LC_EXPORT_GENERIC_ERROR_REMOVE_PAGE],
+ [LB_CHECK_SYMBOL_EXPORT(
+ [generic_error_remove_page],
+ [mm/truncate.c],
+ [AC_DEFINE(HAS_GENERIC_ERROR_REMOVE_PAGE, 1,
+ [kernel export generic_error_remove_page])],
+ [])
+ ]
+)
+
+#
# 2.6.36 fs_struct.lock use spinlock instead of rwlock.
#
AC_DEFUN([LC_FS_STRUCT_RWLOCK],
])
#
+# 2.6.38 export simple_setattr
+#
+AC_DEFUN([LC_EXPORT_SIMPLE_SETATTR],
+[LB_CHECK_SYMBOL_EXPORT([simple_setattr],
+[fs/libfs.c],[
+AC_DEFINE(HAVE_SIMPLE_SETATTR, 1,
+ [simple_setattr is exported by the kernel])
+],[
+])
+])
+
+#
# LC_PROG_LINUX
#
# Lustre linux kernel checks
# RHEL4 patches
LC_EXPORT_TRUNCATE_COMPLETE
- LC_EXPORT_TRUNCATE_RANGE
LC_EXPORT_D_REHASH_COND
LC_EXPORT___D_REHASH
LC_EXPORT_NODE_TO_CPUMASK
- LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP
- LC_STRUCT_STATFS
LC_FILEMAP_POPULATE
- LC_D_ADD_UNIQUE
LC_BIT_SPINLOCK_H
- LC_XATTR_ACL
- LC_POSIX_ACL_XATTR_H
LC_CONST_ACL_SIZE
LC_STRUCT_INTENT_FILE
# 2.6.12
LC_RW_TREE_LOCK
- LC_EXPORT_SYNCHRONIZE_RCU
# 2.6.15
LC_INODE_I_MUTEX
LC_PROCFS_DELETED
LC_EXPORT_BDI_INIT
- #2.6.25
- LC_MAPPING_CAP_WRITEBACK_DIRTY
-
# 2.6.26
LC_FS_STRUCT_USE_PATH
# 2.6.27.15-2 sles11
LC_BI_HW_SEGMENTS
LC_HAVE_QUOTAIO_H
- LC_VFS_SYMLINK_5ARGS
LC_BDI_NAME
LC_SB_ANY_QUOTA_ACTIVE
LC_SB_HAS_QUOTA_ACTIVE
LC_BLK_QUEUE_MAX_SECTORS
LC_BLK_QUEUE_MAX_SEGMENTS
LC_SET_CPUS_ALLOWED
+ LC_CACHE_UPCALL
+ LC_EXPORT_GENERIC_ERROR_REMOVE_PAGE
# 2.6.35
LC_FILE_FSYNC
+ LC_EXPORT_SIMPLE_SETATTR
# 2.6.36
LC_FS_STRUCT_RWLOCK
fi
])
+# RHEL5(2.6.18) has tux_info
AC_DEFUN([LC_TASK_CLENV_TUX_INFO],
[AC_MSG_CHECKING([tux_info])
LB_LINUX_TRY_COMPILE([
lustre/include/Makefile
lustre/include/lustre_ver.h
lustre/include/linux/Makefile
+lustre/include/darwin/Makefile
lustre/include/lustre/Makefile
lustre/kernel_patches/targets/2.6-rhel6.target
lustre/kernel_patches/targets/2.6-rhel5.target