- #include <linux/fs.h>
-],[
- int v __attribute__ ((unused));
- v = FS_RENAME_DOES_D_MOVE;
-],[
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_FS_RENAME_DOES_D_MOVE, 1, [kernel has FS_RENAME_DOES_D_MOVE flag])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-# 2.6.23
-
-# 2.6.23 have return type 'void' for unregister_blkdev
-AC_DEFUN([LC_UNREGISTER_BLKDEV_RETURN_INT],
-[AC_MSG_CHECKING([if unregister_blkdev return int])
-LB_LINUX_TRY_COMPILE([
- #include <linux/fs.h>
-],[
- int i __attribute__ ((unused));
- i = unregister_blkdev(0,NULL);
-],[
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_UNREGISTER_BLKDEV_RETURN_INT, 1,
- [unregister_blkdev return int])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-# 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])
-])
-])
-
-# 2.6.34 has quotactl_ops->[sg]et_dqblk that take struct fs_disk_quota
-AC_DEFUN([LC_HAVE_DQUOT_FS_DISK_QUOTA],
-tmp_flags="$EXTRA_KCFLAGS"
-EXTRA_KCFLAGS="-Werror"
-[AC_MSG_CHECKING([if quotactl_ops.set_dqblk takes struct fs_disk_quota])
-LB_LINUX_TRY_COMPILE([
- #include <linux/fs.h>
- #include <linux/quota.h>
-],[
- struct quotactl_ops qops = {};
- struct fs_disk_quota fdq;
- qops.set_dqblk(NULL, 0, 0, &fdq);
-],[
- AC_DEFINE(HAVE_DQUOT_FS_DISK_QUOTA, 1, [quotactl_ops.set_dqblk takes struct fs_disk_quota])
- AC_MSG_RESULT([yes])
-],[
- AC_MSG_RESULT([no])
-])
-EXTRA_KCFLAGS="$tmp_flags"
-])
-
-# 2.6.34 has renamed dquot options to dquot_*, check for dquot_suspend
-AC_DEFUN([LC_HAVE_DQUOT_SUSPEND],
-[AC_MSG_CHECKING([if dquot_suspend is defined])
-LB_LINUX_TRY_COMPILE([
- #include <linux/quotaops.h>
-],[
- dquot_suspend(NULL, -1);
-],[
- AC_DEFINE(HAVE_DQUOT_SUSPEND, 1, [dquot_suspend 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])
-],[
- AC_MSG_RESULT(no)
-])
-])
-
-# 2.6.32
-
-# 2.6.32 introduced inode_newsize_ok
-AC_DEFUN([LC_VFS_INODE_NEWSIZE_OK],
-[AC_MSG_CHECKING([if inode_newsize_ok is defined])
-LB_LINUX_TRY_COMPILE([
- #include <linux/fs.h>
-],[
- return inode_newsize_ok(NULL, 0);
-],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_VFS_INODE_NEWSIZE_OK, 1,
- [inode_newsize_ok is defined])
-],[
- AC_MSG_RESULT(no)
-])
-])
-
-# 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])
-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/blkdev.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)
-])
-])
-
-#
-# LC_QUOTA64
-#
-# Check if kernel has been patched for 64-bit quota limits support.
-# The upstream version of this patch in RHEL6 2.6.32 kernels introduces
-# the constant QFMT_VFS_V1 in include/linux/quota.h, so we can check for
-# that in the absence of quotaio_v1.h in the kernel headers.
-#
-AC_DEFUN([LC_QUOTA64],[
- AC_MSG_CHECKING([if kernel has 64-bit quota limits support])
-tmp_flags="$EXTRA_KCFLAGS"
-EXTRA_KCFLAGS="-I$LINUX/fs"
- LB_LINUX_TRY_COMPILE([
- #include <linux/kernel.h>
- #include <linux/fs.h>
- #ifdef HAVE_QUOTAIO_H
- # include <linux/quotaio_v2.h>
- int versions[] = V2_INITQVERSIONS_R1;
- struct v2_disk_dqblk_r1 dqblk_r1;
- #elif defined(HAVE_FS_QUOTA_QUOTAIO_H)
- # include <quota/quotaio_v2.h>
- struct v2r1_disk_dqblk dqblk_r1;
- #elif defined(HAVE_FS_QUOTAIO_H)
- # include <quotaio_v2.h>
- struct v2r1_disk_dqblk dqblk_r1;
- #else
- #include <linux/quota.h>
- int ver = QFMT_VFS_V1;
- #endif
- ],[],[
- AC_DEFINE(HAVE_QUOTA64, 1, [have quota64])
- AC_MSG_RESULT([yes])
- ],[
- LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],[
- AC_MSG_ERROR([You have got no 64-bit kernel quota support.])
- ],[])
- AC_MSG_RESULT([no])
- ])
-EXTRA_KCFLAGS=$tmp_flags
-])
-
-# 2.6.32 set_cpus_allowed is no more defined if CONFIG_CPUMASK_OFFSTACK=yes
-AC_DEFUN([LC_SET_CPUS_ALLOWED],
- [AC_MSG_CHECKING([if kernel defines set_cpus_allowed])
- LB_LINUX_TRY_COMPILE(
- [#include <linux/sched.h>],
- [struct task_struct *p = NULL;
- cpumask_t mask = { { 0 } };
- (void) set_cpus_allowed(p, mask);],
- [AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_SET_CPUS_ALLOWED, 1,
- [set_cpus_allowed is exported by the kernel])],
- [AC_MSG_RESULT([no])] )])
-
-# 2.6.32 introduces selinux_is_enabled()
-AC_DEFUN([LC_SELINUX_IS_ENABLED],
-[AC_MSG_CHECKING([if selinux_is_enabled is available])
-LB_LINUX_TRY_COMPILE([
- #include <linux/selinux.h>
-],[
- selinux_is_enabled();
-],[
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_SELINUX_IS_ENABLED, 1,
- [selinux_is_enabled is defined])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-#
-# 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])
-LB_LINUX_TRY_COMPILE([
- #include <linux/dcache.h>
-],[
- d_obtain_alias(NULL);
-],[
- AC_DEFINE(HAVE_D_OBTAIN_ALIAS, 1,
- [d_obtain_alias exist in kernel])
- AC_MSG_RESULT([yes])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-#
-# 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.32 if kernel export access_process_vm().
-AC_DEFUN([LC_EXPORT_ACCESS_PROCESS_VM],
- [LB_CHECK_SYMBOL_EXPORT([access_process_vm],
- [mm/memory.c],
- [AC_DEFINE(HAVE_ACCESS_PROCESS_VM, 1,
- [access_process_vm function is present])],
- [])
- ]
-)
-
-#
-# 2.6.36 fs_struct.lock use spinlock instead of rwlock.
-#
-AC_DEFUN([LC_FS_STRUCT_RWLOCK],
-[AC_MSG_CHECKING([if fs_struct.lock use rwlock])
-LB_LINUX_TRY_COMPILE([
- #include <asm/atomic.h>
- #include <linux/spinlock.h>
- #include <linux/fs_struct.h>
-],[
- ((struct fs_struct *)0)->lock = (rwlock_t){ 0 };
-],[
- AC_DEFINE(HAVE_FS_STRUCT_RWLOCK, 1,
- [fs_struct.lock use rwlock])
- AC_MSG_RESULT([yes])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-#
-# 2.6.36 super_operations add evict_inode method. it hybird of
-# delete_inode & clear_inode.
-#
-AC_DEFUN([LC_SBOPS_EVICT_INODE],
-[AC_MSG_CHECKING([if super_operations.evict_inode exist])
-LB_LINUX_TRY_COMPILE([
- #include <linux/fs.h>
-],[
- ((struct super_operations *)0)->evict_inode(NULL);
-],[
- AC_DEFINE(HAVE_SBOPS_EVICT_INODE, 1,
- [super_operations.evict_inode() is exist in kernel])
- AC_MSG_RESULT([yes])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-#
-# 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 takes 4 or 2 arguments])
-LB_LINUX_TRY_COMPILE([
- #include <linux/fs.h>
-],[
- ((struct file_operations *)0)->fsync(NULL, 0, 0, 0);
-],[
- AC_DEFINE(HAVE_FILE_FSYNC_4ARGS, 1,
- [file_operations.fsync takes 4 arguments])
- AC_MSG_RESULT([yes, 4 args])
-],[
- 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])
- ])
-])
-])
-
-#
-# 2.6.37 remove kernel_locked
-#
-AC_DEFUN([LC_KERNEL_LOCKED],
-[AC_MSG_CHECKING([if kernel_locked is defined])
-LB_LINUX_TRY_COMPILE([
- #include <linux/smp_lock.h>
-],[
- kernel_locked();
-],[
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_KERNEL_LOCKED, 1,
- [kernel_locked is defined])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-#
-# 2.6.38 dentry_operations.d_compare() taken 7 arguments.
-#
-AC_DEFUN([LC_D_COMPARE_7ARGS],
-[AC_MSG_CHECKING([if d_compare taken 7 arguments])
-LB_LINUX_TRY_COMPILE([
- #include <linux/dcache.h>
-],[
- ((struct dentry_operations*)0)->d_compare(NULL,NULL,NULL,NULL,0,NULL,NULL);
-],[
- AC_DEFINE(HAVE_D_COMPARE_7ARGS, 1,
- [d_compare need 7 arguments])
- AC_MSG_RESULT([yes])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-#
-# 2.6.38 dentry_operations.d_delete() defined 'const' for 1st parameter.
-#
-AC_DEFUN([LC_D_DELETE_CONST],
-[AC_MSG_CHECKING([if d_delete has const declare on first parameter])
-tmp_flags="$EXTRA_KCFLAGS"
-EXTRA_KCFLAGS="-Werror"
-LB_LINUX_TRY_COMPILE([
- #include <linux/dcache.h>
-],[
- const struct dentry *d = NULL;
- ((struct dentry_operations*)0)->d_delete(d);
-],[
- AC_DEFINE(HAVE_D_DELETE_CONST, const,
- [d_delete first parameter declared const])
- AC_MSG_RESULT([yes])
-],[
- AC_DEFINE(HAVE_D_DELETE_CONST, , [])
- AC_MSG_RESULT([no])
-])
-EXTRA_KCFLAGS="$tmp_flags"
-])
-
-#
-# 2.6.38 dcache_lock removed. rcu-walk commited.
-#
-AC_DEFUN([LC_DCACHE_LOCK],
-[AC_MSG_CHECKING([if dcache_lock is exist])
-LB_LINUX_TRY_COMPILE([
- #include <linux/dcache.h>