X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fautoconf%2Flustre-core.m4;h=8bd7f6bea579dd51343ef65430cf393fdb4e6f6b;hp=91bf08c59ec1d1f9b08a96d20efaf59f325c2a71;hb=f40891396a460b6b73d2ff9ea55629e4065ef349;hpb=1515e409cc57af5eaef809eee6d8f8d6725d092b diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 91bf08c..8bd7f6b 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -475,10 +475,9 @@ $1 AC_DEFUN([LC_CONST_ACL_SIZE], [AC_MSG_CHECKING([calc acl size]) tmp_flags="$CFLAGS" -CFLAGS="$CFLAGS -I$LINUX/include -I$LINUX_OBJ/include -I$LINUX_OBJ/include2 -I$LINUX/arch/`uname -m|sed -e 's/ppc.*/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include $EXTRA_KCFLAGS" +CFLAGS="$CFLAGS -I$LINUX/include -I$LINUX_OBJ/include -I$LINUX_OBJ/include2 -I$LINUX/arch/`uname -m|sed -e 's/ppc.*/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include -include $AUTOCONF_HDIR/autoconf.h $EXTRA_KCFLAGS" AC_TRY_RUN([ #define __KERNEL__ - #include #include #undef __KERNEL__ // block include @@ -966,22 +965,27 @@ LB_LINUX_TRY_COMPILE([ # # 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 ],[ - 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" ]) # @@ -1152,7 +1156,6 @@ LB_LINUX_TRY_COMPILE([ AC_DEFUN([LC_PAGE_CHECKED], [AC_MSG_CHECKING([kernel has PageChecked and SetPageChecked]) LB_LINUX_TRY_COMPILE([ - #include #ifdef HAVE_LINUX_MMTYPES_H #include #endif @@ -1217,34 +1220,6 @@ LB_LINUX_TRY_COMPILE([ ]) ]) -# 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 - 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], @@ -1362,7 +1337,7 @@ LB_LINUX_TRY_COMPILE([ #include ],[ 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]) @@ -1567,15 +1542,13 @@ LB_LINUX_TRY_COMPILE([ 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 #ifdef HAVE_LINUX_EXPORTFS_H #include -#else - #include #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, @@ -1593,7 +1566,7 @@ LB_LINUX_TRY_COMPILE([ ],[ struct proc_dir_entry pde; - pde.deleted = NULL; + pde.deleted = sizeof(pde); ], [ AC_MSG_RESULT([yes]) AC_DEFINE(HAVE_PROCFS_DELETED, 1, @@ -1647,6 +1620,7 @@ LB_LINUX_TRY_COMPILE([ struct fs_struct fs; fs.pwd = path; + memset(&fs, 0, sizeof(fs)); ], [ AC_MSG_RESULT([yes]) AC_DEFINE(HAVE_FS_STRUCT_USE_PATH, 1, @@ -1656,18 +1630,19 @@ LB_LINUX_TRY_COMPILE([ ]) ]) -# 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 ],[ 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]) ],[ @@ -1809,7 +1784,7 @@ LB_LINUX_TRY_COMPILE([ #include ],[ 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]) @@ -1903,6 +1878,15 @@ AC_DEFUN([LC_EXPORT_ADD_TO_PAGE_CACHE_LRU], # 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]) @@ -1965,6 +1949,23 @@ LB_LINUX_TRY_COMPILE([ ]) ]) +# 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 +],[ + 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], @@ -2039,6 +2040,19 @@ 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])] )]) + # # LC_D_OBTAIN_ALIAS # starting from 2.6.28 kernel replaces d_alloc_anon() with @@ -2059,6 +2073,112 @@ LB_LINUX_TRY_COMPILE([ ]) ]) +# +# 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 +],[ + ((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 +],[ + ((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 + #include + #include +],[ + ((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 +],[ + 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 +],[ + 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 @@ -2143,7 +2263,6 @@ AC_DEFUN([LC_PROG_LINUX], # 2.6.19 LC_INODE_BLKSIZE - LC_VFS_READDIR_U64_INO LC_FILE_WRITEV LC_FILE_READV @@ -2168,9 +2287,9 @@ AC_DEFUN([LC_PROG_LINUX], 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 @@ -2178,7 +2297,7 @@ AC_DEFUN([LC_PROG_LINUX], #2.6.25 LC_MAPPING_CAP_WRITEBACK_DIRTY - + # 2.6.26 LC_FS_STRUCT_USE_PATH @@ -2197,10 +2316,14 @@ AC_DEFUN([LC_PROG_LINUX], 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 @@ -2210,6 +2333,21 @@ AC_DEFUN([LC_PROG_LINUX], 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