X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fautoconf%2Flustre-core.m4;h=359cee4e28dc3913537862b04aafb5a555d7d7eb;hb=1cd0fdde12df0332b043fc92839b3bd94c6213e1;hp=9ac1194a28b52da9dfa979a2938c09b53fc60cfa;hpb=0aec97df129d2c6263c66454ee9039cd5dbfdf85;p=fs%2Flustre-release.git diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 9ac1194..359cee4 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -216,10 +216,10 @@ AC_DEFUN([LC_QUOTA_CONFIG], ]) ]) -# truncate_complete_page() was exported from RHEL5/SLES10, but not in SLES11 SP0 (2.6.27) +# truncate_complete_page() has never been exported from an upstream kernel # remove_from_page_cache() was exported between 2.6.35 and 2.6.38 # delete_from_page_cache() is exported from 2.6.39 -AC_DEFUN([LC_EXPORT_TRUNCATE_COMPLETE], +AC_DEFUN([LC_EXPORT_TRUNCATE_COMPLETE_PAGE], [LB_CHECK_SYMBOL_EXPORT([truncate_complete_page], [mm/truncate.c], [AC_DEFINE(HAVE_TRUNCATE_COMPLETE_PAGE, 1, @@ -234,48 +234,6 @@ AC_DEFUN([LC_EXPORT_TRUNCATE_COMPLETE], [kernel export delete_from_page_cache])]) ]) -# The actual symbol exported varies among architectures, so we need -# to check many symbols (but only in the current architecture.) No -# matter what symbol is exported, the kernel #defines node_to_cpumask -# to the appropriate function and that's what we use. -AC_DEFUN([LC_EXPORT_NODE_TO_CPUMASK], - [LB_CHECK_SYMBOL_EXPORT([node_to_cpumask], - [arch/$LINUX_ARCH/mm/numa.c], - [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1, - [node_to_cpumask is exported by - the kernel])]) # x86_64 - LB_CHECK_SYMBOL_EXPORT([node_to_cpu_mask], - [arch/$LINUX_ARCH/kernel/smpboot.c], - [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1, - [node_to_cpumask is exported by - the kernel])]) # ia64 - LB_CHECK_SYMBOL_EXPORT([node_2_cpu_mask], - [arch/$LINUX_ARCH/kernel/smpboot.c], - [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1, - [node_to_cpumask is exported by - the kernel])]) # i386 - ]) - -# -# added in 2.6.17 -# -AC_DEFUN([LC_BIT_SPINLOCK_H], -[LB_CHECK_FILE([$LINUX/include/linux/bit_spinlock.h],[ - AC_MSG_CHECKING([if bit_spinlock.h can be compiled]) - LB_LINUX_TRY_COMPILE([ - #include - #include - #include - ],[],[ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_BIT_SPINLOCK_H, 1, [Kernel has bit_spinlock.h]) - ],[ - AC_MSG_RESULT([no]) - ]) -], -[]) -]) - # # LC_CAPA_CRYPTO # @@ -328,7 +286,9 @@ AC_DEFUN([LC_CONFIG_GSS_KEYRING], AC_DEFUN([LC_CONFIG_SUNRPC], [LB_LINUX_CONFIG_IM([SUNRPC],[], - [AC_MSG_ERROR([kernel SUNRPC support is required by using GSS.])]) + [if test x$sunrpc_required == xyes; then + AC_MSG_ERROR([kernel SUNRPC support is required by using GSS.]) + fi]) ]) # @@ -341,12 +301,14 @@ AC_DEFUN([LC_CONFIG_GSS], [AC_MSG_CHECKING([whether to enable gss/krb5 support]) AC_ARG_ENABLE([gss], [AC_HELP_STRING([--enable-gss], [enable gss/krb5 support])], - [],[enable_gss='no']) + [],[enable_gss='auto']) AC_MSG_RESULT([$enable_gss]) - if test x$enable_gss == xyes; then + if test x$enable_gss != xno; then LC_CONFIG_GSS_KEYRING + sunrpc_required=$enable_gss LC_CONFIG_SUNRPC + sunrpc_required=no AC_DEFINE([HAVE_GSS], [1], [Define this if you enable gss]) @@ -359,103 +321,25 @@ AC_DEFUN([LC_CONFIG_GSS], LB_LINUX_CONFIG_IM([CRYPTO_SHA512],[], [AC_MSG_WARN([kernel SHA512 support is recommended by using GSS.])]) - AC_CHECK_LIB([gssapi], [gss_export_lucid_sec_context], - [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi"], - [AC_CHECK_LIB([gssglue], [gss_export_lucid_sec_context], - [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssglue"], - [AC_MSG_ERROR([libgssapi or libgssglue is not found, which is required by GSS.])])],) - - AC_SUBST(GSSAPI_LIBS) - + require_krb5=$enable_gss AC_KERBEROS_V5 + require_krb5=no + + if test x$KRBDIR != x; then + AC_CHECK_LIB([gssapi], [gss_export_lucid_sec_context], + [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi"], + [AC_CHECK_LIB([gssglue], [gss_export_lucid_sec_context], + [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssglue"], + [if test x$enable_gss == xyes; then + AC_MSG_ERROR([libgssapi or libgssglue is not found, which is required by GSS.]) + fi])],) + AC_SUBST(GSSAPI_LIBS) + fi fi ]) -# 2.6.12 - -# ~2.6.12 merge patch from oracle to convert tree_lock from spinlock to rwlock -# yet tree_lock is converted from rwlock to spin_lock since v2.6.26 -AC_DEFUN([LC_RW_TREE_LOCK], -[AC_MSG_CHECKING([if kernel has tree_lock as rwlock]) -tmp_flags="$EXTRA_KCFLAGS" -EXTRA_KCFLAGS="-Werror" -LB_LINUX_TRY_COMPILE([ - #include -],[ - struct address_space a; - - write_lock(&a.tree_lock); -],[ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_RW_TREE_LOCK, 1, [kernel has tree_lock as rw_lock]) -],[ - AC_MSG_RESULT([no]) -]) -EXTRA_KCFLAGS="$tmp_flags" -]) - #2.6.18 + RHEL5 (fc6) -# -# LC_LINUX_FIEMAP_H -# -# fiemap.h is added since v2.6.28 -# RHEL5 2.6.18 has it, while SLES10 2.6.27 does not -# -AC_DEFUN([LC_LINUX_FIEMAP_H], -[LB_CHECK_FILE([$LINUX/include/linux/fiemap.h],[ - AC_MSG_CHECKING([if fiemap.h can be compiled]) - LB_LINUX_TRY_COMPILE([ - #include - #include - ],[],[ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_LINUX_FIEMAP_H, 1, [Kernel has fiemap.h]) - ],[ - AC_MSG_RESULT([no]) - ]) -], -[]) -]) - -# 2.6.19 - -# LC_FILE_WRITEV -# 2.6.19 replaced writev with aio_write -AC_DEFUN([LC_FILE_WRITEV], -[AC_MSG_CHECKING([writev in fops]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - struct file_operations *fops = NULL; - fops->writev = NULL; -],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_FILE_WRITEV, 1, - [use fops->writev]) -],[ - AC_MSG_RESULT(no) -]) -]) - -# LC_FILE_READV -# 2.6.19 replaced readv with aio_read -AC_DEFUN([LC_FILE_READV], -[AC_MSG_CHECKING([readv in fops]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - struct file_operations *fops = NULL; - fops->readv = NULL; -],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_FILE_READV, 1, - [use fops->readv]) -],[ - AC_MSG_RESULT(no) -]) -]) - # raid5-zerocopy patch # @@ -482,91 +366,6 @@ LB_LINUX_TRY_COMPILE([ ]) ]) -# 2.6.22 - -# 2.6.22 lost second parameter for invalidate_bdev -AC_DEFUN([LC_INVALIDATE_BDEV_2ARG], -[AC_MSG_CHECKING([if invalidate_bdev has second argument]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - invalidate_bdev(NULL,0); -],[ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_INVALIDATE_BDEV_2ARG, 1, - [invalidate_bdev has second argument]) -],[ - AC_MSG_RESULT([no]) -]) -]) - -# -# 2.6.19 check for FS_RENAME_DOES_D_MOVE flag -# -AC_DEFUN([LC_FS_RENAME_DOES_D_MOVE], -[AC_MSG_CHECKING([if kernel has FS_RENAME_DOES_D_MOVE flag]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - int v __attribute__ ((unused)); - v = FS_RENAME_DOES_D_MOVE; -],[ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_FS_RENAME_DOES_D_MOVE, 1, [kernel has FS_RENAME_DOES_D_MOVE flag]) -],[ - AC_MSG_RESULT([no]) -]) -]) - -# 2.6.23 - -# 2.6.23 have return type 'void' for unregister_blkdev -AC_DEFUN([LC_UNREGISTER_BLKDEV_RETURN_INT], -[AC_MSG_CHECKING([if unregister_blkdev return int]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - int i __attribute__ ((unused)); - i = unregister_blkdev(0,NULL); -],[ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_UNREGISTER_BLKDEV_RETURN_INT, 1, - [unregister_blkdev return int]) -],[ - AC_MSG_RESULT([no]) -]) -]) - -# 2.6.23 add code to wait other users to complete before removing procfs entry -AC_DEFUN([LC_PROCFS_USERS], -[AC_MSG_CHECKING([if kernel has pde_users member in procfs entry struct]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - struct proc_dir_entry pde; - - pde.pde_users = 0; -],[ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_PROCFS_USERS, 1, - [kernel has pde_users member in procfs entry struct]) -],[ - 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.24 # 2.6.24 has bio_endio with 2 args @@ -603,50 +402,14 @@ LB_LINUX_TRY_COMPILE([ ]) ]) -# 2.6.26 - -# 2.6.26 isn't export set_fs_pwd and change paramter in fs struct -AC_DEFUN([LC_FS_STRUCT_USE_PATH], -[AC_MSG_CHECKING([fs_struct use path structure]) -LB_LINUX_TRY_COMPILE([ - #include - #include - #include -],[ - struct fs_struct fs; - - fs.pwd = *((struct path *)sizeof(fs)); -], [ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_FS_STRUCT_USE_PATH, 1, - [fs_struct use path structure]) -],[ - AC_MSG_RESULT([no]) -]) -]) - # # 2.6.27 # -# LC_SECURITY_PLUG # for SLES10 SP2 (2.6.27) -# check security plug in sles10 sp2 kernel -AC_DEFUN([LC_SECURITY_PLUG], -[AC_MSG_CHECKING([If kernel has security plug support]) -LB_LINUX_TRY_COMPILE([ - #include - #include -],[ - notify_change(NULL, NULL, NULL); -],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_SECURITY_PLUG, 1, - [SLES10 SP2 use extra parameter in vfs]) -],[ - AC_MSG_RESULT(no) -]) -]) - +# 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], [AC_MSG_CHECKING([inode_operations->permission has two args]) LB_LINUX_TRY_COMPILE([ @@ -737,23 +500,6 @@ LB_LINUX_TRY_COMPILE([ ]) ]) -# LC_LOCK_MAP_ACQUIRE -# after 2.6.27 lock_map_acquire replaces lock_acquire -AC_DEFUN([LC_LOCK_MAP_ACQUIRE], -[AC_MSG_CHECKING([if lock_map_acquire is defined]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - lock_map_acquire(NULL); -],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_LOCK_MAP_ACQUIRE, 1, - [lock_map_acquire is defined]) -],[ - AC_MSG_RESULT(no) -]) -]) - # 2.6.27.15-2 sles11 # 2.6.27 sles11 remove the bi_hw_segments @@ -793,16 +539,6 @@ AC_DEFUN([LC_HAVE_QUOTAIO_H], ]) ]) -# 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.32 # 2.6.32 replaces 2 functions blk_queue_max_phys_segments and blk_queue_max_hw_segments by blk_queue_max_segments @@ -855,19 +591,6 @@ EXTRA_KCFLAGS="-I$LINUX/fs" 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 ], - [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])] )]) - # # 2.6.36 fs_struct.lock use spinlock instead of rwlock. # @@ -1604,6 +1327,51 @@ LB_LINUX_TRY_COMPILE([ ]) # +# 3.9 uses hlist_for_each_entry with 3 args +# b67bfe0d42cac56c512dd5da4b1b347a23f4b70a +# +AC_DEFUN([LC_HAVE_HLIST_FOR_EACH_3ARG], +[AC_MSG_CHECKING([if hlist_for_each_entry has 3 args]) +LB_LINUX_TRY_COMPILE([ + #include + #include +],[ + struct inode *inode; + struct dentry *dentry; + hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) { + continue; + } +],[ + AC_DEFINE(HAVE_HLIST_FOR_EACH_3ARG, 1, [3 args]) + AC_MSG_RESULT([yes]) +],[ + AC_MSG_RESULT([no]) +]) +]) + +# +# 3.9 killed f_vfsmnt by +# 182be684784334598eee1d90274e7f7aa0063616 +# replacement is f_path.mnt +# +AC_DEFUN([LC_HAVE_F_PATH_MNT], +[AC_MSG_CHECKING([if struct file has f_path.mnt]) +LB_LINUX_TRY_COMPILE([ + #include +],[ + struct file *fp = NULL; + struct path path; + + path.mnt = fp->f_path.mnt; +],[ + AC_DEFINE(HAVE_F_PATH_MNT,1,[yes]) + AC_MSG_RESULT([yes]) +],[ + AC_MSG_RESULT([no]) +]) +]) + +# # LC_PROG_LINUX # # Lustre linux kernel checks @@ -1617,61 +1385,27 @@ AC_DEFUN([LC_PROG_LINUX], LC_CONFIG_LRU_RESIZE LC_LLITE_LLOOP_MODULE - # RHEL4 patches - LC_EXPORT_TRUNCATE_COMPLETE - LC_EXPORT_NODE_TO_CPUMASK - - LC_BIT_SPINLOCK_H - LC_CAPA_CRYPTO LC_CONFIG_RMTCLIENT LC_CONFIG_GSS - # 2.6.12 - LC_RW_TREE_LOCK - - #2.6.18 + RHEL5 (fc6) - LC_LINUX_FIEMAP_H - - # 2.6.19 - LC_FILE_WRITEV - LC_FILE_READV - # raid5-zerocopy patch LC_PAGE_CONSTANT - # 2.6.22 - LC_INVALIDATE_BDEV_2ARG - LC_FS_RENAME_DOES_D_MOVE - - # 2.6.23 - LC_UNREGISTER_BLKDEV_RETURN_INT - LC_PROCFS_USERS - # 2.6.24 LC_BIO_ENDIO_2ARG LC_PROCFS_DELETED - # 2.6.26 - LC_FS_STRUCT_USE_PATH - # 2.6.27 - LC_SECURITY_PLUG # for SLES10 SP2 - LC_INODE_PERMISION_2ARGS LC_QUOTA_ON_5ARGS LC_QUOTA_OFF_3ARGS - LC_LOCK_MAP_ACQUIRE # 2.6.27.15-2 sles11 LC_BI_HW_SEGMENTS LC_HAVE_QUOTAIO_H - # 2.6.30 - LC_EXPORT_CPUMASK_OF_NODE - # 2.6.32 LC_BLK_QUEUE_MAX_SEGMENTS - LC_SET_CPUS_ALLOWED # 2.6.34 LC_HAVE_DQUOT_FS_DISK_QUOTA @@ -1680,6 +1414,7 @@ AC_DEFUN([LC_PROG_LINUX], # 2.6.35, 3.0.0 LC_FILE_FSYNC LC_EXPORT_SIMPLE_SETATTR + LC_EXPORT_TRUNCATE_COMPLETE_PAGE # 2.6.36 LC_FS_STRUCT_RWLOCK @@ -1709,6 +1444,7 @@ AC_DEFUN([LC_PROG_LINUX], LC_INODE_DIO_WAIT LC_IOP_GET_ACL LC_FILE_LLSEEK_SIZE + LC_INODE_PERMISION_2ARGS # 3.1.1 LC_BLOCKS_FOR_TRUNCATE @@ -1740,6 +1476,11 @@ AC_DEFUN([LC_PROG_LINUX], # 3.7 LC_HAVE_POSIXACL_USER_NS + + # 3.9 + LC_HAVE_HLIST_FOR_EACH_3ARG + LC_HAVE_F_PATH_MNT + # if test x$enable_server = xyes ; then AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server]) @@ -1805,22 +1546,6 @@ if test x$enable_liblustre_acl = xyes ; then AC_DEFINE(LIBLUSTRE_POSIX_ACL, 1, Liblustre Support ACL-enabled MDS) fi -# 2.6.29 blkdev_put has 2 arguments -AC_DEFUN([LC_BLKDEV_PUT_2ARGS], -[AC_MSG_CHECKING([blkdev_put needs 2 parameters]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - blkdev_put(NULL, 0); -],[ - AC_DEFINE(HAVE_BLKDEV_PUT_2ARGS, 1, - [blkdev_put needs 2 paramters]) - AC_MSG_RESULT([yes]) -],[ - AC_MSG_RESULT([no]) -]) -]) - # # --enable-mpitest # @@ -2094,10 +1819,6 @@ if test x$enable_pgstat_track = xyes ; then AC_DEFINE([CONFIG_DEBUG_PAGESTATE_TRACKING], 1, [enable page state tracking code]) fi - - #2.6.29 - LC_BLKDEV_PUT_2ARGS - ]) #