#
# LC_STATFS_DENTRY_PARAM
-# starting from 2.6.18 linux kernel uses dentry instead of
-# super_block for first vfs_statfs argument
+# 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([first vfs_statfs parameter is dentry])
+[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>
],[
- int vfs_statfs(struct dentry *, struct kstatfs *);
+ struct super_operations *sop = NULL;
+ sop->statfs((struct dentry *)0, (struct kstatfs*)0);
],[
AC_DEFINE(HAVE_STATFS_DENTRY_PARAM, 1,
- [first parameter of vfs_statfs is dentry])
+ [super_ops.statfs() first parameter is dentry])
AC_MSG_RESULT([yes])
],[
AC_MSG_RESULT([no])
])
+EXTRA_KCFLAGS="$tmp_flags"
])
#
])
])
-# LC_VFS_READDIR_U64_INO
-# 2.6.19 use u64 for inode number instead of inode_t
-AC_DEFUN([LC_VFS_READDIR_U64_INO],
-[AC_MSG_CHECKING([check vfs_readdir need 64bit inode number])
-tmp_flags="$EXTRA_KCFLAGS"
-EXTRA_KCFLAGS="-Werror"
-LB_LINUX_TRY_COMPILE([
-#include <linux/fs.h>
- int fillonedir(void * __buf, const char * name, int namlen, loff_t offset,
- u64 ino, unsigned int d_type)
- {
- return 0;
- }
-],[
- filldir_t filter;
-
- filter = fillonedir;
- return 1;
-],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_VFS_READDIR_U64_INO, 1,
- [if vfs_readdir need 64bit inode number])
-],[
- AC_MSG_RESULT(no)
-])
-EXTRA_KCFLAGS="$tmp_flags"
-])
-
# LC_FILE_WRITEV
# 2.6.19 replaced writev with aio_write
AC_DEFUN([LC_FILE_WRITEV],
#include <linux/crypto.h>
],[
struct crypto_blkcipher *tfm;
- tfm = crypto_alloc_blkcipher("aes", 0, 0 );
+ tfm = crypto_alloc_blkcipher("aes", 0, sizeof(tfm) );
],[
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_ASYNC_BLOCK_CIPHER, 1, [kernel has block cipher support])
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>
-#else
- #include <linux/fs.h>
#endif
],[
struct export_operations exp;
-
- exp.fh_to_dentry = NULL;
+ memset(exp.fh_to_dentry, 0, sizeof(exp.fh_to_dentry));
], [
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_FH_TO_DENTRY, 1,
],[
struct proc_dir_entry pde;
- pde.deleted = NULL;
+ pde.deleted = sizeof(pde);
], [
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_PROCFS_DELETED, 1,
struct fs_struct fs;
fs.pwd = path;
+ memset(&fs, 0, sizeof(fs));
], [
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_FS_STRUCT_USE_PATH, 1,
])
])
-# 2.6.27
+#
+# 2.6.27
+#
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;
-
- inode->i_op->permission(NULL,0);
+ inode->i_op->permission(NULL, 0);
],[
- AC_DEFINE(HAVE_INODE_PERMISION_2ARGS, 1,
+ AC_DEFINE(HAVE_INODE_PERMISION_2ARGS, 1,
[inode_operations->permission has two args])
AC_MSG_RESULT([yes])
],[
#include <linux/bio.h>
],[
struct bio io;
- io.bi_hw_segments = 0;
+ io.bi_hw_segments = sizeof(io);
],[
AC_DEFINE(HAVE_BI_HW_SEGMENTS, 1,
[struct bio has a bi_hw_segments field])
# 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])
])
])
+# 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],
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])] )])
+
#
# LC_D_OBTAIN_ALIAS
# starting from 2.6.28 kernel replaces d_alloc_anon() with
])
])
+#
+# 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.
+#
+AC_DEFUN([LC_FILE_FSYNC],
+[AC_MSG_CHECKING([if file_operations.fsync taken 2 arguments])
+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 taken 2 arguments])
+ AC_MSG_RESULT([yes])
+],[
+ AC_MSG_RESULT([no])
+])
+])
+
+#
+# 2.6.38 export blkdev_get_by_dev
+#
+AC_DEFUN([LC_BLKDEV_GET_BY_DEV],
+[LB_CHECK_SYMBOL_EXPORT([blkdev_get_by_dev],
+[fs/block_dev.c],[
+AC_DEFINE(HAVE_BLKDEV_GET_BY_DEV, 1,
+ [blkdev_get_by_dev is exported by the kernel])
+],[
+])
+])
+
+#
+# 2.6.38 vfsmount.mnt_count doesn't use atomic_t
+#
+AC_DEFUN([LC_ATOMIC_MNT_COUNT],
+[AC_MSG_CHECKING([if vfsmount.mnt_count is atomic_t])
+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])
+],[
+ AC_MSG_RESULT([no])
+])
+])
+
+#
+# 2.6.39 remove unplug_fn from request_queue.
+#
+AC_DEFUN([LC_REQUEST_QUEUE_UNPLUG_FN],
+[AC_MSG_CHECKING([if request_queue has unplug_fn field])
+LB_LINUX_TRY_COMPILE([
+ #include <linux/blkdev.h>
+],[
+ struct request_queue rq;
+ memset(rq.unplug_fn, 0, sizeof(rq.unplug_fn));
+],[
+ AC_DEFINE(HAVE_REQUEST_QUEUE_UNPLUG_FN, 1,
+ [request_queue has unplug_fn field])
+ AC_MSG_RESULT([yes])
+],[
+ AC_MSG_RESULT([no])
+])
+])
+
+#
+# 2.6.38 generic_permission taken 4 paremater.
+# in fact, it means rcu-walk aware permission bring.
+#
+AC_DEFUN([LC_GENERIC_PERMISSION],
+[AC_MSG_CHECKING([if generic_permission take 4 arguments])
+LB_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+],[
+ generic_permission(NULL, 0, 0, NULL);
+],[
+ AC_DEFINE(HAVE_GENERIC_PERMISSION_4ARGS, 1,
+ [generic_permission taken 4 arguments])
+ AC_MSG_RESULT([yes])
+],[
+ AC_MSG_RESULT([no])
+])
+])
#
# LC_PROG_LINUX
# 2.6.19
LC_INODE_BLKSIZE
- LC_VFS_READDIR_U64_INO
LC_FILE_WRITEV
LC_FILE_READV
LC_VM_OP_FAULT
LC_PROCFS_USERS
LC_EXPORTFS_DECODE_FH
-
- # 2.6.24
- LC_HAVE_MMTYPES_H
+
+ # 2.6.24
+ LC_HAVE_MMTYPES_H
LC_BIO_ENDIO_2ARG
LC_FH_TO_DENTRY
LC_PROCFS_DELETED
#2.6.25
LC_MAPPING_CAP_WRITEBACK_DIRTY
-
+
# 2.6.26
LC_FS_STRUCT_USE_PATH
LC_BI_HW_SEGMENTS
LC_HAVE_QUOTAIO_H
LC_VFS_SYMLINK_5ARGS
+ LC_BDI_NAME
LC_SB_ANY_QUOTA_ACTIVE
LC_SB_HAS_QUOTA_ACTIVE
LC_EXPORT_ADD_TO_PAGE_CACHE_LRU
+ # 2.6.30
+ LC_EXPORT_CPUMASK_OF_NODE
+
# 2.6.31
LC_BLK_QUEUE_LOG_BLK_SIZE
LC_SB_BDI
LC_BLK_QUEUE_MAX_SECTORS
LC_BLK_QUEUE_MAX_SEGMENTS
+ LC_SET_CPUS_ALLOWED
+
+ # 2.6.35
+ LC_FILE_FSYNC
+
+ # 2.6.36
+ LC_SBOPS_EVICT_INODE
+
+ # 2.6.38
+ LC_ATOMIC_MNT_COUNT
+ LC_BLKDEV_GET_BY_DEV
+ LC_GENERIC_PERMISSION
+
+ # 2.6.39
+ LC_REQUEST_QUEUE_UNPLUG_FN
#
if test x$enable_server = xyes ; then