-AC_DEFUN([LC_INODE_I_RCU], [
-LB_CHECK_COMPILE([if 'inode.i_rcu' exists],
-inode_i_rcu, [
- #include <linux/fs.h>
-],[
- struct inode ino;
- struct rcu_head rcu = {};
- ino.i_rcu = rcu;
-],[
- AC_DEFINE(HAVE_INODE_I_RCU, 1,
- [inode.i_rcu exists])
-])
-]) # LC_INODE_I_RCU
-
-#
-# LC_BLKDEV_GET_BY_DEV
-#
-# 2.6.38 export blkdev_get_by_dev
-#
-AC_DEFUN([LC_BLKDEV_GET_BY_DEV], [
-LB_CHECK_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])])
-]) # LC_BLKDEV_GET_BY_DEV
-
-#
-# LC_EXPORT_SIMPLE_SETATTR
-#
-# 2.6.38 export simple_setattr
-#
-AC_DEFUN([LC_EXPORT_SIMPLE_SETATTR], [
-LB_CHECK_EXPORT([simple_setattr], [fs/libfs.c],
- [AC_DEFINE(HAVE_SIMPLE_SETATTR, 1,
- [simple_setattr is exported by the kernel])])
-]) # LC_EXPORT_SIMPLE_SETATTR
-
-#
-# LC_HAVE_BLK_PLUG
-#
-# 2.6.38 add struct blk_plug
-#
-AC_DEFUN([LC_HAVE_BLK_PLUG], [
-LB_CHECK_COMPILE([if 'struct blk_plug' exists],
-blk_plug, [
- #include <linux/blkdev.h>
-],[
- struct blk_plug plug;
-
- blk_start_plug(&plug);
- blk_finish_plug(&plug);
-],[
- AC_DEFINE(HAVE_BLK_PLUG, 1,
- [blk_plug struct exists])
-])
-]) # LC_HAVE_BLK_PLUG
-
-#
-# LC_HAVE_FSTYPE_MOUNT
-#
-# 2.6.39 replace get_sb with mount in struct file_system_type
-#
-AC_DEFUN([LC_HAVE_FSTYPE_MOUNT], [
-LB_CHECK_COMPILE([if 'file_system_type' has 'mount' field],
-file_system_type_mount, [
- #include <linux/fs.h>
-],[
- struct file_system_type fst = { };
- void *mount;
-
- mount = (void *)fst.mount;
-],[
- AC_DEFINE(HAVE_FSTYPE_MOUNT, 1,
- [struct file_system_type has mount field])
-])
-]) # LC_HAVE_FSTYPE_MOUNT
-
-#
-# LC_HAVE_FHANDLE_SYSCALLS
-#
-# 2.6.39 The open_by_handle_at() and name_to_handle_at() system calls were
-# added to Linux kernel 2.6.39.
-# Check if client supports these functions
-#
-AC_DEFUN([LC_HAVE_FHANDLE_SYSCALLS], [
-LB_CHECK_CONFIG_IM([FHANDLE],[
- AC_DEFINE(HAVE_FHANDLE_SYSCALLS, 1,
- [kernel supports fhandles and related syscalls])
- ])
-]) # LC_HAVE_FHANDLE_SYSCALLS
-
-#
-# LC_HAVE_INODE_OWNER_OR_CAPABLE
-#
-# 2.6.39 renames is_owner_or_cap to inode_owner_or_capable
-#
-AC_DEFUN([LC_HAVE_INODE_OWNER_OR_CAPABLE], [
-LB_CHECK_COMPILE([if 'inode_owner_or_capable' exist],
-inode_owner_or_capable, [
- #include <linux/fs.h>
-],[
- inode_owner_or_capable(NULL);
-],[
- AC_DEFINE(HAVE_INODE_OWNER_OR_CAPABLE, 1,
- [inode_owner_or_capable exist])
-])
-]) # LC_HAVE_INODE_OWNER_OR_CAPABLE
-
-#
-# LC_DIRTY_INODE_WITH_FLAG
-#
-# 3.0 dirty_inode() has a flag parameter
-# see kernel commit aa38572954ade525817fe88c54faebf85e5a61c0
-#
-AC_DEFUN([LC_DIRTY_INODE_WITH_FLAG], [
-LB_CHECK_COMPILE([if 'dirty_inode' super_operation takes flag],
-dirty_inode_super_operation_flag, [
- #include <linux/fs.h>
-],[
- struct inode *inode = NULL;
- inode->i_sb->s_op->dirty_inode(NULL, 0);
-],[
- AC_DEFINE(HAVE_DIRTY_INODE_HAS_FLAG, 1,
- [dirty_inode super_operation takes flag])
-])
-]) # LC_DIRTY_INODE_WITH_FLAG
-
-#
-# LC_SETNS
-#
-# 3.0 introduced setns
-#
-AC_DEFUN([LC_SETNS], [
-AC_CHECK_HEADERS([sched.h], [], [],
- [#define _GNU_SOURCE
- ])
-AC_CHECK_FUNCS([setns])
-]) # LC_SETNS
-
-#
-# LC_GENERIC_PERMISSION
-#
-# 2.6.38 generic_permission taken 4 parameters.
-# in fact, it means rcu-walk aware permission bring.
-#
-# 3.1 generic_permission taken 2 parameters.
-# see kernel commit 2830ba7f34ebb27c4e5b8b6ef408cd6d74860890
-#
-AC_DEFUN([LC_GENERIC_PERMISSION], [
-LB_CHECK_COMPILE([if 'generic_permission' take 2 arguments],
-generic_permission_2args, [
- #include <linux/fs.h>
-],[
- generic_permission(NULL, 0);
-],[
- AC_DEFINE(HAVE_GENERIC_PERMISSION_2ARGS, 1,
- [generic_permission taken 2 arguments])
-],[
- LB_CHECK_COMPILE([if 'generic_permission' take 4 arguments],
- generic_permission_4args, [
- #include <linux/fs.h>
- ],[
- generic_permission(NULL, 0, 0, NULL);
- ],[
- AC_DEFINE(HAVE_GENERIC_PERMISSION_4ARGS, 1,
- [generic_permission taken 4 arguments])
- ])
-])
-]) # LC_GENERIC_PERMISSION
-
-#
-# LC_LM_XXX_LOCK_MANAGER_OPS
-#
-# 3.1 renames lock-manager ops(lock_manager_operations) from fl_xxx to lm_xxx
-# see kernel commit 8fb47a4fbf858a164e973b8ea8ef5e83e61f2e50
-#
-AC_DEFUN([LC_LM_XXX_LOCK_MANAGER_OPS], [
-LB_CHECK_COMPILE([if 'lock-manager' ops renamed to 'lm_xxx'],
-lock_manager_ops_lm_xxx, [
- #include <linux/fs.h>
-],[
- struct lock_manager_operations lm_ops;
- lm_ops.lm_compare_owner = NULL;
-],[
- AC_DEFINE(HAVE_LM_XXX_LOCK_MANAGER_OPS, 1,
- [lock-manager ops renamed to lm_xxx])
-])
-]) # LC_LM_XXX_LOCK_MANAGER_OPS
-
-#
-# LC_INODE_DIO_WAIT
-#
-# 3.1 kills inode->i_alloc_sem, use i_dio_count and inode_dio_wait
-# instead.
-# see kernel commit bd5fe6c5eb9c548d7f07fe8f89a150bb6705e8e3
-#
-AC_DEFUN([LC_INODE_DIO_WAIT], [
-LB_CHECK_COMPILE([if 'inode->i_alloc_sem' is killed and use inode_dio_wait],
-inode_dio_wait, [
- #include <linux/fs.h>
-],[
- inode_dio_wait((struct inode *)0);
-],[
- AC_DEFINE(HAVE_INODE_DIO_WAIT, 1,
- [inode->i_alloc_sem is killed and use inode_dio_wait])
-])
-]) # LC_INODE_DIO_WAIT
-
-#
-# LC_IOP_GET_ACL
-#
-# 3.1 adds get_acl method to inode_operations to read ACL from disk.
-# see kernel commit 4e34e719e457f2e031297175410fc0bd4016a085
-#
-AC_DEFUN([LC_IOP_GET_ACL], [
-LB_CHECK_COMPILE([if 'inode_operations' has '.get_acl' member function],
-inode_ops_get_acl, [
- #include <linux/fs.h>
-],[
- struct inode_operations iop;
- iop.get_acl = NULL;
-],[
- AC_DEFINE(HAVE_IOP_GET_ACL, 1,
- [inode_operations has .get_acl member function])
-])
-]) # LC_IOP_GET_ACL
-
-#
-# LC_FILE_LLSEEK_SIZE
-#
-# 3.1 introduced generic_file_llseek_size()
-#
-AC_DEFUN([LC_FILE_LLSEEK_SIZE], [
-LB_CHECK_EXPORT([generic_file_llseek_size], [fs/read_write.c],
- [AC_DEFINE(HAVE_FILE_LLSEEK_SIZE, 1,
- [generic_file_llseek_size is exported by the kernel])])
-]) # LC_FILE_LLSEEK_SIZE
-
-#
-# LC_RADIX_EXCEPTION_ENTRY
-# 3.1 adds radix_tree_exception_entry.
-#
-AC_DEFUN([LC_RADIX_EXCEPTION_ENTRY], [
-LB_CHECK_COMPILE([radix_tree_exceptional_entry exist],
-radix_tree_exceptional_entry, [
- #include <linux/radix-tree.h>
-],[
- radix_tree_exceptional_entry(NULL);
-],[
- AC_DEFINE(HAVE_RADIX_EXCEPTION_ENTRY, 1,
- [radix_tree_exceptional_entry exist])
-])
-]) # LC_RADIX_EXCEPTION_ENTRY
-
-#
-# LC_HAVE_PROTECT_I_NLINK
-#
-# 3.2 protects inode->i_nlink from direct modification
-# see kernel commit a78ef704a8dd430225955f0709b22d4a6ba21deb
-# at the same time adds set_nlink(), so checks set_nlink() for it.
-#
-AC_DEFUN([LC_HAVE_PROTECT_I_NLINK], [
-LB_CHECK_COMPILE([if 'inode->i_nlink' is protected from direct modification],
-inode_i_nlink_protected, [
- #include <linux/fs.h>
-],[
- struct inode i;
- set_nlink(&i, 1);
-],[
- AC_DEFINE(HAVE_PROTECT_I_NLINK, 1,
- [inode->i_nlink is protected from direct modification])
-])
-]) # LC_HAVE_PROTECT_I_NLINK
-
-#
-# 2.6.39 security_inode_init_security takes a 'struct qstr' parameter
-#
-# 3.2 security_inode_init_security takes a callback to set xattrs
-#
-AC_DEFUN([LC_HAVE_SECURITY_IINITSEC], [
-LB_CHECK_COMPILE([if security_inode_init_security takes a callback],
-security_inode_init_security_callback, [
- #include <linux/security.h>
-],[
- security_inode_init_security(NULL, NULL, NULL, (const initxattrs)NULL, NULL);
-],[
- AC_DEFINE(HAVE_SECURITY_IINITSEC_CALLBACK, 1,
- [security_inode_init_security takes a callback to set xattrs])
-],[
- LB_CHECK_COMPILE([if security_inode_init_security takes a 'struct qstr' parameter],
- security_inode_init_security_qstr, [
- #include <linux/security.h>
- ],[
- security_inode_init_security(NULL, NULL, (struct qstr *)NULL, NULL, NULL, NULL);
- ],[
- AC_DEFINE(HAVE_SECURITY_IINITSEC_QSTR, 1,
- [security_inode_init_security takes a 'struct qstr' parameter])
- ])
-])
-]) # LC_HAVE_SECURITY_IINITSEC
-
-#
-# LC_HAVE_MIGRATE_HEADER
-#
-# 3.3 introduces migrate_mode.h and migratepage has 4 args
-#
-AC_DEFUN([LC_HAVE_MIGRATE_HEADER], [
-LB_CHECK_FILE([$LINUX/include/linux/migrate.h], [
- AC_DEFINE(HAVE_MIGRATE_H, 1,
- [kernel has include/linux/migrate.h])
-],[
- LB_CHECK_FILE([$LINUX/include/linux/migrate_mode.h], [
- AC_DEFINE(HAVE_MIGRATE_MODE_H, 1,
- [kernel has include/linux/migrate_mode.h])
- ])
-])
-]) # LC_HAVE_MIGRATE_HEADER
-
-#
-# LC_MIGRATEPAGE_4ARGS
-#
-AC_DEFUN([LC_MIGRATEPAGE_4ARGS], [
-LB_CHECK_COMPILE([if 'address_space_operations.migratepage' has 4 args],
-address_space_ops_migratepage_4args, [
- #include <linux/fs.h>
-#ifdef HAVE_MIGRATE_H
- #include <linux/migrate.h>
-#elif defined(HAVE_MIGRATE_MODE_H)
- #include <linux/migrate_mode.h>
-#endif
-],[
- struct address_space_operations aops = { };
- aops.migratepage(NULL, NULL, NULL, MIGRATE_ASYNC);
-],[
- AC_DEFINE(HAVE_MIGRATEPAGE_4ARGS, 1,
- [address_space_operations.migratepage has 4 args])
-])
-]) # LC_MIGRATEPAGE_4ARGS
-
-#
-# LC_SUPEROPS_USE_DENTRY
-#
-# 3.3 switchs super_operations to use dentry as parameter (but not vfsmount)
-# see kernel commit 34c80b1d93e6e20ca9dea0baf583a5b5510d92d4
-#
-AC_DEFUN([LC_SUPEROPS_USE_DENTRY], [
-tmp_flags="$EXTRA_KCFLAGS"
-EXTRA_KCFLAGS="-Werror"
-LB_CHECK_COMPILE([if 'super_operations' use 'dentry' as parameter],
-super_ops_dentry, [
- #include <linux/fs.h>
- int show_options(struct seq_file *seq, struct dentry *root) {
- return 0;
- }
-],[
- struct super_operations ops;
- ops.show_options = show_options;
-],[
- AC_DEFINE(HAVE_SUPEROPS_USE_DENTRY, 1,
- [super_operations use dentry as parameter])
-])
-EXTRA_KCFLAGS="$tmp_flags"
-]) # LC_SUPEROPS_USE_DENTRY
-
-#
-# LC_INODEOPS_USE_UMODE_T
-#
-# 3.3 switchs inode_operations to use umode_t as parameter (but not int)
-# see kernel commit 1a67aafb5f72a436ca044293309fa7e6351d6a35
-#
-AC_DEFUN([LC_INODEOPS_USE_UMODE_T], [
-tmp_flags="$EXTRA_KCFLAGS"
-EXTRA_KCFLAGS="-Werror"
-LB_CHECK_COMPILE([if 'inode_operations' use 'umode_t' as parameter],
-inode_ops_umode_t, [
- #include <linux/fs.h>
- #include <linux/types.h>
- int my_mknod(struct inode *dir, struct dentry *dchild,
- umode_t mode, dev_t dev)
- {
- return 0;
- }
-],[
- struct inode_operations ops;
- ops.mknod = my_mknod;
-],[
- AC_DEFINE(HAVE_INODEOPS_USE_UMODE_T, 1,
- [inode_operations use umode_t as parameter])
-])
-EXTRA_KCFLAGS="$tmp_flags"
-]) # LC_INODEOPS_USE_UMODE_T
-
-#
-# LC_KMAP_ATOMIC_HAS_1ARG
-#
-# 3.4 kmap_atomic removes second argument
-# see kernel commit 1ec9c5ddc17aa398f05646abfcbaf315b544e62f
-#
-AC_DEFUN([LC_KMAP_ATOMIC_HAS_1ARG], [
-LB_CHECK_COMPILE([if 'kmap_atomic' has only 1 argument],
-kmap_atomic_1arg, [
- #include <linux/highmem.h>
-],[
- kmap_atomic(NULL);
-],[
- AC_DEFINE(HAVE_KMAP_ATOMIC_HAS_1ARG, 1,
- [have kmap_atomic has only 1 argument])
-])
-]) # LC_KMAP_ATOMIC_HAS_1ARG
-
-#
-# LC_HAVE_D_MAKE_ROOT
-#
-# 3.4 converts d_alloc_root to d_make_root
-# see kernel commit 32991ab305ace7017c62f8eecbe5eb36dc32e13b
-#
-AC_DEFUN([LC_HAVE_D_MAKE_ROOT], [
-LB_CHECK_COMPILE([if have 'd_make_root'],
-d_make_root, [
- #include <linux/fs.h>
-],[
- d_make_root((struct inode *)NULL);
-],[
- AC_DEFINE(HAVE_D_MAKE_ROOT, 1,
- [have d_make_root])
-])
-]) # LC_HAVE_D_MAKE_ROOT
-
-#
-# LC_HAVE_CACHE_REGISTER
-#
-# 3.4 cache_register/cache_unregister are removed
-# see kernel commit 2c5f846747526e2b83c5f1b8e69016be0e2e87c0
-# Note, since 2.6.37 cache_register_net/cache_unregister_net
-# are defined, but not exported.
-# 3.3 cache_register_net/cache_unregister_net are
-# exported and replacing cache_register/cache_unregister in 3.4
-#
-AC_DEFUN([LC_HAVE_CACHE_REGISTER], [
-LB_CHECK_COMPILE([if have 'cache_register'],
-cache_register, [
- #include <linux/sunrpc/cache.h>
-],[
- cache_register(NULL);
-],[
- AC_DEFINE(HAVE_CACHE_REGISTER, 1,
- [have cache_register])
-])
-]) # LC_HAVE_CACHE_REGISTER
-
-#
-# LC_HAVE_CLEAR_INODE
-#
-# 3.5 renames end_writeback() back to clear_inode()...
-# see kernel commit dbd5768f87ff6fb0a4fe09c4d7b6c4a24de99430
-#
-AC_DEFUN([LC_HAVE_CLEAR_INODE], [
-LB_CHECK_COMPILE([if have 'clear_inode'],
-clear_inode, [
- #include <linux/fs.h>
-],[
- clear_inode((struct inode *)NULL);
-],[
- AC_DEFINE(HAVE_CLEAR_INODE, 1,
- [have clear_inode])
-])
-]) # LC_HAVE_CLEAR_INODE
-
-#
-# LC_HAVE_ENCODE_FH_PARENT
-#
-# 3.5 encode_fh has parent inode passed in directly
-# see kernel commit b0b0382b
-#
-AC_DEFUN([LC_HAVE_ENCODE_FH_PARENT], [
-tmp_flags="$EXTRA_KCFLAGS"
-EXTRA_KCFLAGS="-Werror"
-LB_CHECK_COMPILE([if 'encode_fh' have parent inode as parameter],
-encode_fh_parent_inode, [
- #include <linux/exportfs.h>
- #include <linux/fs.h>
- #include <linux/types.h>
- int ll_encode_fh(struct inode *i, __u32 *a, int *b, struct inode *p)
- {
- return 0;
- }
-],[
- struct export_operations exp_op;
- exp_op.encode_fh = ll_encode_fh;
-],[
- AC_DEFINE(HAVE_ENCODE_FH_PARENT, 1,
- [have parent inode as parameter])
-])
-EXTRA_KCFLAGS="$tmp_flags"
-]) # LC_HAVE_ENCODE_FH_PARENT
-
-#
-# LC_FILE_LLSEEK_SIZE_5ARG
-#
-# 3.5 has generic_file_llseek_size with 5 args
-#
-AC_DEFUN([LC_FILE_LLSEEK_SIZE_5ARG], [
-LB_CHECK_COMPILE([if Linux kernel has 'generic_file_llseek_size' with 5 args],
-generic_file_llseek_size_5args, [
- #include <linux/fs.h>
-],[
- generic_file_llseek_size(NULL, 0, 0, 0, 0);
-], [
- AC_DEFINE(HAVE_FILE_LLSEEK_SIZE_5ARGS, 1,
- [kernel has generic_file_llseek_size with 5 args])
-])
-]) # LC_FILE_LLSEEK_SIZE_5ARG
-
-#
-# LC_LLITE_DATA_IS_LIST
-#
-# 3.6 switch i_dentry/d_alias from list to hlist
-#
-# In the upstream kernels d_alias first changes
-# to a hlist and then in later version, 3.11, gets
-# moved to the union d_u. Due to some distros having
-# d_alias in the d_u union as a struct list, which
-# has never existed upstream stream, we can't test
-# if d_alias is a list or hlist directly. If ever
-# i_dentry and d_alias even up different combos then
-# the build will fail. In that case then we will need
-# to separate out the i_dentry and d_alias test below.
-#
-AC_DEFUN([LC_DATA_FOR_LLITE_IS_LIST], [
-tmp_flags="$EXTRA_KCFLAGS"
-EXTRA_KCFLAGS="-Werror"
-LB_CHECK_COMPILE([if 'i_dentry/d_alias' uses 'list'],
-i_dentry_d_alias_list, [
- #include <linux/fs.h>
-],[
- struct inode inode;
- INIT_LIST_HEAD(&inode.i_dentry);
-],[
- AC_DEFINE(DATA_FOR_LLITE_IS_LIST, 1,
- [both i_dentry/d_alias uses list])
-])
-EXTRA_KCFLAGS="$tmp_flags"
-]) # LC_DATA_FOR_LLITE_IS_LIST
-
-#
-# LC_DENTRY_OPEN_USE_PATH
-#
-# 3.6 dentry_open uses struct path as first argument
-# see kernel commit 765927b2
-#
-AC_DEFUN([LC_DENTRY_OPEN_USE_PATH], [
-tmp_flags="$EXTRA_KCFLAGS"
-EXTRA_KCFLAGS="-Werror"
-LB_CHECK_COMPILE([if 'dentry_open' uses 'struct path' as first argument],
-dentry_open_path, [
- #include <linux/fs.h>
- #include <linux/path.h>
-],[
- struct path path;
- dentry_open(&path, 0, NULL);
-],[
- AC_DEFINE(HAVE_DENTRY_OPEN_USE_PATH, 1,
- [dentry_open uses struct path as first argument])
-])
-EXTRA_KCFLAGS="$tmp_flags"
-]) # LC_DENTRY_OPEN_USE_PATH
-
-#
-# LC_HAVE_IOP_ATOMIC_OPEN
-#
-# 3.6 vfs adds iop->atomic_open
-#
-AC_DEFUN([LC_HAVE_IOP_ATOMIC_OPEN], [
-LB_CHECK_COMPILE([if 'iop' has 'atomic_open'],
-inode_ops_atomic_open, [
- #include <linux/fs.h>
-],[
- struct inode_operations iop;
- iop.atomic_open = NULL;
-],[
- AC_DEFINE(HAVE_IOP_ATOMIC_OPEN, 1,
- [have iop atomic_open])
-])
-]) # LC_HAVE_IOP_ATOMIC_OPEN
-
-#
-# LC_HAVE_SB_START_WRITE
-#
-# RHEL6 2.6.32, 3.6 or newer support wrapped FS freeze functions
-#
-AC_DEFUN([LC_HAVE_SB_START_WRITE], [
-LB_CHECK_COMPILE([if kernel supports wrapped FS freeze functions],
-sb_start_write, [
- #include <linux/fs.h>
-],[
- sb_start_write(NULL);
-],[
- AC_DEFINE(HAVE_SB_START_WRITE, 1,
- [kernel supports wrapped FS freeze functions])
-])
-]) # LC_HAVE_SB_START_WRITE
-
-#
-# LC_HAVE_POSIXACL_USER_NS
-#
-# 3.7 posix_acl_{to,from}_xattr take struct user_namespace
-#
-AC_DEFUN([LC_HAVE_POSIXACL_USER_NS], [
-LB_CHECK_COMPILE([if 'posix_acl_to_xattr' takes 'struct user_namespace'],
-posix_acl_to_xattr_user_namespace, [
- #include <linux/fs.h>
- #include <linux/posix_acl_xattr.h>
-],[
- posix_acl_to_xattr((struct user_namespace *)NULL, NULL, NULL, 0);
-],[
- AC_DEFINE(HAVE_POSIXACL_USER_NS, 1,
- [posix_acl_to_xattr takes struct user_namespace])
-])
-]) # LC_HAVE_POSIXACL_USER_NS
-
-#
-# LC_HAVE_FILE_F_INODE
-#
-# 3.8 struct file has new member f_inode
-#
-AC_DEFUN([LC_HAVE_FILE_F_INODE], [
-LB_CHECK_COMPILE([if 'struct file' has member 'f_inode'],
-file_f_inode, [
- #include <linux/fs.h>
-],[
- ((struct file *)0)->f_inode = NULL;
-],[
- AC_DEFINE(HAVE_FILE_F_INODE, 1,
- [struct file has member f_inode])
-])
-]) # LC_HAVE_FILE_F_INODE
-
-#
-# LC_HAVE_FILE_INODE
-#
-# 3.8 has introduced inline function file_inode
-#
-AC_DEFUN([LC_HAVE_FILE_INODE], [
-LB_CHECK_COMPILE([if file_inode() exists],
-file_inode, [
- #include <linux/fs.h>
-],[
- file_inode(NULL);
-],[
- AC_DEFINE(HAVE_FILE_INODE, 1,
- [file_inode() has been defined])
-])
-]) # LC_HAVE_FILE_INODE
-
-#
-# LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS
-#
-AC_DEFUN([LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS], [
-LB_CHECK_COMPILE([if 'sunrpc_cache_pipe_upcall' takes 3 args],
-sunrpc_cache_pipe_upcall_3args, [
- #include <linux/sunrpc/cache.h>
-],[
- sunrpc_cache_pipe_upcall(NULL, NULL, NULL);
-],[
- AC_DEFINE(HAVE_SUNRPC_UPCALL_HAS_3ARGS, 1,
- [sunrpc_cache_pipe_upcall takes 3 args])
-])
-]) # LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS
-
-#
-# LC_HAVE_HLIST_FOR_EACH_3ARG
-#
-# 3.9 uses hlist_for_each_entry with 3 args
-# b67bfe0d42cac56c512dd5da4b1b347a23f4b70a
-#
-AC_DEFUN([LC_HAVE_HLIST_FOR_EACH_3ARG], [
-LB_CHECK_COMPILE([if 'hlist_for_each_entry' has 3 args],
-hlist_for_each_entry_3args, [
- #include <linux/list.h>
- #include <linux/fs.h>
-],[
- struct hlist_head *head = NULL;
- struct inode *inode;
-
- hlist_for_each_entry(inode, head, i_hash) {
- continue;
- }
-],[
- AC_DEFINE(HAVE_HLIST_FOR_EACH_3ARG, 1,
- [hlist_for_each_entry has 3 args])
-])
-]) # LC_HAVE_HLIST_FOR_EACH_3ARG
-
-#
-# LC_HAVE_BIO_END_SECTOR
-#
-# 3.9 introduces bio_end_sector macro
-# f73a1c7d117d07a96d89475066188a2b79e53c48
-#
-AC_DEFUN([LC_HAVE_BIO_END_SECTOR], [
-LB_CHECK_COMPILE([if 'bio_end_sector' is defined],
-bio_end_sector, [
- #include <linux/bio.h>
-],[
- struct bio bio = { };
- unsigned long long end;
-
- end = bio_end_sector(&bio);
-],[
- AC_DEFINE(HAVE_BIO_END_SECTOR, 1,
- [bio_end_sector is defined])
-])
-]) # LC_HAVE_BIO_END_SECTOR
-
-#
-# 3.9 created is_sxid
-#
-AC_DEFUN([LC_HAVE_IS_SXID], [
-LB_CHECK_COMPILE([if 'is_sxid' is defined],
-is_sxid, [
- #include <linux/fs.h>
-],[
- struct inode inode = { };
-
- is_sxid(inode.i_mode);
-],[
- AC_DEFINE(HAVE_IS_SXID, 1, [is_sxid is defined])
-])
-]) # LC_HAVE_IS_SXID
-
-#
-# LC_HAVE_REMOVE_PROC_SUBTREE
-#
-# 3.10 introduced remove_proc_subtree
-#
-AC_DEFUN([LC_HAVE_REMOVE_PROC_SUBTREE], [
-LB_CHECK_COMPILE([if 'remove_proc_subtree' is defined],
-remove_proc_subtree, [
- #include <linux/proc_fs.h>
-],[
- remove_proc_subtree(NULL, NULL);
-], [
- AC_DEFINE(HAVE_REMOVE_PROC_SUBTREE, 1,
- [remove_proc_subtree is defined])
-])
-]) # LC_HAVE_REMOVE_PROC_SUBTREE
-
-#
-# LC_HAVE_PROC_REMOVE
-#
-# 3.10 introduced proc_remove
-#
-AC_DEFUN([LC_HAVE_PROC_REMOVE], [
-LB_CHECK_COMPILE([if 'proc_remove' is defined],
-proc_remove, [
- #include <linux/proc_fs.h>
-],[
- proc_remove(NULL);
-], [
- AC_DEFINE(HAVE_PROC_REMOVE, 1,
- [proc_remove is defined])
-])
-]) # LC_HAVE_PROC_REMOVE
-
-AC_DEFUN([LC_HAVE_PROJECT_QUOTA], [
-LB_CHECK_COMPILE([if get_projid exists],
-get_projid, [
- struct inode;
- #include <linux/quota.h>
-],[
- struct dquot_operations ops = { };
-
- ops.get_projid(NULL, NULL);
-],[
- AC_DEFINE(HAVE_PROJECT_QUOTA, 1,
- [get_projid function exists])
-])
-]) # LC_HAVE_PROJECT_QUOTA
-
-
-#
-# LC_HAVE_SECURITY_DENTRY_INIT_SECURITY
-#
-# 3.10 introduced security_dentry_init_security()
-#
-AC_DEFUN([LC_HAVE_SECURITY_DENTRY_INIT_SECURITY], [
-LB_CHECK_COMPILE([if 'security_dentry_init_security' is defined],
-security_dentry_init_security, [
- #include <linux/security.h>
-],[
- security_dentry_init_security(NULL, 0, NULL, NULL, NULL);
-],[
- AC_DEFINE(HAVE_SECURITY_DENTRY_INIT_SECURITY, 1,
- [security_dentry_init_security' is defined])
-])
-]) # LC_HAVE_SECURITY_DENTRY_INIT_SECURITY
-
-#
-# LC_INVALIDATE_RANGE
-#
-# 3.11 invalidatepage requires the length of the range to invalidate
-#
-AC_DEFUN([LC_INVALIDATE_RANGE], [
-LB_CHECK_COMPILE([if 'address_space_operations.invalidatepage' requires 3 arguments],
-address_space_ops_invalidatepage_3args, [
- #include <linux/fs.h>
-],[
- struct address_space_operations a_ops;
- a_ops.invalidatepage(NULL, 0, 0);
-],[
- AC_DEFINE(HAVE_INVALIDATE_RANGE, 1,
- [address_space_operations.invalidatepage needs 3 arguments])
-])
-]) # LC_INVALIDATE_RANGE
-
-#
-# LC_HAVE_DIR_CONTEXT
-#
-# 3.11 readdir now takes the new struct dir_context
-#
-AC_DEFUN([LC_HAVE_DIR_CONTEXT], [
-LB_CHECK_COMPILE([if 'dir_context' exist],
-dir_context, [
- #include <linux/fs.h>
-],[
-#ifdef FMODE_KABI_ITERATE
-#error "back to use readdir in kabi_extand mode"
-#else
- struct dir_context ctx;
-
- ctx.pos = 0;
-#endif
-],[
- AC_DEFINE(HAVE_DIR_CONTEXT, 1,
- [dir_context exist])
-])
-]) # LC_HAVE_DIR_CONTEXT
-
-#
-# LC_D_COMPARE_5ARGS
-#
-# 3.11 dentry_operations.d_compare() taken 5 arguments.
-#
-AC_DEFUN([LC_D_COMPARE_5ARGS], [
-LB_CHECK_COMPILE([if 'd_compare' taken 5 arguments],
-d_compare_5args, [
- #include <linux/dcache.h>
-],[
- ((struct dentry_operations*)0)->d_compare(NULL,NULL,0,NULL,NULL);
-],[
- AC_DEFINE(HAVE_D_COMPARE_5ARGS, 1,
- [d_compare need 5 arguments])
-])
-]) # LC_D_COMPARE_5ARGS
-
-#
-# LC_HAVE_DCOUNT
-#
-# 3.11 need to access d_count to get dentry reference count
-#
-AC_DEFUN([LC_HAVE_DCOUNT], [
-LB_CHECK_COMPILE([if 'd_count' exists],
-d_count, [
- #include <linux/dcache.h>
-],[
- struct dentry de = { };
- int count;
-
- count = d_count(&de);
-],[
- AC_DEFINE(HAVE_D_COUNT, 1,
- [d_count exist])
-])
-]) # LC_HAVE_DCOUNT
-
-#
-# LC_PID_NS_FOR_CHILDREN
-#
-# 3.11 replaces pid_ns by pid_ns_for_children in struct nsproxy
-#
-AC_DEFUN([LC_PID_NS_FOR_CHILDREN], [
-LB_CHECK_COMPILE([if 'struct nsproxy' has 'pid_ns_for_children'],
-pid_ns_for_children, [
- #include <linux/nsproxy.h>
-],[
- struct nsproxy ns;
- ns.pid_ns_for_children = NULL;
-],[
- AC_DEFINE(HAVE_PID_NS_FOR_CHILDREN, 1,
- ['struct nsproxy' has 'pid_ns_for_children'])
-])
-]) # LC_PID_NS_FOR_CHILDREN
-
-#
-# LC_OLDSIZE_TRUNCATE_PAGECACHE
-#
-# 3.12 truncate_pagecache without oldsize parameter
-#
-AC_DEFUN([LC_OLDSIZE_TRUNCATE_PAGECACHE], [
-LB_CHECK_COMPILE([if 'truncate_pagecache' with 'old_size' parameter],
-truncate_pagecache_old_size, [
- #include <linux/mm.h>
-],[
- truncate_pagecache(NULL, 0, 0);
-],[
- AC_DEFINE(HAVE_OLDSIZE_TRUNCATE_PAGECACHE, 1,
- [with oldsize])
-])
-]) # LC_OLDSIZE_TRUNCATE_PAGECACHE
-
-#
-# LC_PTR_ERR_OR_ZERO
-#
-# For some reason SLES11SP4 is missing the PTR_ERR_OR_ZERO macro
-# It was added to linux kernel 3.12
-#
-AC_DEFUN([LC_PTR_ERR_OR_ZERO_MISSING], [
-LB_CHECK_COMPILE([if 'PTR_ERR_OR_ZERO' is missing],
-is_err_or_null, [
- #include <linux/err.h>
-],[
- if (PTR_ERR_OR_ZERO(NULL)) return 0;
-],[
- AC_DEFINE(HAVE_PTR_ERR_OR_ZERO, 1,
- ['PTR_ERR_OR_ZERO' exist])
-])
-]) # LC_PTR_ERR_OR_ZERO_MISSING
-
-#
-# LC_HAVE_DENTRY_D_U_D_ALIAS
-#
-# 3.11 kernel moved d_alias to the union d_u in struct dentry
-#
-# Some distros move d_alias to d_u but it is still a struct list
-#
-AC_DEFUN([LC_HAVE_DENTRY_D_U_D_ALIAS], [
-AS_IF([test "x$lb_cv_compile_i_dentry_d_alias_list" = xyes], [
- LB_CHECK_COMPILE([if list 'dentry.d_u.d_alias' exist],
- d_alias, [
- #include <linux/list.h>
- #include <linux/dcache.h>
- ],[
- struct dentry de;
- INIT_LIST_HEAD(&de.d_u.d_alias);
- ],[
- AC_DEFINE(HAVE_DENTRY_D_U_D_ALIAS, 1,
- [list dentry.d_u.d_alias exist])
- ])
-],[
- LB_CHECK_COMPILE([if hlist 'dentry.d_u.d_alias' exist],
- d_alias, [
- #include <linux/list.h>
- #include <linux/dcache.h>
- ],[
- struct dentry de;
- INIT_HLIST_NODE(&de.d_u.d_alias);
- ],[
- AC_DEFINE(HAVE_DENTRY_D_U_D_ALIAS, 1,
- [hlist dentry.d_u.d_alias exist])
- ])
-])
-]) # LC_HAVE_DENTRY_D_U_D_ALIAS
-
-#
-# LC_HAVE_DENTRY_D_CHILD
-#
-# 3.11 kernel d_child has been moved out of the union d_u
-# in struct dentry
-#
-AC_DEFUN([LC_HAVE_DENTRY_D_CHILD], [
-LB_CHECK_COMPILE([if 'dentry.d_child' exist],
-d_child, [
- #include <linux/list.h>