📄 lustre-core.m4
字号:
])])AC_DEFUN([LC_POSIX_ACL_XATTR_H],[LB_CHECK_FILE([$LINUX/include/linux/posix_acl_xattr.h],[ AC_MSG_CHECKING([if linux/posix_acl_xattr.h can be compiled]) LB_LINUX_TRY_COMPILE([ #include <linux/posix_acl_xattr.h> ],[],[ AC_MSG_RESULT([yes]) AC_DEFINE(HAVE_LINUX_POSIX_ACL_XATTR_H, 1, [linux/posix_acl_xattr.h found]) ],[ AC_MSG_RESULT([no]) ])$1],[AC_MSG_RESULT([no])])])## LC_EXPORT___IGET# starting from 2.6.19 linux kernel exports __iget()#AC_DEFUN([LC_EXPORT___IGET],[LB_CHECK_SYMBOL_EXPORT([__iget],[fs/inode.c],[ AC_DEFINE(HAVE_EXPORT___IGET, 1, [kernel exports __iget])],[])])AC_DEFUN([LC_LUSTRE_VERSION_H],[LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],[ rm -f "$LUSTRE/include/linux/lustre_version.h"],[ touch "$LUSTRE/include/linux/lustre_version.h" if test x$enable_server = xyes ; then AC_MSG_WARN([Unpatched kernel detected.]) AC_MSG_WARN([Lustre servers cannot be built with an unpatched kernel;]) AC_MSG_WARN([disabling server build]) enable_server='no' fi])])AC_DEFUN([LC_FUNC_SET_FS_PWD],[LB_CHECK_SYMBOL_EXPORT([set_fs_pwd],[fs/namespace.c],[ AC_DEFINE(HAVE_SET_FS_PWD, 1, [set_fs_pwd is exported])],[])])## LC_FUNC_MS_FLOCK_LOCK## SLES9 kernel has MS_FLOCK_LOCK sb flag#AC_DEFUN([LC_FUNC_MS_FLOCK_LOCK],[AC_MSG_CHECKING([if kernel has MS_FLOCK_LOCK sb flag])LB_LINUX_TRY_COMPILE([ #include <linux/fs.h>],[ int flags = MS_FLOCK_LOCK;],[ AC_DEFINE(HAVE_MS_FLOCK_LOCK, 1, [kernel has MS_FLOCK_LOCK flag]) AC_MSG_RESULT([yes])],[ AC_MSG_RESULT([no])])])## LC_FUNC_HAVE_CAN_SLEEP_ARG## SLES9 kernel has third arg can_sleep# in fs/locks.c: flock_lock_file_wait()#AC_DEFUN([LC_FUNC_HAVE_CAN_SLEEP_ARG],[AC_MSG_CHECKING([if kernel has third arg can_sleep in fs/locks.c: flock_lock_file_wait()])LB_LINUX_TRY_COMPILE([ #include <linux/fs.h>],[ int cansleep; struct file *file; struct file_lock *file_lock; flock_lock_file_wait(file, file_lock, cansleep);],[ AC_DEFINE(HAVE_CAN_SLEEP_ARG, 1, [kernel has third arg can_sleep in fs/locks.c: flock_lock_file_wait()]) AC_MSG_RESULT([yes])],[ AC_MSG_RESULT([no])])])## LC_FUNC_F_OP_FLOCK## rhel4.2 kernel has f_op->flock field#AC_DEFUN([LC_FUNC_F_OP_FLOCK],[AC_MSG_CHECKING([if struct file_operations has flock field])LB_LINUX_TRY_COMPILE([ #include <linux/fs.h>],[ struct file_operations ll_file_operations_flock; ll_file_operations_flock.flock = NULL;],[ AC_DEFINE(HAVE_F_OP_FLOCK, 1, [struct file_operations has flock field]) AC_MSG_RESULT([yes])],[ AC_MSG_RESULT([no])])])## LC_FUNC_MS_FLOCK_LOCK## SLES9 kernel has MS_FLOCK_LOCK sb flag#AC_DEFUN([LC_FUNC_MS_FLOCK_LOCK],[AC_MSG_CHECKING([if kernel has MS_FLOCK_LOCK sb flag])LB_LINUX_TRY_COMPILE([ #include <linux/fs.h>],[ int flags = MS_FLOCK_LOCK;],[ AC_DEFINE(HAVE_MS_FLOCK_LOCK, 1, [kernel has MS_FLOCK_LOCK flag]) AC_MSG_RESULT([yes])],[ AC_MSG_RESULT([no])])])## LC_FUNC_HAVE_CAN_SLEEP_ARG## SLES9 kernel has third arg can_sleep# in fs/locks.c: flock_lock_file_wait()#AC_DEFUN([LC_FUNC_HAVE_CAN_SLEEP_ARG],[AC_MSG_CHECKING([if kernel has third arg can_sleep in fs/locks.c: flock_lock_file_wait()])LB_LINUX_TRY_COMPILE([ #include <linux/fs.h>],[ int cansleep; struct file *file; struct file_lock *file_lock; flock_lock_file_wait(file, file_lock, cansleep);],[ AC_DEFINE(HAVE_CAN_SLEEP_ARG, 1, [kernel has third arg can_sleep in fs/locks.c: flock_lock_file_wait()]) AC_MSG_RESULT([yes])],[ AC_MSG_RESULT([no])])])## LC_TASK_PPTR## task struct has p_pptr instead of parent#AC_DEFUN([LC_TASK_PPTR],[AC_MSG_CHECKING([task p_pptr found])LB_LINUX_TRY_COMPILE([ #include <linux/sched.h>],[ struct task_struct *p; p = p->p_pptr;],[ AC_MSG_RESULT([yes]) AC_DEFINE(HAVE_TASK_PPTR, 1, [task p_pptr found])],[ AC_MSG_RESULT([no])])])## LC_FUNC_F_OP_FLOCK## rhel4.2 kernel has f_op->flock field#AC_DEFUN([LC_FUNC_F_OP_FLOCK],[AC_MSG_CHECKING([if struct file_operations has flock field])LB_LINUX_TRY_COMPILE([ #include <linux/fs.h>],[ struct file_operations ll_file_operations_flock; ll_file_operations_flock.flock = NULL;],[ AC_DEFINE(HAVE_F_OP_FLOCK, 1, [struct file_operations has flock field]) AC_MSG_RESULT([yes])],[ AC_MSG_RESULT([no])])])# LC_INODE_I_MUTEX# after 2.6.15 inode have i_mutex intead of i_semAC_DEFUN([LC_INODE_I_MUTEX],[AC_MSG_CHECKING([use inode have 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)])])# LC_SYMVERFILE# SLES 9 uses a different name for this file - unsure about vanilla kernels# around this version, but it matters for servers only.AC_DEFUN([LC_SYMVERFILE], [AC_MSG_CHECKING([name of symverfile]) if grep -q Modules.symvers $LINUX/scripts/Makefile.modpost ; then SYMVERFILE=Modules.symvers else SYMVERFILE=Module.symvers fi AC_MSG_RESULT($SYMVERFILE) AC_SUBST(SYMVERFILE)])# LC_DQUOTOFF_MUTEX# after 2.6.17 dquote use mutex instead if semaphoreAC_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)])])## LC_STATFS_DENTRY_PARAM# starting from 2.6.18 linux kernel uses dentry instead of# super_block for first vfs_statfs argument#AC_DEFUN([LC_STATFS_DENTRY_PARAM],[AC_MSG_CHECKING([first vfs_statfs parameter is dentry])LB_LINUX_TRY_COMPILE([ #include <linux/fs.h>],[ int vfs_statfs(struct dentry *, struct kstatfs *);],[ AC_DEFINE(HAVE_STATFS_DENTRY_PARAM, 1, [first parameter of vfs_statfs is dentry]) AC_MSG_RESULT([yes])],[ AC_MSG_RESULT([no])])])## 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# more 2.6 api changes. return type for the invalidatepage# address_space_operation is 'void' in new kernels but 'int' in old#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# more 2.6 API changes. 2.6.18 umount_begin has different parametersAC_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"])# 2.6.19 API changes# inode don't have i_blksize fieldAC_DEFUN([LC_INODE_BLKSIZE],[AC_MSG_CHECKING([inode has i_blksize field])LB_LINUX_TRY_COMPILE([#include <linux/fs.h>],[ struct inode i; i.i_blksize = 0; ],[ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_INODE_BLKSIZE, 1, [struct inode has i_blksize field])],[ AC_MSG_RESULT(NO)])])# LC_VFS_READDIR_U64_INO# 2.6.19 use u64 for inode number instead of inode_tAC_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_writeAC_DEFUN([LC_FILE_WRITEV],[AC_MSG_CHECKING([writev in fops])LB_LINUX_TRY_COMPILE([ #include <linux/fs.h>],[ struct file_operations *fops; fops->writev = NULL;],[ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_FILE_WRITEV, 1, [use fops->writev])],[ AC_MSG_RESULT(NO)])])# LC_GENERIC_FILE_READ# 2.6.19 replaced readv with aio_readAC_DEFUN([LC_FILE_READV],[AC_MSG_CHECKING([readv in fops])LB_LINUX_TRY_COMPILE([ #include <linux/fs.h>],[ struct file_operations *fops; fops->readv = NULL;],[ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_FILE_READV, 1, [use fops->readv])],[ AC_MSG_RESULT(NO)])])# LC_NR_PAGECACHE# 2.6.18 don't export nr_pagecaheAC_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_CANCEL_DIRTY_PAGE# 2.6.20 introduse cancel_dirty_page instead of # clear_page_dirty.AC_DEFUN([LC_CANCEL_DIRTY_PAGE],[AC_MSG_CHECKING([kernel has cancel_dirty_page])LB_LINUX_TRY_COMPILE([ #include <linux/page-flags.h>],[ cancel_dirty_page(NULL, 0);],[ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_CANCEL_DIRTY_PAGE, 1, [kernel has cancel_dirty_page instead of clear_page_dirty])],[ AC_MSG_RESULT(NO)])])## LC_PAGE_CONSTANT## In order to support raid5 zerocopy patch, we have to patch the kernel to make# it support constant page, which means the page won't be modified during the# IO.#AC_DEFUN([LC_PAGE_CONSTANT],[AC_MSG_CHECKING([if kernel have PageConstant defined])LB_LINUX_TRY_COMPILE([ #include <linux/page-flags.h>],[ #ifndef PG_constant #error "Have no raid5 zcopy patch" #endif],[ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_PAGE_CONSTANT, 1, [kernel have PageConstant supported])],[ AC_MSG_RESULT(no);])])# RHEL5 in FS-cache patch rename PG_checked flag# into PG_fs_miscAC_DEFUN([LC_PG_FS_MISC],[AC_MSG_CHECKING([kernel has PG_fs_misc])LB_LINUX_TRY_COMPILE([ #include <linux/page-flags.h>],[ #ifndef PG_fs_misc #error PG_fs_misc not defined in kernel #endif],[ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_PG_FS_MISC, 1, [is kernel have PG_fs_misc])],[ AC_MSG_RESULT(NO)])])# RHEL5 PageChecked and SetPageChecked definedAC_DEFUN([LC_PAGE_CHECKED],[AC_MSG_CHECKING([kernel has PageChecked and SetPageChecked])LB_LINUX_TRY_COMPILE([ #include <linux/page-flags.h>],[ #ifndef PageChecked #error PageChecked not defined in kernel #endif #ifndef SetPageChecked #error SetPageChecked not defined in kernel #endif],[ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_PAGE_CHECKED, 1, [does kernel have PageChecked and SetPageChecked])],[ AC_MSG_RESULT(NO)])])AC_DEFUN([LC_EXPORT_TRUNCATE_COMPLETE],[LB_CHECK_SYMBOL_EXPORT([truncate_complete_page],[mm/truncate.c],[AC_DEFINE(HAVE_TRUNCATE_COMPLETE_PAGE, 1, [kernel export truncate_complete_page])],[])])AC_DEFUN([LC_EXPORT_D_REHASH_COND],[LB_CHECK_SYMBOL_EXPORT([d_rehash_cond],[fs/dcache.c],[AC_DEFINE(HAVE_D_REHASH_COND, 1, [d_rehash_cond is exported by the kernel])],[])])AC_DEFUN([LC_EXPORT___D_REHASH],[LB_CHECK_SYMBOL_EXPORT([__d_rehash],[fs/dcache.c],[AC_DEFINE(HAVE___D_REHASH, 1, [__d_rehash is exported by the kernel])],[])])AC_DEFUN([LC_EXPORT_D_MOVE_LOCKED],[LB_CHECK_SYMBOL_EXPORT([d_move_locked],[fs/dcache.c],[AC_DEFINE(HAVE_D_MOVE_LOCKED, 1, [d_move_locked is exported by the kernel])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -