4 # Wrapper for AC_CONFIG_SUBDIR
6 AC_DEFUN([LC_CONFIG_SRCDIR],
7 [AC_CONFIG_SRCDIR([lustre/obdclass/obdo.c])
15 # lustre specific paths
17 AC_DEFUN([LC_PATH_DEFAULTS],
18 [# ptlrpc kernel build requires this
26 demodir='$(docdir)/demo'
29 pkgexampledir='${pkgdatadir}/examples'
30 AC_SUBST(pkgexampledir)
36 # is the target os supported?
38 AC_DEFUN([LC_TARGET_SUPPORTED],
50 # LC_CONFIG_OBD_BUFFER_SIZE
52 # the maximum buffer size of lctl ioctls
54 AC_DEFUN([LC_CONFIG_OBD_BUFFER_SIZE],
55 [AC_MSG_CHECKING([maximum OBD ioctl size])
56 AC_ARG_WITH([obd-buffer-size],
57 AC_HELP_STRING([--with-obd-buffer-size=[size]],
58 [set lctl ioctl maximum bytes (default=8192)]),
60 OBD_BUFFER_SIZE=$with_obd_buffer_size
64 AC_MSG_RESULT([$OBD_BUFFER_SIZE bytes])
65 AC_DEFINE_UNQUOTED(OBD_MAX_IOCTL_BUFFER, $OBD_BUFFER_SIZE, [IOCTL Buffer Size])
71 AC_DEFUN([LC_READLINK_SSIZE_T],
72 [AC_MSG_CHECKING([if readlink returns ssize_t])
76 ssize_t readlink(const char *, char *, size_t);
79 AC_DEFINE(HAVE_POSIX_1003_READLINK, 1, [readlink returns ssize_t])
86 # LC_FUNC_DEV_SET_RDONLY
88 # check whether dev_set_rdonly is exported. This is needed until we
89 # have another mechanism to fence IO from the underlying device.
91 AC_DEFUN([LC_FUNC_DEV_SET_RDONLY],
92 [LB_CHECK_SYMBOL_EXPORT([dev_set_rdonly],
93 [block/ll_rw_block.c,block/blk-core.c],[
94 AC_DEFINE(HAVE_DEV_SET_RDONLY, 1, [kernel exports dev_set_rdonly])
96 AC_MSG_WARN([kernel missing dev_set_rdonly patch for testing])
101 # Ensure stack size big than 8k in Lustre server (all kernels)
103 AC_DEFUN([LC_STACK_SIZE],
104 [AC_MSG_CHECKING([stack size big than 8k])
105 LB_LINUX_TRY_COMPILE([
106 #include <linux/thread_info.h>
108 #if THREAD_SIZE < 8192
109 #error "stack size < 8192"
114 AC_MSG_ERROR([Lustre requires that Linux is configured with at least a 8KB stack.])
119 # Allow the user to set the MDS thread upper limit
121 AC_DEFUN([LC_MDS_MAX_THREADS],
123 AC_ARG_WITH([mds_max_threads],
124 AC_HELP_STRING([--with-mds-max-threads=size],
125 [define the maximum number of threads available on the MDS: (default=512)]),
127 MDS_THREAD_COUNT=$with_mds_max_threads
128 AC_DEFINE_UNQUOTED(MDT_MAX_THREADS, $MDS_THREAD_COUNT, [maximum number of mdt threads])
135 # the pinger is temporary, until we have the recovery node in place
137 AC_DEFUN([LC_CONFIG_PINGER],
138 [AC_MSG_CHECKING([whether to enable pinger support])
139 AC_ARG_ENABLE([pinger],
140 AC_HELP_STRING([--disable-pinger],
141 [disable recovery pinger support]),
142 [],[enable_pinger='yes'])
143 AC_MSG_RESULT([$enable_pinger])
144 if test x$enable_pinger != xno ; then
145 AC_DEFINE(ENABLE_PINGER, 1, Use the Pinger)
152 # do checksum of bulk data between client and OST
154 AC_DEFUN([LC_CONFIG_CHECKSUM],
155 [AC_MSG_CHECKING([whether to enable data checksum support])
156 AC_ARG_ENABLE([checksum],
157 AC_HELP_STRING([--disable-checksum],
158 [disable data checksum support]),
159 [],[enable_checksum='yes'])
160 AC_MSG_RESULT([$enable_checksum])
161 if test x$enable_checksum != xno ; then
162 AC_DEFINE(ENABLE_CHECKSUM, 1, do data checksums)
167 # LC_CONFIG_LIBLUSTRE_RECOVERY
169 AC_DEFUN([LC_CONFIG_LIBLUSTRE_RECOVERY],
170 [AC_MSG_CHECKING([whether to enable liblustre recovery support])
171 AC_ARG_ENABLE([liblustre-recovery],
172 AC_HELP_STRING([--disable-liblustre-recovery],
173 [disable liblustre recovery support]),
174 [],[enable_liblustre_recovery='yes'])
175 AC_MSG_RESULT([$enable_liblustre_recovery])
176 if test x$enable_liblustre_recovery != xno ; then
177 AC_DEFINE(ENABLE_LIBLUSTRE_RECOVERY, 1, Liblustre Can Recover)
182 # LC_CONFIG_HEALTH_CHECK_WRITE
184 # Turn off the actual write to the disk
186 AC_DEFUN([LC_CONFIG_HEALTH_CHECK_WRITE],
187 [AC_MSG_CHECKING([whether to enable a write with the health check])
188 AC_ARG_ENABLE([health_write],
189 AC_HELP_STRING([--enable-health_write],
190 [enable disk writes when doing health check]),
191 [],[enable_health_write='no'])
192 AC_MSG_RESULT([$enable_health_write])
193 if test x$enable_health_write != xno ; then
194 AC_DEFINE(USE_HEALTH_CHECK_WRITE, 1, Write when Checking Health)
198 AC_DEFUN([LC_CONFIG_LRU_RESIZE],
199 [AC_MSG_CHECKING([whether to enable lru self-adjusting])
200 AC_ARG_ENABLE([lru_resize],
201 AC_HELP_STRING([--enable-lru-resize],
202 [enable lru resize support]),
203 [],[enable_lru_resize='yes'])
204 AC_MSG_RESULT([$enable_lru_resize])
205 if test x$enable_lru_resize != xno; then
206 AC_DEFINE(HAVE_LRU_RESIZE_SUPPORT, 1, [Enable lru resize support])
211 # Quota support. The kernel must support CONFIG_QUOTA.
213 AC_DEFUN([LC_QUOTA_CONFIG],
214 [LB_LINUX_CONFIG_IM([QUOTA],[AC_DEFINE(HAVE_QUOTA_SUPPORT, 1, [support quota])],[
215 AC_MSG_ERROR([Lustre quota requires that CONFIG_QUOTA is enabled in your kernel.])
219 # truncate_complete_page() was exported from RHEL5/SLES10, but not in SLES11 SP0 (2.6.27)
220 # remove_from_page_cache() was exported between 2.6.35 and 2.6.38
221 # delete_from_page_cache() is exported from 2.6.39
222 AC_DEFUN([LC_EXPORT_TRUNCATE_COMPLETE],
223 [LB_CHECK_SYMBOL_EXPORT([truncate_complete_page],
225 [AC_DEFINE(HAVE_TRUNCATE_COMPLETE_PAGE, 1,
226 [kernel export truncate_complete_page])])
227 LB_CHECK_SYMBOL_EXPORT([remove_from_page_cache],
229 [AC_DEFINE(HAVE_REMOVE_FROM_PAGE_CACHE, 1,
230 [kernel export remove_from_page_cache])])
231 LB_CHECK_SYMBOL_EXPORT([delete_from_page_cache],
233 [AC_DEFINE(HAVE_DELETE_FROM_PAGE_CACHE, 1,
234 [kernel export delete_from_page_cache])])
237 AC_DEFUN([LC_EXPORT_D_REHASH_COND],
238 [LB_CHECK_SYMBOL_EXPORT([d_rehash_cond],
240 AC_DEFINE(HAVE_D_REHASH_COND, 1,
241 [d_rehash_cond is exported by the kernel])
246 AC_DEFUN([LC_EXPORT___D_REHASH],
247 [LB_CHECK_SYMBOL_EXPORT([__d_rehash],
249 AC_DEFINE(HAVE___D_REHASH, 1,
250 [__d_rehash is exported by the kernel])
255 # The actual symbol exported varies among architectures, so we need
256 # to check many symbols (but only in the current architecture.) No
257 # matter what symbol is exported, the kernel #defines node_to_cpumask
258 # to the appropriate function and that's what we use.
259 AC_DEFUN([LC_EXPORT_NODE_TO_CPUMASK],
260 [LB_CHECK_SYMBOL_EXPORT([node_to_cpumask],
261 [arch/$LINUX_ARCH/mm/numa.c],
262 [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1,
263 [node_to_cpumask is exported by
264 the kernel])]) # x86_64
265 LB_CHECK_SYMBOL_EXPORT([node_to_cpu_mask],
266 [arch/$LINUX_ARCH/kernel/smpboot.c],
267 [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1,
268 [node_to_cpumask is exported by
269 the kernel])]) # ia64
270 LB_CHECK_SYMBOL_EXPORT([node_2_cpu_mask],
271 [arch/$LINUX_ARCH/kernel/smpboot.c],
272 [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1,
273 [node_to_cpumask is exported by
274 the kernel])]) # i386
279 # between 2.6.5 - 2.6.22 filemap_populate is exported in some kernels
281 AC_DEFUN([LC_FILEMAP_POPULATE],
282 [AC_MSG_CHECKING([for exported filemap_populate])
283 LB_LINUX_TRY_COMPILE([
284 #include <asm/page.h>
285 #include <linux/mm.h>
287 filemap_populate(NULL, 0, 0, __pgprot(0), 0, 0);
290 AC_DEFINE(HAVE_FILEMAP_POPULATE, 1, [Kernel exports filemap_populate])
299 AC_DEFUN([LC_BIT_SPINLOCK_H],
300 [LB_CHECK_FILE([$LINUX/include/linux/bit_spinlock.h],[
301 AC_MSG_CHECKING([if bit_spinlock.h can be compiled])
302 LB_LINUX_TRY_COMPILE([
303 #include <asm/processor.h>
304 #include <linux/spinlock.h>
305 #include <linux/bit_spinlock.h>
308 AC_DEFINE(HAVE_BIT_SPINLOCK_H, 1, [Kernel has bit_spinlock.h])
319 AC_DEFUN([LC_CONST_ACL_SIZE],
320 [AC_MSG_CHECKING([calc acl size])
322 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"
325 #include <linux/types.h>
328 #define __LINUX_POSIX_ACL_H
330 #ifdef CONFIG_FS_POSIX_ACL
331 # include <linux/posix_acl_xattr.h>
338 /* LUSTRE_POSIX_ACL_MAX_ENTRIES = 32 */
339 int size = posix_acl_xattr_size(32);
340 FILE *f = fopen("acl.size","w+");
341 fprintf(f,"%d", size);
347 acl_size=`cat acl.size`
348 AC_MSG_RESULT([ACL size $acl_size])
349 AC_DEFINE_UNQUOTED(XATTR_ACL_SIZE, AS_TR_SH([$acl_size]), [size of xattr acl])
351 AC_ERROR([ACL size can't be computed])
353 AC_MSG_RESULT([can't check ACL size, make it 260])
354 AC_DEFINE_UNQUOTED(XATTR_ACL_SIZE,260)
362 AC_DEFUN([LC_CAPA_CRYPTO],
363 [LB_LINUX_CONFIG_IM([CRYPTO],[],[
364 AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO is enabled in your kernel.])
366 LB_LINUX_CONFIG_IM([CRYPTO_HMAC],[],[
367 AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_HMAC is enabled in your kernel.])
369 LB_LINUX_CONFIG_IM([CRYPTO_SHA1],[],[
370 AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_SHA1 is enabled in your kernel.])
375 # LC_CONFIG_RMTCLIENT
378 dnl the AES symbol usually tied with arch, e.g. CRYPTO_AES_586
380 AC_DEFUN([LC_CONFIG_RMTCLIENT],
381 [LB_LINUX_CONFIG_IM([CRYPTO_AES],[],[
382 AC_MSG_WARN([Lustre remote client require that CONFIG_CRYPTO_AES is enabled in your kernel.])
387 # LC_CONFIG_GSS_KEYRING (default enabled, if gss is enabled)
389 AC_DEFUN([LC_CONFIG_GSS_KEYRING],
390 [AC_MSG_CHECKING([whether to enable gss keyring backend])
391 AC_ARG_ENABLE([gss_keyring],
392 [AC_HELP_STRING([--disable-gss-keyring],
393 [disable gss keyring backend])],
394 [],[enable_gss_keyring='yes'])
395 AC_MSG_RESULT([$enable_gss_keyring])
397 if test x$enable_gss_keyring != xno; then
398 LB_LINUX_CONFIG_IM([KEYS],[],
399 [AC_MSG_ERROR([GSS keyring backend require that CONFIG_KEYS be enabled in your kernel.])])
401 AC_CHECK_LIB([keyutils], [keyctl_search], [],
402 [AC_MSG_ERROR([libkeyutils is not found, which is required by gss keyring backend])],)
404 AC_DEFINE([HAVE_GSS_KEYRING], [1],
405 [Define this if you enable gss keyring backend])
409 AC_DEFUN([LC_CONFIG_SUNRPC],
410 [LB_LINUX_CONFIG_IM([SUNRPC],[],
411 [AC_MSG_ERROR([kernel SUNRPC support is required by using GSS.])])
415 # LC_CONFIG_GSS (default disabled)
417 # Build gss and related tools of Lustre. Currently both kernel and user space
418 # parts are depend on linux platform.
420 AC_DEFUN([LC_CONFIG_GSS],
421 [AC_MSG_CHECKING([whether to enable gss/krb5 support])
423 [AC_HELP_STRING([--enable-gss], [enable gss/krb5 support])],
424 [],[enable_gss='no'])
425 AC_MSG_RESULT([$enable_gss])
427 if test x$enable_gss == xyes; then
428 LC_CONFIG_GSS_KEYRING
431 AC_DEFINE([HAVE_GSS], [1], [Define this if you enable gss])
433 LB_LINUX_CONFIG_IM([CRYPTO_MD5],[],
434 [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
435 LB_LINUX_CONFIG_IM([CRYPTO_SHA1],[],
436 [AC_MSG_WARN([kernel SHA1 support is recommended by using GSS.])])
437 LB_LINUX_CONFIG_IM([CRYPTO_SHA256],[],
438 [AC_MSG_WARN([kernel SHA256 support is recommended by using GSS.])])
439 LB_LINUX_CONFIG_IM([CRYPTO_SHA512],[],
440 [AC_MSG_WARN([kernel SHA512 support is recommended by using GSS.])])
442 AC_CHECK_LIB([gssapi], [gss_init_sec_context],
443 [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi"],
444 [AC_CHECK_LIB([gssglue], [gss_init_sec_context],
445 [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssglue"],
446 [AC_MSG_ERROR([libgssapi or libgssglue is not found, which is required by GSS.])])],)
448 AC_SUBST(GSSAPI_LIBS)
454 AC_DEFUN([LC_TASK_CLENV_STORE],
456 AC_MSG_CHECKING([if we can store cl_env in task_struct])
457 if test x$have_task_clenv_store != xyes ; then
458 LC_TASK_CLENV_TUX_INFO
464 # ~2.6.12 merge patch from oracle to convert tree_lock from spinlock to rwlock
465 AC_DEFUN([LC_RW_TREE_LOCK],
466 [AC_MSG_CHECKING([if kernel has tree_lock as rwlock])
467 tmp_flags="$EXTRA_KCFLAGS"
468 EXTRA_KCFLAGS="-Werror"
469 LB_LINUX_TRY_COMPILE([
470 #include <linux/fs.h>
472 struct address_space a;
474 write_lock(&a.tree_lock);
477 AC_DEFINE(HAVE_RW_TREE_LOCK, 1, [kernel has tree_lock as rw_lock])
481 EXTRA_KCFLAGS="$tmp_flags"
487 # after 2.6.15 inode have i_mutex intead of i_sem
488 AC_DEFUN([LC_INODE_I_MUTEX],
489 [AC_MSG_CHECKING([if inode has i_mutex ])
490 LB_LINUX_TRY_COMPILE([
491 #include <linux/mutex.h>
492 #include <linux/fs.h>
497 mutex_unlock(&i.i_mutex);
500 AC_DEFINE(HAVE_INODE_I_MUTEX, 1,
501 [after 2.6.15 inode have i_mutex intead of i_sem])
509 # LC_SECURITY_PLUG # for SLES10 SP2
510 # check security plug in sles10 sp2 kernel
511 AC_DEFUN([LC_SECURITY_PLUG],
512 [AC_MSG_CHECKING([If kernel has security plug support])
513 LB_LINUX_TRY_COMPILE([
514 #include <linux/fs.h>
515 #include <linux/stddef.h>
517 notify_change(NULL, NULL, NULL);
520 AC_DEFINE(HAVE_SECURITY_PLUG, 1,
521 [SLES10 SP2 use extra parameter in vfs])
529 # inode have i_private field since 2.6.17
530 AC_DEFUN([LC_INODE_IPRIVATE],
531 [AC_MSG_CHECKING([if inode has a i_private field])
532 LB_LINUX_TRY_COMPILE([
533 #include <linux/fs.h>
539 AC_DEFINE(HAVE_INODE_IPRIVATE, 1,
540 [struct inode has i_private field])
547 # after 2.6.17 dquote use mutex instead if semaphore
548 AC_DEFUN([LC_DQUOTOFF_MUTEX],
549 [AC_MSG_CHECKING([use dqonoff_mutex])
550 LB_LINUX_TRY_COMPILE([
551 #include <linux/mutex.h>
552 #include <linux/fs.h>
553 #include <linux/quota.h>
555 struct quota_info dq;
557 mutex_unlock(&dq.dqonoff_mutex);
560 AC_DEFINE(HAVE_DQUOTOFF_MUTEX, 1,
561 [after 2.6.17 dquote use mutex instead if semaphore])
570 # 2.6.18 don't export nr_pagecahe
571 AC_DEFUN([LC_NR_PAGECACHE],
572 [AC_MSG_CHECKING([kernel export nr_pagecache])
573 LB_LINUX_TRY_COMPILE([
574 #include <linux/pagemap.h>
576 return atomic_read(&nr_pagecache);
579 AC_DEFINE(HAVE_NR_PAGECACHE, 1,
580 [is kernel export nr_pagecache])
587 # LC_STATFS_DENTRY_PARAM
588 # starting from 2.6.18 linux kernel uses dentry instead of super_block
589 # for the first parameter of the super_operations->statfs() callback.
592 AC_DEFUN([LC_STATFS_DENTRY_PARAM],
593 [AC_MSG_CHECKING([if super_ops.statfs() first parameter is dentry])
594 tmp_flags="$EXTRA_KCFLAGS"
595 EXTRA_KCFLAGS="-Werror"
596 LB_LINUX_TRY_COMPILE([
597 #include <linux/fs.h>
599 ((struct super_operations *)0)->statfs((struct dentry *)0, (struct kstatfs*)0);
601 AC_DEFINE(HAVE_STATFS_DENTRY_PARAM, 1,
602 [super_ops.statfs() first parameter is dentry])
607 EXTRA_KCFLAGS="$tmp_flags"
610 # LC_UMOUNTBEGIN_HAS_VFSMOUNT
611 # 2.6.18~2.6.25 umount_begin has different parameters
612 AC_DEFUN([LC_UMOUNTBEGIN_HAS_VFSMOUNT],
613 [AC_MSG_CHECKING([if umount_begin needs vfsmount parameter instead of super_block])
614 tmp_flags="$EXTRA_KCFLAGS"
615 EXTRA_KCFLAGS="-Werror"
616 LB_LINUX_TRY_COMPILE([
617 #include <linux/fs.h>
620 static void cfg_umount_begin (struct vfsmount *v, int flags)
625 static struct super_operations cfg_super_operations = {
626 .umount_begin = cfg_umount_begin,
629 cfg_super_operations.umount_begin(NULL,0);
632 AC_DEFINE(HAVE_UMOUNTBEGIN_VFSMOUNT, 1,
633 [Define umount_begin need second argument])
637 EXTRA_KCFLAGS="$tmp_flags"
641 # starting from 2.6.18 the file_operations .flush
642 # method has a new "fl_owner_t id" parameter
644 AC_DEFUN([LC_FLUSH_OWNER_ID],
645 [AC_MSG_CHECKING([if file_operations .flush has an fl_owner_t id])
646 LB_LINUX_TRY_COMPILE([
647 #include <linux/fs.h>
649 struct file_operations *fops = NULL;
650 fl_owner_t id = NULL;
653 i = fops->flush(NULL, id);
655 AC_DEFINE(HAVE_FLUSH_OWNER_ID, 1,
656 [file_operations .flush method has an fl_owner_t id])
664 # LC_EXPORT_INVALIDATE_MAPPING_PAGES
666 # SLES9, RHEL4, RHEL5, vanilla 2.6.24 export invalidate_mapping_pages() but
667 # SLES10 2.6.16 does not, for some reason. For filter cache invalidation.
669 AC_DEFUN([LC_EXPORT_INVALIDATE_MAPPING_PAGES],
670 [LB_CHECK_SYMBOL_EXPORT([invalidate_mapping_pages], [mm/truncate.c], [
671 AC_DEFINE(HAVE_INVALIDATE_MAPPING_PAGES, 1,
672 [exported invalidate_mapping_pages])],
673 [LB_CHECK_SYMBOL_EXPORT([invalidate_inode_pages], [mm/truncate.c], [
674 AC_DEFINE(HAVE_INVALIDATE_INODE_PAGES, 1,
675 [exported invalidate_inode_pages])], [
676 AC_MSG_ERROR([no way to invalidate pages])
681 #2.6.18 + RHEL5 (fc6)
683 # RHEL5 in FS-cache patch rename PG_checked flag into PG_fs_misc
684 AC_DEFUN([LC_PG_FS_MISC],
685 [AC_MSG_CHECKING([kernel has PG_fs_misc])
686 LB_LINUX_TRY_COMPILE([
687 #include <linux/mm.h>
688 #include <linux/page-flags.h>
691 #error PG_fs_misc not defined in kernel
695 AC_DEFINE(HAVE_PG_FS_MISC, 1,
696 [is kernel have PG_fs_misc])
702 # RHEL5 PageChecked and SetPageChecked defined
703 AC_DEFUN([LC_PAGE_CHECKED],
704 [AC_MSG_CHECKING([kernel has PageChecked and SetPageChecked])
705 LB_LINUX_TRY_COMPILE([
706 #include <linux/mm.h>
707 #ifdef HAVE_LINUX_MMTYPES_H
708 #include <linux/mm_types.h>
710 #include <linux/page-flags.h>
712 struct page *p = NULL;
714 /* before 2.6.26 this define*/
716 /* 2.6.26 use function instead of define for it */
722 AC_DEFINE(HAVE_PAGE_CHECKED, 1,
723 [does kernel have PageChecked and SetPageChecked])
732 # If we have fiemap.h
733 # after 2.6.27 use fiemap.h in include/linux
735 AC_DEFUN([LC_LINUX_FIEMAP_H],
736 [LB_CHECK_FILE([$LINUX/include/linux/fiemap.h],[
737 AC_MSG_CHECKING([if fiemap.h can be compiled])
738 LB_LINUX_TRY_COMPILE([
739 #include <linux/types.h>
740 #include <linux/fiemap.h>
743 AC_DEFINE(HAVE_LINUX_FIEMAP_H, 1, [Kernel has fiemap.h])
754 # inode don't have i_blksize field
755 AC_DEFUN([LC_INODE_BLKSIZE],
756 [AC_MSG_CHECKING([inode has i_blksize field])
757 LB_LINUX_TRY_COMPILE([
758 #include <linux/fs.h>
764 AC_DEFINE(HAVE_INODE_BLKSIZE, 1,
765 [struct inode has i_blksize field])
772 # 2.6.19 replaced writev with aio_write
773 AC_DEFUN([LC_FILE_WRITEV],
774 [AC_MSG_CHECKING([writev in fops])
775 LB_LINUX_TRY_COMPILE([
776 #include <linux/fs.h>
778 struct file_operations *fops = NULL;
782 AC_DEFINE(HAVE_FILE_WRITEV, 1,
790 # 2.6.19 replaced readv with aio_read
791 AC_DEFUN([LC_FILE_READV],
792 [AC_MSG_CHECKING([readv in fops])
793 LB_LINUX_TRY_COMPILE([
794 #include <linux/fs.h>
796 struct file_operations *fops = NULL;
800 AC_DEFINE(HAVE_FILE_READV, 1,
809 # LC_CANCEL_DIRTY_PAGE
810 # 2.6.20 introduced cancel_dirty_page instead of clear_page_dirty.
811 AC_DEFUN([LC_CANCEL_DIRTY_PAGE],
812 [AC_MSG_CHECKING([kernel has cancel_dirty_page])
813 # the implementation of cancel_dirty_page in OFED 1.4.1's SLES10 SP2
814 # backport is broken, so ignore it
815 if test -f $OFED_BACKPORT_PATH/linux/mm.h &&
816 test "$(sed -ne '/^static inline void cancel_dirty_page(struct page \*page, unsigned int account_size)$/,/^}$/p' $OFED_BACKPORT_PATH/linux/mm.h | md5sum)" = "c518cb32d6394760c5bca14cb7538d3e -"; then
819 LB_LINUX_TRY_COMPILE([
820 #include <linux/mm.h>
821 #include <linux/page-flags.h>
823 cancel_dirty_page(NULL, 0);
826 AC_DEFINE(HAVE_CANCEL_DIRTY_PAGE, 1,
827 [kernel has cancel_dirty_page instead of clear_page_dirty])
834 # raid5-zerocopy patch
839 # In order to support raid5 zerocopy patch, we have to patch the kernel to make
840 # it support constant page, which means the page won't be modified during the
843 AC_DEFUN([LC_PAGE_CONSTANT],
844 [AC_MSG_CHECKING([if kernel have PageConstant defined])
845 LB_LINUX_TRY_COMPILE([
846 #include <linux/mm.h>
847 #include <linux/page-flags.h>
850 #error "Have no raid5 zcopy patch"
854 AC_DEFINE(HAVE_PAGE_CONSTANT, 1, [kernel have PageConstant supported])
862 # 2.6.22 lost second parameter for invalidate_bdev
863 AC_DEFUN([LC_INVALIDATE_BDEV_2ARG],
864 [AC_MSG_CHECKING([if invalidate_bdev has second argument])
865 LB_LINUX_TRY_COMPILE([
866 #include <linux/buffer_head.h>
868 invalidate_bdev(NULL,0);
871 AC_DEFINE(HAVE_INVALIDATE_BDEV_2ARG, 1,
872 [invalidate_bdev has second argument])
879 # check for crypto API
881 AC_DEFUN([LC_ASYNC_BLOCK_CIPHER],
882 [AC_MSG_CHECKING([if kernel has block cipher support])
883 LB_LINUX_TRY_COMPILE([
884 #include <linux/err.h>
885 #include <linux/crypto.h>
887 struct crypto_blkcipher *tfm;
888 tfm = crypto_alloc_blkcipher("aes", 0, sizeof(tfm) );
891 AC_DEFINE(HAVE_ASYNC_BLOCK_CIPHER, 1, [kernel has block cipher support])
898 # check for struct hash_desc
900 AC_DEFUN([LC_STRUCT_HASH_DESC],
901 [AC_MSG_CHECKING([if kernel has struct hash_desc])
902 LB_LINUX_TRY_COMPILE([
903 #include <linux/err.h>
904 #include <linux/crypto.h>
906 struct hash_desc foo __attribute__ ((unused));
909 AC_DEFINE(HAVE_STRUCT_HASH_DESC, 1, [kernel has struct hash_desc])
916 # check for struct blkcipher_desc
918 AC_DEFUN([LC_STRUCT_BLKCIPHER_DESC],
919 [AC_MSG_CHECKING([if kernel has struct blkcipher_desc])
920 LB_LINUX_TRY_COMPILE([
921 #include <linux/err.h>
922 #include <linux/crypto.h>
924 struct blkcipher_desc foo __attribute__ ((unused));
927 AC_DEFINE(HAVE_STRUCT_BLKCIPHER_DESC, 1, [kernel has struct blkcipher_desc])
934 # 2.6.19 check for FS_RENAME_DOES_D_MOVE flag
936 AC_DEFUN([LC_FS_RENAME_DOES_D_MOVE],
937 [AC_MSG_CHECKING([if kernel has FS_RENAME_DOES_D_MOVE flag])
938 LB_LINUX_TRY_COMPILE([
939 #include <linux/fs.h>
941 int v __attribute__ ((unused));
942 v = FS_RENAME_DOES_D_MOVE;
945 AC_DEFINE(HAVE_FS_RENAME_DOES_D_MOVE, 1, [kernel has FS_RENAME_DOES_D_MOVE flag])
953 # 2.6.23 have return type 'void' for unregister_blkdev
954 AC_DEFUN([LC_UNREGISTER_BLKDEV_RETURN_INT],
955 [AC_MSG_CHECKING([if unregister_blkdev return int])
956 LB_LINUX_TRY_COMPILE([
957 #include <linux/fs.h>
959 int i __attribute__ ((unused));
960 i = unregister_blkdev(0,NULL);
963 AC_DEFINE(HAVE_UNREGISTER_BLKDEV_RETURN_INT, 1,
964 [unregister_blkdev return int])
970 # 2.6.23 change .sendfile to .splice_read
971 AC_DEFUN([LC_KERNEL_SPLICE_READ],
972 [AC_MSG_CHECKING([if kernel has .splice_read])
973 LB_LINUX_TRY_COMPILE([
974 #include <linux/fs.h>
976 struct file_operations file;
978 file.splice_read = NULL;
981 AC_DEFINE(HAVE_KERNEL_SPLICE_READ, 1,
982 [kernel has .slice_read])
988 # 2.6.23 change .sendfile to .splice_read
989 # RHEL4 (-92 kernel) have both sendfile and .splice_read API
990 AC_DEFUN([LC_KERNEL_SENDFILE],
991 [AC_MSG_CHECKING([if kernel has .sendfile])
992 LB_LINUX_TRY_COMPILE([
993 #include <linux/fs.h>
995 struct file_operations file;
997 file.sendfile = NULL;
1000 AC_DEFINE(HAVE_KERNEL_SENDFILE, 1,
1001 [kernel has .sendfile])
1007 # 2.6.23 extract nfs export related data into exportfs.h
1008 AC_DEFUN([LC_HAVE_EXPORTFS_H],
1009 [LB_CHECK_FILE([$LINUX/include/linux/exportfs.h], [
1010 AC_DEFINE(HAVE_LINUX_EXPORTFS_H, 1,
1011 [kernel has include/exportfs.h])
1017 # 2.6.23 has new page fault handling API
1018 AC_DEFUN([LC_VM_OP_FAULT],
1019 [AC_MSG_CHECKING([kernel has .fault in vm_operation_struct])
1020 LB_LINUX_TRY_COMPILE([
1021 #include <linux/mm.h>
1023 struct vm_operations_struct op;
1027 AC_MSG_RESULT([yes])
1028 AC_DEFINE(HAVE_VM_OP_FAULT, 1,
1029 [kernel has .fault in vm_operation_struct])
1035 # 2.6.23 add code to wait other users to complete before removing procfs entry
1036 AC_DEFUN([LC_PROCFS_USERS],
1037 [AC_MSG_CHECKING([if kernel has pde_users member in procfs entry struct])
1038 LB_LINUX_TRY_COMPILE([
1039 #include <linux/proc_fs.h>
1041 struct proc_dir_entry pde;
1045 AC_MSG_RESULT([yes])
1046 AC_DEFINE(HAVE_PROCFS_USERS, 1,
1047 [kernel has pde_users member in procfs entry struct])
1053 # 2.6.23 exports exportfs_decode_fh
1054 AC_DEFUN([LC_EXPORTFS_DECODE_FH],
1055 [LB_CHECK_SYMBOL_EXPORT([exportfs_decode_fh],
1056 [fs/exportfs/expfs.c],[
1057 AC_DEFINE(HAVE_EXPORTFS_DECODE_FH, 1,
1058 [exportfs_decode_fh has been export])
1065 # 2.6.24 need linux/mm_types.h included
1066 AC_DEFUN([LC_HAVE_MMTYPES_H],
1067 [LB_CHECK_FILE([$LINUX/include/linux/mm_types.h], [
1068 AC_DEFINE(HAVE_LINUX_MMTYPES_H, 1,
1069 [kernel has include/mm_types.h])
1075 # 2.6.24 has bio_endio with 2 args
1076 AC_DEFUN([LC_BIO_ENDIO_2ARG],
1077 [AC_MSG_CHECKING([if kernel has bio_endio with 2 args])
1078 LB_LINUX_TRY_COMPILE([
1079 #include <linux/bio.h>
1083 AC_MSG_RESULT([yes])
1084 AC_DEFINE(HAVE_BIO_ENDIO_2ARG, 1,
1085 [kernel has bio_endio with 2 args])
1091 # 2.6.24 has new members in exports struct.
1092 AC_DEFUN([LC_FH_TO_DENTRY],
1093 [AC_MSG_CHECKING([if kernel has .fh_to_dentry member in export_operations struct])
1094 LB_LINUX_TRY_COMPILE([
1095 #include <linux/fs.h>
1096 #ifdef HAVE_LINUX_EXPORTFS_H
1097 #include <linux/exportfs.h>
1100 do{ }while(sizeof(((struct export_operations *)0)->fh_to_dentry));
1102 AC_MSG_RESULT([yes])
1103 AC_DEFINE(HAVE_FH_TO_DENTRY, 1,
1104 [kernel has .fh_to_dentry member in export_operations struct])
1110 # 2.6.24 removes long aged procfs entry -> deleted member
1111 AC_DEFUN([LC_PROCFS_DELETED],
1112 [AC_MSG_CHECKING([if kernel has deleted member in procfs entry struct])
1113 LB_LINUX_TRY_COMPILE([
1114 #include <linux/proc_fs.h>
1116 struct proc_dir_entry pde;
1118 pde.deleted = sizeof(pde);
1120 AC_MSG_RESULT([yes])
1121 AC_DEFINE(HAVE_PROCFS_DELETED, 1,
1122 [kernel has deleted member in procfs entry struct])
1128 # 2.6.24 has bdi_init()/bdi_destroy() functions.
1129 AC_DEFUN([LC_EXPORT_BDI_INIT],
1130 [LB_CHECK_SYMBOL_EXPORT([bdi_init],
1131 [mm/backing-dev.c],[
1132 AC_DEFINE(HAVE_BDI_INIT, 1,
1133 [bdi_init/bdi_destroy functions are present])
1140 # 2.6.26 isn't export set_fs_pwd and change paramter in fs struct
1141 AC_DEFUN([LC_FS_STRUCT_USE_PATH],
1142 [AC_MSG_CHECKING([fs_struct use path structure])
1143 LB_LINUX_TRY_COMPILE([
1144 #include <asm/atomic.h>
1145 #include <linux/spinlock.h>
1146 #include <linux/fs_struct.h>
1148 struct fs_struct fs;
1150 fs.pwd = *((struct path *)sizeof(fs));
1152 AC_MSG_RESULT([yes])
1153 AC_DEFINE(HAVE_FS_STRUCT_USE_PATH, 1,
1154 [fs_struct use path structure])
1164 AC_DEFUN([LC_PGMKWRITE_USE_VMFAULT],
1165 [AC_MSG_CHECKING([kernel .page_mkwrite uses struct vm_fault *])
1166 tmp_flags="$EXTRA_KCFLAGS"
1167 EXTRA_KCFLAGS="-Werror"
1168 LB_LINUX_TRY_COMPILE([
1169 #include <linux/mm.h>
1171 ((struct vm_operations_struct *)0)->page_mkwrite((struct vm_area_struct *)0, (struct vm_fault *)0);
1173 AC_MSG_RESULT([yes])
1174 AC_DEFINE(HAVE_PGMKWRITE_USE_VMFAULT, 1,
1175 [kernel vm_operation_struct.page_mkwrite uses struct vm_fault * as second parameter])
1179 EXTRA_KCFLAGS="$tmp_flags"
1182 AC_DEFUN([LC_INODE_PERMISION_2ARGS],
1183 [AC_MSG_CHECKING([inode_operations->permission has two args])
1184 LB_LINUX_TRY_COMPILE([
1185 #include <linux/fs.h>
1187 struct inode *inode __attribute__ ((unused));
1190 inode->i_op->permission(NULL, 0);
1192 AC_DEFINE(HAVE_INODE_PERMISION_2ARGS, 1,
1193 [inode_operations->permission has two args])
1194 AC_MSG_RESULT([yes])
1200 # 2.6.27 has file_remove_suid instead of remove_suid
1201 AC_DEFUN([LC_FILE_REMOVE_SUID],
1202 [AC_MSG_CHECKING([kernel has file_remove_suid])
1203 LB_LINUX_TRY_COMPILE([
1204 #include <linux/fs.h>
1206 file_remove_suid(NULL);
1208 AC_DEFINE(HAVE_FILE_REMOVE_SUID, 1,
1209 [kernel have file_remove_suid])
1210 AC_MSG_RESULT([yes])
1216 # 2.6.27 have new page locking API
1217 AC_DEFUN([LC_TRYLOCKPAGE],
1218 [AC_MSG_CHECKING([kernel uses trylock_page for page lock])
1219 LB_LINUX_TRY_COMPILE([
1220 #include <linux/pagemap.h>
1224 AC_DEFINE(HAVE_TRYLOCK_PAGE, 1,
1225 [kernel uses trylock_page for page lock])
1226 AC_MSG_RESULT([yes])
1232 # 2.6.27 removed the read_inode from super_operations.
1233 AC_DEFUN([LC_READ_INODE_IN_SBOPS],
1234 [AC_MSG_CHECKING([super_operations has a read_inode field])
1235 LB_LINUX_TRY_COMPILE([
1236 #include <linux/fs.h>
1238 struct super_operations *sop;
1239 sop->read_inode(NULL);
1241 AC_DEFINE(HAVE_READ_INODE_IN_SBOPS, 1,
1242 [super_operations has a read_inode])
1243 AC_MSG_RESULT([yes])
1249 # 2.6.27 has inode_permission instead of permisson
1250 AC_DEFUN([LC_EXPORT_INODE_PERMISSION],
1251 [LB_CHECK_SYMBOL_EXPORT([inode_permission],
1253 AC_DEFINE(HAVE_EXPORT_INODE_PERMISSION, 1,
1254 [inode_permission is exported by the kernel])
1259 # 2.6.27 use 5th parameter in quota_on for remount.
1260 AC_DEFUN([LC_QUOTA_ON_5ARGS],
1261 [AC_MSG_CHECKING([quota_on needs 5 parameters])
1262 LB_LINUX_TRY_COMPILE([
1263 #include <linux/fs.h>
1264 #include <linux/quota.h>
1266 struct quotactl_ops *qop = NULL;
1267 qop->quota_on(NULL, 0, 0, NULL, 0);
1269 AC_DEFINE(HAVE_QUOTA_ON_5ARGS, 1,
1270 [quota_on needs 5 paramters])
1271 AC_MSG_RESULT([yes])
1277 # 2.6.27 use 3th parameter in quota_off for remount.
1278 AC_DEFUN([LC_QUOTA_OFF_3ARGS],
1279 [AC_MSG_CHECKING([quota_off needs 3 parameters])
1280 LB_LINUX_TRY_COMPILE([
1281 #include <linux/fs.h>
1282 #include <linux/quota.h>
1284 struct quotactl_ops *qop = NULL;
1285 qop->quota_off(NULL, 0, 0);
1287 AC_DEFINE(HAVE_QUOTA_OFF_3ARGS, 1,
1288 [quota_off needs 3 paramters])
1289 AC_MSG_RESULT([yes])
1295 # 2.6.27 has vfs_dq_off inline function.
1296 AC_DEFUN([LC_VFS_DQ_OFF],
1297 [AC_MSG_CHECKING([vfs_dq_off is defined])
1298 LB_LINUX_TRY_COMPILE([
1299 #include <linux/quotaops.h>
1301 vfs_dq_off(NULL, 0);
1303 AC_DEFINE(HAVE_VFS_DQ_OFF, 1, [vfs_dq_off is defined])
1304 AC_MSG_RESULT([yes])
1310 # LC_LOCK_MAP_ACQUIRE
1311 # after 2.6.27 lock_map_acquire replaces lock_acquire
1312 AC_DEFUN([LC_LOCK_MAP_ACQUIRE],
1313 [AC_MSG_CHECKING([if lock_map_acquire is defined])
1314 LB_LINUX_TRY_COMPILE([
1315 #include <linux/lockdep.h>
1317 lock_map_acquire(NULL);
1320 AC_DEFINE(HAVE_LOCK_MAP_ACQUIRE, 1,
1321 [lock_map_acquire is defined])
1327 # 2.6.27.15-2 sles11
1329 # 2.6.27 sles11 remove the bi_hw_segments
1330 AC_DEFUN([LC_BI_HW_SEGMENTS],
1331 [AC_MSG_CHECKING([struct bio has a bi_hw_segments field])
1332 LB_LINUX_TRY_COMPILE([
1333 #include <linux/bio.h>
1336 io.bi_hw_segments = sizeof(io);
1338 AC_DEFINE(HAVE_BI_HW_SEGMENTS, 1,
1339 [struct bio has a bi_hw_segments field])
1340 AC_MSG_RESULT([yes])
1347 # 2.6.27 sles11 move the quotaio_v1{2}.h from include/linux to fs
1348 # 2.6.32 move the quotaio_v1{2}.h from fs to fs/quota
1349 AC_DEFUN([LC_HAVE_QUOTAIO_H],
1350 [LB_CHECK_FILE([$LINUX/include/linux/quotaio_v2.h],[
1351 AC_DEFINE(HAVE_QUOTAIO_H, 1,
1352 [kernel has include/linux/quotaio_v2.h])
1353 ],[LB_CHECK_FILE([$LINUX/fs/quotaio_v2.h],[
1354 AC_DEFINE(HAVE_FS_QUOTAIO_H, 1,
1355 [kernel has fs/quotaio_v1.h])
1356 ],[LB_CHECK_FILE([$LINUX/fs/quota/quotaio_v2.h],[
1357 AC_DEFINE(HAVE_FS_QUOTA_QUOTAIO_H, 1,
1358 [kernel has fs/quota/quotaio_v2.h])
1366 # 2.6.27 sles11 has sb_any_quota_active
1367 AC_DEFUN([LC_SB_ANY_QUOTA_ACTIVE],
1368 [AC_MSG_CHECKING([Kernel has sb_any_quota_active])
1369 LB_LINUX_TRY_COMPILE([
1370 #include <linux/quotaops.h>
1372 sb_any_quota_active(NULL);
1374 AC_DEFINE(HAVE_SB_ANY_QUOTA_ACTIVE, 1,
1375 [Kernel has a sb_any_quota_active])
1376 AC_MSG_RESULT([yes])
1382 # 2.6.27 sles11 has sb_has_quota_active
1383 AC_DEFUN([LC_SB_HAS_QUOTA_ACTIVE],
1384 [AC_MSG_CHECKING([Kernel has sb_has_quota_active])
1385 LB_LINUX_TRY_COMPILE([
1386 #include <linux/quotaops.h>
1388 sb_has_quota_active(NULL, 0);
1390 AC_DEFINE(HAVE_SB_HAS_QUOTA_ACTIVE, 1,
1391 [Kernel has a sb_has_quota_active])
1392 AC_MSG_RESULT([yes])
1398 # 2.6.27 exported add_to_page_cache_lru.
1399 AC_DEFUN([LC_EXPORT_ADD_TO_PAGE_CACHE_LRU],
1400 [LB_CHECK_SYMBOL_EXPORT([add_to_page_cache_lru],
1402 AC_DEFINE(HAVE_ADD_TO_PAGE_CACHE_LRU, 1,
1403 [add_to_page_cache_lru functions are present])
1409 # 2.6.29 introduce sb_any_quota_loaded.
1411 AC_DEFUN([LC_SB_ANY_QUOTA_LOADED],
1412 [AC_MSG_CHECKING([Kernel has sb_any_quota_loaded])
1413 LB_LINUX_TRY_COMPILE([
1414 #include <linux/quotaops.h>
1416 sb_any_quota_loaded(NULL);
1418 AC_DEFINE(HAVE_SB_ANY_QUOTA_LOADED, 1,
1419 [Kernel has a sb_any_quota_loaded])
1420 AC_MSG_RESULT([yes])
1426 # 2.6.30 x86 node_to_cpumask has been removed. must use cpumask_of_node
1427 AC_DEFUN([LC_EXPORT_CPUMASK_OF_NODE],
1428 [LB_CHECK_SYMBOL_EXPORT([node_to_cpumask_map],
1429 [arch/$LINUX_ARCH/mm/numa.c],
1430 [AC_DEFINE(HAVE_CPUMASK_OF_NODE, 1,
1431 [node_to_cpumask_map is exported by
1432 the kernel])]) # x86_64
1435 # 2.6.31 replaces blk_queue_hardsect_size by blk_queue_logical_block_size function
1436 AC_DEFUN([LC_BLK_QUEUE_LOG_BLK_SIZE],
1437 [AC_MSG_CHECKING([if blk_queue_logical_block_size is defined])
1438 LB_LINUX_TRY_COMPILE([
1439 #include <linux/blkdev.h>
1441 blk_queue_logical_block_size(NULL, 0);
1444 AC_DEFINE(HAVE_BLK_QUEUE_LOG_BLK_SIZE, 1,
1445 [blk_queue_logical_block_size is defined])
1453 # 2.6.32 changes cache_detail's member cache_request to cache_upcall
1454 # in kernel commit bc74b4f5e63a09fb78e245794a0de1e5a2716bbe
1455 AC_DEFUN([LC_CACHE_UPCALL],
1456 [AC_MSG_CHECKING([if cache_detail has cache_upcall field])
1457 LB_LINUX_TRY_COMPILE([
1458 #include <linux/sunrpc/cache.h>
1460 struct cache_detail cd;
1461 cd.cache_upcall = NULL;
1464 AC_DEFINE(HAVE_CACHE_UPCALL, 1,
1465 [cache_detail has cache_upcall field])
1471 # 2.6.32 add a limits member in struct request_queue.
1472 AC_DEFUN([LC_REQUEST_QUEUE_LIMITS],
1473 [AC_MSG_CHECKING([if request_queue has a limits field])
1474 LB_LINUX_TRY_COMPILE([
1475 #include <linux/blkdev.h>
1477 struct request_queue rq;
1478 rq.limits.io_min = 0;
1481 AC_DEFINE(HAVE_REQUEST_QUEUE_LIMITS, 1,
1482 [request_queue has a limits field])
1488 # 2.6.32 has bdi_register() functions.
1489 AC_DEFUN([LC_EXPORT_BDI_REGISTER],
1490 [LB_CHECK_SYMBOL_EXPORT([bdi_register],
1491 [mm/backing-dev.c],[
1492 AC_DEFINE(HAVE_BDI_REGISTER, 1,
1493 [bdi_register function is present])
1498 # 2.6.32 add s_bdi for super block
1499 AC_DEFUN([LC_SB_BDI],
1500 [AC_MSG_CHECKING([if super_block has s_bdi field])
1501 LB_LINUX_TRY_COMPILE([
1502 #include <linux/fs.h>
1504 struct super_block sb;
1508 AC_DEFINE(HAVE_SB_BDI, 1,
1509 [super_block has s_bdi field])
1515 # 2.6.27.15-2 SuSE 11 sp0 kernels lack the name field for BDI
1516 AC_DEFUN([LC_BDI_NAME],
1517 [AC_MSG_CHECKING([if backing_device_info has name field])
1518 LB_LINUX_TRY_COMPILE([
1519 #include <linux/blkkdev.h>
1521 struct backing_dev_info bdi;
1525 AC_DEFINE(HAVE_BDI_NAME, 1,
1526 [backing_device_info has name field])
1532 # 2.6.32 removes blk_queue_max_sectors and add blk_queue_max_hw_sectors
1533 # check blk_queue_max_sectors and use it until disappear.
1534 AC_DEFUN([LC_BLK_QUEUE_MAX_SECTORS],
1535 [AC_MSG_CHECKING([if blk_queue_max_sectors is defined])
1536 LB_LINUX_TRY_COMPILE([
1537 #include <linux/blkdev.h>
1539 blk_queue_max_sectors(NULL, 0);
1542 AC_DEFINE(HAVE_BLK_QUEUE_MAX_SECTORS, 1,
1543 [blk_queue_max_sectors is defined])
1549 # 2.6.32 replaces 2 functions blk_queue_max_phys_segments and blk_queue_max_hw_segments by blk_queue_max_segments
1550 AC_DEFUN([LC_BLK_QUEUE_MAX_SEGMENTS],
1551 [AC_MSG_CHECKING([if blk_queue_max_segments is defined])
1552 LB_LINUX_TRY_COMPILE([
1553 #include <linux/blkdev.h>
1555 blk_queue_max_segments(NULL, 0);
1558 AC_DEFINE(HAVE_BLK_QUEUE_MAX_SEGMENTS, 1,
1559 [blk_queue_max_segments is defined])
1568 # Check if kernel has been patched for 64-bit quota limits support.
1569 # The upstream version of this patch in RHEL6 2.6.32 kernels introduces
1570 # the constant QFMT_VFS_V1 in include/linux/quota.h, so we can check for
1571 # that in the absence of quotaio_v1.h in the kernel headers.
1573 AC_DEFUN([LC_QUOTA64],[
1574 AC_MSG_CHECKING([if kernel has 64-bit quota limits support])
1575 tmp_flags="$EXTRA_KCFLAGS"
1576 EXTRA_KCFLAGS="-I$LINUX/fs"
1577 LB_LINUX_TRY_COMPILE([
1578 #include <linux/kernel.h>
1579 #include <linux/fs.h>
1580 #ifdef HAVE_QUOTAIO_H
1581 # include <linux/quotaio_v2.h>
1582 int versions[] = V2_INITQVERSIONS_R1;
1583 struct v2_disk_dqblk_r1 dqblk_r1;
1584 #elif defined(HAVE_FS_QUOTA_QUOTAIO_H)
1585 # include <quota/quotaio_v2.h>
1586 struct v2r1_disk_dqblk dqblk_r1;
1587 #elif defined(HAVE_FS_QUOTAIO_H)
1588 # include <quotaio_v2.h>
1589 struct v2r1_disk_dqblk dqblk_r1;
1591 #include <linux/quota.h>
1592 int ver = QFMT_VFS_V1;
1595 AC_DEFINE(HAVE_QUOTA64, 1, [have quota64])
1596 AC_MSG_RESULT([yes])
1598 LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],[
1599 AC_MSG_ERROR([You have got no 64-bit kernel quota support.])
1603 EXTRA_KCFLAGS=$tmp_flags
1606 # 2.6.32 set_cpus_allowed is no more defined if CONFIG_CPUMASK_OFFSTACK=yes
1607 AC_DEFUN([LC_SET_CPUS_ALLOWED],
1608 [AC_MSG_CHECKING([if kernel defines set_cpus_allowed])
1609 LB_LINUX_TRY_COMPILE(
1610 [#include <linux/sched.h>],
1611 [struct task_struct *p = NULL;
1612 cpumask_t mask = { { 0 } };
1613 (void) set_cpus_allowed(p, mask);],
1614 [AC_MSG_RESULT([yes])
1615 AC_DEFINE(HAVE_SET_CPUS_ALLOWED, 1,
1616 [set_cpus_allowed is exported by the kernel])],
1617 [AC_MSG_RESULT([no])] )])
1619 # 2.6.32 introduces selinux_is_enabled()
1620 AC_DEFUN([LC_SELINUX_IS_ENABLED],
1621 [AC_MSG_CHECKING([if selinux_is_enabled is available])
1622 LB_LINUX_TRY_COMPILE([
1623 #include <linux/selinux.h>
1625 selinux_is_enabled();
1627 AC_MSG_RESULT([yes])
1628 AC_DEFINE(HAVE_SELINUX_IS_ENABLED, 1,
1629 [selinux_is_enabled is defined])
1637 # starting from 2.6.28 kernel replaces d_alloc_anon() with
1638 # d_obtain_alias() for getting anonymous dentries
1639 # RHEL5(2.6.18) has d_obtain_alias but SLES11SP0(2.6.27) not
1641 AC_DEFUN([LC_D_OBTAIN_ALIAS],
1642 [AC_MSG_CHECKING([d_obtain_alias exist in kernel])
1643 LB_LINUX_TRY_COMPILE([
1644 #include <linux/dcache.h>
1646 d_obtain_alias(NULL);
1648 AC_DEFINE(HAVE_D_OBTAIN_ALIAS, 1,
1649 [d_obtain_alias exist in kernel])
1650 AC_MSG_RESULT([yes])
1657 # LC_EXPORT_GENERIC_ERROR_REMOVE_PAGE
1659 AC_DEFUN([LC_EXPORT_GENERIC_ERROR_REMOVE_PAGE],
1660 [LB_CHECK_SYMBOL_EXPORT(
1661 [generic_error_remove_page],
1663 [AC_DEFINE(HAS_GENERIC_ERROR_REMOVE_PAGE, 1,
1664 [kernel export generic_error_remove_page])],
1669 # 2.6.32 if kernel export access_process_vm().
1670 AC_DEFUN([LC_EXPORT_ACCESS_PROCESS_VM],
1671 [LB_CHECK_SYMBOL_EXPORT([access_process_vm],
1673 [AC_DEFINE(HAVE_ACCESS_PROCESS_VM, 1,
1674 [access_process_vm function is present])],
1680 # 2.6.36 fs_struct.lock use spinlock instead of rwlock.
1682 AC_DEFUN([LC_FS_STRUCT_RWLOCK],
1683 [AC_MSG_CHECKING([if fs_struct.lock use rwlock])
1684 LB_LINUX_TRY_COMPILE([
1685 #include <asm/atomic.h>
1686 #include <linux/spinlock.h>
1687 #include <linux/fs_struct.h>
1689 ((struct fs_struct *)0)->lock = (rwlock_t){ 0 };
1691 AC_DEFINE(HAVE_FS_STRUCT_RWLOCK, 1,
1692 [fs_struct.lock use rwlock])
1693 AC_MSG_RESULT([yes])
1700 # 2.6.36 super_operations add evict_inode method. it hybird of
1701 # delete_inode & clear_inode.
1703 AC_DEFUN([LC_SBOPS_EVICT_INODE],
1704 [AC_MSG_CHECKING([if super_operations.evict_inode exist])
1705 LB_LINUX_TRY_COMPILE([
1706 #include <linux/fs.h>
1708 ((struct super_operations *)0)->evict_inode(NULL);
1710 AC_DEFINE(HAVE_SBOPS_EVICT_INODE, 1,
1711 [super_operations.evict_inode() is exist in kernel])
1712 AC_MSG_RESULT([yes])
1719 # 2.6.35 file_operations.fsync taken 2 arguments.
1720 # 3.0.0 file_operations.fsync takes 4 arguments.
1722 AC_DEFUN([LC_FILE_FSYNC],
1723 [AC_MSG_CHECKING([if file_operations.fsync takes 4 or 2 arguments])
1724 LB_LINUX_TRY_COMPILE([
1725 #include <linux/fs.h>
1727 ((struct file_operations *)0)->fsync(NULL, 0, 0, 0);
1729 AC_DEFINE(HAVE_FILE_FSYNC_4ARGS, 1,
1730 [file_operations.fsync takes 4 arguments])
1731 AC_MSG_RESULT([yes, 4 args])
1733 LB_LINUX_TRY_COMPILE([
1734 #include <linux/fs.h>
1736 ((struct file_operations *)0)->fsync(NULL, 0);
1738 AC_DEFINE(HAVE_FILE_FSYNC_2ARGS, 1,
1739 [file_operations.fsync takes 2 arguments])
1740 AC_MSG_RESULT([yes, 2 args])
1748 # 2.6.37 remove kernel_locked
1750 AC_DEFUN([LC_KERNEL_LOCKED],
1751 [AC_MSG_CHECKING([if kernel_locked is defined])
1752 LB_LINUX_TRY_COMPILE([
1753 #include <linux/smp_lock.h>
1757 AC_MSG_RESULT([yes])
1758 AC_DEFINE(HAVE_KERNEL_LOCKED, 1,
1759 [kernel_locked is defined])
1766 # 2.6.38 dentry_operations.d_compare() taken 7 arguments.
1768 AC_DEFUN([LC_D_COMPARE_7ARGS],
1769 [AC_MSG_CHECKING([if d_compare taken 7 arguments])
1770 LB_LINUX_TRY_COMPILE([
1771 #include <linux/dcache.h>
1773 ((struct dentry_operations*)0)->d_compare(NULL,NULL,NULL,NULL,0,NULL,NULL);
1775 AC_DEFINE(HAVE_D_COMPARE_7ARGS, 1,
1776 [d_compare need 7 arguments])
1777 AC_MSG_RESULT([yes])
1784 # 2.6.38 dentry_operations.d_delete() defined 'const' for 1st parameter.
1786 AC_DEFUN([LC_D_DELETE_CONST],
1787 [AC_MSG_CHECKING([if d_delete has const declare on first parameter])
1788 tmp_flags="$EXTRA_KCFLAGS"
1789 EXTRA_KCFLAGS="-Werror"
1790 LB_LINUX_TRY_COMPILE([
1791 #include <linux/dcache.h>
1793 const struct dentry *d = NULL;
1794 ((struct dentry_operations*)0)->d_delete(d);
1796 AC_DEFINE(HAVE_D_DELETE_CONST, const,
1797 [d_delete first parameter declared const])
1798 AC_MSG_RESULT([yes])
1800 AC_DEFINE(HAVE_D_DELETE_CONST, , [])
1803 EXTRA_KCFLAGS="$tmp_flags"
1807 # 2.6.38 dcache_lock removed. rcu-walk commited.
1809 AC_DEFUN([LC_DCACHE_LOCK],
1810 [AC_MSG_CHECKING([if dcache_lock is exist])
1811 LB_LINUX_TRY_COMPILE([
1812 #include <linux/dcache.h>
1814 spin_lock(&dcache_lock);
1816 AC_DEFINE(HAVE_DCACHE_LOCK, 1,
1817 [dcache_lock is exist])
1818 AC_MSG_RESULT([yes])
1825 # 2.6.38 export blkdev_get_by_dev
1827 AC_DEFUN([LC_BLKDEV_GET_BY_DEV],
1828 [LB_CHECK_SYMBOL_EXPORT([blkdev_get_by_dev],
1830 AC_DEFINE(HAVE_BLKDEV_GET_BY_DEV, 1,
1831 [blkdev_get_by_dev is exported by the kernel])
1837 # 2.6.38 vfsmount.mnt_count doesn't use atomic_t
1839 AC_DEFUN([LC_ATOMIC_MNT_COUNT],
1840 [AC_MSG_CHECKING([if vfsmount.mnt_count is atomic_t])
1841 LB_LINUX_TRY_COMPILE([
1842 #include <asm/atomic.h>
1843 #include <linux/fs.h>
1844 #include <linux/mount.h>
1846 ((struct vfsmount *)0)->mnt_count = ((atomic_t) { 0 });
1848 AC_DEFINE(HAVE_ATOMIC_MNT_COUNT, 1,
1849 [vfsmount.mnt_count is atomic_t])
1850 AC_MSG_RESULT([yes])
1857 # 2.6.38 use path as 4th parameter in quota_on.
1859 AC_DEFUN([LC_QUOTA_ON_USE_PATH],
1860 [AC_MSG_CHECKING([quota_on use path as parameter])
1861 tmp_flags="$EXTRA_KCFLAGS"
1862 EXTRA_KCFLAGS="-Werror"
1863 LB_LINUX_TRY_COMPILE([
1864 #include <linux/fs.h>
1865 #include <linux/quota.h>
1867 ((struct quotactl_ops *)0)->quota_on(NULL, 0, 0, ((struct path*)0));
1869 AC_DEFINE(HAVE_QUOTA_ON_USE_PATH, 1,
1870 [quota_on use path as 4th paramter])
1871 AC_MSG_RESULT([yes])
1875 EXTRA_KCFLAGS="$tmp_flags"
1879 # 2.6.39 remove unplug_fn from request_queue.
1881 AC_DEFUN([LC_REQUEST_QUEUE_UNPLUG_FN],
1882 [AC_MSG_CHECKING([if request_queue has unplug_fn field])
1883 LB_LINUX_TRY_COMPILE([
1884 #include <linux/blkdev.h>
1886 do{ }while(sizeof(((struct request_queue *)0)->unplug_fn));
1888 AC_DEFINE(HAVE_REQUEST_QUEUE_UNPLUG_FN, 1,
1889 [request_queue has unplug_fn field])
1890 AC_MSG_RESULT([yes])
1897 # 2.6.38 generic_permission taken 4 paremater.
1898 # in fact, it means rcu-walk aware permission bring.
1900 AC_DEFUN([LC_GENERIC_PERMISSION],
1901 [AC_MSG_CHECKING([if generic_permission take 4 arguments])
1902 LB_LINUX_TRY_COMPILE([
1903 #include <linux/fs.h>
1905 generic_permission(NULL, 0, 0, NULL);
1907 AC_DEFINE(HAVE_GENERIC_PERMISSION_4ARGS, 1,
1908 [generic_permission taken 4 arguments])
1909 AC_MSG_RESULT([yes])
1916 # 2.6.38 export simple_setattr
1918 AC_DEFUN([LC_EXPORT_SIMPLE_SETATTR],
1919 [LB_CHECK_SYMBOL_EXPORT([simple_setattr],
1921 AC_DEFINE(HAVE_SIMPLE_SETATTR, 1,
1922 [simple_setattr is exported by the kernel])
1930 # Lustre linux kernel checks
1932 AC_DEFUN([LC_PROG_LINUX],
1936 LC_CONFIG_LIBLUSTRE_RECOVERY
1937 LC_CONFIG_HEALTH_CHECK_WRITE
1938 LC_CONFIG_LRU_RESIZE
1939 LC_LLITE_LLOOP_MODULE
1942 LC_EXPORT_TRUNCATE_COMPLETE
1943 LC_EXPORT_D_REHASH_COND
1944 LC_EXPORT___D_REHASH
1945 LC_EXPORT_NODE_TO_CPUMASK
1964 LC_SECURITY_PLUG # for SLES10 SP2
1972 LC_STATFS_DENTRY_PARAM
1973 LC_UMOUNTBEGIN_HAS_VFSMOUNT
1975 if test x$enable_server = xyes ; then
1976 LC_EXPORT_INVALIDATE_MAPPING_PAGES
1979 #2.6.18 + RHEL5 (fc6)
1990 LC_CANCEL_DIRTY_PAGE
1992 # raid5-zerocopy patch
1996 LC_INVALIDATE_BDEV_2ARG
1997 LC_ASYNC_BLOCK_CIPHER
1999 LC_STRUCT_BLKCIPHER_DESC
2000 LC_FS_RENAME_DOES_D_MOVE
2003 LC_UNREGISTER_BLKDEV_RETURN_INT
2004 LC_KERNEL_SPLICE_READ
2009 LC_EXPORTFS_DECODE_FH
2019 LC_FS_STRUCT_USE_PATH
2022 LC_PGMKWRITE_USE_VMFAULT
2023 LC_INODE_PERMISION_2ARGS
2026 LC_READ_INODE_IN_SBOPS
2027 LC_EXPORT_INODE_PERMISSION
2033 # 2.6.27.15-2 sles11
2037 LC_SB_ANY_QUOTA_ACTIVE
2038 LC_SB_HAS_QUOTA_ACTIVE
2039 LC_EXPORT_ADD_TO_PAGE_CACHE_LRU
2042 LC_SB_ANY_QUOTA_LOADED
2045 LC_EXPORT_CPUMASK_OF_NODE
2048 LC_BLK_QUEUE_LOG_BLK_SIZE
2051 LC_REQUEST_QUEUE_LIMITS
2052 LC_EXPORT_BDI_REGISTER
2054 LC_BLK_QUEUE_MAX_SECTORS
2055 LC_BLK_QUEUE_MAX_SEGMENTS
2058 LC_EXPORT_GENERIC_ERROR_REMOVE_PAGE
2059 LC_SELINUX_IS_ENABLED
2060 LC_EXPORT_ACCESS_PROCESS_VM
2064 LC_EXPORT_SIMPLE_SETATTR
2068 LC_SBOPS_EVICT_INODE
2075 LC_BLKDEV_GET_BY_DEV
2076 LC_GENERIC_PERMISSION
2077 LC_QUOTA_ON_USE_PATH
2083 LC_REQUEST_QUEUE_UNPLUG_FN
2086 if test x$enable_server = xyes ; then
2087 AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server])
2088 LC_FUNC_DEV_SET_RDONLY
2096 # LC_CONFIG_CLIENT_SERVER
2098 # Build client/server sides of Lustre
2100 AC_DEFUN([LC_CONFIG_CLIENT_SERVER],
2101 [AC_MSG_CHECKING([whether to build Lustre server support])
2102 AC_ARG_ENABLE([server],
2103 AC_HELP_STRING([--disable-server],
2104 [disable Lustre server support]),
2105 [],[enable_server='yes'])
2106 AC_MSG_RESULT([$enable_server])
2108 AC_MSG_CHECKING([whether to build Lustre client support])
2109 AC_ARG_ENABLE([client],
2110 AC_HELP_STRING([--disable-client],
2111 [disable Lustre client support]),
2112 [],[enable_client='yes'])
2113 AC_MSG_RESULT([$enable_client])])
2116 # LC_CONFIG_LIBLUSTRE
2118 # whether to build liblustre
2120 AC_DEFUN([LC_CONFIG_LIBLUSTRE],
2121 [AC_MSG_CHECKING([whether to build Lustre library])
2122 AC_ARG_ENABLE([liblustre],
2123 AC_HELP_STRING([--disable-liblustre],
2124 [disable building of Lustre library]),
2125 [],[enable_liblustre=$with_sysio])
2126 AC_MSG_RESULT([$enable_liblustre])
2127 # only build sysio if liblustre is built
2128 with_sysio="$enable_liblustre"
2130 AC_MSG_CHECKING([whether to build liblustre tests])
2131 AC_ARG_ENABLE([liblustre-tests],
2132 AC_HELP_STRING([--enable-liblustre-tests],
2133 [enable liblustre tests, if --disable-tests is used]),
2134 [],[enable_liblustre_tests=$enable_tests])
2135 if test x$enable_liblustre != xyes ; then
2136 enable_liblustre_tests='no'
2138 AC_MSG_RESULT([$enable_liblustre_tests])
2140 AC_MSG_CHECKING([whether to enable liblustre acl])
2141 AC_ARG_ENABLE([liblustre-acl],
2142 AC_HELP_STRING([--disable-liblustre-acl],
2143 [disable ACL support for liblustre]),
2144 [],[enable_liblustre_acl=yes])
2145 AC_MSG_RESULT([$enable_liblustre_acl])
2146 if test x$enable_liblustre_acl = xyes ; then
2147 AC_DEFINE(LIBLUSTRE_POSIX_ACL, 1, Liblustre Support ACL-enabled MDS)
2150 # 2.6.29 change prepare/commit_write to write_begin/end
2151 AC_DEFUN([LC_WRITE_BEGIN_END],
2152 [AC_MSG_CHECKING([if kernel has .write_begin/end])
2153 LB_LINUX_TRY_COMPILE([
2154 #include <linux/fs.h>
2155 #include <linux/pagemap.h>
2156 #ifdef HAVE_LINUX_MMTYPES_H
2157 #include <linux/mm_types.h>
2160 struct address_space_operations aops;
2163 aops.write_begin = NULL;
2164 aops.write_end = NULL;
2165 page = grab_cache_page_write_begin(NULL, 0, 0);
2167 AC_MSG_RESULT([yes])
2168 AC_DEFINE(HAVE_KERNEL_WRITE_BEGIN_END, 1,
2169 [kernel has .write_begin/end])
2175 # 2.6.29 blkdev_put has 2 arguments
2176 AC_DEFUN([LC_BLKDEV_PUT_2ARGS],
2177 [AC_MSG_CHECKING([blkdev_put needs 2 parameters])
2178 LB_LINUX_TRY_COMPILE([
2179 #include <linux/fs.h>
2181 blkdev_put(NULL, 0);
2183 AC_DEFINE(HAVE_BLKDEV_PUT_2ARGS, 1,
2184 [blkdev_put needs 2 paramters])
2185 AC_MSG_RESULT([yes])
2191 # 2.6.29 dentry_open has 4 arguments
2192 AC_DEFUN([LC_DENTRY_OPEN_4ARGS],
2193 [AC_MSG_CHECKING([dentry_open needs 4 parameters])
2194 LB_LINUX_TRY_COMPILE([
2195 #include <linux/fs.h>
2197 dentry_open(NULL, NULL, 0, NULL);
2199 AC_DEFINE(HAVE_DENTRY_OPEN_4ARGS, 1,
2200 [dentry_open needs 4 paramters])
2201 AC_MSG_RESULT([yes])
2207 # 2.6.29 split file and anonymous page queues
2208 AC_DEFUN([LC_PAGEVEC_LRU_ADD_FILE],
2209 [AC_MSG_CHECKING([if kernel has .pagevec_lru_add_file])
2210 LB_LINUX_TRY_COMPILE([
2211 #include <linux/mm.h>
2212 #include <linux/pagevec.h>
2214 struct pagevec lru_pagevec;
2216 pagevec_init(&lru_pagevec, 0);
2217 pagevec_lru_add_file(&lru_pagevec);
2219 AC_MSG_RESULT([yes])
2220 AC_DEFINE(HAVE_PAGEVEC_LRU_ADD_FILE, 1,
2221 [kernel has .pagevec_lru_add_file])
2230 AC_ARG_ENABLE(mpitests,
2231 AC_HELP_STRING([--enable-mpitests=yes|no|mpicc wrapper],
2232 [include mpi tests]),
2243 MPICC_WRAPPER=$enableval
2253 if test x$enable_mpitests != xno; then
2254 AC_MSG_CHECKING([whether mpitests can be built])
2262 MPI_Initialized(&flag);
2265 AC_MSG_RESULT([yes])
2272 AC_SUBST(MPICC_WRAPPER)
2274 AC_MSG_NOTICE([Enabling Lustre configure options for libsysio])
2275 ac_configure_args="$ac_configure_args --with-lustre-hack --with-sockets"
2278 LC_CONFIG_LIBLUSTRE_RECOVERY
2284 # whether to enable quota support global control
2286 AC_DEFUN([LC_CONFIG_QUOTA],
2287 [AC_ARG_ENABLE([quota],
2288 AC_HELP_STRING([--enable-quota],
2289 [enable quota support]),
2290 [],[enable_quota='yes'])
2293 AC_DEFUN([LC_QUOTA],
2297 AC_CHECK_HEADER(sys/quota.h,
2298 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1, [Define to 1 if you have <sys/quota.h>.])],
2299 [AC_MSG_ERROR([don't find <sys/quota.h> in your system])])
2305 # whether to enable split support
2307 AC_DEFUN([LC_CONFIG_SPLIT],
2308 [AC_MSG_CHECKING([whether to enable split support])
2309 AC_ARG_ENABLE([split],
2310 AC_HELP_STRING([--enable-split],
2311 [enable split support]),
2312 [],[enable_split='no'])
2313 AC_MSG_RESULT([$enable_split])
2314 if test x$enable_split != xno; then
2315 AC_DEFINE(HAVE_SPLIT_SUPPORT, 1, [enable split support])
2319 # RHEL5(2.6.18) has tux_info
2320 AC_DEFUN([LC_TASK_CLENV_TUX_INFO],
2321 [AC_MSG_CHECKING([tux_info])
2322 LB_LINUX_TRY_COMPILE([
2323 #include <linux/sched.h>
2325 struct task_struct task;
2328 AC_MSG_RESULT([yes])
2329 AC_DEFINE(LL_TASK_CL_ENV, tux_info, [have tux_info])
2330 have_task_clenv_store='yes'
2337 # LC_LLITE_LLOOP_MODULE
2338 # lloop_llite.ko does not currently work with page sizes
2341 AC_DEFUN([LC_LLITE_LLOOP_MODULE],
2342 [AC_MSG_CHECKING([whether to enable llite_lloop module])
2343 LB_LINUX_TRY_COMPILE([
2344 #include <asm/page.h>
2346 #if PAGE_SIZE >= 65536
2347 #error "PAGE_SIZE >= 65536"
2350 enable_llite_lloop_module='yes'
2351 AC_MSG_RESULT([yes])
2353 enable_llite_lloop_module='no'
2361 # other configure checks
2363 AC_DEFUN([LC_CONFIGURE],
2364 [LC_CONFIG_OBD_BUFFER_SIZE
2366 if test $target_cpu == "i686" -o $target_cpu == "x86_64"; then
2367 CFLAGS="$CFLAGS -Werror"
2370 # maximum MDS thread count
2373 # include/liblustre.h
2374 AC_CHECK_HEADERS([sys/user.h sys/vfs.h stdint.h blkid/blkid.h])
2376 # liblustre/llite_lib.h
2377 AC_CHECK_HEADERS([xtio.h file.h])
2380 AC_CHECK_HEADERS([linux/types.h sys/types.h linux/unistd.h unistd.h])
2383 AC_CHECK_HEADERS([netinet/in.h arpa/inet.h catamount/data.h])
2384 AC_CHECK_FUNCS([inet_ntoa])
2386 # libsysio/src/readlink.c
2389 # lvfs/prng.c - depends on linux/types.h from liblustre/dir.c
2390 AC_CHECK_HEADERS([linux/random.h], [], [],
2391 [#ifdef HAVE_LINUX_TYPES_H
2392 # include <linux/types.h>
2397 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
2399 # check for -lz support
2403 [AC_CHECK_HEADERS([zlib.h],
2405 AC_DEFINE([HAVE_ADLER], 1,
2406 [support alder32 checksum type])],
2407 [AC_MSG_WARN([No zlib-devel package found,
2408 unable to use adler32 checksum])])],
2409 [AC_MSG_WARN([No zlib package found, unable to use adler32 checksum])]
2414 AC_ARG_ENABLE([mindf],
2415 AC_HELP_STRING([--enable-mindf],
2416 [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
2418 if test "$enable_mindf" = "yes" ; then
2419 AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])
2422 AC_ARG_ENABLE([fail_alloc],
2423 AC_HELP_STRING([--disable-fail-alloc],
2424 [disable randomly alloc failure]),
2425 [],[enable_fail_alloc=yes])
2426 AC_MSG_CHECKING([whether to randomly failing memory alloc])
2427 AC_MSG_RESULT([$enable_fail_alloc])
2428 if test x$enable_fail_alloc != xno ; then
2429 AC_DEFINE([RANDOM_FAIL_ALLOC], 1, [enable randomly alloc failure])
2432 AC_ARG_ENABLE([invariants],
2433 AC_HELP_STRING([--enable-invariants],
2434 [enable invariant checking (cpu intensive)]),
2436 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
2437 AC_MSG_RESULT([$enable_invariants])
2438 if test x$enable_invariants = xyes ; then
2439 AC_DEFINE([INVARIANT_CHECK], 1, [enable invariant checking])
2442 AC_ARG_ENABLE([lu_ref],
2443 AC_HELP_STRING([--enable-lu_ref],
2444 [enable lu_ref reference tracking code]),
2446 AC_MSG_CHECKING([whether to track references with lu_ref])
2447 AC_MSG_RESULT([$enable_lu_ref])
2448 if test x$enable_lu_ref = xyes ; then
2449 AC_DEFINE([USE_LU_REF], 1, [enable lu_ref reference tracking code])
2452 AC_ARG_ENABLE([pgstate-track],
2453 AC_HELP_STRING([--enable-pgstate-track],
2454 [enable page state tracking]),
2455 [enable_pgstat_track='yes'],[])
2456 AC_MSG_CHECKING([whether to enable page state tracking])
2457 AC_MSG_RESULT([$enable_pgstat_track])
2458 if test x$enable_pgstat_track = xyes ; then
2459 AC_DEFINE([LUSTRE_PAGESTATE_TRACKING], 1,
2460 [enable page state tracking code])
2467 LC_DENTRY_OPEN_4ARGS
2468 LC_PAGEVEC_LRU_ADD_FILE
2475 # AM_CONDITIONALS for lustre
2477 AC_DEFUN([LC_CONDITIONALS],
2478 [AM_CONDITIONAL(LIBLUSTRE, test x$enable_liblustre = xyes)
2479 AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno)
2480 AM_CONDITIONAL(LIBLUSTRE_TESTS, test x$enable_liblustre_tests = xyes)
2481 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
2482 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
2483 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
2484 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
2485 AM_CONDITIONAL(BLKID, test x$ac_cv_header_blkid_blkid_h = xyes)
2486 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
2487 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
2488 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
2489 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
2490 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
2491 AM_CONDITIONAL(LLITE_LLOOP, test x$enable_llite_lloop_module = xyes)
2497 # files that should be generated with AC_OUTPUT
2499 AC_DEFUN([LC_CONFIG_FILES],
2503 lustre/autoconf/Makefile
2504 lustre/conf/Makefile
2505 lustre/contrib/Makefile
2507 lustre/include/Makefile
2508 lustre/include/lustre_ver.h
2509 lustre/include/linux/Makefile
2510 lustre/include/darwin/Makefile
2511 lustre/include/lustre/Makefile
2512 lustre/kernel_patches/targets/2.6-rhel6.target
2513 lustre/kernel_patches/targets/2.6-rhel5.target
2514 lustre/kernel_patches/targets/2.6-sles10.target
2515 lustre/kernel_patches/targets/2.6-sles11.target
2516 lustre/kernel_patches/targets/2.6-oel5.target
2517 lustre/kernel_patches/targets/2.6-fc11.target
2518 lustre/kernel_patches/targets/2.6-fc12.target
2519 lustre/ldlm/Makefile
2521 lustre/fid/autoMakefile
2522 lustre/liblustre/Makefile
2523 lustre/liblustre/tests/Makefile
2524 lustre/liblustre/tests/mpi/Makefile
2525 lustre/llite/Makefile
2526 lustre/llite/autoMakefile
2527 lustre/lclient/Makefile
2529 lustre/lov/autoMakefile
2530 lustre/lvfs/Makefile
2531 lustre/lvfs/autoMakefile
2533 lustre/mdc/autoMakefile
2535 lustre/lmv/autoMakefile
2537 lustre/mds/autoMakefile
2539 lustre/mdt/autoMakefile
2541 lustre/cmm/autoMakefile
2543 lustre/mdd/autoMakefile
2545 lustre/fld/autoMakefile
2546 lustre/obdclass/Makefile
2547 lustre/obdclass/autoMakefile
2548 lustre/obdclass/linux/Makefile
2549 lustre/obdecho/Makefile
2550 lustre/obdecho/autoMakefile
2551 lustre/obdfilter/Makefile
2552 lustre/obdfilter/autoMakefile
2554 lustre/ofd/autoMakefile
2556 lustre/osc/autoMakefile
2558 lustre/ost/autoMakefile
2559 lustre/osd-ldiskfs/Makefile
2560 lustre/osd-ldiskfs/autoMakefile
2561 lustre/osd-zfs/Makefile
2562 lustre/osd-zfs/autoMakefile
2564 lustre/mgc/autoMakefile
2566 lustre/mgs/autoMakefile
2567 lustre/ptlrpc/Makefile
2568 lustre/ptlrpc/autoMakefile
2569 lustre/ptlrpc/gss/Makefile
2570 lustre/ptlrpc/gss/autoMakefile
2571 lustre/quota/Makefile
2572 lustre/quota/autoMakefile
2573 lustre/scripts/Makefile
2574 lustre/scripts/lustre
2575 lustre/tests/Makefile
2576 lustre/tests/mpi/Makefile
2577 lustre/utils/Makefile
2578 lustre/utils/gss/Makefile
2579 lustre/obdclass/darwin/Makefile