-
- write_lock(&a.tree_lock);
-],[
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_RW_TREE_LOCK, 1, [kernel has tree_lock as rw_lock])
-],[
- AC_MSG_RESULT([no])
-])
-EXTRA_KCFLAGS="$tmp_flags"
-])
-
-# 2.6.15
-
-# LC_INODE_I_MUTEX
-# after 2.6.15 inode have i_mutex intead of i_sem
-AC_DEFUN([LC_INODE_I_MUTEX],
-[AC_MSG_CHECKING([if inode has i_mutex ])
-LB_LINUX_TRY_COMPILE([
- #include <linux/mutex.h>
- #include <linux/fs.h>
- #undef i_mutex
-],[
- struct inode i;
-
- mutex_unlock(&i.i_mutex);
-],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_INODE_I_MUTEX, 1,
- [after 2.6.15 inode have i_mutex intead of i_sem])
-],[
- AC_MSG_RESULT(no)
-])
-])
-
-# 2.6.16
-
-# LC_SECURITY_PLUG # for SLES10 SP2
-# 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>
-],[
- struct dentry *dentry;
- struct vfsmount *mnt;
- struct iattr *iattr;
-
- notify_change(dentry, mnt, iattr);
-],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_SECURITY_PLUG, 1,
- [SLES10 SP2 use extra parameter in vfs])
-],[
- AC_MSG_RESULT(no)
-])
-])
-
-# 2.6.17
-
-# inode have i_private field since 2.6.17
-AC_DEFUN([LC_INODE_IPRIVATE],
-[AC_MSG_CHECKING([if inode has a i_private field])
-LB_LINUX_TRY_COMPILE([
-#include <linux/fs.h>
-],[
- struct inode i;
- i.i_private = NULL;
-],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_INODE_IPRIVATE, 1,
- [struct inode has i_private field])
-],[
- AC_MSG_RESULT(no)
-])
-])
-
-# LC_DQUOTOFF_MUTEX
-# after 2.6.17 dquote use mutex instead if semaphore
-AC_DEFUN([LC_DQUOTOFF_MUTEX],
-[AC_MSG_CHECKING([use dqonoff_mutex])
-LB_LINUX_TRY_COMPILE([
- #include <linux/mutex.h>
- #include <linux/fs.h>
- #include <linux/quota.h>
-],[
- struct quota_info dq;
-
- mutex_unlock(&dq.dqonoff_mutex);
-],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_DQUOTOFF_MUTEX, 1,
- [after 2.6.17 dquote use mutex instead if semaphore])
-],[
- AC_MSG_RESULT(no)
-])
-])
-
-# 2.6.18
-
-# LC_NR_PAGECACHE
-# 2.6.18 don't export nr_pagecahe
-AC_DEFUN([LC_NR_PAGECACHE],
-[AC_MSG_CHECKING([kernel export nr_pagecache])
-LB_LINUX_TRY_COMPILE([
- #include <linux/pagemap.h>
-],[
- return atomic_read(&nr_pagecache);
-],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_NR_PAGECACHE, 1,
- [is kernel export nr_pagecache])
-],[
- AC_MSG_RESULT(no)
-])
-])
-
-#
-# LC_STATFS_DENTRY_PARAM
-# starting from 2.6.18 linux kernel uses dentry instead of super_block
-# for the first parameter of the super_operations->statfs() callback.
-#
-#
-AC_DEFUN([LC_STATFS_DENTRY_PARAM],
-[AC_MSG_CHECKING([if super_ops.statfs() first parameter is dentry])
-tmp_flags="$EXTRA_KCFLAGS"
-EXTRA_KCFLAGS="-Werror"
-LB_LINUX_TRY_COMPILE([
- #include <linux/fs.h>
-],[
- ((struct super_operations *)0)->statfs((struct dentry *)0, (struct kstatfs*)0);
-],[
- AC_DEFINE(HAVE_STATFS_DENTRY_PARAM, 1,
- [super_ops.statfs() first parameter is dentry])
- AC_MSG_RESULT([yes])
-],[
- AC_MSG_RESULT([no])
-])
-EXTRA_KCFLAGS="$tmp_flags"
-])
-
-#
-# LC_VFS_KERN_MOUNT
-# starting from 2.6.18 kernel don't export do_kern_mount
-# and want to use vfs_kern_mount instead.
-#
-AC_DEFUN([LC_VFS_KERN_MOUNT],
-[AC_MSG_CHECKING([vfs_kern_mount exist in kernel])
-LB_LINUX_TRY_COMPILE([
- #include <linux/mount.h>
-],[
- vfs_kern_mount(NULL, 0, NULL, NULL);
-],[
- AC_DEFINE(HAVE_VFS_KERN_MOUNT, 1,
- [vfs_kern_mount exist in kernel])
- AC_MSG_RESULT([yes])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-#
-# LC_INVALIDATEPAGE_RETURN_INT
-# 2.6.17 changes return type for invalidatepage to 'void' from 'int'
-#
-AC_DEFUN([LC_INVALIDATEPAGE_RETURN_INT],
-[AC_MSG_CHECKING([invalidatepage has return int])
-LB_LINUX_TRY_COMPILE([
- #include <linux/buffer_head.h>
-],[
- int rc = block_invalidatepage(NULL, 0);
-],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_INVALIDATEPAGE_RETURN_INT, 1,
- [Define if return type of invalidatepage should be int])
-],[
- AC_MSG_RESULT(no)
-])
-])
-
-# LC_UMOUNTBEGIN_HAS_VFSMOUNT
-# after 2.6.18 umount_begin has different parameters
-AC_DEFUN([LC_UMOUNTBEGIN_HAS_VFSMOUNT],
-[AC_MSG_CHECKING([if umount_begin needs vfsmount parameter instead of super_block])
-tmp_flags="$EXTRA_KCFLAGS"
-EXTRA_KCFLAGS="-Werror"
-LB_LINUX_TRY_COMPILE([
- #include <linux/fs.h>
-
- struct vfsmount;
- static void cfg_umount_begin (struct vfsmount *v, int flags)
- {
- ;
- }
-
- static struct super_operations cfg_super_operations = {
- .umount_begin = cfg_umount_begin,
- };
-],[
- cfg_super_operations.umount_begin(NULL,0);
-],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_UMOUNTBEGIN_VFSMOUNT, 1,
- [Define umount_begin need second argument])
-],[
- AC_MSG_RESULT(no)
-])
-EXTRA_KCFLAGS="$tmp_flags"
-])
-
-# LC_SEQ_LOCK
-# after 2.6.18 seq_file has lock intead of sem
-AC_DEFUN([LC_SEQ_LOCK],
-[AC_MSG_CHECKING([if struct seq_file has lock field])
-LB_LINUX_TRY_COMPILE([
- #include <linux/seq_file.h>
-],[
- struct seq_file seq;
-
- mutex_unlock(&seq.lock);
-],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_SEQ_LOCK, 1,
- [after 2.6.18 seq_file has lock intead of sem])
-],[
- AC_MSG_RESULT(NO)
-])
-])
-
-#
-# LC_EXPORT_FILEMAP_FDATAWRITE_RANGE
-#
-# No standard kernels export this
-#
-AC_DEFUN([LC_EXPORT_FILEMAP_FDATAWRITE_RANGE],
-[LB_CHECK_SYMBOL_EXPORT([filemap_fdatawrite_range],
-[mm/filemap.c],[
-AC_DEFINE(HAVE_FILEMAP_FDATAWRITE_RANGE, 1,
- [filemap_fdatawrite_range is exported by the kernel])
-],[
-])
-])
-
-# LC_FLUSH_OWNER_ID
-# starting from 2.6.18 the file_operations .flush
-# method has a new "fl_owner_t id" parameter
-#
-AC_DEFUN([LC_FLUSH_OWNER_ID],
-[AC_MSG_CHECKING([if file_operations .flush has an fl_owner_t id])
-LB_LINUX_TRY_COMPILE([
- #include <linux/fs.h>
-],[
- struct file_operations *fops = NULL;
- fl_owner_t id;
- int i;
-
- i = fops->flush(NULL, id);
-],[
- AC_DEFINE(HAVE_FLUSH_OWNER_ID, 1,
- [file_operations .flush method has an fl_owner_t id])
- AC_MSG_RESULT([yes])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-#
-# LC_EXPORT_INVALIDATE_MAPPING_PAGES
-#
-# SLES9, RHEL4, RHEL5, vanilla 2.6.24 export invalidate_mapping_pages() but
-# SLES10 2.6.16 does not, for some reason. For filter cache invalidation.
-#
-AC_DEFUN([LC_EXPORT_INVALIDATE_MAPPING_PAGES],
- [LB_CHECK_SYMBOL_EXPORT([invalidate_mapping_pages], [mm/truncate.c], [
- AC_DEFINE(HAVE_INVALIDATE_MAPPING_PAGES, 1,
- [exported invalidate_mapping_pages])],
- [LB_CHECK_SYMBOL_EXPORT([invalidate_inode_pages], [mm/truncate.c], [
- AC_DEFINE(HAVE_INVALIDATE_INODE_PAGES, 1,
- [exported invalidate_inode_pages])], [
- AC_MSG_ERROR([no way to invalidate pages])
- ])
- ],[])
-])
-
-#2.6.18 + RHEL5 (fc6)
-
-# RHEL5 in FS-cache patch rename PG_checked flag into PG_fs_misc
-AC_DEFUN([LC_PG_FS_MISC],
-[AC_MSG_CHECKING([kernel has PG_fs_misc])
-LB_LINUX_TRY_COMPILE([
- #include <linux/mm.h>
- #include <linux/page-flags.h>
-],[
- #ifndef PG_fs_misc
- #error PG_fs_misc not defined in kernel
- #endif