- enable_ssk=$enable_gss
-])
-]) # LC_CONFIG_GSS
-
-# LC_OPENSSL_SSK
-#
-# OpenSSL 1.0+ return int for HMAC functions but older SLES11 versions do not
-AC_DEFUN([LC_OPENSSL_SSK], [
-AC_MSG_CHECKING([whether OpenSSL has functions needed for SSK])
-AS_IF([test "x$enable_ssk" != xno], [
-AC_COMPILE_IFELSE([AC_LANG_SOURCE([
- #include <openssl/hmac.h>
- #include <openssl/evp.h>
-
- int main(void) {
- int rc;
- HMAC_CTX ctx;
- HMAC_CTX_init(&ctx);
- rc = HMAC_Init_ex(&ctx, "test", 4, EVP_md_null(), NULL);
- }
-])],[AC_DEFINE(HAVE_OPENSSL_SSK, 1,
- [OpenSSL HMAC functions needed for SSK])],
- [enable_ssk="no"])
-])
-AC_MSG_RESULT([$enable_ssk])
-]) # LC_OPENSSL_SSK
-
-# LC_INODE_PERMISION_2ARGS
-#
-# up to v2.6.27 had a 3 arg version (inode, mask, nameidata)
-# v2.6.27->v2.6.37 had a 2 arg version (inode, mask)
-# v2.6.37->v3.0 had a 3 arg version (inode, mask, nameidata)
-# v3.1 onward have a 2 arg version (inode, mask)
-#
-AC_DEFUN([LC_INODE_PERMISION_2ARGS], [
-LB_CHECK_COMPILE([if 'inode_operations->permission' has two args],
-inode_ops_permission_2args, [
- #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])
-])
-]) # LC_INODE_PERMISION_2ARGS
-
-#
-# LC_BLK_QUEUE_MAX_SEGMENTS
-#
-# 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], [
-LB_CHECK_COMPILE([if 'blk_queue_max_segments' is defined],
-blk_queue_max_segments, [
- #include <linux/blkdev.h>
-],[
- blk_queue_max_segments(NULL, 0);
-],[
- AC_DEFINE(HAVE_BLK_QUEUE_MAX_SEGMENTS, 1,
- [blk_queue_max_segments is defined])
-])
-]) # LC_BLK_QUEUE_MAX_SEGMENTS
-
-#
-# LC_HAVE_XATTR_HANDLER_FLAGS
-#
-# 2.6.33 added a private flag to xattr_handler
-#
-AC_DEFUN([LC_HAVE_XATTR_HANDLER_FLAGS], [
-LB_CHECK_COMPILE([if 'struct xattr_handler' has flags field],
-xattr_handler_flags, [
- #include <linux/xattr.h>
-],[
- struct xattr_handler handler;
-
- handler.flags = 0;
-],[
- AC_DEFINE(HAVE_XATTR_HANDLER_FLAGS, 1, [flags field exist])
-])
-]) # LC_HAVE_XATTR_HANDLER_FLAGS
-
-#
-# LC_HAVE_DQUOT_FS_DISK_QUOTA
-#
-# 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"
-LB_CHECK_COMPILE([if 'quotactl_ops.set_dqblk' takes struct fs_disk_quota],
-fs_disk_quota, [
- #include <linux/fs.h>
- #include <linux/quota.h>
-],[
- ((struct quotactl_ops *)0)->set_dqblk(NULL, 0, 0, (struct fs_disk_quota*)0);
-],[
- AC_DEFINE(HAVE_DQUOT_FS_DISK_QUOTA, 1,
- [quotactl_ops.set_dqblk takes struct fs_disk_quota])
-],[
- LB_CHECK_COMPILE([if 'quotactl_ops.set_dqblk' takes struct kqid & fs_disk_quota],
- kqid_fs_disk_quota, [
- #include <linux/fs.h>
- #include <linux/quota.h>
- ],[
- ((struct quotactl_ops *)0)->set_dqblk((struct super_block*)0, *((struct kqid*)0), (struct fs_disk_quota*)0);
- ],[
- AC_DEFINE(HAVE_DQUOT_FS_DISK_QUOTA, 1,
- [quotactl_ops.set_dqblk takes struct fs_disk_quota])
- AC_DEFINE(HAVE_DQUOT_KQID, 1,
- [quotactl_ops.set_dqblk takes struct kqid])
- ])
-])
-EXTRA_KCFLAGS="$tmp_flags"
-]) # LC_HAVE_DQUOT_FS_DISK_QUOTA
-
-#
-# LC_HAVE_DQUOT_SUSPEND
-#
-# 2.6.34 has renamed dquot options to dquot_*, check for dquot_suspend
-#
-AC_DEFUN([LC_HAVE_DQUOT_SUSPEND], [
-LB_CHECK_COMPILE([if 'dquot_suspend' is defined],
-dquot_suspend, [
- #include <linux/quotaops.h>
-],[
- dquot_suspend(NULL, -1);
-],[
- AC_DEFINE(HAVE_DQUOT_SUSPEND, 1, [dquot_suspend is defined])
-])
-]) # LC_HAVE_DQUOT_SUSPEND
-
-#
-# 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], [
-tmp_flags="$EXTRA_KCFLAGS"
-EXTRA_KCFLAGS="-I$LINUX/fs"
-LB_CHECK_COMPILE([if kernel has 64-bit quota limits support],
-quota64, [
- #include <linux/kernel.h>
- #include <linux/fs.h>
- #if defined(HAVE_FS_QUOTA_QUOTAIO_H)
- #include <quota/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])
-],[
- LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],
- [AC_MSG_ERROR([You have got no 64-bit kernel quota support.])])
-])
-EXTRA_KCFLAGS=$tmp_flags
-]) # LC_QUOTA64
-
-#
-# LC_HAVE_ADD_WAIT_QUEUE_EXCLUSIVE
-#
-# 2.6.34 adds __add_wait_queue_exclusive
-#
-AC_DEFUN([LC_HAVE_ADD_WAIT_QUEUE_EXCLUSIVE], [
-LB_CHECK_COMPILE([if '__add_wait_queue_exclusive' exists],
-__add_wait_queue_exclusive, [
- #include <linux/wait.h>
-],[
- wait_queue_head_t queue;
- wait_queue_t wait;
- __add_wait_queue_exclusive(&queue, &wait);
-],[
- AC_DEFINE(HAVE___ADD_WAIT_QUEUE_EXCLUSIVE, 1,
- [__add_wait_queue_exclusive exists])
-])
-]) # LC_HAVE_ADD_WAIT_QUEUE_EXCLUSIVE
-
-#
-# LC_FS_STRUCT_RWLOCK
-#
-# 2.6.36 fs_struct.lock use spinlock instead of rwlock.
-#
-AC_DEFUN([LC_FS_STRUCT_RWLOCK], [
-LB_CHECK_COMPILE([if 'fs_struct.lock' use rwlock],
-fs_struct_rwlock, [
- #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])
-])
-]) # LC_FS_STRUCT_RWLOCK
-
-#
-# LC_SBOPS_EVICT_INODE
-#
-# 2.6.36 super_operations add evict_inode method. it hybird of
-# delete_inode & clear_inode.
-#
-AC_DEFUN([LC_SBOPS_EVICT_INODE], [
-LB_CHECK_COMPILE([if 'super_operations.evict_inode' exist],
-super_ops_evict_inode, [
- #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])
-])
-]) # LC_SBOPS_EVICT_INODE
-
-#
-# LC_FILE_FSYNC
-#
-# 2.6.35 file_operations.fsync taken 2 arguments.
-# 3.0.0 file_operations.fsync takes 4 arguments.
-#
-AC_DEFUN([LC_FILE_FSYNC], [
-LB_CHECK_COMPILE([if 'file_operations.fsync' takes 4 arguments],
-file_ops_fsync_4args, [
- #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])
-],[
- LB_CHECK_COMPILE([if 'file_operations.fsync' takes 2 arguments],
- file_ops_fsync_2args, [
- #include <linux/fs.h>
- ],[
- ((struct file_operations *)0)->fsync(NULL, 0);
- ],[
- AC_DEFINE(HAVE_FILE_FSYNC_2ARGS, 1,
- [file_operations.fsync takes 2 arguments])
- ])
-])
-]) # LC_FILE_FSYNC
-
-#
-# LC_KERNEL_LOCKED
-#
-# 2.6.37 remove kernel_locked
-#
-AC_DEFUN([LC_KERNEL_LOCKED], [
-LB_CHECK_COMPILE([if 'kernel_locked' is defined],
-kernel_locked, [
- #include <linux/smp_lock.h>
-],[
- kernel_locked();
-],[
- AC_DEFINE(HAVE_KERNEL_LOCKED, 1, [kernel_locked is defined])
-])
-]) # LC_KERNEL_LOCKED
-
-#
-# LC_FS_STRUCT_SEQCOUNT
-#
-# 2.6.37 uses seqlock in fs_struct
-#
-AC_DEFUN([LC_FS_STRUCT_SEQCOUNT], [
-LB_CHECK_COMPILE([if fs_struct use seqcount],
-fs_struct_seqcount, [
- #include <linux/fs_struct.h>
-],[
- ((struct fs_struct *)0)->seq = (struct seqcount){ 0 };
-],[
- AC_DEFINE(HAVE_FS_STRUCT_SEQCOUNT, 1, [fs_struct use seqcount])
-])
-]) # LC_FS_STRUCT_SEQCOUNT
-
-#
-# LC_D_COMPARE_7ARGS
-#
-# 2.6.38 dentry_operations.d_compare() taken 7 arguments.
-#
-AC_DEFUN([LC_D_COMPARE_7ARGS], [
-LB_CHECK_COMPILE([if 'dentry_operations.d_compare()' taken 7 arguments],
-dentry_ops_d_compare_7arg, [
- #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])
-])
-]) # LC_D_COMPARE_7ARGS
-
-#
-# LC_D_DELETE_CONST
-#
-# 2.6.38 dentry_operations.d_delete() defined 'const' for 1st parameter.
-#
-AC_DEFUN([LC_D_DELETE_CONST], [
-tmp_flags="$EXTRA_KCFLAGS"
-EXTRA_KCFLAGS="-Werror"
-LB_CHECK_COMPILE([if 'dentry_operations.d_delete()' has const declare on first parameter],
-dentry_ops_d_delete_1st_const, [
- #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_DEFINE(HAVE_D_DELETE_CONST, [],
- [d_delete first parameter declared is not const])
-])
-EXTRA_KCFLAGS="$tmp_flags"
-]) # LC_D_DELETE_CONST
-
-#
-# LC_DCACHE_LOCK
-#
-# 2.6.38 dcache_lock removed. rcu-walk committed.
-#
-AC_DEFUN([LC_DCACHE_LOCK], [
-LB_CHECK_COMPILE([if 'dcache_lock' is exist],
-dcache_lock, [
- #include <linux/dcache.h>
-],[
- spin_lock(&dcache_lock);
-],[
- AC_DEFINE(HAVE_DCACHE_LOCK, 1,
- [dcache_lock is exist])
-])
-]) # LC_DCACHE_LOCK
-
-#
-# LC_INODE_I_RCU
-#
-# 2.6.38 inode.i_rcu added.
-#
-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_IOP_TRUNCATE
-#
-# truncate callback removed since 2.6.39
-#
-AC_DEFUN([LC_IOP_TRUNCATE], [
-LB_CHECK_COMPILE([if 'inode_operations' has '.truncate' member function],
-inode_ops_truncate, [
- #include <linux/fs.h>
-],[
- ((struct inode_operations *)0)->truncate(NULL);
-],[
- AC_DEFINE(HAVE_INODEOPS_TRUNCATE, 1,
- [inode_operations has .truncate member function])
-])
-]) # LC_IOP_TRUNCATE
-
-#
-# 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 *i = (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;
- 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])