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_PERCPU_COUNTER],
455 [AC_MSG_CHECKING([if have struct percpu_counter defined])
456 LB_LINUX_TRY_COMPILE([
457 #include <linux/percpu_counter.h>
459 AC_DEFINE(HAVE_PERCPU_COUNTER, 1, [percpu_counter found])
462 AC_MSG_CHECKING([if percpu_counter_inc takes the 2nd argument])
463 LB_LINUX_TRY_COMPILE([
464 #include <linux/percpu_counter.h>
466 struct percpu_counter c;
467 percpu_counter_init(&c, 0);
469 AC_DEFINE(HAVE_PERCPU_2ND_ARG, 1, [percpu_counter_init has two
480 AC_DEFUN([LC_TASK_CLENV_STORE],
482 AC_MSG_CHECKING([if we can store cl_env in task_struct])
483 if test x$have_task_clenv_store != xyes ; then
484 LC_TASK_CLENV_TUX_INFO
490 AC_DEFUN([LC_S_TIME_GRAN],
491 [AC_MSG_CHECKING([if super block has s_time_gran member])
492 LB_LINUX_TRY_COMPILE([
493 #include <linux/fs.h>
495 struct super_block *sb = NULL;
497 return sb->s_time_gran;
500 AC_DEFINE(HAVE_S_TIME_GRAN, 1, [super block has s_time_gran member])
506 AC_DEFUN([LC_SB_TIME_GRAN],
507 [AC_MSG_CHECKING([if kernel has old get_sb_time_gran])
508 LB_LINUX_TRY_COMPILE([
509 #include <linux/fs.h>
511 return get_sb_time_gran(NULL);
514 AC_DEFINE(HAVE_SB_TIME_GRAN, 1, [kernel has old get_sb_time_gran])
522 # ~2.6.12 merge patch from oracle to convert tree_lock from spinlock to rwlock
523 AC_DEFUN([LC_RW_TREE_LOCK],
524 [AC_MSG_CHECKING([if kernel has tree_lock as rwlock])
525 tmp_flags="$EXTRA_KCFLAGS"
526 EXTRA_KCFLAGS="-Werror"
527 LB_LINUX_TRY_COMPILE([
528 #include <linux/fs.h>
530 struct address_space a;
532 write_lock(&a.tree_lock);
535 AC_DEFINE(HAVE_RW_TREE_LOCK, 1, [kernel has tree_lock as rw_lock])
539 EXTRA_KCFLAGS="$tmp_flags"
545 # after 2.6.15 inode have i_mutex intead of i_sem
546 AC_DEFUN([LC_INODE_I_MUTEX],
547 [AC_MSG_CHECKING([if inode has i_mutex ])
548 LB_LINUX_TRY_COMPILE([
549 #include <linux/mutex.h>
550 #include <linux/fs.h>
555 mutex_unlock(&i.i_mutex);
558 AC_DEFINE(HAVE_INODE_I_MUTEX, 1,
559 [after 2.6.15 inode have i_mutex intead of i_sem])
567 # LC_SECURITY_PLUG # for SLES10 SP2
568 # check security plug in sles10 sp2 kernel
569 AC_DEFUN([LC_SECURITY_PLUG],
570 [AC_MSG_CHECKING([If kernel has security plug support])
571 LB_LINUX_TRY_COMPILE([
572 #include <linux/fs.h>
573 #include <linux/stddef.h>
575 notify_change(NULL, NULL, NULL);
578 AC_DEFINE(HAVE_SECURITY_PLUG, 1,
579 [SLES10 SP2 use extra parameter in vfs])
587 # inode have i_private field since 2.6.17
588 AC_DEFUN([LC_INODE_IPRIVATE],
589 [AC_MSG_CHECKING([if inode has a i_private field])
590 LB_LINUX_TRY_COMPILE([
591 #include <linux/fs.h>
597 AC_DEFINE(HAVE_INODE_IPRIVATE, 1,
598 [struct inode has i_private field])
605 # after 2.6.17 dquote use mutex instead if semaphore
606 AC_DEFUN([LC_DQUOTOFF_MUTEX],
607 [AC_MSG_CHECKING([use dqonoff_mutex])
608 LB_LINUX_TRY_COMPILE([
609 #include <linux/mutex.h>
610 #include <linux/fs.h>
611 #include <linux/quota.h>
613 struct quota_info dq;
615 mutex_unlock(&dq.dqonoff_mutex);
618 AC_DEFINE(HAVE_DQUOTOFF_MUTEX, 1,
619 [after 2.6.17 dquote use mutex instead if semaphore])
628 # 2.6.18 don't export nr_pagecahe
629 AC_DEFUN([LC_NR_PAGECACHE],
630 [AC_MSG_CHECKING([kernel export nr_pagecache])
631 LB_LINUX_TRY_COMPILE([
632 #include <linux/pagemap.h>
634 return atomic_read(&nr_pagecache);
637 AC_DEFINE(HAVE_NR_PAGECACHE, 1,
638 [is kernel export nr_pagecache])
645 # LC_STATFS_DENTRY_PARAM
646 # starting from 2.6.18 linux kernel uses dentry instead of super_block
647 # for the first parameter of the super_operations->statfs() callback.
650 AC_DEFUN([LC_STATFS_DENTRY_PARAM],
651 [AC_MSG_CHECKING([if super_ops.statfs() first parameter is dentry])
652 tmp_flags="$EXTRA_KCFLAGS"
653 EXTRA_KCFLAGS="-Werror"
654 LB_LINUX_TRY_COMPILE([
655 #include <linux/fs.h>
657 ((struct super_operations *)0)->statfs((struct dentry *)0, (struct kstatfs*)0);
659 AC_DEFINE(HAVE_STATFS_DENTRY_PARAM, 1,
660 [super_ops.statfs() first parameter is dentry])
665 EXTRA_KCFLAGS="$tmp_flags"
668 # LC_UMOUNTBEGIN_HAS_VFSMOUNT
669 # 2.6.18~2.6.25 umount_begin has different parameters
670 AC_DEFUN([LC_UMOUNTBEGIN_HAS_VFSMOUNT],
671 [AC_MSG_CHECKING([if umount_begin needs vfsmount parameter instead of super_block])
672 tmp_flags="$EXTRA_KCFLAGS"
673 EXTRA_KCFLAGS="-Werror"
674 LB_LINUX_TRY_COMPILE([
675 #include <linux/fs.h>
678 static void cfg_umount_begin (struct vfsmount *v, int flags)
683 static struct super_operations cfg_super_operations = {
684 .umount_begin = cfg_umount_begin,
687 cfg_super_operations.umount_begin(NULL,0);
690 AC_DEFINE(HAVE_UMOUNTBEGIN_VFSMOUNT, 1,
691 [Define umount_begin need second argument])
695 EXTRA_KCFLAGS="$tmp_flags"
699 # starting from 2.6.18 the file_operations .flush
700 # method has a new "fl_owner_t id" parameter
702 AC_DEFUN([LC_FLUSH_OWNER_ID],
703 [AC_MSG_CHECKING([if file_operations .flush has an fl_owner_t id])
704 LB_LINUX_TRY_COMPILE([
705 #include <linux/fs.h>
707 struct file_operations *fops = NULL;
708 fl_owner_t id = NULL;
711 i = fops->flush(NULL, id);
713 AC_DEFINE(HAVE_FLUSH_OWNER_ID, 1,
714 [file_operations .flush method has an fl_owner_t id])
722 # LC_EXPORT_INVALIDATE_MAPPING_PAGES
724 # SLES9, RHEL4, RHEL5, vanilla 2.6.24 export invalidate_mapping_pages() but
725 # SLES10 2.6.16 does not, for some reason. For filter cache invalidation.
727 AC_DEFUN([LC_EXPORT_INVALIDATE_MAPPING_PAGES],
728 [LB_CHECK_SYMBOL_EXPORT([invalidate_mapping_pages], [mm/truncate.c], [
729 AC_DEFINE(HAVE_INVALIDATE_MAPPING_PAGES, 1,
730 [exported invalidate_mapping_pages])],
731 [LB_CHECK_SYMBOL_EXPORT([invalidate_inode_pages], [mm/truncate.c], [
732 AC_DEFINE(HAVE_INVALIDATE_INODE_PAGES, 1,
733 [exported invalidate_inode_pages])], [
734 AC_MSG_ERROR([no way to invalidate pages])
739 #2.6.18 + RHEL5 (fc6)
741 # RHEL5 in FS-cache patch rename PG_checked flag into PG_fs_misc
742 AC_DEFUN([LC_PG_FS_MISC],
743 [AC_MSG_CHECKING([kernel has PG_fs_misc])
744 LB_LINUX_TRY_COMPILE([
745 #include <linux/mm.h>
746 #include <linux/page-flags.h>
749 #error PG_fs_misc not defined in kernel
753 AC_DEFINE(HAVE_PG_FS_MISC, 1,
754 [is kernel have PG_fs_misc])
760 # RHEL5 PageChecked and SetPageChecked defined
761 AC_DEFUN([LC_PAGE_CHECKED],
762 [AC_MSG_CHECKING([kernel has PageChecked and SetPageChecked])
763 LB_LINUX_TRY_COMPILE([
764 #include <linux/mm.h>
765 #ifdef HAVE_LINUX_MMTYPES_H
766 #include <linux/mm_types.h>
768 #include <linux/page-flags.h>
770 struct page *p = NULL;
772 /* before 2.6.26 this define*/
774 /* 2.6.26 use function instead of define for it */
780 AC_DEFINE(HAVE_PAGE_CHECKED, 1,
781 [does kernel have PageChecked and SetPageChecked])
790 # If we have fiemap.h
791 # after 2.6.27 use fiemap.h in include/linux
793 AC_DEFUN([LC_LINUX_FIEMAP_H],
794 [LB_CHECK_FILE([$LINUX/include/linux/fiemap.h],[
795 AC_MSG_CHECKING([if fiemap.h can be compiled])
796 LB_LINUX_TRY_COMPILE([
797 #include <linux/types.h>
798 #include <linux/fiemap.h>
801 AC_DEFINE(HAVE_LINUX_FIEMAP_H, 1, [Kernel has fiemap.h])
812 # inode don't have i_blksize field
813 AC_DEFUN([LC_INODE_BLKSIZE],
814 [AC_MSG_CHECKING([inode has i_blksize field])
815 LB_LINUX_TRY_COMPILE([
816 #include <linux/fs.h>
822 AC_DEFINE(HAVE_INODE_BLKSIZE, 1,
823 [struct inode has i_blksize field])
830 # 2.6.19 replaced writev with aio_write
831 AC_DEFUN([LC_FILE_WRITEV],
832 [AC_MSG_CHECKING([writev in fops])
833 LB_LINUX_TRY_COMPILE([
834 #include <linux/fs.h>
836 struct file_operations *fops = NULL;
840 AC_DEFINE(HAVE_FILE_WRITEV, 1,
848 # 2.6.19 replaced readv with aio_read
849 AC_DEFUN([LC_FILE_READV],
850 [AC_MSG_CHECKING([readv in fops])
851 LB_LINUX_TRY_COMPILE([
852 #include <linux/fs.h>
854 struct file_operations *fops = NULL;
858 AC_DEFINE(HAVE_FILE_READV, 1,
867 # LC_CANCEL_DIRTY_PAGE
868 # 2.6.20 introduced cancel_dirty_page instead of clear_page_dirty.
869 AC_DEFUN([LC_CANCEL_DIRTY_PAGE],
870 [AC_MSG_CHECKING([kernel has cancel_dirty_page])
871 # the implementation of cancel_dirty_page in OFED 1.4.1's SLES10 SP2
872 # backport is broken, so ignore it
873 if test -f $OFED_BACKPORT_PATH/linux/mm.h &&
874 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
877 LB_LINUX_TRY_COMPILE([
878 #include <linux/mm.h>
879 #include <linux/page-flags.h>
881 cancel_dirty_page(NULL, 0);
884 AC_DEFINE(HAVE_CANCEL_DIRTY_PAGE, 1,
885 [kernel has cancel_dirty_page instead of clear_page_dirty])
892 # raid5-zerocopy patch
897 # In order to support raid5 zerocopy patch, we have to patch the kernel to make
898 # it support constant page, which means the page won't be modified during the
901 AC_DEFUN([LC_PAGE_CONSTANT],
902 [AC_MSG_CHECKING([if kernel have PageConstant defined])
903 LB_LINUX_TRY_COMPILE([
904 #include <linux/mm.h>
905 #include <linux/page-flags.h>
908 #error "Have no raid5 zcopy patch"
912 AC_DEFINE(HAVE_PAGE_CONSTANT, 1, [kernel have PageConstant supported])
920 # 2.6.22 lost second parameter for invalidate_bdev
921 AC_DEFUN([LC_INVALIDATE_BDEV_2ARG],
922 [AC_MSG_CHECKING([if invalidate_bdev has second argument])
923 LB_LINUX_TRY_COMPILE([
924 #include <linux/buffer_head.h>
926 invalidate_bdev(NULL,0);
929 AC_DEFINE(HAVE_INVALIDATE_BDEV_2ARG, 1,
930 [invalidate_bdev has second argument])
937 # check for crypto API
939 AC_DEFUN([LC_ASYNC_BLOCK_CIPHER],
940 [AC_MSG_CHECKING([if kernel has block cipher support])
941 LB_LINUX_TRY_COMPILE([
942 #include <linux/err.h>
943 #include <linux/crypto.h>
945 struct crypto_blkcipher *tfm;
946 tfm = crypto_alloc_blkcipher("aes", 0, sizeof(tfm) );
949 AC_DEFINE(HAVE_ASYNC_BLOCK_CIPHER, 1, [kernel has block cipher support])
956 # check for struct hash_desc
958 AC_DEFUN([LC_STRUCT_HASH_DESC],
959 [AC_MSG_CHECKING([if kernel has struct hash_desc])
960 LB_LINUX_TRY_COMPILE([
961 #include <linux/err.h>
962 #include <linux/crypto.h>
964 struct hash_desc foo __attribute__ ((unused));
967 AC_DEFINE(HAVE_STRUCT_HASH_DESC, 1, [kernel has struct hash_desc])
974 # check for struct blkcipher_desc
976 AC_DEFUN([LC_STRUCT_BLKCIPHER_DESC],
977 [AC_MSG_CHECKING([if kernel has struct blkcipher_desc])
978 LB_LINUX_TRY_COMPILE([
979 #include <linux/err.h>
980 #include <linux/crypto.h>
982 struct blkcipher_desc foo __attribute__ ((unused));
985 AC_DEFINE(HAVE_STRUCT_BLKCIPHER_DESC, 1, [kernel has struct blkcipher_desc])
992 # 2.6.19 check for FS_RENAME_DOES_D_MOVE flag
994 AC_DEFUN([LC_FS_RENAME_DOES_D_MOVE],
995 [AC_MSG_CHECKING([if kernel has FS_RENAME_DOES_D_MOVE flag])
996 LB_LINUX_TRY_COMPILE([
997 #include <linux/fs.h>
999 int v __attribute__ ((unused));
1000 v = FS_RENAME_DOES_D_MOVE;
1002 AC_MSG_RESULT([yes])
1003 AC_DEFINE(HAVE_FS_RENAME_DOES_D_MOVE, 1, [kernel has FS_RENAME_DOES_D_MOVE flag])
1011 # 2.6.23 have return type 'void' for unregister_blkdev
1012 AC_DEFUN([LC_UNREGISTER_BLKDEV_RETURN_INT],
1013 [AC_MSG_CHECKING([if unregister_blkdev return int])
1014 LB_LINUX_TRY_COMPILE([
1015 #include <linux/fs.h>
1017 int i __attribute__ ((unused));
1018 i = unregister_blkdev(0,NULL);
1020 AC_MSG_RESULT([yes])
1021 AC_DEFINE(HAVE_UNREGISTER_BLKDEV_RETURN_INT, 1,
1022 [unregister_blkdev return int])
1028 # 2.6.23 change .sendfile to .splice_read
1029 AC_DEFUN([LC_KERNEL_SPLICE_READ],
1030 [AC_MSG_CHECKING([if kernel has .splice_read])
1031 LB_LINUX_TRY_COMPILE([
1032 #include <linux/fs.h>
1034 struct file_operations file;
1036 file.splice_read = NULL;
1038 AC_MSG_RESULT([yes])
1039 AC_DEFINE(HAVE_KERNEL_SPLICE_READ, 1,
1040 [kernel has .slice_read])
1046 # 2.6.23 change .sendfile to .splice_read
1047 # RHEL4 (-92 kernel) have both sendfile and .splice_read API
1048 AC_DEFUN([LC_KERNEL_SENDFILE],
1049 [AC_MSG_CHECKING([if kernel has .sendfile])
1050 LB_LINUX_TRY_COMPILE([
1051 #include <linux/fs.h>
1053 struct file_operations file;
1055 file.sendfile = NULL;
1057 AC_MSG_RESULT([yes])
1058 AC_DEFINE(HAVE_KERNEL_SENDFILE, 1,
1059 [kernel has .sendfile])
1065 # 2.6.23 extract nfs export related data into exportfs.h
1066 AC_DEFUN([LC_HAVE_EXPORTFS_H],
1067 [LB_CHECK_FILE([$LINUX/include/linux/exportfs.h], [
1068 AC_DEFINE(HAVE_LINUX_EXPORTFS_H, 1,
1069 [kernel has include/exportfs.h])
1075 # 2.6.23 has new page fault handling API
1076 AC_DEFUN([LC_VM_OP_FAULT],
1077 [AC_MSG_CHECKING([kernel has .fault in vm_operation_struct])
1078 LB_LINUX_TRY_COMPILE([
1079 #include <linux/mm.h>
1081 struct vm_operations_struct op;
1085 AC_MSG_RESULT([yes])
1086 AC_DEFINE(HAVE_VM_OP_FAULT, 1,
1087 [kernel has .fault in vm_operation_struct])
1093 # 2.6.23 add code to wait other users to complete before removing procfs entry
1094 AC_DEFUN([LC_PROCFS_USERS],
1095 [AC_MSG_CHECKING([if kernel has pde_users member in procfs entry struct])
1096 LB_LINUX_TRY_COMPILE([
1097 #include <linux/proc_fs.h>
1099 struct proc_dir_entry pde;
1103 AC_MSG_RESULT([yes])
1104 AC_DEFINE(HAVE_PROCFS_USERS, 1,
1105 [kernel has pde_users member in procfs entry struct])
1111 # 2.6.23 exports exportfs_decode_fh
1112 AC_DEFUN([LC_EXPORTFS_DECODE_FH],
1113 [LB_CHECK_SYMBOL_EXPORT([exportfs_decode_fh],
1114 [fs/exportfs/expfs.c],[
1115 AC_DEFINE(HAVE_EXPORTFS_DECODE_FH, 1,
1116 [exportfs_decode_fh has been export])
1123 # 2.6.24 need linux/mm_types.h included
1124 AC_DEFUN([LC_HAVE_MMTYPES_H],
1125 [LB_CHECK_FILE([$LINUX/include/linux/mm_types.h], [
1126 AC_DEFINE(HAVE_LINUX_MMTYPES_H, 1,
1127 [kernel has include/mm_types.h])
1133 # 2.6.24 has bio_endio with 2 args
1134 AC_DEFUN([LC_BIO_ENDIO_2ARG],
1135 [AC_MSG_CHECKING([if kernel has bio_endio with 2 args])
1136 LB_LINUX_TRY_COMPILE([
1137 #include <linux/bio.h>
1141 AC_MSG_RESULT([yes])
1142 AC_DEFINE(HAVE_BIO_ENDIO_2ARG, 1,
1143 [kernel has bio_endio with 2 args])
1149 # 2.6.24 has new members in exports struct.
1150 AC_DEFUN([LC_FH_TO_DENTRY],
1151 [AC_MSG_CHECKING([if kernel has .fh_to_dentry member in export_operations struct])
1152 LB_LINUX_TRY_COMPILE([
1153 #include <linux/fs.h>
1154 #ifdef HAVE_LINUX_EXPORTFS_H
1155 #include <linux/exportfs.h>
1158 do{ }while(sizeof(((struct export_operations *)0)->fh_to_dentry));
1160 AC_MSG_RESULT([yes])
1161 AC_DEFINE(HAVE_FH_TO_DENTRY, 1,
1162 [kernel has .fh_to_dentry member in export_operations struct])
1168 # 2.6.24 removes long aged procfs entry -> deleted member
1169 AC_DEFUN([LC_PROCFS_DELETED],
1170 [AC_MSG_CHECKING([if kernel has deleted member in procfs entry struct])
1171 LB_LINUX_TRY_COMPILE([
1172 #include <linux/proc_fs.h>
1174 struct proc_dir_entry pde;
1176 pde.deleted = sizeof(pde);
1178 AC_MSG_RESULT([yes])
1179 AC_DEFINE(HAVE_PROCFS_DELETED, 1,
1180 [kernel has deleted member in procfs entry struct])
1186 # 2.6.24 has bdi_init()/bdi_destroy() functions.
1187 AC_DEFUN([LC_EXPORT_BDI_INIT],
1188 [LB_CHECK_SYMBOL_EXPORT([bdi_init],
1189 [mm/backing-dev.c],[
1190 AC_DEFINE(HAVE_BDI_INIT, 1,
1191 [bdi_init/bdi_destroy functions are present])
1198 # 2.6.26 isn't export set_fs_pwd and change paramter in fs struct
1199 AC_DEFUN([LC_FS_STRUCT_USE_PATH],
1200 [AC_MSG_CHECKING([fs_struct use path structure])
1201 LB_LINUX_TRY_COMPILE([
1202 #include <asm/atomic.h>
1203 #include <linux/spinlock.h>
1204 #include <linux/fs_struct.h>
1206 struct fs_struct fs;
1208 fs.pwd = *((struct path *)sizeof(fs));
1210 AC_MSG_RESULT([yes])
1211 AC_DEFINE(HAVE_FS_STRUCT_USE_PATH, 1,
1212 [fs_struct use path structure])
1222 AC_DEFUN([LC_PGMKWRITE_USE_VMFAULT],
1223 [AC_MSG_CHECKING([kernel .page_mkwrite uses struct vm_fault *])
1224 tmp_flags="$EXTRA_KCFLAGS"
1225 EXTRA_KCFLAGS="-Werror"
1226 LB_LINUX_TRY_COMPILE([
1227 #include <linux/mm.h>
1229 ((struct vm_operations_struct *)0)->page_mkwrite((struct vm_area_struct *)0, (struct vm_fault *)0);
1231 AC_MSG_RESULT([yes])
1232 AC_DEFINE(HAVE_PGMKWRITE_USE_VMFAULT, 1,
1233 [kernel vm_operation_struct.page_mkwrite uses struct vm_fault * as second parameter])
1237 EXTRA_KCFLAGS="$tmp_flags"
1240 AC_DEFUN([LC_INODE_PERMISION_2ARGS],
1241 [AC_MSG_CHECKING([inode_operations->permission has two args])
1242 LB_LINUX_TRY_COMPILE([
1243 #include <linux/fs.h>
1245 struct inode *inode __attribute__ ((unused));
1248 inode->i_op->permission(NULL, 0);
1250 AC_DEFINE(HAVE_INODE_PERMISION_2ARGS, 1,
1251 [inode_operations->permission has two args])
1252 AC_MSG_RESULT([yes])
1258 # 2.6.27 has file_remove_suid instead of remove_suid
1259 AC_DEFUN([LC_FILE_REMOVE_SUID],
1260 [AC_MSG_CHECKING([kernel has file_remove_suid])
1261 LB_LINUX_TRY_COMPILE([
1262 #include <linux/fs.h>
1264 file_remove_suid(NULL);
1266 AC_DEFINE(HAVE_FILE_REMOVE_SUID, 1,
1267 [kernel have file_remove_suid])
1268 AC_MSG_RESULT([yes])
1274 # 2.6.27 have new page locking API
1275 AC_DEFUN([LC_TRYLOCKPAGE],
1276 [AC_MSG_CHECKING([kernel uses trylock_page for page lock])
1277 LB_LINUX_TRY_COMPILE([
1278 #include <linux/pagemap.h>
1282 AC_DEFINE(HAVE_TRYLOCK_PAGE, 1,
1283 [kernel uses trylock_page for page lock])
1284 AC_MSG_RESULT([yes])
1290 # 2.6.27 removed the read_inode from super_operations.
1291 AC_DEFUN([LC_READ_INODE_IN_SBOPS],
1292 [AC_MSG_CHECKING([super_operations has a read_inode field])
1293 LB_LINUX_TRY_COMPILE([
1294 #include <linux/fs.h>
1296 struct super_operations *sop;
1297 sop->read_inode(NULL);
1299 AC_DEFINE(HAVE_READ_INODE_IN_SBOPS, 1,
1300 [super_operations has a read_inode])
1301 AC_MSG_RESULT([yes])
1307 # 2.6.27 has inode_permission instead of permisson
1308 AC_DEFUN([LC_EXPORT_INODE_PERMISSION],
1309 [LB_CHECK_SYMBOL_EXPORT([inode_permission],
1311 AC_DEFINE(HAVE_EXPORT_INODE_PERMISSION, 1,
1312 [inode_permission is exported by the kernel])
1317 # 2.6.27 use 5th parameter in quota_on for remount.
1318 AC_DEFUN([LC_QUOTA_ON_5ARGS],
1319 [AC_MSG_CHECKING([quota_on needs 5 parameters])
1320 LB_LINUX_TRY_COMPILE([
1321 #include <linux/fs.h>
1322 #include <linux/quota.h>
1324 struct quotactl_ops *qop = NULL;
1325 qop->quota_on(NULL, 0, 0, NULL, 0);
1327 AC_DEFINE(HAVE_QUOTA_ON_5ARGS, 1,
1328 [quota_on needs 5 paramters])
1329 AC_MSG_RESULT([yes])
1335 # 2.6.27 use 3th parameter in quota_off for remount.
1336 AC_DEFUN([LC_QUOTA_OFF_3ARGS],
1337 [AC_MSG_CHECKING([quota_off needs 3 parameters])
1338 LB_LINUX_TRY_COMPILE([
1339 #include <linux/fs.h>
1340 #include <linux/quota.h>
1342 struct quotactl_ops *qop = NULL;
1343 qop->quota_off(NULL, 0, 0);
1345 AC_DEFINE(HAVE_QUOTA_OFF_3ARGS, 1,
1346 [quota_off needs 3 paramters])
1347 AC_MSG_RESULT([yes])
1353 # 2.6.27 has vfs_dq_off inline function.
1354 AC_DEFUN([LC_VFS_DQ_OFF],
1355 [AC_MSG_CHECKING([vfs_dq_off is defined])
1356 LB_LINUX_TRY_COMPILE([
1357 #include <linux/quotaops.h>
1359 vfs_dq_off(NULL, 0);
1361 AC_DEFINE(HAVE_VFS_DQ_OFF, 1, [vfs_dq_off is defined])
1362 AC_MSG_RESULT([yes])
1368 # LC_LOCK_MAP_ACQUIRE
1369 # after 2.6.27 lock_map_acquire replaces lock_acquire
1370 AC_DEFUN([LC_LOCK_MAP_ACQUIRE],
1371 [AC_MSG_CHECKING([if lock_map_acquire is defined])
1372 LB_LINUX_TRY_COMPILE([
1373 #include <linux/lockdep.h>
1375 lock_map_acquire(NULL);
1378 AC_DEFINE(HAVE_LOCK_MAP_ACQUIRE, 1,
1379 [lock_map_acquire is defined])
1385 # 2.6.27.15-2 sles11
1387 # 2.6.27 sles11 remove the bi_hw_segments
1388 AC_DEFUN([LC_BI_HW_SEGMENTS],
1389 [AC_MSG_CHECKING([struct bio has a bi_hw_segments field])
1390 LB_LINUX_TRY_COMPILE([
1391 #include <linux/bio.h>
1394 io.bi_hw_segments = sizeof(io);
1396 AC_DEFINE(HAVE_BI_HW_SEGMENTS, 1,
1397 [struct bio has a bi_hw_segments field])
1398 AC_MSG_RESULT([yes])
1405 # 2.6.27 sles11 move the quotaio_v1{2}.h from include/linux to fs
1406 # 2.6.32 move the quotaio_v1{2}.h from fs to fs/quota
1407 AC_DEFUN([LC_HAVE_QUOTAIO_H],
1408 [LB_CHECK_FILE([$LINUX/include/linux/quotaio_v2.h],[
1409 AC_DEFINE(HAVE_QUOTAIO_H, 1,
1410 [kernel has include/linux/quotaio_v2.h])
1411 ],[LB_CHECK_FILE([$LINUX/fs/quotaio_v2.h],[
1412 AC_DEFINE(HAVE_FS_QUOTAIO_H, 1,
1413 [kernel has fs/quotaio_v1.h])
1414 ],[LB_CHECK_FILE([$LINUX/fs/quota/quotaio_v2.h],[
1415 AC_DEFINE(HAVE_FS_QUOTA_QUOTAIO_H, 1,
1416 [kernel has fs/quota/quotaio_v2.h])
1424 # 2.6.27 sles11 has sb_any_quota_active
1425 AC_DEFUN([LC_SB_ANY_QUOTA_ACTIVE],
1426 [AC_MSG_CHECKING([Kernel has sb_any_quota_active])
1427 LB_LINUX_TRY_COMPILE([
1428 #include <linux/quotaops.h>
1430 sb_any_quota_active(NULL);
1432 AC_DEFINE(HAVE_SB_ANY_QUOTA_ACTIVE, 1,
1433 [Kernel has a sb_any_quota_active])
1434 AC_MSG_RESULT([yes])
1440 # 2.6.27 sles11 has sb_has_quota_active
1441 AC_DEFUN([LC_SB_HAS_QUOTA_ACTIVE],
1442 [AC_MSG_CHECKING([Kernel has sb_has_quota_active])
1443 LB_LINUX_TRY_COMPILE([
1444 #include <linux/quotaops.h>
1446 sb_has_quota_active(NULL, 0);
1448 AC_DEFINE(HAVE_SB_HAS_QUOTA_ACTIVE, 1,
1449 [Kernel has a sb_has_quota_active])
1450 AC_MSG_RESULT([yes])
1456 # 2.6.27 exported add_to_page_cache_lru.
1457 AC_DEFUN([LC_EXPORT_ADD_TO_PAGE_CACHE_LRU],
1458 [LB_CHECK_SYMBOL_EXPORT([add_to_page_cache_lru],
1460 AC_DEFINE(HAVE_ADD_TO_PAGE_CACHE_LRU, 1,
1461 [add_to_page_cache_lru functions are present])
1467 # 2.6.29 introduce sb_any_quota_loaded.
1469 AC_DEFUN([LC_SB_ANY_QUOTA_LOADED],
1470 [AC_MSG_CHECKING([Kernel has sb_any_quota_loaded])
1471 LB_LINUX_TRY_COMPILE([
1472 #include <linux/quotaops.h>
1474 sb_any_quota_loaded(NULL);
1476 AC_DEFINE(HAVE_SB_ANY_QUOTA_LOADED, 1,
1477 [Kernel has a sb_any_quota_loaded])
1478 AC_MSG_RESULT([yes])
1484 # 2.6.30 x86 node_to_cpumask has been removed. must use cpumask_of_node
1485 AC_DEFUN([LC_EXPORT_CPUMASK_OF_NODE],
1486 [LB_CHECK_SYMBOL_EXPORT([node_to_cpumask_map],
1487 [arch/$LINUX_ARCH/mm/numa.c],
1488 [AC_DEFINE(HAVE_CPUMASK_OF_NODE, 1,
1489 [node_to_cpumask_map is exported by
1490 the kernel])]) # x86_64
1493 # 2.6.31 replaces blk_queue_hardsect_size by blk_queue_logical_block_size function
1494 AC_DEFUN([LC_BLK_QUEUE_LOG_BLK_SIZE],
1495 [AC_MSG_CHECKING([if blk_queue_logical_block_size is defined])
1496 LB_LINUX_TRY_COMPILE([
1497 #include <linux/blkdev.h>
1499 blk_queue_logical_block_size(NULL, 0);
1502 AC_DEFINE(HAVE_BLK_QUEUE_LOG_BLK_SIZE, 1,
1503 [blk_queue_logical_block_size is defined])
1511 # 2.6.32 changes cache_detail's member cache_request to cache_upcall
1512 # in kernel commit bc74b4f5e63a09fb78e245794a0de1e5a2716bbe
1513 AC_DEFUN([LC_CACHE_UPCALL],
1514 [AC_MSG_CHECKING([if cache_detail has cache_upcall field])
1515 LB_LINUX_TRY_COMPILE([
1516 #include <linux/sunrpc/cache.h>
1518 struct cache_detail cd;
1519 cd.cache_upcall = NULL;
1522 AC_DEFINE(HAVE_CACHE_UPCALL, 1,
1523 [cache_detail has cache_upcall field])
1529 # 2.6.32 add a limits member in struct request_queue.
1530 AC_DEFUN([LC_REQUEST_QUEUE_LIMITS],
1531 [AC_MSG_CHECKING([if request_queue has a limits field])
1532 LB_LINUX_TRY_COMPILE([
1533 #include <linux/blkdev.h>
1535 struct request_queue rq;
1536 rq.limits.io_min = 0;
1539 AC_DEFINE(HAVE_REQUEST_QUEUE_LIMITS, 1,
1540 [request_queue has a limits field])
1546 # 2.6.32 has bdi_register() functions.
1547 AC_DEFUN([LC_EXPORT_BDI_REGISTER],
1548 [LB_CHECK_SYMBOL_EXPORT([bdi_register],
1549 [mm/backing-dev.c],[
1550 AC_DEFINE(HAVE_BDI_REGISTER, 1,
1551 [bdi_register function is present])
1556 # 2.6.32 add s_bdi for super block
1557 AC_DEFUN([LC_SB_BDI],
1558 [AC_MSG_CHECKING([if super_block has s_bdi field])
1559 LB_LINUX_TRY_COMPILE([
1560 #include <linux/fs.h>
1562 struct super_block sb;
1566 AC_DEFINE(HAVE_SB_BDI, 1,
1567 [super_block has s_bdi field])
1573 # 2.6.27.15-2 SuSE 11 sp0 kernels lack the name field for BDI
1574 AC_DEFUN([LC_BDI_NAME],
1575 [AC_MSG_CHECKING([if backing_device_info has name field])
1576 LB_LINUX_TRY_COMPILE([
1577 #include <linux/blkkdev.h>
1579 struct backing_dev_info bdi;
1583 AC_DEFINE(HAVE_BDI_NAME, 1,
1584 [backing_device_info has name field])
1590 # 2.6.32 removes blk_queue_max_sectors and add blk_queue_max_hw_sectors
1591 # check blk_queue_max_sectors and use it until disappear.
1592 AC_DEFUN([LC_BLK_QUEUE_MAX_SECTORS],
1593 [AC_MSG_CHECKING([if blk_queue_max_sectors is defined])
1594 LB_LINUX_TRY_COMPILE([
1595 #include <linux/blkdev.h>
1597 blk_queue_max_sectors(NULL, 0);
1600 AC_DEFINE(HAVE_BLK_QUEUE_MAX_SECTORS, 1,
1601 [blk_queue_max_sectors is defined])
1607 # 2.6.32 replaces 2 functions blk_queue_max_phys_segments and blk_queue_max_hw_segments by blk_queue_max_segments
1608 AC_DEFUN([LC_BLK_QUEUE_MAX_SEGMENTS],
1609 [AC_MSG_CHECKING([if blk_queue_max_segments is defined])
1610 LB_LINUX_TRY_COMPILE([
1611 #include <linux/blkdev.h>
1613 blk_queue_max_segments(NULL, 0);
1616 AC_DEFINE(HAVE_BLK_QUEUE_MAX_SEGMENTS, 1,
1617 [blk_queue_max_segments is defined])
1626 # Check if kernel has been patched for 64-bit quota limits support.
1627 # The upstream version of this patch in RHEL6 2.6.32 kernels introduces
1628 # the constant QFMT_VFS_V1 in include/linux/quota.h, so we can check for
1629 # that in the absence of quotaio_v1.h in the kernel headers.
1631 AC_DEFUN([LC_QUOTA64],[
1632 AC_MSG_CHECKING([if kernel has 64-bit quota limits support])
1633 tmp_flags="$EXTRA_KCFLAGS"
1634 EXTRA_KCFLAGS="-I$LINUX/fs"
1635 LB_LINUX_TRY_COMPILE([
1636 #include <linux/kernel.h>
1637 #include <linux/fs.h>
1638 #ifdef HAVE_QUOTAIO_H
1639 # include <linux/quotaio_v2.h>
1640 int versions[] = V2_INITQVERSIONS_R1;
1641 struct v2_disk_dqblk_r1 dqblk_r1;
1642 #elif defined(HAVE_FS_QUOTA_QUOTAIO_H)
1643 # include <quota/quotaio_v2.h>
1644 struct v2r1_disk_dqblk dqblk_r1;
1645 #elif defined(HAVE_FS_QUOTAIO_H)
1646 # include <quotaio_v2.h>
1647 struct v2r1_disk_dqblk dqblk_r1;
1649 #include <linux/quota.h>
1650 int ver = QFMT_VFS_V1;
1653 AC_DEFINE(HAVE_QUOTA64, 1, [have quota64])
1654 AC_MSG_RESULT([yes])
1656 LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],[
1657 AC_MSG_ERROR([You have got no 64-bit kernel quota support.])
1661 EXTRA_KCFLAGS=$tmp_flags
1664 # 2.6.32 set_cpus_allowed is no more defined if CONFIG_CPUMASK_OFFSTACK=yes
1665 AC_DEFUN([LC_SET_CPUS_ALLOWED],
1666 [AC_MSG_CHECKING([if kernel defines set_cpus_allowed])
1667 LB_LINUX_TRY_COMPILE(
1668 [#include <linux/sched.h>],
1669 [struct task_struct *p = NULL;
1670 cpumask_t mask = { { 0 } };
1671 (void) set_cpus_allowed(p, mask);],
1672 [AC_MSG_RESULT([yes])
1673 AC_DEFINE(HAVE_SET_CPUS_ALLOWED, 1,
1674 [set_cpus_allowed is exported by the kernel])],
1675 [AC_MSG_RESULT([no])] )])
1677 # 2.6.32 introduces selinux_is_enabled()
1678 AC_DEFUN([LC_SELINUX_IS_ENABLED],
1679 [AC_MSG_CHECKING([if selinux_is_enabled is available])
1680 LB_LINUX_TRY_COMPILE([
1681 #include <linux/selinux.h>
1683 selinux_is_enabled();
1685 AC_MSG_RESULT([yes])
1686 AC_DEFINE(HAVE_SELINUX_IS_ENABLED, 1,
1687 [selinux_is_enabled is defined])
1695 # starting from 2.6.28 kernel replaces d_alloc_anon() with
1696 # d_obtain_alias() for getting anonymous dentries
1697 # RHEL5(2.6.18) has d_obtain_alias but SLES11SP0(2.6.27) not
1699 AC_DEFUN([LC_D_OBTAIN_ALIAS],
1700 [AC_MSG_CHECKING([d_obtain_alias exist in kernel])
1701 LB_LINUX_TRY_COMPILE([
1702 #include <linux/dcache.h>
1704 d_obtain_alias(NULL);
1706 AC_DEFINE(HAVE_D_OBTAIN_ALIAS, 1,
1707 [d_obtain_alias exist in kernel])
1708 AC_MSG_RESULT([yes])
1715 # LC_EXPORT_GENERIC_ERROR_REMOVE_PAGE
1717 AC_DEFUN([LC_EXPORT_GENERIC_ERROR_REMOVE_PAGE],
1718 [LB_CHECK_SYMBOL_EXPORT(
1719 [generic_error_remove_page],
1721 [AC_DEFINE(HAS_GENERIC_ERROR_REMOVE_PAGE, 1,
1722 [kernel export generic_error_remove_page])],
1727 # 2.6.32 if kernel export access_process_vm().
1728 AC_DEFUN([LC_EXPORT_ACCESS_PROCESS_VM],
1729 [LB_CHECK_SYMBOL_EXPORT([access_process_vm],
1731 [AC_DEFINE(HAVE_ACCESS_PROCESS_VM, 1,
1732 [access_process_vm function is present])],
1738 # 2.6.36 fs_struct.lock use spinlock instead of rwlock.
1740 AC_DEFUN([LC_FS_STRUCT_RWLOCK],
1741 [AC_MSG_CHECKING([if fs_struct.lock use rwlock])
1742 LB_LINUX_TRY_COMPILE([
1743 #include <asm/atomic.h>
1744 #include <linux/spinlock.h>
1745 #include <linux/fs_struct.h>
1747 ((struct fs_struct *)0)->lock = (rwlock_t){ 0 };
1749 AC_DEFINE(HAVE_FS_STRUCT_RWLOCK, 1,
1750 [fs_struct.lock use rwlock])
1751 AC_MSG_RESULT([yes])
1758 # 2.6.36 super_operations add evict_inode method. it hybird of
1759 # delete_inode & clear_inode.
1761 AC_DEFUN([LC_SBOPS_EVICT_INODE],
1762 [AC_MSG_CHECKING([if super_operations.evict_inode exist])
1763 LB_LINUX_TRY_COMPILE([
1764 #include <linux/fs.h>
1766 ((struct super_operations *)0)->evict_inode(NULL);
1768 AC_DEFINE(HAVE_SBOPS_EVICT_INODE, 1,
1769 [super_operations.evict_inode() is exist in kernel])
1770 AC_MSG_RESULT([yes])
1777 # 2.6.35 file_operations.fsync taken 2 arguments.
1778 # 3.0.0 file_operations.fsync takes 4 arguments.
1780 AC_DEFUN([LC_FILE_FSYNC],
1781 [AC_MSG_CHECKING([if file_operations.fsync takes 4 or 2 arguments])
1782 LB_LINUX_TRY_COMPILE([
1783 #include <linux/fs.h>
1785 ((struct file_operations *)0)->fsync(NULL, 0, 0, 0);
1787 AC_DEFINE(HAVE_FILE_FSYNC_4ARGS, 1,
1788 [file_operations.fsync takes 4 arguments])
1789 AC_MSG_RESULT([yes, 4 args])
1791 LB_LINUX_TRY_COMPILE([
1792 #include <linux/fs.h>
1794 ((struct file_operations *)0)->fsync(NULL, 0);
1796 AC_DEFINE(HAVE_FILE_FSYNC_2ARGS, 1,
1797 [file_operations.fsync takes 2 arguments])
1798 AC_MSG_RESULT([yes, 2 args])
1806 # 2.6.37 remove kernel_locked
1808 AC_DEFUN([LC_KERNEL_LOCKED],
1809 [AC_MSG_CHECKING([if kernel_locked is defined])
1810 LB_LINUX_TRY_COMPILE([
1811 #include <linux/smp_lock.h>
1815 AC_MSG_RESULT([yes])
1816 AC_DEFINE(HAVE_KERNEL_LOCKED, 1,
1817 [kernel_locked is defined])
1824 # 2.6.38 dentry_operations.d_compare() taken 7 arguments.
1826 AC_DEFUN([LC_D_COMPARE_7ARGS],
1827 [AC_MSG_CHECKING([if d_compare taken 7 arguments])
1828 LB_LINUX_TRY_COMPILE([
1829 #include <linux/dcache.h>
1831 ((struct dentry_operations*)0)->d_compare(NULL,NULL,NULL,NULL,0,NULL,NULL);
1833 AC_DEFINE(HAVE_D_COMPARE_7ARGS, 1,
1834 [d_compare need 7 arguments])
1835 AC_MSG_RESULT([yes])
1842 # 2.6.38 dentry_operations.d_delete() defined 'const' for 1st parameter.
1844 AC_DEFUN([LC_D_DELETE_CONST],
1845 [AC_MSG_CHECKING([if d_delete has const declare on first parameter])
1846 tmp_flags="$EXTRA_KCFLAGS"
1847 EXTRA_KCFLAGS="-Werror"
1848 LB_LINUX_TRY_COMPILE([
1849 #include <linux/dcache.h>
1851 const struct dentry *d = NULL;
1852 ((struct dentry_operations*)0)->d_delete(d);
1854 AC_DEFINE(HAVE_D_DELETE_CONST, const,
1855 [d_delete first parameter declared const])
1856 AC_MSG_RESULT([yes])
1858 AC_DEFINE(HAVE_D_DELETE_CONST, , [])
1861 EXTRA_KCFLAGS="$tmp_flags"
1865 # 2.6.38 dcache_lock removed. rcu-walk commited.
1867 AC_DEFUN([LC_DCACHE_LOCK],
1868 [AC_MSG_CHECKING([if dcache_lock is exist])
1869 LB_LINUX_TRY_COMPILE([
1870 #include <linux/dcache.h>
1872 spin_lock(&dcache_lock);
1874 AC_DEFINE(HAVE_DCACHE_LOCK, 1,
1875 [dcache_lock is exist])
1876 AC_MSG_RESULT([yes])
1883 # 2.6.38 export blkdev_get_by_dev
1885 AC_DEFUN([LC_BLKDEV_GET_BY_DEV],
1886 [LB_CHECK_SYMBOL_EXPORT([blkdev_get_by_dev],
1888 AC_DEFINE(HAVE_BLKDEV_GET_BY_DEV, 1,
1889 [blkdev_get_by_dev is exported by the kernel])
1895 # 2.6.38 vfsmount.mnt_count doesn't use atomic_t
1897 AC_DEFUN([LC_ATOMIC_MNT_COUNT],
1898 [AC_MSG_CHECKING([if vfsmount.mnt_count is atomic_t])
1899 LB_LINUX_TRY_COMPILE([
1900 #include <asm/atomic.h>
1901 #include <linux/fs.h>
1902 #include <linux/mount.h>
1904 ((struct vfsmount *)0)->mnt_count = ((atomic_t) { 0 });
1906 AC_DEFINE(HAVE_ATOMIC_MNT_COUNT, 1,
1907 [vfsmount.mnt_count is atomic_t])
1908 AC_MSG_RESULT([yes])
1915 # 2.6.38 use path as 4th parameter in quota_on.
1917 AC_DEFUN([LC_QUOTA_ON_USE_PATH],
1918 [AC_MSG_CHECKING([quota_on use path as parameter])
1919 tmp_flags="$EXTRA_KCFLAGS"
1920 EXTRA_KCFLAGS="-Werror"
1921 LB_LINUX_TRY_COMPILE([
1922 #include <linux/fs.h>
1923 #include <linux/quota.h>
1925 ((struct quotactl_ops *)0)->quota_on(NULL, 0, 0, ((struct path*)0));
1927 AC_DEFINE(HAVE_QUOTA_ON_USE_PATH, 1,
1928 [quota_on use path as 4th paramter])
1929 AC_MSG_RESULT([yes])
1933 EXTRA_KCFLAGS="$tmp_flags"
1937 # 2.6.39 remove unplug_fn from request_queue.
1939 AC_DEFUN([LC_REQUEST_QUEUE_UNPLUG_FN],
1940 [AC_MSG_CHECKING([if request_queue has unplug_fn field])
1941 LB_LINUX_TRY_COMPILE([
1942 #include <linux/blkdev.h>
1944 do{ }while(sizeof(((struct request_queue *)0)->unplug_fn));
1946 AC_DEFINE(HAVE_REQUEST_QUEUE_UNPLUG_FN, 1,
1947 [request_queue has unplug_fn field])
1948 AC_MSG_RESULT([yes])
1955 # 2.6.38 generic_permission taken 4 paremater.
1956 # in fact, it means rcu-walk aware permission bring.
1958 AC_DEFUN([LC_GENERIC_PERMISSION],
1959 [AC_MSG_CHECKING([if generic_permission take 4 arguments])
1960 LB_LINUX_TRY_COMPILE([
1961 #include <linux/fs.h>
1963 generic_permission(NULL, 0, 0, NULL);
1965 AC_DEFINE(HAVE_GENERIC_PERMISSION_4ARGS, 1,
1966 [generic_permission taken 4 arguments])
1967 AC_MSG_RESULT([yes])
1974 # 2.6.38 export simple_setattr
1976 AC_DEFUN([LC_EXPORT_SIMPLE_SETATTR],
1977 [LB_CHECK_SYMBOL_EXPORT([simple_setattr],
1979 AC_DEFINE(HAVE_SIMPLE_SETATTR, 1,
1980 [simple_setattr is exported by the kernel])
1988 # Lustre linux kernel checks
1990 AC_DEFUN([LC_PROG_LINUX],
1994 LC_CONFIG_LIBLUSTRE_RECOVERY
1995 LC_CONFIG_HEALTH_CHECK_WRITE
1996 LC_CONFIG_LRU_RESIZE
1997 LC_LLITE_LLOOP_MODULE
2000 LC_EXPORT_TRUNCATE_COMPLETE
2001 LC_EXPORT_D_REHASH_COND
2002 LC_EXPORT___D_REHASH
2003 LC_EXPORT_NODE_TO_CPUMASK
2027 LC_SECURITY_PLUG # for SLES10 SP2
2035 LC_STATFS_DENTRY_PARAM
2036 LC_UMOUNTBEGIN_HAS_VFSMOUNT
2038 if test x$enable_server = xyes ; then
2039 LC_EXPORT_INVALIDATE_MAPPING_PAGES
2042 #2.6.18 + RHEL5 (fc6)
2053 LC_CANCEL_DIRTY_PAGE
2055 # raid5-zerocopy patch
2059 LC_INVALIDATE_BDEV_2ARG
2060 LC_ASYNC_BLOCK_CIPHER
2062 LC_STRUCT_BLKCIPHER_DESC
2063 LC_FS_RENAME_DOES_D_MOVE
2066 LC_UNREGISTER_BLKDEV_RETURN_INT
2067 LC_KERNEL_SPLICE_READ
2072 LC_EXPORTFS_DECODE_FH
2082 LC_FS_STRUCT_USE_PATH
2085 LC_PGMKWRITE_USE_VMFAULT
2086 LC_INODE_PERMISION_2ARGS
2089 LC_READ_INODE_IN_SBOPS
2090 LC_EXPORT_INODE_PERMISSION
2096 # 2.6.27.15-2 sles11
2100 LC_SB_ANY_QUOTA_ACTIVE
2101 LC_SB_HAS_QUOTA_ACTIVE
2102 LC_EXPORT_ADD_TO_PAGE_CACHE_LRU
2105 LC_SB_ANY_QUOTA_LOADED
2108 LC_EXPORT_CPUMASK_OF_NODE
2111 LC_BLK_QUEUE_LOG_BLK_SIZE
2114 LC_REQUEST_QUEUE_LIMITS
2115 LC_EXPORT_BDI_REGISTER
2117 LC_BLK_QUEUE_MAX_SECTORS
2118 LC_BLK_QUEUE_MAX_SEGMENTS
2121 LC_EXPORT_GENERIC_ERROR_REMOVE_PAGE
2122 LC_SELINUX_IS_ENABLED
2123 LC_EXPORT_ACCESS_PROCESS_VM
2127 LC_EXPORT_SIMPLE_SETATTR
2131 LC_SBOPS_EVICT_INODE
2138 LC_BLKDEV_GET_BY_DEV
2139 LC_GENERIC_PERMISSION
2140 LC_QUOTA_ON_USE_PATH
2146 LC_REQUEST_QUEUE_UNPLUG_FN
2149 if test x$enable_server = xyes ; then
2150 AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server])
2151 LC_FUNC_DEV_SET_RDONLY
2159 # LC_CONFIG_CLIENT_SERVER
2161 # Build client/server sides of Lustre
2163 AC_DEFUN([LC_CONFIG_CLIENT_SERVER],
2164 [AC_MSG_CHECKING([whether to build Lustre server support])
2165 AC_ARG_ENABLE([server],
2166 AC_HELP_STRING([--disable-server],
2167 [disable Lustre server support]),
2168 [],[enable_server='yes'])
2169 AC_MSG_RESULT([$enable_server])
2171 AC_MSG_CHECKING([whether to build Lustre client support])
2172 AC_ARG_ENABLE([client],
2173 AC_HELP_STRING([--disable-client],
2174 [disable Lustre client support]),
2175 [],[enable_client='yes'])
2176 AC_MSG_RESULT([$enable_client])])
2179 # LC_CONFIG_LIBLUSTRE
2181 # whether to build liblustre
2183 AC_DEFUN([LC_CONFIG_LIBLUSTRE],
2184 [AC_MSG_CHECKING([whether to build Lustre library])
2185 AC_ARG_ENABLE([liblustre],
2186 AC_HELP_STRING([--disable-liblustre],
2187 [disable building of Lustre library]),
2188 [],[enable_liblustre=$with_sysio])
2189 AC_MSG_RESULT([$enable_liblustre])
2190 # only build sysio if liblustre is built
2191 with_sysio="$enable_liblustre"
2193 AC_MSG_CHECKING([whether to build liblustre tests])
2194 AC_ARG_ENABLE([liblustre-tests],
2195 AC_HELP_STRING([--enable-liblustre-tests],
2196 [enable liblustre tests, if --disable-tests is used]),
2197 [],[enable_liblustre_tests=$enable_tests])
2198 if test x$enable_liblustre != xyes ; then
2199 enable_liblustre_tests='no'
2201 AC_MSG_RESULT([$enable_liblustre_tests])
2203 AC_MSG_CHECKING([whether to enable liblustre acl])
2204 AC_ARG_ENABLE([liblustre-acl],
2205 AC_HELP_STRING([--disable-liblustre-acl],
2206 [disable ACL support for liblustre]),
2207 [],[enable_liblustre_acl=yes])
2208 AC_MSG_RESULT([$enable_liblustre_acl])
2209 if test x$enable_liblustre_acl = xyes ; then
2210 AC_DEFINE(LIBLUSTRE_POSIX_ACL, 1, Liblustre Support ACL-enabled MDS)
2213 # 2.6.29 change prepare/commit_write to write_begin/end
2214 AC_DEFUN([LC_WRITE_BEGIN_END],
2215 [AC_MSG_CHECKING([if kernel has .write_begin/end])
2216 LB_LINUX_TRY_COMPILE([
2217 #include <linux/fs.h>
2218 #include <linux/pagemap.h>
2219 #ifdef HAVE_LINUX_MMTYPES_H
2220 #include <linux/mm_types.h>
2223 struct address_space_operations aops;
2226 aops.write_begin = NULL;
2227 aops.write_end = NULL;
2228 page = grab_cache_page_write_begin(NULL, 0, 0);
2230 AC_MSG_RESULT([yes])
2231 AC_DEFINE(HAVE_KERNEL_WRITE_BEGIN_END, 1,
2232 [kernel has .write_begin/end])
2238 # 2.6.29 blkdev_put has 2 arguments
2239 AC_DEFUN([LC_BLKDEV_PUT_2ARGS],
2240 [AC_MSG_CHECKING([blkdev_put needs 2 parameters])
2241 LB_LINUX_TRY_COMPILE([
2242 #include <linux/fs.h>
2244 blkdev_put(NULL, 0);
2246 AC_DEFINE(HAVE_BLKDEV_PUT_2ARGS, 1,
2247 [blkdev_put needs 2 paramters])
2248 AC_MSG_RESULT([yes])
2254 # 2.6.29 dentry_open has 4 arguments
2255 AC_DEFUN([LC_DENTRY_OPEN_4ARGS],
2256 [AC_MSG_CHECKING([dentry_open needs 4 parameters])
2257 LB_LINUX_TRY_COMPILE([
2258 #include <linux/fs.h>
2260 dentry_open(NULL, NULL, 0, NULL);
2262 AC_DEFINE(HAVE_DENTRY_OPEN_4ARGS, 1,
2263 [dentry_open needs 4 paramters])
2264 AC_MSG_RESULT([yes])
2270 # 2.6.29 split file and anonymous page queues
2271 AC_DEFUN([LC_PAGEVEC_LRU_ADD_FILE],
2272 [AC_MSG_CHECKING([if kernel has .pagevec_lru_add_file])
2273 LB_LINUX_TRY_COMPILE([
2274 #include <linux/mm.h>
2275 #include <linux/pagevec.h>
2277 struct pagevec lru_pagevec;
2279 pagevec_init(&lru_pagevec, 0);
2280 pagevec_lru_add_file(&lru_pagevec);
2282 AC_MSG_RESULT([yes])
2283 AC_DEFINE(HAVE_PAGEVEC_LRU_ADD_FILE, 1,
2284 [kernel has .pagevec_lru_add_file])
2293 AC_ARG_ENABLE(mpitests,
2294 AC_HELP_STRING([--enable-mpitests=yes|no|mpicc wrapper],
2295 [include mpi tests]),
2306 MPICC_WRAPPER=$enableval
2316 if test x$enable_mpitests != xno; then
2317 AC_MSG_CHECKING([whether mpitests can be built])
2325 MPI_Initialized(&flag);
2328 AC_MSG_RESULT([yes])
2335 AC_SUBST(MPICC_WRAPPER)
2337 AC_MSG_NOTICE([Enabling Lustre configure options for libsysio])
2338 ac_configure_args="$ac_configure_args --with-lustre-hack --with-sockets"
2341 LC_CONFIG_LIBLUSTRE_RECOVERY
2347 # whether to enable quota support global control
2349 AC_DEFUN([LC_CONFIG_QUOTA],
2350 [AC_ARG_ENABLE([quota],
2351 AC_HELP_STRING([--enable-quota],
2352 [enable quota support]),
2353 [],[enable_quota='yes'])
2356 AC_DEFUN([LC_QUOTA],
2360 AC_CHECK_HEADER(sys/quota.h,
2361 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1, [Define to 1 if you have <sys/quota.h>.])],
2362 [AC_MSG_ERROR([don't find <sys/quota.h> in your system])])
2368 # whether to enable split support
2370 AC_DEFUN([LC_CONFIG_SPLIT],
2371 [AC_MSG_CHECKING([whether to enable split support])
2372 AC_ARG_ENABLE([split],
2373 AC_HELP_STRING([--enable-split],
2374 [enable split support]),
2375 [],[enable_split='no'])
2376 AC_MSG_RESULT([$enable_split])
2377 if test x$enable_split != xno; then
2378 AC_DEFINE(HAVE_SPLIT_SUPPORT, 1, [enable split support])
2382 # RHEL5(2.6.18) has tux_info
2383 AC_DEFUN([LC_TASK_CLENV_TUX_INFO],
2384 [AC_MSG_CHECKING([tux_info])
2385 LB_LINUX_TRY_COMPILE([
2386 #include <linux/sched.h>
2388 struct task_struct task;
2391 AC_MSG_RESULT([yes])
2392 AC_DEFINE(LL_TASK_CL_ENV, tux_info, [have tux_info])
2393 have_task_clenv_store='yes'
2400 # LC_LLITE_LLOOP_MODULE
2401 # lloop_llite.ko does not currently work with page sizes
2404 AC_DEFUN([LC_LLITE_LLOOP_MODULE],
2405 [AC_MSG_CHECKING([whether to enable llite_lloop module])
2406 LB_LINUX_TRY_COMPILE([
2407 #include <asm/page.h>
2409 #if PAGE_SIZE >= 65536
2410 #error "PAGE_SIZE >= 65536"
2413 enable_llite_lloop_module='yes'
2414 AC_MSG_RESULT([yes])
2416 enable_llite_lloop_module='no'
2424 # other configure checks
2426 AC_DEFUN([LC_CONFIGURE],
2427 [LC_CONFIG_OBD_BUFFER_SIZE
2429 if test $target_cpu == "i686" -o $target_cpu == "x86_64"; then
2430 CFLAGS="$CFLAGS -Werror"
2433 # maximum MDS thread count
2436 # include/liblustre.h
2437 AC_CHECK_HEADERS([sys/user.h sys/vfs.h stdint.h blkid/blkid.h])
2439 # liblustre/llite_lib.h
2440 AC_CHECK_HEADERS([xtio.h file.h])
2443 AC_CHECK_HEADERS([linux/types.h sys/types.h linux/unistd.h unistd.h])
2446 AC_CHECK_HEADERS([netinet/in.h arpa/inet.h catamount/data.h])
2447 AC_CHECK_FUNCS([inet_ntoa])
2449 # libsysio/src/readlink.c
2452 # lvfs/prng.c - depends on linux/types.h from liblustre/dir.c
2453 AC_CHECK_HEADERS([linux/random.h], [], [],
2454 [#ifdef HAVE_LINUX_TYPES_H
2455 # include <linux/types.h>
2460 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
2462 # check for -lz support
2466 [AC_CHECK_HEADERS([zlib.h],
2468 AC_DEFINE([HAVE_ADLER], 1,
2469 [support alder32 checksum type])],
2470 [AC_MSG_WARN([No zlib-devel package found,
2471 unable to use adler32 checksum])])],
2472 [AC_MSG_WARN([No zlib package found, unable to use adler32 checksum])]
2477 AC_ARG_ENABLE([mindf],
2478 AC_HELP_STRING([--enable-mindf],
2479 [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
2481 if test "$enable_mindf" = "yes" ; then
2482 AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])
2485 AC_ARG_ENABLE([fail_alloc],
2486 AC_HELP_STRING([--disable-fail-alloc],
2487 [disable randomly alloc failure]),
2488 [],[enable_fail_alloc=yes])
2489 AC_MSG_CHECKING([whether to randomly failing memory alloc])
2490 AC_MSG_RESULT([$enable_fail_alloc])
2491 if test x$enable_fail_alloc != xno ; then
2492 AC_DEFINE([RANDOM_FAIL_ALLOC], 1, [enable randomly alloc failure])
2495 AC_ARG_ENABLE([invariants],
2496 AC_HELP_STRING([--enable-invariants],
2497 [enable invariant checking (cpu intensive)]),
2499 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
2500 AC_MSG_RESULT([$enable_invariants])
2501 if test x$enable_invariants = xyes ; then
2502 AC_DEFINE([INVARIANT_CHECK], 1, [enable invariant checking])
2505 AC_ARG_ENABLE([lu_ref],
2506 AC_HELP_STRING([--enable-lu_ref],
2507 [enable lu_ref reference tracking code]),
2509 AC_MSG_CHECKING([whether to track references with lu_ref])
2510 AC_MSG_RESULT([$enable_lu_ref])
2511 if test x$enable_lu_ref = xyes ; then
2512 AC_DEFINE([USE_LU_REF], 1, [enable lu_ref reference tracking code])
2515 AC_ARG_ENABLE([pgstate-track],
2516 AC_HELP_STRING([--enable-pgstate-track],
2517 [enable page state tracking]),
2518 [enable_pgstat_track='yes'],[])
2519 AC_MSG_CHECKING([whether to enable page state tracking])
2520 AC_MSG_RESULT([$enable_pgstat_track])
2521 if test x$enable_pgstat_track = xyes ; then
2522 AC_DEFINE([LUSTRE_PAGESTATE_TRACKING], 1,
2523 [enable page state tracking code])
2530 LC_DENTRY_OPEN_4ARGS
2531 LC_PAGEVEC_LRU_ADD_FILE
2538 # AM_CONDITIONALS for lustre
2540 AC_DEFUN([LC_CONDITIONALS],
2541 [AM_CONDITIONAL(LIBLUSTRE, test x$enable_liblustre = xyes)
2542 AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno)
2543 AM_CONDITIONAL(LIBLUSTRE_TESTS, test x$enable_liblustre_tests = xyes)
2544 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
2545 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
2546 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
2547 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
2548 AM_CONDITIONAL(BLKID, test x$ac_cv_header_blkid_blkid_h = xyes)
2549 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
2550 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
2551 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
2552 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
2553 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
2554 AM_CONDITIONAL(LLITE_LLOOP, test x$enable_llite_lloop_module = xyes)
2560 # files that should be generated with AC_OUTPUT
2562 AC_DEFUN([LC_CONFIG_FILES],
2566 lustre/autoconf/Makefile
2567 lustre/conf/Makefile
2568 lustre/contrib/Makefile
2570 lustre/include/Makefile
2571 lustre/include/lustre_ver.h
2572 lustre/include/linux/Makefile
2573 lustre/include/darwin/Makefile
2574 lustre/include/lustre/Makefile
2575 lustre/kernel_patches/targets/2.6-rhel6.target
2576 lustre/kernel_patches/targets/2.6-rhel5.target
2577 lustre/kernel_patches/targets/2.6-sles10.target
2578 lustre/kernel_patches/targets/2.6-sles11.target
2579 lustre/kernel_patches/targets/2.6-oel5.target
2580 lustre/kernel_patches/targets/2.6-fc11.target
2581 lustre/kernel_patches/targets/2.6-fc12.target
2582 lustre/ldlm/Makefile
2584 lustre/fid/autoMakefile
2585 lustre/liblustre/Makefile
2586 lustre/liblustre/tests/Makefile
2587 lustre/liblustre/tests/mpi/Makefile
2588 lustre/llite/Makefile
2589 lustre/llite/autoMakefile
2590 lustre/lclient/Makefile
2592 lustre/lov/autoMakefile
2593 lustre/lvfs/Makefile
2594 lustre/lvfs/autoMakefile
2596 lustre/mdc/autoMakefile
2598 lustre/lmv/autoMakefile
2600 lustre/mds/autoMakefile
2602 lustre/mdt/autoMakefile
2604 lustre/cmm/autoMakefile
2606 lustre/mdd/autoMakefile
2608 lustre/fld/autoMakefile
2609 lustre/obdclass/Makefile
2610 lustre/obdclass/autoMakefile
2611 lustre/obdclass/linux/Makefile
2612 lustre/obdecho/Makefile
2613 lustre/obdecho/autoMakefile
2614 lustre/obdfilter/Makefile
2615 lustre/obdfilter/autoMakefile
2617 lustre/ofd/autoMakefile
2619 lustre/osc/autoMakefile
2621 lustre/ost/autoMakefile
2622 lustre/osd-ldiskfs/Makefile
2623 lustre/osd-ldiskfs/autoMakefile
2624 lustre/osd-zfs/Makefile
2625 lustre/osd-zfs/autoMakefile
2627 lustre/mgc/autoMakefile
2629 lustre/mgs/autoMakefile
2630 lustre/ptlrpc/Makefile
2631 lustre/ptlrpc/autoMakefile
2632 lustre/ptlrpc/gss/Makefile
2633 lustre/ptlrpc/gss/autoMakefile
2634 lustre/quota/Makefile
2635 lustre/quota/autoMakefile
2636 lustre/scripts/Makefile
2637 lustre/scripts/lustre
2638 lustre/tests/Makefile
2639 lustre/tests/mpi/Makefile
2640 lustre/utils/Makefile
2641 lustre/utils/gss/Makefile
2642 lustre/obdclass/darwin/Makefile