+ 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])
+LB_LINUX_TRY_COMPILE([
+ #include <linux/quotaops.h>
+],[
+ sb_any_quota_active(NULL);
+],[
+ AC_DEFINE(HAVE_SB_ANY_QUOTA_ACTIVE, 1,
+ [Kernel has a sb_any_quota_active])
+ AC_MSG_RESULT([yes])
+],[
+ AC_MSG_RESULT([no])
+])
+])
+
+# 2.6.27 sles11 has sb_has_quota_active
+AC_DEFUN([LC_SB_HAS_QUOTA_ACTIVE],
+[AC_MSG_CHECKING([Kernel has sb_has_quota_active])
+LB_LINUX_TRY_COMPILE([
+ #include <linux/quotaops.h>
+],[
+ sb_has_quota_active(NULL, 0);
+],[
+ AC_DEFINE(HAVE_SB_HAS_QUOTA_ACTIVE, 1,
+ [Kernel has a sb_has_quota_active])
+ AC_MSG_RESULT([yes])
+],[
+ AC_MSG_RESULT([no])
+])
+])
+
+# 2.6.27 exported add_to_page_cache_lru.
+AC_DEFUN([LC_EXPORT_ADD_TO_PAGE_CACHE_LRU],
+[LB_CHECK_SYMBOL_EXPORT([add_to_page_cache_lru],
+[mm/filemap.c],[
+ AC_DEFINE(HAVE_ADD_TO_PAGE_CACHE_LRU, 1,
+ [add_to_page_cache_lru functions are present])
+],[
+])
+])
+
+# 2.6.31
+
+# 2.6.30 x86 node_to_cpumask has been removed. must use cpumask_of_node
+AC_DEFUN([LC_EXPORT_CPUMASK_OF_NODE],
+ [LB_CHECK_SYMBOL_EXPORT([node_to_cpumask_map],
+ [arch/$LINUX_ARCH/mm/numa.c],
+ [AC_DEFINE(HAVE_CPUMASK_OF_NODE, 1,
+ [node_to_cpumask_map is exported by
+ the kernel])]) # x86_64
+ ])
+
+# 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)
+])
+])
+
+# 2.6.32
+
+# 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])
+LB_LINUX_TRY_COMPILE([
+ #include <linux/blkdev.h>
+],[
+ struct request_queue rq;
+ rq.limits.io_min = 0;
+],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_REQUEST_QUEUE_LIMITS, 1,
+ [request_queue has a limits field])
+],[
+ AC_MSG_RESULT(no)
+])
+])
+
+# 2.6.32 has bdi_register() functions.
+AC_DEFUN([LC_EXPORT_BDI_REGISTER],
+[LB_CHECK_SYMBOL_EXPORT([bdi_register],
+[mm/backing-dev.c],[
+ AC_DEFINE(HAVE_BDI_REGISTER, 1,
+ [bdi_register function is present])
+],[
+])
+])
+
+# 2.6.32 add s_bdi for super block
+AC_DEFUN([LC_SB_BDI],
+[AC_MSG_CHECKING([if super_block has s_bdi field])
+LB_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+],[
+ struct super_block sb;
+ sb.s_bdi = NULL;
+],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_SB_BDI, 1,
+ [super_block has s_bdi field])
+],[
+ AC_MSG_RESULT(no)
+])
+])
+
+# 2.6.27.15-2 SuSE 11 sp0 kernels lack the name field for BDI
+AC_DEFUN([LC_BDI_NAME],
+[AC_MSG_CHECKING([if backing_device_info has name field])
+LB_LINUX_TRY_COMPILE([
+ #include <linux/blkkdev.h>
+],[
+ struct backing_dev_info bdi;
+ bdi.name = NULL;
+],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_BDI_NAME, 1,
+ [backing_device_info has name field])
+],[
+ AC_MSG_RESULT(no)
+])
+])
+
+# 2.6.32 removes blk_queue_max_sectors and add blk_queue_max_hw_sectors
+# check blk_queue_max_sectors and use it until disappear.
+AC_DEFUN([LC_BLK_QUEUE_MAX_SECTORS],
+[AC_MSG_CHECKING([if blk_queue_max_sectors is defined])
+LB_LINUX_TRY_COMPILE([
+ #include <linux/blkdev.h>
+],[
+ blk_queue_max_sectors(NULL, 0);
+],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_BLK_QUEUE_MAX_SECTORS, 1,
+ [blk_queue_max_sectors is defined])
+],[
+ AC_MSG_RESULT(no)
+])
+])
+
+# 2.6.32 replaces 2 functions blk_queue_max_phys_segments and blk_queue_max_hw_segments by blk_queue_max_segments
+AC_DEFUN([LC_BLK_QUEUE_MAX_SEGMENTS],
+[AC_MSG_CHECKING([if blk_queue_max_segments is defined])
+LB_LINUX_TRY_COMPILE([
+ #include <linux/blkdev.h>
+],[
+ blk_queue_max_segments(NULL, 0);
+],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_BLK_QUEUE_MAX_SEGMENTS, 1,
+ [blk_queue_max_segments is defined])
+],[
+ AC_MSG_RESULT(no)