#
# 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
+[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_RESULT([yes])
- AC_DEFINE(HAVE_DEV_SET_RDONLY, 1, [kernel has new 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])
])
])
])
#
-# 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])
- ],[
- ])
- ])
-])
-
-#
#
# between 2.6.5 - 2.6.22 filemap_populate is exported in some kernels
#
#include <linux/exportfs.h>
#endif
],[
- struct export_operations exp;
- memset(exp.fh_to_dentry, 0, sizeof(exp.fh_to_dentry));
+ do{ }while(sizeof(((struct export_operations *)0)->fh_to_dentry));
], [
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_FH_TO_DENTRY, 1,
#include <linux/spinlock.h>
#include <linux/fs_struct.h>
],[
- struct path path;
struct fs_struct fs;
- fs.pwd = path;
- memset(&fs, 0, sizeof(fs));
+ fs.pwd = *((struct path *)sizeof(fs));
], [
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_FS_STRUCT_USE_PATH, 1,
#
# 2.6.27
#
+AC_DEFUN([LC_PGMKWRITE_USE_VMFAULT],
+[AC_MSG_CHECKING([kernel .page_mkwrite uses struct vm_fault *])
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
+LB_LINUX_TRY_COMPILE([
+ #include <linux/mm.h>
+],[
+ ((struct vm_operations_struct *)0)->page_mkwrite((struct vm_area_struct *)0, (struct vm_fault *)0);
+], [
+ AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_PGMKWRITE_USE_VMFAULT, 1,
+ [kernel vm_operation_struct.page_mkwrite uses struct vm_fault * as second parameter])
+],[
+ AC_MSG_RESULT([no])
+])
+EXTRA_KCFLAGS="$tmp_flags"
+])
+
AC_DEFUN([LC_INODE_PERMISION_2ARGS],
[AC_MSG_CHECKING([inode_operations->permission has two args])
LB_LINUX_TRY_COMPILE([
# 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])
#
# 2.6.35 file_operations.fsync taken 2 arguments.
+# 3.0.0 file_operations.fsync takes 4 arguments.
#
AC_DEFUN([LC_FILE_FSYNC],
-[AC_MSG_CHECKING([if file_operations.fsync taken 2 arguments])
+[AC_MSG_CHECKING([if file_operations.fsync takes 4 or 2 arguments])
LB_LINUX_TRY_COMPILE([
#include <linux/fs.h>
],[
- ((struct file_operations *)0)->fsync(NULL, 0);
+ ((struct file_operations *)0)->fsync(NULL, 0, 0, 0);
],[
- AC_DEFINE(HAVE_FILE_FSYNC_2ARGS, 1,
- [file_operations.fsync taken 2 arguments])
- AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_FILE_FSYNC_4ARGS, 1,
+ [file_operations.fsync takes 4 arguments])
+ AC_MSG_RESULT([yes, 4 args])
],[
- AC_MSG_RESULT([no])
+ LB_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+ ],[
+ ((struct file_operations *)0)->fsync(NULL, 0);
+ ],[
+ AC_DEFINE(HAVE_FILE_FSYNC_2ARGS, 1,
+ [file_operations.fsync takes 2 arguments])
+ AC_MSG_RESULT([yes, 2 args])
+ ],[
+ AC_MSG_RESULT([no])
+ ])
])
])
LB_LINUX_TRY_COMPILE([
#include <linux/blkdev.h>
],[
- struct request_queue rq;
- memset(rq.unplug_fn, 0, sizeof(rq.unplug_fn));
+ do{ }while(sizeof(((struct request_queue *)0)->unplug_fn));
],[
AC_DEFINE(HAVE_REQUEST_QUEUE_UNPLUG_FN, 1,
[request_queue has unplug_fn field])
LC_EXPORT___D_REHASH
LC_EXPORT_NODE_TO_CPUMASK
- LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP
LC_FILEMAP_POPULATE
LC_BIT_SPINLOCK_H
# 2.6.12
LC_RW_TREE_LOCK
- LC_EXPORT_SYNCHRONIZE_RCU
# 2.6.15
LC_INODE_I_MUTEX
LC_FS_STRUCT_USE_PATH
# 2.6.27
+ LC_PGMKWRITE_USE_VMFAULT
LC_INODE_PERMISION_2ARGS
LC_FILE_REMOVE_SUID
LC_TRYLOCKPAGE
LC_CACHE_UPCALL
LC_EXPORT_GENERIC_ERROR_REMOVE_PAGE
- # 2.6.35
+ # 2.6.35, 3.0.0
LC_FILE_FSYNC
LC_EXPORT_SIMPLE_SETATTR
fi
])
+# RHEL5(2.6.18) has tux_info
AC_DEFUN([LC_TASK_CLENV_TUX_INFO],
[AC_MSG_CHECKING([tux_info])
LB_LINUX_TRY_COMPILE([