])
#
+# 3.3 introduces migrate_mode.h and migratepage has 4 args
+#
+AC_DEFUN([LC_HAVE_MIGRATE_HEADER],
+[LB_CHECK_FILE([$LINUX/include/linux/migrate.h],[
+ AC_DEFINE(HAVE_MIGRATE_H, 1,
+ [kernel has include/linux/migrate.h])
+],[LB_CHECK_FILE([$LINUX/include/linux/migrate_mode.h],[
+ AC_DEFINE(HAVE_MIGRATE_MODE_H, 1,
+ [kernel has include/linux/migrate_mode.h])
+],[
+ AC_MSG_RESULT([no])
+])
+])
+])
+
+AC_DEFUN([LC_MIGRATEPAGE_4ARGS],
+[AC_MSG_CHECKING([if address_space_operations.migratepage has 4 args])
+LB_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+#ifdef HAVE_MIGRATE_H
+ #include <linux/migrate.h>
+#elif defined(HAVE_MIGRATE_MODE_H)
+ #include <linux/migrate_mode.h>
+#endif
+],[
+ struct address_space_operations aops;
+
+ aops.migratepage(NULL, NULL, NULL, MIGRATE_ASYNC);
+],[
+ AC_DEFINE(HAVE_MIGRATEPAGE_4ARGS, 1,
+ [address_space_operations.migratepage has 4 args])
+ AC_MSG_RESULT([yes])
+],[
+ AC_MSG_RESULT([no])
+])
+])
+
+#
# LC_PROG_LINUX
#
# Lustre linux kernel checks
# 2.6.39
LC_REQUEST_QUEUE_UNPLUG_FN
+ # 3.3
+ LC_HAVE_MIGRATE_HEADER
+ LC_MIGRATEPAGE_4ARGS
+
#
if test x$enable_server = xyes ; then
AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server])
#include <asm/system.h>
#include <asm/uaccess.h>
+#ifdef HAVE_MIGRATE_H
+#include <linux/migrate.h>
+#elif defined(HAVE_MIGRATE_MODE_H)
+#include <linux/migrate_mode.h>
+#endif
#include <linux/fs.h>
#include <linux/buffer_head.h>
#include <linux/writeback.h>
#ifdef CONFIG_MIGRATION
int ll_migratepage(struct address_space *mapping,
- struct page *newpage, struct page *page)
+ struct page *newpage, struct page *page
+#ifdef HAVE_MIGRATEPAGE_4ARGS
+ , enum migrate_mode mode
+#endif
+ )
{
/* Always fail page migration until we have a proper implementation */
return -EIO;