-# 2.6.23 change .sendfile to .splice_read
-AC_DEFUN([LC_KERNEL_SPLICE_READ],
-[AC_MSG_CHECKING([if kernel has .splice_read])
-LB_LINUX_TRY_COMPILE([
- #include <linux/fs.h>
-],[
- struct file_operations file;
-
- file.splice_read = NULL;
-], [
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_KERNEL_SPLICE_READ, 1,
- [kernel has .slice_read])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-# 2.6.23 change .sendfile to .splice_read
-# RHEL4 (-92 kernel) have both sendfile and .splice_read API
-AC_DEFUN([LC_KERNEL_SENDFILE],
-[AC_MSG_CHECKING([if kernel has .sendfile])
-LB_LINUX_TRY_COMPILE([
- #include <linux/fs.h>
-],[
- struct file_operations file;
-
- file.sendfile = NULL;
-], [
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_KERNEL_SENDFILE, 1,
- [kernel has .sendfile])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-# 2.6.23 extract nfs export related data into exportfs.h
-AC_DEFUN([LC_HAVE_EXPORTFS_H],
-[LB_CHECK_FILE([$LINUX/include/linux/exportfs.h], [
- AC_DEFINE(HAVE_LINUX_EXPORTFS_H, 1,
- [kernel has include/exportfs.h])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-# 2.6.23 has new page fault handling API
-AC_DEFUN([LC_VM_OP_FAULT],
-[AC_MSG_CHECKING([kernel has .fault in vm_operation_struct])
-LB_LINUX_TRY_COMPILE([
- #include <linux/mm.h>
-],[
- struct vm_operations_struct op;
-
- op.fault = NULL;
-], [
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_VM_OP_FAULT, 1,
- [kernel has .fault in vm_operation_struct])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-# 2.6.23 add code to wait other users to complete before removing procfs entry
-AC_DEFUN([LC_PROCFS_USERS],
-[AC_MSG_CHECKING([if kernel has pde_users member in procfs entry struct])
-LB_LINUX_TRY_COMPILE([
- #include <linux/proc_fs.h>
-],[
- struct proc_dir_entry pde;
-
- pde.pde_users = 0;
-],[
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_PROCFS_USERS, 1,
- [kernel has pde_users member in procfs entry struct])
-],[
- LB_LINUX_TRY_COMPILE([
- #include "$LINUX/fs/proc/internal.h"
- ],[
- struct proc_dir_entry_aux pde_aux;
-
- pde_aux.pde_users = 0;
- ],[
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_PROCFS_USERS, 1,
- [kernel has pde_users member in proc_dir_entry_aux])
- ],[
- AC_MSG_RESULT([no])
- ])
-])
-])
-
-# 2.6.23 exports exportfs_decode_fh
-AC_DEFUN([LC_EXPORTFS_DECODE_FH],
-[LB_CHECK_SYMBOL_EXPORT([exportfs_decode_fh],
-[fs/exportfs/expfs.c],[
- AC_DEFINE(HAVE_EXPORTFS_DECODE_FH, 1,
- [exportfs_decode_fh has been export])
-],[
-])
-])
-
-# 2.6.24
-
-# 2.6.24 need linux/mm_types.h included
-AC_DEFUN([LC_HAVE_MMTYPES_H],
-[LB_CHECK_FILE([$LINUX/include/linux/mm_types.h], [
- AC_DEFINE(HAVE_LINUX_MMTYPES_H, 1,
- [kernel has include/mm_types.h])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-# 2.6.24 has bio_endio with 2 args
-AC_DEFUN([LC_BIO_ENDIO_2ARG],
-[AC_MSG_CHECKING([if kernel has bio_endio with 2 args])
-LB_LINUX_TRY_COMPILE([
- #include <linux/bio.h>
-],[
- bio_endio(NULL, 0);
-], [
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_BIO_ENDIO_2ARG, 1,
- [kernel has bio_endio with 2 args])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-# 2.6.24 has new members in exports struct.
-AC_DEFUN([LC_FH_TO_DENTRY],
-[AC_MSG_CHECKING([if kernel has .fh_to_dentry member in export_operations struct])
-LB_LINUX_TRY_COMPILE([
- #include <linux/fs.h>
-#ifdef HAVE_LINUX_EXPORTFS_H
- #include <linux/exportfs.h>
-#endif
-],[
- do{ }while(sizeof(((struct export_operations *)0)->fh_to_dentry));
-], [
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_FH_TO_DENTRY, 1,
- [kernel has .fh_to_dentry member in export_operations struct])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-# 2.6.24 removes long aged procfs entry -> deleted member
-AC_DEFUN([LC_PROCFS_DELETED],
-[AC_MSG_CHECKING([if kernel has deleted member in procfs entry struct])
-LB_LINUX_TRY_COMPILE([
- #include <linux/proc_fs.h>
-],[
- struct proc_dir_entry pde;
-
- pde.deleted = sizeof(pde);
-], [
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_PROCFS_DELETED, 1,
- [kernel has deleted member in procfs entry struct])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-# 2.6.24 has bdi_init()/bdi_destroy() functions.
-AC_DEFUN([LC_EXPORT_BDI_INIT],
-[LB_CHECK_SYMBOL_EXPORT([bdi_init],
-[mm/backing-dev.c],[
- AC_DEFINE(HAVE_BDI_INIT, 1,
- [bdi_init/bdi_destroy functions are present])
-],[
-])
-])
-
-# 2.6.26
-
-# 2.6.26 isn't export set_fs_pwd and change paramter in fs struct
-AC_DEFUN([LC_FS_STRUCT_USE_PATH],
-[AC_MSG_CHECKING([fs_struct use path structure])
-LB_LINUX_TRY_COMPILE([
- #include <asm/atomic.h>
- #include <linux/spinlock.h>
- #include <linux/fs_struct.h>
-],[
- struct fs_struct fs;
-
- fs.pwd = *((struct path *)sizeof(fs));
-], [
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_FS_STRUCT_USE_PATH, 1,
- [fs_struct use path structure])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-#
-# 2.6.27
-#
-
-# LC_SECURITY_PLUG # for SLES10 SP2 (2.6.27)
-# check security plug in sles10 sp2 kernel
-AC_DEFUN([LC_SECURITY_PLUG],
-[AC_MSG_CHECKING([If kernel has security plug support])
-LB_LINUX_TRY_COMPILE([
- #include <linux/fs.h>
- #include <linux/stddef.h>
-],[
- notify_change(NULL, NULL, NULL);
-],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_SECURITY_PLUG, 1,
- [SLES10 SP2 use extra parameter in vfs])
-],[
- AC_MSG_RESULT(no)
-])
-])
-
-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_PGMKWRITE_COMPACT],
-[AC_MSG_CHECKING([if kernel .page_mkwrite is located in vm_operation_struct._pmkw])
-tmp_flags="$EXTRA_KCFLAGS"
-EXTRA_KCFLAGS="-Werror"
-LB_LINUX_TRY_COMPILE([
- #include <linux/mm.h>
-],[
- struct vm_operations_struct *vm_ops;
-
- vm_ops = NULL;
- vm_ops->_pmkw.page_mkwrite(NULL, NULL);
-], [
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_PGMKWRITE_COMPACT, 1,
- [kernel .page_mkwrite is located in vm_operation_struct._pmkw])
-],[
- 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([
- #include <linux/fs.h>
-],[
- struct inode *inode __attribute__ ((unused));
-
- inode = NULL;
- inode->i_op->permission(NULL, 0);
-],[
- AC_DEFINE(HAVE_INODE_PERMISION_2ARGS, 1,
- [inode_operations->permission has two args])
- AC_MSG_RESULT([yes])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-# 2.6.27 have new page locking API
-AC_DEFUN([LC_TRYLOCKPAGE],
-[AC_MSG_CHECKING([kernel uses trylock_page for page lock])
-LB_LINUX_TRY_COMPILE([
- #include <linux/pagemap.h>
-],[
- trylock_page(NULL);
-],[
- AC_DEFINE(HAVE_TRYLOCK_PAGE, 1,
- [kernel uses trylock_page for page lock])
- AC_MSG_RESULT([yes])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-# 2.6.27 removed the read_inode from super_operations.
-AC_DEFUN([LC_READ_INODE_IN_SBOPS],
-[AC_MSG_CHECKING([super_operations has a read_inode field])
-LB_LINUX_TRY_COMPILE([
- #include <linux/fs.h>
-],[
- struct super_operations *sop;
- sop->read_inode(NULL);
-],[
- AC_DEFINE(HAVE_READ_INODE_IN_SBOPS, 1,
- [super_operations has a read_inode])
- AC_MSG_RESULT([yes])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-# 2.6.27 has inode_permission instead of permisson
-AC_DEFUN([LC_EXPORT_INODE_PERMISSION],
-[LB_CHECK_SYMBOL_EXPORT([inode_permission],
-[fs/namei.c],[
-AC_DEFINE(HAVE_EXPORT_INODE_PERMISSION, 1,
- [inode_permission is exported by the kernel])
-],[
-])
-])
-
-# 2.6.27 use 5th parameter in quota_on for remount.
-AC_DEFUN([LC_QUOTA_ON_5ARGS],
-[AC_MSG_CHECKING([quota_on needs 5 parameters])
-LB_LINUX_TRY_COMPILE([
- #include <linux/fs.h>
- #include <linux/quota.h>
-],[
- struct quotactl_ops *qop = NULL;
- qop->quota_on(NULL, 0, 0, NULL, 0);
-],[
- AC_DEFINE(HAVE_QUOTA_ON_5ARGS, 1,
- [quota_on needs 5 paramters])
- AC_MSG_RESULT([yes])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-# 2.6.27 use 3th parameter in quota_off for remount.
-AC_DEFUN([LC_QUOTA_OFF_3ARGS],
-[AC_MSG_CHECKING([quota_off needs 3 parameters])
-LB_LINUX_TRY_COMPILE([
- #include <linux/fs.h>
- #include <linux/quota.h>
-],[
- struct quotactl_ops *qop = NULL;
- qop->quota_off(NULL, 0, 0);
-],[
- AC_DEFINE(HAVE_QUOTA_OFF_3ARGS, 1,
- [quota_off needs 3 paramters])
- AC_MSG_RESULT([yes])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-# 2.6.27 has vfs_dq_off inline function.
-AC_DEFUN([LC_VFS_DQ_OFF],
-[AC_MSG_CHECKING([vfs_dq_off is defined])
-LB_LINUX_TRY_COMPILE([
- #include <linux/quotaops.h>
-],[
- vfs_dq_off(NULL, 0);
-],[
- AC_DEFINE(HAVE_VFS_DQ_OFF, 1, [vfs_dq_off is defined])
- AC_MSG_RESULT([yes])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-# LC_LOCK_MAP_ACQUIRE
-# after 2.6.27 lock_map_acquire replaces lock_acquire
-AC_DEFUN([LC_LOCK_MAP_ACQUIRE],
-[AC_MSG_CHECKING([if lock_map_acquire is defined])
-LB_LINUX_TRY_COMPILE([
- #include <linux/lockdep.h>
-],[
- lock_map_acquire(NULL);
-],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_LOCK_MAP_ACQUIRE, 1,
- [lock_map_acquire is defined])
-],[
- AC_MSG_RESULT(no)
-])
-])
-
-# 2.6.27.15-2 sles11
-
-# 2.6.27 sles11 remove the bi_hw_segments
-AC_DEFUN([LC_BI_HW_SEGMENTS],
-[AC_MSG_CHECKING([struct bio has a bi_hw_segments field])
-LB_LINUX_TRY_COMPILE([
- #include <linux/bio.h>
-],[
- struct bio io;
- io.bi_hw_segments = sizeof(io);
-],[
- AC_DEFINE(HAVE_BI_HW_SEGMENTS, 1,
- [struct bio has a bi_hw_segments field])
- AC_MSG_RESULT([yes])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-#
-# 2.6.27 sles11 move the quotaio_v1{2}.h from include/linux to fs
-# 2.6.32 move the quotaio_v1{2}.h from fs to fs/quota
-AC_DEFUN([LC_HAVE_QUOTAIO_H],
-[LB_CHECK_FILE([$LINUX/include/linux/quotaio_v2.h],[
- AC_DEFINE(HAVE_QUOTAIO_H, 1,
- [kernel has include/linux/quotaio_v2.h])
-],[LB_CHECK_FILE([$LINUX/fs/quotaio_v2.h],[
- AC_DEFINE(HAVE_FS_QUOTAIO_H, 1,
- [kernel has fs/quotaio_v1.h])
-],[LB_CHECK_FILE([$LINUX/fs/quota/quotaio_v2.h],[
- AC_DEFINE(HAVE_FS_QUOTA_QUOTAIO_H, 1,
- [kernel has fs/quota/quotaio_v2.h])
-],[
- 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.29 introduce sb_any_quota_loaded.
-#
-AC_DEFUN([LC_SB_ANY_QUOTA_LOADED],
-[AC_MSG_CHECKING([Kernel has sb_any_quota_loaded])
-LB_LINUX_TRY_COMPILE([
- #include <linux/quotaops.h>
-],[
- sb_any_quota_loaded(NULL);
-],[
- AC_DEFINE(HAVE_SB_ANY_QUOTA_LOADED, 1,
- [Kernel has a sb_any_quota_loaded])
- AC_MSG_RESULT([yes])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-# 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])