# 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_UMOUNTBEGIN_HAS_VFSMOUNT
# 2.6.18~2.6.25 umount_begin has different parameters
AC_DEFUN([LC_UMOUNTBEGIN_HAS_VFSMOUNT],
EXTRA_KCFLAGS="$tmp_flags"
])
-# 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 = NULL;
- 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_DEFINE(HAVE_PROCFS_USERS, 1,
[kernel has pde_users member in procfs entry struct])
],[
- AC_MSG_RESULT([no])
+ 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.38 vfsmount.mnt_count doesn't use atomic_t
#
+# 3.3 starts hiding vfsmount guts series (move from include/linux/mount.h to
+# fs/mount.h, see kernel commit 7d6fec45a5131918b51dcd76da52f2ec86a85be6)
+#
AC_DEFUN([LC_ATOMIC_MNT_COUNT],
-[AC_MSG_CHECKING([if vfsmount.mnt_count is atomic_t])
+[AC_MSG_CHECKING([if vfsmount guts is hidden, or vfsmount.mnt_count is atomic_t.])
LB_LINUX_TRY_COMPILE([
- #include <asm/atomic.h>
- #include <linux/fs.h>
- #include <linux/mount.h>
+ #include <linux/fs.h>
+ #include <../fs/mount.h>
],[
- ((struct vfsmount *)0)->mnt_count = ((atomic_t) { 0 });
+ struct mount *mnt = real_mount((struct vfsmount *)0);
],[
- AC_DEFINE(HAVE_ATOMIC_MNT_COUNT, 1,
- [vfsmount.mnt_count is atomic_t])
- AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_HIDE_VFSMOUNT_GUTS, 1,
+ [hide vfsmount guts in fs/mount.h])
+ AC_MSG_RESULT([yes, hide vfsmount guts in fs/mount.h])
],[
- AC_MSG_RESULT([no])
+ LB_LINUX_TRY_COMPILE([
+ #include <asm/atomic.h>
+ #include <linux/fs.h>
+ #include <linux/mount.h>
+ ],[
+ ((struct vfsmount *)0)->mnt_count = ((atomic_t) { 0 });
+ ],[
+ AC_DEFINE(HAVE_ATOMIC_MNT_COUNT, 1,
+ [vfsmount.mnt_count is atomic_t])
+ AC_MSG_RESULT([yes, vfsmount.mnt_count is atomic_t])
+ ],[
+ AC_MSG_RESULT([no])
+ ])
])
])
LC_RW_TREE_LOCK
# 2.6.18
- LC_NR_PAGECACHE
- LC_STATFS_DENTRY_PARAM
LC_UMOUNTBEGIN_HAS_VFSMOUNT
- LC_FLUSH_OWNER_ID
- if test x$enable_server = xyes ; then
- LC_EXPORT_INVALIDATE_MAPPING_PAGES
- fi
#2.6.18 + RHEL5 (fc6)
LC_PG_FS_MISC