1 #* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 #* vim:expandtab:shiftwidth=8:tabstop=8:
6 # Wrapper for AC_CONFIG_SUBDIR
8 AC_DEFUN([LC_CONFIG_SRCDIR],
9 [AC_CONFIG_SRCDIR([lustre/obdclass/obdo.c])
17 # lustre specific paths
19 AC_DEFUN([LC_PATH_DEFAULTS],
20 [# ptlrpc kernel build requires this
28 demodir='$(docdir)/demo'
31 pkgexampledir='${pkgdatadir}/examples'
32 AC_SUBST(pkgexampledir)
38 # is the target os supported?
40 AC_DEFUN([LC_TARGET_SUPPORTED],
52 # LC_CONFIG_OBD_BUFFER_SIZE
54 # the maximum buffer size of lctl ioctls
56 AC_DEFUN([LC_CONFIG_OBD_BUFFER_SIZE],
57 [AC_MSG_CHECKING([maximum OBD ioctl size])
58 AC_ARG_WITH([obd-buffer-size],
59 AC_HELP_STRING([--with-obd-buffer-size=[size]],
60 [set lctl ioctl maximum bytes (default=8192)]),
62 OBD_BUFFER_SIZE=$with_obd_buffer_size
66 AC_MSG_RESULT([$OBD_BUFFER_SIZE bytes])
67 AC_DEFINE_UNQUOTED(OBD_MAX_IOCTL_BUFFER, $OBD_BUFFER_SIZE, [IOCTL Buffer Size])
73 AC_DEFUN([LC_READLINK_SSIZE_T],
74 [AC_MSG_CHECKING([if readlink returns ssize_t])
78 ssize_t readlink(const char *, char *, size_t);
81 AC_DEFINE(HAVE_POSIX_1003_READLINK, 1, [readlink returns ssize_t])
88 # LC_FUNC_DEV_SET_RDONLY
90 # check whether dev_set_rdonly is exported. This is needed until we
91 # have another mechanism to fence IO from the underlying device.
93 AC_DEFUN([LC_FUNC_DEV_SET_RDONLY],
94 [LB_CHECK_SYMBOL_EXPORT([dev_set_rdonly],
95 [block/ll_rw_block.c,block/blk-core.c],[
96 AC_DEFINE(HAVE_DEV_SET_RDONLY, 1, [kernel exports dev_set_rdonly])
98 AC_MSG_WARN([kernel missing dev_set_rdonly patch for testing])
103 # Ensure stack size big than 8k in Lustre server (all kernels)
105 AC_DEFUN([LC_STACK_SIZE],
106 [AC_MSG_CHECKING([stack size big than 8k])
107 LB_LINUX_TRY_COMPILE([
108 #include <linux/thread_info.h>
110 #if THREAD_SIZE < 8192
111 #error "stack size < 8192"
116 AC_MSG_ERROR([Lustre requires that Linux is configured with at least a 8KB stack.])
121 # Allow the user to set the MDS thread upper limit
123 AC_DEFUN([LC_MDS_MAX_THREADS],
125 AC_ARG_WITH([mds_max_threads],
126 AC_HELP_STRING([--with-mds-max-threads=size],
127 [define the maximum number of threads available on the MDS: (default=512)]),
129 MDS_THREAD_COUNT=$with_mds_max_threads
130 AC_DEFINE_UNQUOTED(MDT_MAX_THREADS, $MDS_THREAD_COUNT, [maximum number of mdt threads])
137 # the pinger is temporary, until we have the recovery node in place
139 AC_DEFUN([LC_CONFIG_PINGER],
140 [AC_MSG_CHECKING([whether to enable pinger support])
141 AC_ARG_ENABLE([pinger],
142 AC_HELP_STRING([--disable-pinger],
143 [disable recovery pinger support]),
144 [],[enable_pinger='yes'])
145 AC_MSG_RESULT([$enable_pinger])
146 if test x$enable_pinger != xno ; then
147 AC_DEFINE(ENABLE_PINGER, 1, Use the Pinger)
154 # do checksum of bulk data between client and OST
156 AC_DEFUN([LC_CONFIG_CHECKSUM],
157 [AC_MSG_CHECKING([whether to enable data checksum support])
158 AC_ARG_ENABLE([checksum],
159 AC_HELP_STRING([--disable-checksum],
160 [disable data checksum support]),
161 [],[enable_checksum='yes'])
162 AC_MSG_RESULT([$enable_checksum])
163 if test x$enable_checksum != xno ; then
164 AC_DEFINE(ENABLE_CHECKSUM, 1, do data checksums)
169 # LC_CONFIG_LIBLUSTRE_RECOVERY
171 AC_DEFUN([LC_CONFIG_LIBLUSTRE_RECOVERY],
172 [AC_MSG_CHECKING([whether to enable liblustre recovery support])
173 AC_ARG_ENABLE([liblustre-recovery],
174 AC_HELP_STRING([--disable-liblustre-recovery],
175 [disable liblustre recovery support]),
176 [],[enable_liblustre_recovery='yes'])
177 AC_MSG_RESULT([$enable_liblustre_recovery])
178 if test x$enable_liblustre_recovery != xno ; then
179 AC_DEFINE(ENABLE_LIBLUSTRE_RECOVERY, 1, Liblustre Can Recover)
184 # LC_CONFIG_HEALTH_CHECK_WRITE
186 # Turn off the actual write to the disk
188 AC_DEFUN([LC_CONFIG_HEALTH_CHECK_WRITE],
189 [AC_MSG_CHECKING([whether to enable a write with the health check])
190 AC_ARG_ENABLE([health_write],
191 AC_HELP_STRING([--enable-health_write],
192 [enable disk writes when doing health check]),
193 [],[enable_health_write='no'])
194 AC_MSG_RESULT([$enable_health_write])
195 if test x$enable_health_write != xno ; then
196 AC_DEFINE(USE_HEALTH_CHECK_WRITE, 1, Write when Checking Health)
200 AC_DEFUN([LC_CONFIG_LRU_RESIZE],
201 [AC_MSG_CHECKING([whether to enable lru self-adjusting])
202 AC_ARG_ENABLE([lru_resize],
203 AC_HELP_STRING([--enable-lru-resize],
204 [enable lru resize support]),
205 [],[enable_lru_resize='yes'])
206 AC_MSG_RESULT([$enable_lru_resize])
207 if test x$enable_lru_resize != xno; then
208 AC_DEFINE(HAVE_LRU_RESIZE_SUPPORT, 1, [Enable lru resize support])
212 # whether to enable quota support(kernel modules)
213 AC_DEFUN([LC_QUOTA_MODULE],
214 [if test x$enable_quota != xno; then
215 LB_LINUX_CONFIG([QUOTA],[
216 enable_quota_module='yes'
217 AC_DEFINE(HAVE_QUOTA_SUPPORT, 1, [Enable quota support])
219 enable_quota_module='no'
220 AC_MSG_WARN([quota is not enabled because the kernel - lacks quota support])
225 # truncate_complete_page() was exported from RHEL5/SLES10, but not in SLES11 SP0 (2.6.27)
226 # remove_from_page_cache() was exported between 2.6.35 and 2.6.38
227 # delete_from_page_cache() is exported from 2.6.39
228 AC_DEFUN([LC_EXPORT_TRUNCATE_COMPLETE],
229 [LB_CHECK_SYMBOL_EXPORT([truncate_complete_page],
231 [AC_DEFINE(HAVE_TRUNCATE_COMPLETE_PAGE, 1,
232 [kernel export truncate_complete_page])])
233 LB_CHECK_SYMBOL_EXPORT([remove_from_page_cache],
235 [AC_DEFINE(HAVE_REMOVE_FROM_PAGE_CACHE, 1,
236 [kernel export remove_from_page_cache])])
237 LB_CHECK_SYMBOL_EXPORT([delete_from_page_cache],
239 [AC_DEFINE(HAVE_DELETE_FROM_PAGE_CACHE, 1,
240 [kernel export delete_from_page_cache])])
243 AC_DEFUN([LC_EXPORT_D_REHASH_COND],
244 [LB_CHECK_SYMBOL_EXPORT([d_rehash_cond],
246 AC_DEFINE(HAVE_D_REHASH_COND, 1,
247 [d_rehash_cond is exported by the kernel])
252 AC_DEFUN([LC_EXPORT___D_REHASH],
253 [LB_CHECK_SYMBOL_EXPORT([__d_rehash],
255 AC_DEFINE(HAVE___D_REHASH, 1,
256 [__d_rehash is exported by the kernel])
261 # The actual symbol exported varies among architectures, so we need
262 # to check many symbols (but only in the current architecture.) No
263 # matter what symbol is exported, the kernel #defines node_to_cpumask
264 # to the appropriate function and that's what we use.
265 AC_DEFUN([LC_EXPORT_NODE_TO_CPUMASK],
266 [LB_CHECK_SYMBOL_EXPORT([node_to_cpumask],
267 [arch/$LINUX_ARCH/mm/numa.c],
268 [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1,
269 [node_to_cpumask is exported by
270 the kernel])]) # x86_64
271 LB_CHECK_SYMBOL_EXPORT([node_to_cpu_mask],
272 [arch/$LINUX_ARCH/kernel/smpboot.c],
273 [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1,
274 [node_to_cpumask is exported by
275 the kernel])]) # ia64
276 LB_CHECK_SYMBOL_EXPORT([node_2_cpu_mask],
277 [arch/$LINUX_ARCH/kernel/smpboot.c],
278 [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1,
279 [node_to_cpumask is exported by
280 the kernel])]) # i386
285 # between 2.6.5 - 2.6.22 filemap_populate is exported in some kernels
287 AC_DEFUN([LC_FILEMAP_POPULATE],
288 [AC_MSG_CHECKING([for exported filemap_populate])
289 LB_LINUX_TRY_COMPILE([
290 #include <asm/page.h>
291 #include <linux/mm.h>
293 filemap_populate(NULL, 0, 0, __pgprot(0), 0, 0);
296 AC_DEFINE(HAVE_FILEMAP_POPULATE, 1, [Kernel exports filemap_populate])
305 AC_DEFUN([LC_BIT_SPINLOCK_H],
306 [LB_CHECK_FILE([$LINUX/include/linux/bit_spinlock.h],[
307 AC_MSG_CHECKING([if bit_spinlock.h can be compiled])
308 LB_LINUX_TRY_COMPILE([
309 #include <asm/processor.h>
310 #include <linux/spinlock.h>
311 #include <linux/bit_spinlock.h>
314 AC_DEFINE(HAVE_BIT_SPINLOCK_H, 1, [Kernel has bit_spinlock.h])
325 AC_DEFUN([LC_CONST_ACL_SIZE],
326 [AC_MSG_CHECKING([calc acl size])
328 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"
331 #include <linux/types.h>
334 #define __LINUX_POSIX_ACL_H
336 #ifdef CONFIG_FS_POSIX_ACL
337 # include <linux/posix_acl_xattr.h>
344 /* LUSTRE_POSIX_ACL_MAX_ENTRIES = 32 */
345 int size = posix_acl_xattr_size(32);
346 FILE *f = fopen("acl.size","w+");
347 fprintf(f,"%d", size);
353 acl_size=`cat acl.size`
354 AC_MSG_RESULT([ACL size $acl_size])
355 AC_DEFINE_UNQUOTED(XATTR_ACL_SIZE, AS_TR_SH([$acl_size]), [size of xattr acl])
357 AC_ERROR([ACL size can't be computed])
359 AC_MSG_RESULT([can't check ACL size, make it 260])
360 AC_DEFINE_UNQUOTED(XATTR_ACL_SIZE,260)
368 AC_DEFUN([LC_CAPA_CRYPTO],
369 [LB_LINUX_CONFIG_IM([CRYPTO],[],[
370 AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO is enabled in your kernel.])
372 LB_LINUX_CONFIG_IM([CRYPTO_HMAC],[],[
373 AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_HMAC is enabled in your kernel.])
375 LB_LINUX_CONFIG_IM([CRYPTO_SHA1],[],[
376 AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_SHA1 is enabled in your kernel.])
381 # LC_CONFIG_RMTCLIENT
384 dnl the AES symbol usually tied with arch, e.g. CRYPTO_AES_586
386 AC_DEFUN([LC_CONFIG_RMTCLIENT],
387 [LB_LINUX_CONFIG_IM([CRYPTO_AES],[],[
388 AC_MSG_WARN([Lustre remote client require that CONFIG_CRYPTO_AES is enabled in your kernel.])
393 # LC_CONFIG_GSS_KEYRING (default enabled, if gss is enabled)
395 AC_DEFUN([LC_CONFIG_GSS_KEYRING],
396 [AC_MSG_CHECKING([whether to enable gss keyring backend])
397 AC_ARG_ENABLE([gss_keyring],
398 [AC_HELP_STRING([--disable-gss-keyring],
399 [disable gss keyring backend])],
400 [],[enable_gss_keyring='yes'])
401 AC_MSG_RESULT([$enable_gss_keyring])
403 if test x$enable_gss_keyring != xno; then
404 LB_LINUX_CONFIG_IM([KEYS],[],
405 [AC_MSG_ERROR([GSS keyring backend require that CONFIG_KEYS be enabled in your kernel.])])
407 AC_CHECK_LIB([keyutils], [keyctl_search], [],
408 [AC_MSG_ERROR([libkeyutils is not found, which is required by gss keyring backend])],)
410 AC_DEFINE([HAVE_GSS_KEYRING], [1],
411 [Define this if you enable gss keyring backend])
415 AC_DEFUN([LC_CONFIG_SUNRPC],
416 [LB_LINUX_CONFIG_IM([SUNRPC],[],
417 [AC_MSG_ERROR([kernel SUNRPC support is required by using GSS.])])
421 # LC_CONFIG_GSS (default disabled)
423 # Build gss and related tools of Lustre. Currently both kernel and user space
424 # parts are depend on linux platform.
426 AC_DEFUN([LC_CONFIG_GSS],
427 [AC_MSG_CHECKING([whether to enable gss/krb5 support])
429 [AC_HELP_STRING([--enable-gss], [enable gss/krb5 support])],
430 [],[enable_gss='no'])
431 AC_MSG_RESULT([$enable_gss])
433 if test x$enable_gss == xyes; then
434 LC_CONFIG_GSS_KEYRING
437 AC_DEFINE([HAVE_GSS], [1], [Define this if you enable gss])
439 LB_LINUX_CONFIG_IM([CRYPTO_MD5],[],
440 [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
441 LB_LINUX_CONFIG_IM([CRYPTO_SHA1],[],
442 [AC_MSG_WARN([kernel SHA1 support is recommended by using GSS.])])
443 LB_LINUX_CONFIG_IM([CRYPTO_SHA256],[],
444 [AC_MSG_WARN([kernel SHA256 support is recommended by using GSS.])])
445 LB_LINUX_CONFIG_IM([CRYPTO_SHA512],[],
446 [AC_MSG_WARN([kernel SHA512 support is recommended by using GSS.])])
448 AC_CHECK_LIB([gssapi], [gss_init_sec_context],
449 [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi"],
450 [AC_CHECK_LIB([gssglue], [gss_init_sec_context],
451 [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssglue"],
452 [AC_MSG_ERROR([libgssapi or libgssglue is not found, which is required by GSS.])])],)
454 AC_SUBST(GSSAPI_LIBS)
460 AC_DEFUN([LC_QUOTA_READ],
461 [AC_MSG_CHECKING([if kernel supports quota_read])
462 LB_LINUX_TRY_COMPILE([
463 #include <linux/fs.h>
465 struct super_operations sp;
466 void *i = (void *)sp.quota_read;
469 AC_DEFINE(KERNEL_SUPPORTS_QUOTA_READ, 1, [quota_read found])
476 # LC_COOKIE_FOLLOW_LINK
478 # kernel 2.6.13+ ->follow_link returns a cookie
480 AC_DEFUN([LC_COOKIE_FOLLOW_LINK],
481 [AC_MSG_CHECKING([if inode_operations->follow_link returns a cookie])
482 LB_LINUX_TRY_COMPILE([
483 #include <linux/fs.h>
484 #include <linux/namei.h>
486 struct dentry *dentry = NULL;
489 dentry->d_inode->i_op->put_link(dentry, &nd, NULL);
491 AC_DEFINE(HAVE_COOKIE_FOLLOW_LINK, 1, [inode_operations->follow_link returns a cookie])
501 # kernels prior than 2.6.0(?) have no RCU supported; in kernel 2.6.5(SUSE),
502 # call_rcu takes three parameters.
504 AC_DEFUN([LC_FUNC_RCU],
505 [AC_MSG_CHECKING([if kernel have RCU supported])
506 LB_LINUX_TRY_COMPILE([
507 #include <linux/rcupdate.h>
509 AC_DEFINE(HAVE_RCU, 1, [have RCU defined])
512 AC_MSG_CHECKING([if call_rcu takes three parameters])
513 LB_LINUX_TRY_COMPILE([
514 #include <linux/rcupdate.h>
517 call_rcu(&rh, (void (*)(struct rcu_head *))1, NULL);
519 AC_DEFINE(HAVE_CALL_RCU_PARAM, 1, [call_rcu takes three parameters])
530 AC_DEFUN([LC_PERCPU_COUNTER],
531 [AC_MSG_CHECKING([if have struct percpu_counter defined])
532 LB_LINUX_TRY_COMPILE([
533 #include <linux/percpu_counter.h>
535 AC_DEFINE(HAVE_PERCPU_COUNTER, 1, [percpu_counter found])
538 AC_MSG_CHECKING([if percpu_counter_inc takes the 2nd argument])
539 LB_LINUX_TRY_COMPILE([
540 #include <linux/percpu_counter.h>
542 struct percpu_counter c;
543 percpu_counter_init(&c, 0);
545 AC_DEFINE(HAVE_PERCPU_2ND_ARG, 1, [percpu_counter_init has two
556 AC_DEFUN([LC_TASK_CLENV_STORE],
558 AC_MSG_CHECKING([if we can store cl_env in task_struct])
559 if test x$have_task_clenv_store != xyes ; then
560 LC_TASK_CLENV_TUX_INFO
566 AC_DEFUN([LC_S_TIME_GRAN],
567 [AC_MSG_CHECKING([if super block has s_time_gran member])
568 LB_LINUX_TRY_COMPILE([
569 #include <linux/fs.h>
571 struct super_block *sb = NULL;
573 return sb->s_time_gran;
576 AC_DEFINE(HAVE_S_TIME_GRAN, 1, [super block has s_time_gran member])
582 AC_DEFUN([LC_SB_TIME_GRAN],
583 [AC_MSG_CHECKING([if kernel has old get_sb_time_gran])
584 LB_LINUX_TRY_COMPILE([
585 #include <linux/fs.h>
587 return get_sb_time_gran(NULL);
590 AC_DEFINE(HAVE_SB_TIME_GRAN, 1, [kernel has old get_sb_time_gran])
598 # ~2.6.12 merge patch from oracle to convert tree_lock from spinlock to rwlock
599 AC_DEFUN([LC_RW_TREE_LOCK],
600 [AC_MSG_CHECKING([if kernel has tree_lock as rwlock])
601 tmp_flags="$EXTRA_KCFLAGS"
602 EXTRA_KCFLAGS="-Werror"
603 LB_LINUX_TRY_COMPILE([
604 #include <linux/fs.h>
606 struct address_space a;
608 write_lock(&a.tree_lock);
611 AC_DEFINE(HAVE_RW_TREE_LOCK, 1, [kernel has tree_lock as rw_lock])
615 EXTRA_KCFLAGS="$tmp_flags"
621 # after 2.6.15 inode have i_mutex intead of i_sem
622 AC_DEFUN([LC_INODE_I_MUTEX],
623 [AC_MSG_CHECKING([if inode has i_mutex ])
624 LB_LINUX_TRY_COMPILE([
625 #include <linux/mutex.h>
626 #include <linux/fs.h>
631 mutex_unlock(&i.i_mutex);
634 AC_DEFINE(HAVE_INODE_I_MUTEX, 1,
635 [after 2.6.15 inode have i_mutex intead of i_sem])
643 # LC_SECURITY_PLUG # for SLES10 SP2
644 # check security plug in sles10 sp2 kernel
645 AC_DEFUN([LC_SECURITY_PLUG],
646 [AC_MSG_CHECKING([If kernel has security plug support])
647 LB_LINUX_TRY_COMPILE([
648 #include <linux/fs.h>
649 #include <linux/stddef.h>
651 notify_change(NULL, NULL, NULL);
654 AC_DEFINE(HAVE_SECURITY_PLUG, 1,
655 [SLES10 SP2 use extra parameter in vfs])
663 # inode have i_private field since 2.6.17
664 AC_DEFUN([LC_INODE_IPRIVATE],
665 [AC_MSG_CHECKING([if inode has a i_private field])
666 LB_LINUX_TRY_COMPILE([
667 #include <linux/fs.h>
673 AC_DEFINE(HAVE_INODE_IPRIVATE, 1,
674 [struct inode has i_private field])
681 # after 2.6.17 dquote use mutex instead if semaphore
682 AC_DEFUN([LC_DQUOTOFF_MUTEX],
683 [AC_MSG_CHECKING([use dqonoff_mutex])
684 LB_LINUX_TRY_COMPILE([
685 #include <linux/mutex.h>
686 #include <linux/fs.h>
687 #include <linux/quota.h>
689 struct quota_info dq;
691 mutex_unlock(&dq.dqonoff_mutex);
694 AC_DEFINE(HAVE_DQUOTOFF_MUTEX, 1,
695 [after 2.6.17 dquote use mutex instead if semaphore])
704 # 2.6.18 don't export nr_pagecahe
705 AC_DEFUN([LC_NR_PAGECACHE],
706 [AC_MSG_CHECKING([kernel export nr_pagecache])
707 LB_LINUX_TRY_COMPILE([
708 #include <linux/pagemap.h>
710 return atomic_read(&nr_pagecache);
713 AC_DEFINE(HAVE_NR_PAGECACHE, 1,
714 [is kernel export nr_pagecache])
721 # LC_STATFS_DENTRY_PARAM
722 # starting from 2.6.18 linux kernel uses dentry instead of super_block
723 # for the first parameter of the super_operations->statfs() callback.
726 AC_DEFUN([LC_STATFS_DENTRY_PARAM],
727 [AC_MSG_CHECKING([if super_ops.statfs() first parameter is dentry])
728 tmp_flags="$EXTRA_KCFLAGS"
729 EXTRA_KCFLAGS="-Werror"
730 LB_LINUX_TRY_COMPILE([
731 #include <linux/fs.h>
733 ((struct super_operations *)0)->statfs((struct dentry *)0, (struct kstatfs*)0);
735 AC_DEFINE(HAVE_STATFS_DENTRY_PARAM, 1,
736 [super_ops.statfs() first parameter is dentry])
741 EXTRA_KCFLAGS="$tmp_flags"
744 # LC_UMOUNTBEGIN_HAS_VFSMOUNT
745 # 2.6.18~2.6.25 umount_begin has different parameters
746 AC_DEFUN([LC_UMOUNTBEGIN_HAS_VFSMOUNT],
747 [AC_MSG_CHECKING([if umount_begin needs vfsmount parameter instead of super_block])
748 tmp_flags="$EXTRA_KCFLAGS"
749 EXTRA_KCFLAGS="-Werror"
750 LB_LINUX_TRY_COMPILE([
751 #include <linux/fs.h>
754 static void cfg_umount_begin (struct vfsmount *v, int flags)
759 static struct super_operations cfg_super_operations = {
760 .umount_begin = cfg_umount_begin,
763 cfg_super_operations.umount_begin(NULL,0);
766 AC_DEFINE(HAVE_UMOUNTBEGIN_VFSMOUNT, 1,
767 [Define umount_begin need second argument])
771 EXTRA_KCFLAGS="$tmp_flags"
775 # starting from 2.6.18 the file_operations .flush
776 # method has a new "fl_owner_t id" parameter
778 AC_DEFUN([LC_FLUSH_OWNER_ID],
779 [AC_MSG_CHECKING([if file_operations .flush has an fl_owner_t id])
780 LB_LINUX_TRY_COMPILE([
781 #include <linux/fs.h>
783 struct file_operations *fops = NULL;
784 fl_owner_t id = NULL;
787 i = fops->flush(NULL, id);
789 AC_DEFINE(HAVE_FLUSH_OWNER_ID, 1,
790 [file_operations .flush method has an fl_owner_t id])
798 # LC_EXPORT_INVALIDATE_MAPPING_PAGES
800 # SLES9, RHEL4, RHEL5, vanilla 2.6.24 export invalidate_mapping_pages() but
801 # SLES10 2.6.16 does not, for some reason. For filter cache invalidation.
803 AC_DEFUN([LC_EXPORT_INVALIDATE_MAPPING_PAGES],
804 [LB_CHECK_SYMBOL_EXPORT([invalidate_mapping_pages], [mm/truncate.c], [
805 AC_DEFINE(HAVE_INVALIDATE_MAPPING_PAGES, 1,
806 [exported invalidate_mapping_pages])],
807 [LB_CHECK_SYMBOL_EXPORT([invalidate_inode_pages], [mm/truncate.c], [
808 AC_DEFINE(HAVE_INVALIDATE_INODE_PAGES, 1,
809 [exported invalidate_inode_pages])], [
810 AC_MSG_ERROR([no way to invalidate pages])
815 #2.6.18 + RHEL5 (fc6)
817 # RHEL5 in FS-cache patch rename PG_checked flag into PG_fs_misc
818 AC_DEFUN([LC_PG_FS_MISC],
819 [AC_MSG_CHECKING([kernel has PG_fs_misc])
820 LB_LINUX_TRY_COMPILE([
821 #include <linux/mm.h>
822 #include <linux/page-flags.h>
825 #error PG_fs_misc not defined in kernel
829 AC_DEFINE(HAVE_PG_FS_MISC, 1,
830 [is kernel have PG_fs_misc])
836 # RHEL5 PageChecked and SetPageChecked defined
837 AC_DEFUN([LC_PAGE_CHECKED],
838 [AC_MSG_CHECKING([kernel has PageChecked and SetPageChecked])
839 LB_LINUX_TRY_COMPILE([
840 #include <linux/mm.h>
841 #ifdef HAVE_LINUX_MMTYPES_H
842 #include <linux/mm_types.h>
844 #include <linux/page-flags.h>
846 struct page *p = NULL;
848 /* before 2.6.26 this define*/
850 /* 2.6.26 use function instead of define for it */
856 AC_DEFINE(HAVE_PAGE_CHECKED, 1,
857 [does kernel have PageChecked and SetPageChecked])
866 # If we have fiemap.h
867 # after 2.6.27 use fiemap.h in include/linux
869 AC_DEFUN([LC_LINUX_FIEMAP_H],
870 [LB_CHECK_FILE([$LINUX/include/linux/fiemap.h],[
871 AC_MSG_CHECKING([if fiemap.h can be compiled])
872 LB_LINUX_TRY_COMPILE([
873 #include <linux/types.h>
874 #include <linux/fiemap.h>
877 AC_DEFINE(HAVE_LINUX_FIEMAP_H, 1, [Kernel has fiemap.h])
888 # inode don't have i_blksize field
889 AC_DEFUN([LC_INODE_BLKSIZE],
890 [AC_MSG_CHECKING([inode has i_blksize field])
891 LB_LINUX_TRY_COMPILE([
892 #include <linux/fs.h>
898 AC_DEFINE(HAVE_INODE_BLKSIZE, 1,
899 [struct inode has i_blksize field])
906 # 2.6.19 replaced writev with aio_write
907 AC_DEFUN([LC_FILE_WRITEV],
908 [AC_MSG_CHECKING([writev in fops])
909 LB_LINUX_TRY_COMPILE([
910 #include <linux/fs.h>
912 struct file_operations *fops = NULL;
916 AC_DEFINE(HAVE_FILE_WRITEV, 1,
924 # 2.6.19 replaced readv with aio_read
925 AC_DEFUN([LC_FILE_READV],
926 [AC_MSG_CHECKING([readv in fops])
927 LB_LINUX_TRY_COMPILE([
928 #include <linux/fs.h>
930 struct file_operations *fops = NULL;
934 AC_DEFINE(HAVE_FILE_READV, 1,
943 # LC_CANCEL_DIRTY_PAGE
944 # 2.6.20 introduced cancel_dirty_page instead of clear_page_dirty.
945 AC_DEFUN([LC_CANCEL_DIRTY_PAGE],
946 [AC_MSG_CHECKING([kernel has cancel_dirty_page])
947 # the implementation of cancel_dirty_page in OFED 1.4.1's SLES10 SP2
948 # backport is broken, so ignore it
949 if test -f $OFED_BACKPORT_PATH/linux/mm.h &&
950 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
953 LB_LINUX_TRY_COMPILE([
954 #include <linux/mm.h>
955 #include <linux/page-flags.h>
957 cancel_dirty_page(NULL, 0);
960 AC_DEFINE(HAVE_CANCEL_DIRTY_PAGE, 1,
961 [kernel has cancel_dirty_page instead of clear_page_dirty])
968 # raid5-zerocopy patch
973 # In order to support raid5 zerocopy patch, we have to patch the kernel to make
974 # it support constant page, which means the page won't be modified during the
977 AC_DEFUN([LC_PAGE_CONSTANT],
978 [AC_MSG_CHECKING([if kernel have PageConstant defined])
979 LB_LINUX_TRY_COMPILE([
980 #include <linux/mm.h>
981 #include <linux/page-flags.h>
984 #error "Have no raid5 zcopy patch"
988 AC_DEFINE(HAVE_PAGE_CONSTANT, 1, [kernel have PageConstant supported])
996 # 2.6.22 lost second parameter for invalidate_bdev
997 AC_DEFUN([LC_INVALIDATE_BDEV_2ARG],
998 [AC_MSG_CHECKING([if invalidate_bdev has second argument])
999 LB_LINUX_TRY_COMPILE([
1000 #include <linux/buffer_head.h>
1002 invalidate_bdev(NULL,0);
1004 AC_MSG_RESULT([yes])
1005 AC_DEFINE(HAVE_INVALIDATE_BDEV_2ARG, 1,
1006 [invalidate_bdev has second argument])
1013 # check for crypto API
1015 AC_DEFUN([LC_ASYNC_BLOCK_CIPHER],
1016 [AC_MSG_CHECKING([if kernel has block cipher support])
1017 LB_LINUX_TRY_COMPILE([
1018 #include <linux/err.h>
1019 #include <linux/crypto.h>
1021 struct crypto_blkcipher *tfm;
1022 tfm = crypto_alloc_blkcipher("aes", 0, sizeof(tfm) );
1024 AC_MSG_RESULT([yes])
1025 AC_DEFINE(HAVE_ASYNC_BLOCK_CIPHER, 1, [kernel has block cipher support])
1032 # check for struct hash_desc
1034 AC_DEFUN([LC_STRUCT_HASH_DESC],
1035 [AC_MSG_CHECKING([if kernel has struct hash_desc])
1036 LB_LINUX_TRY_COMPILE([
1037 #include <linux/err.h>
1038 #include <linux/crypto.h>
1040 struct hash_desc foo __attribute__ ((unused));
1042 AC_MSG_RESULT([yes])
1043 AC_DEFINE(HAVE_STRUCT_HASH_DESC, 1, [kernel has struct hash_desc])
1050 # check for struct blkcipher_desc
1052 AC_DEFUN([LC_STRUCT_BLKCIPHER_DESC],
1053 [AC_MSG_CHECKING([if kernel has struct blkcipher_desc])
1054 LB_LINUX_TRY_COMPILE([
1055 #include <linux/err.h>
1056 #include <linux/crypto.h>
1058 struct blkcipher_desc foo __attribute__ ((unused));
1060 AC_MSG_RESULT([yes])
1061 AC_DEFINE(HAVE_STRUCT_BLKCIPHER_DESC, 1, [kernel has struct blkcipher_desc])
1068 # 2.6.19 check for FS_RENAME_DOES_D_MOVE flag
1070 AC_DEFUN([LC_FS_RENAME_DOES_D_MOVE],
1071 [AC_MSG_CHECKING([if kernel has FS_RENAME_DOES_D_MOVE flag])
1072 LB_LINUX_TRY_COMPILE([
1073 #include <linux/fs.h>
1075 int v __attribute__ ((unused));
1076 v = FS_RENAME_DOES_D_MOVE;
1078 AC_MSG_RESULT([yes])
1079 AC_DEFINE(HAVE_FS_RENAME_DOES_D_MOVE, 1, [kernel has FS_RENAME_DOES_D_MOVE flag])
1087 # 2.6.23 have return type 'void' for unregister_blkdev
1088 AC_DEFUN([LC_UNREGISTER_BLKDEV_RETURN_INT],
1089 [AC_MSG_CHECKING([if unregister_blkdev return int])
1090 LB_LINUX_TRY_COMPILE([
1091 #include <linux/fs.h>
1093 int i __attribute__ ((unused));
1094 i = unregister_blkdev(0,NULL);
1096 AC_MSG_RESULT([yes])
1097 AC_DEFINE(HAVE_UNREGISTER_BLKDEV_RETURN_INT, 1,
1098 [unregister_blkdev return int])
1104 # 2.6.23 change .sendfile to .splice_read
1105 AC_DEFUN([LC_KERNEL_SPLICE_READ],
1106 [AC_MSG_CHECKING([if kernel has .splice_read])
1107 LB_LINUX_TRY_COMPILE([
1108 #include <linux/fs.h>
1110 struct file_operations file;
1112 file.splice_read = NULL;
1114 AC_MSG_RESULT([yes])
1115 AC_DEFINE(HAVE_KERNEL_SPLICE_READ, 1,
1116 [kernel has .slice_read])
1122 # 2.6.23 change .sendfile to .splice_read
1123 # RHEL4 (-92 kernel) have both sendfile and .splice_read API
1124 AC_DEFUN([LC_KERNEL_SENDFILE],
1125 [AC_MSG_CHECKING([if kernel has .sendfile])
1126 LB_LINUX_TRY_COMPILE([
1127 #include <linux/fs.h>
1129 struct file_operations file;
1131 file.sendfile = NULL;
1133 AC_MSG_RESULT([yes])
1134 AC_DEFINE(HAVE_KERNEL_SENDFILE, 1,
1135 [kernel has .sendfile])
1141 # 2.6.23 extract nfs export related data into exportfs.h
1142 AC_DEFUN([LC_HAVE_EXPORTFS_H],
1143 [LB_CHECK_FILE([$LINUX/include/linux/exportfs.h], [
1144 AC_DEFINE(HAVE_LINUX_EXPORTFS_H, 1,
1145 [kernel has include/exportfs.h])
1151 # 2.6.23 has new page fault handling API
1152 AC_DEFUN([LC_VM_OP_FAULT],
1153 [AC_MSG_CHECKING([kernel has .fault in vm_operation_struct])
1154 LB_LINUX_TRY_COMPILE([
1155 #include <linux/mm.h>
1157 struct vm_operations_struct op;
1161 AC_MSG_RESULT([yes])
1162 AC_DEFINE(HAVE_VM_OP_FAULT, 1,
1163 [kernel has .fault in vm_operation_struct])
1169 # 2.6.23 add code to wait other users to complete before removing procfs entry
1170 AC_DEFUN([LC_PROCFS_USERS],
1171 [AC_MSG_CHECKING([if kernel has pde_users member in procfs entry struct])
1172 LB_LINUX_TRY_COMPILE([
1173 #include <linux/proc_fs.h>
1175 struct proc_dir_entry pde;
1179 AC_MSG_RESULT([yes])
1180 AC_DEFINE(HAVE_PROCFS_USERS, 1,
1181 [kernel has pde_users member in procfs entry struct])
1187 # 2.6.23 exports exportfs_decode_fh
1188 AC_DEFUN([LC_EXPORTFS_DECODE_FH],
1189 [LB_CHECK_SYMBOL_EXPORT([exportfs_decode_fh],
1190 [fs/exportfs/expfs.c],[
1191 AC_DEFINE(HAVE_EXPORTFS_DECODE_FH, 1,
1192 [exportfs_decode_fh has been export])
1199 # 2.6.24 need linux/mm_types.h included
1200 AC_DEFUN([LC_HAVE_MMTYPES_H],
1201 [LB_CHECK_FILE([$LINUX/include/linux/mm_types.h], [
1202 AC_DEFINE(HAVE_LINUX_MMTYPES_H, 1,
1203 [kernel has include/mm_types.h])
1209 # 2.6.24 has bio_endio with 2 args
1210 AC_DEFUN([LC_BIO_ENDIO_2ARG],
1211 [AC_MSG_CHECKING([if kernel has bio_endio with 2 args])
1212 LB_LINUX_TRY_COMPILE([
1213 #include <linux/bio.h>
1217 AC_MSG_RESULT([yes])
1218 AC_DEFINE(HAVE_BIO_ENDIO_2ARG, 1,
1219 [kernel has bio_endio with 2 args])
1225 # 2.6.24 has new members in exports struct.
1226 AC_DEFUN([LC_FH_TO_DENTRY],
1227 [AC_MSG_CHECKING([if kernel has .fh_to_dentry member in export_operations struct])
1228 LB_LINUX_TRY_COMPILE([
1229 #include <linux/fs.h>
1230 #ifdef HAVE_LINUX_EXPORTFS_H
1231 #include <linux/exportfs.h>
1234 do{ }while(sizeof(((struct export_operations *)0)->fh_to_dentry));
1236 AC_MSG_RESULT([yes])
1237 AC_DEFINE(HAVE_FH_TO_DENTRY, 1,
1238 [kernel has .fh_to_dentry member in export_operations struct])
1244 # 2.6.24 removes long aged procfs entry -> deleted member
1245 AC_DEFUN([LC_PROCFS_DELETED],
1246 [AC_MSG_CHECKING([if kernel has deleted member in procfs entry struct])
1247 LB_LINUX_TRY_COMPILE([
1248 #include <linux/proc_fs.h>
1250 struct proc_dir_entry pde;
1252 pde.deleted = sizeof(pde);
1254 AC_MSG_RESULT([yes])
1255 AC_DEFINE(HAVE_PROCFS_DELETED, 1,
1256 [kernel has deleted member in procfs entry struct])
1262 # 2.6.24 has bdi_init()/bdi_destroy() functions.
1263 AC_DEFUN([LC_EXPORT_BDI_INIT],
1264 [LB_CHECK_SYMBOL_EXPORT([bdi_init],
1265 [mm/backing-dev.c],[
1266 AC_DEFINE(HAVE_BDI_INIT, 1,
1267 [bdi_init/bdi_destroy functions are present])
1274 # 2.6.26 isn't export set_fs_pwd and change paramter in fs struct
1275 AC_DEFUN([LC_FS_STRUCT_USE_PATH],
1276 [AC_MSG_CHECKING([fs_struct use path structure])
1277 LB_LINUX_TRY_COMPILE([
1278 #include <asm/atomic.h>
1279 #include <linux/spinlock.h>
1280 #include <linux/fs_struct.h>
1282 struct fs_struct fs;
1284 fs.pwd = *((struct path *)sizeof(fs));
1286 AC_MSG_RESULT([yes])
1287 AC_DEFINE(HAVE_FS_STRUCT_USE_PATH, 1,
1288 [fs_struct use path structure])
1298 AC_DEFUN([LC_PGMKWRITE_USE_VMFAULT],
1299 [AC_MSG_CHECKING([kernel .page_mkwrite uses struct vm_fault *])
1300 tmp_flags="$EXTRA_KCFLAGS"
1301 EXTRA_KCFLAGS="-Werror"
1302 LB_LINUX_TRY_COMPILE([
1303 #include <linux/mm.h>
1305 ((struct vm_operations_struct *)0)->page_mkwrite((struct vm_area_struct *)0, (struct vm_fault *)0);
1307 AC_MSG_RESULT([yes])
1308 AC_DEFINE(HAVE_PGMKWRITE_USE_VMFAULT, 1,
1309 [kernel vm_operation_struct.page_mkwrite uses struct vm_fault * as second parameter])
1313 EXTRA_KCFLAGS="$tmp_flags"
1316 AC_DEFUN([LC_INODE_PERMISION_2ARGS],
1317 [AC_MSG_CHECKING([inode_operations->permission has two args])
1318 LB_LINUX_TRY_COMPILE([
1319 #include <linux/fs.h>
1321 struct inode *inode __attribute__ ((unused));
1324 inode->i_op->permission(NULL, 0);
1326 AC_DEFINE(HAVE_INODE_PERMISION_2ARGS, 1,
1327 [inode_operations->permission has two args])
1328 AC_MSG_RESULT([yes])
1334 # 2.6.27 has file_remove_suid instead of remove_suid
1335 AC_DEFUN([LC_FILE_REMOVE_SUID],
1336 [AC_MSG_CHECKING([kernel has file_remove_suid])
1337 LB_LINUX_TRY_COMPILE([
1338 #include <linux/fs.h>
1340 file_remove_suid(NULL);
1342 AC_DEFINE(HAVE_FILE_REMOVE_SUID, 1,
1343 [kernel have file_remove_suid])
1344 AC_MSG_RESULT([yes])
1350 # 2.6.27 have new page locking API
1351 AC_DEFUN([LC_TRYLOCKPAGE],
1352 [AC_MSG_CHECKING([kernel uses trylock_page for page lock])
1353 LB_LINUX_TRY_COMPILE([
1354 #include <linux/pagemap.h>
1358 AC_DEFINE(HAVE_TRYLOCK_PAGE, 1,
1359 [kernel uses trylock_page for page lock])
1360 AC_MSG_RESULT([yes])
1366 # 2.6.27 removed the read_inode from super_operations.
1367 AC_DEFUN([LC_READ_INODE_IN_SBOPS],
1368 [AC_MSG_CHECKING([super_operations has a read_inode field])
1369 LB_LINUX_TRY_COMPILE([
1370 #include <linux/fs.h>
1372 struct super_operations *sop;
1373 sop->read_inode(NULL);
1375 AC_DEFINE(HAVE_READ_INODE_IN_SBOPS, 1,
1376 [super_operations has a read_inode])
1377 AC_MSG_RESULT([yes])
1383 # 2.6.27 has inode_permission instead of permisson
1384 AC_DEFUN([LC_EXPORT_INODE_PERMISSION],
1385 [LB_CHECK_SYMBOL_EXPORT([inode_permission],
1387 AC_DEFINE(HAVE_EXPORT_INODE_PERMISSION, 1,
1388 [inode_permission is exported by the kernel])
1393 # 2.6.27 use 5th parameter in quota_on for remount.
1394 AC_DEFUN([LC_QUOTA_ON_5ARGS],
1395 [AC_MSG_CHECKING([quota_on needs 5 parameters])
1396 LB_LINUX_TRY_COMPILE([
1397 #include <linux/fs.h>
1398 #include <linux/quota.h>
1400 struct quotactl_ops *qop = NULL;
1401 qop->quota_on(NULL, 0, 0, NULL, 0);
1403 AC_DEFINE(HAVE_QUOTA_ON_5ARGS, 1,
1404 [quota_on needs 5 paramters])
1405 AC_MSG_RESULT([yes])
1411 # 2.6.27 use 3th parameter in quota_off for remount.
1412 AC_DEFUN([LC_QUOTA_OFF_3ARGS],
1413 [AC_MSG_CHECKING([quota_off needs 3 parameters])
1414 LB_LINUX_TRY_COMPILE([
1415 #include <linux/fs.h>
1416 #include <linux/quota.h>
1418 struct quotactl_ops *qop = NULL;
1419 qop->quota_off(NULL, 0, 0);
1421 AC_DEFINE(HAVE_QUOTA_OFF_3ARGS, 1,
1422 [quota_off needs 3 paramters])
1423 AC_MSG_RESULT([yes])
1429 # 2.6.27 has vfs_dq_off inline function.
1430 AC_DEFUN([LC_VFS_DQ_OFF],
1431 [AC_MSG_CHECKING([vfs_dq_off is defined])
1432 LB_LINUX_TRY_COMPILE([
1433 #include <linux/quotaops.h>
1435 vfs_dq_off(NULL, 0);
1437 AC_DEFINE(HAVE_VFS_DQ_OFF, 1, [vfs_dq_off is defined])
1438 AC_MSG_RESULT([yes])
1444 # LC_LOCK_MAP_ACQUIRE
1445 # after 2.6.27 lock_map_acquire replaces lock_acquire
1446 AC_DEFUN([LC_LOCK_MAP_ACQUIRE],
1447 [AC_MSG_CHECKING([if lock_map_acquire is defined])
1448 LB_LINUX_TRY_COMPILE([
1449 #include <linux/lockdep.h>
1451 lock_map_acquire(NULL);
1454 AC_DEFINE(HAVE_LOCK_MAP_ACQUIRE, 1,
1455 [lock_map_acquire is defined])
1461 # 2.6.27.15-2 sles11
1463 # 2.6.27 sles11 remove the bi_hw_segments
1464 AC_DEFUN([LC_BI_HW_SEGMENTS],
1465 [AC_MSG_CHECKING([struct bio has a bi_hw_segments field])
1466 LB_LINUX_TRY_COMPILE([
1467 #include <linux/bio.h>
1470 io.bi_hw_segments = sizeof(io);
1472 AC_DEFINE(HAVE_BI_HW_SEGMENTS, 1,
1473 [struct bio has a bi_hw_segments field])
1474 AC_MSG_RESULT([yes])
1481 # 2.6.27 sles11 move the quotaio_v1{2}.h from include/linux to fs
1482 # 2.6.32 move the quotaio_v1{2}.h from fs to fs/quota
1483 AC_DEFUN([LC_HAVE_QUOTAIO_H],
1484 [LB_CHECK_FILE([$LINUX/include/linux/quotaio_v2.h],[
1485 AC_DEFINE(HAVE_QUOTAIO_H, 1,
1486 [kernel has include/linux/quotaio_v2.h])
1487 ],[LB_CHECK_FILE([$LINUX/fs/quotaio_v2.h],[
1488 AC_DEFINE(HAVE_FS_QUOTAIO_H, 1,
1489 [kernel has fs/quotaio_v1.h])
1490 ],[LB_CHECK_FILE([$LINUX/fs/quota/quotaio_v2.h],[
1491 AC_DEFINE(HAVE_FS_QUOTA_QUOTAIO_H, 1,
1492 [kernel has fs/quota/quotaio_v2.h])
1500 # 2.6.27 sles11 has sb_any_quota_active
1501 AC_DEFUN([LC_SB_ANY_QUOTA_ACTIVE],
1502 [AC_MSG_CHECKING([Kernel has sb_any_quota_active])
1503 LB_LINUX_TRY_COMPILE([
1504 #include <linux/quotaops.h>
1506 sb_any_quota_active(NULL);
1508 AC_DEFINE(HAVE_SB_ANY_QUOTA_ACTIVE, 1,
1509 [Kernel has a sb_any_quota_active])
1510 AC_MSG_RESULT([yes])
1516 # 2.6.27 sles11 has sb_has_quota_active
1517 AC_DEFUN([LC_SB_HAS_QUOTA_ACTIVE],
1518 [AC_MSG_CHECKING([Kernel has sb_has_quota_active])
1519 LB_LINUX_TRY_COMPILE([
1520 #include <linux/quotaops.h>
1522 sb_has_quota_active(NULL, 0);
1524 AC_DEFINE(HAVE_SB_HAS_QUOTA_ACTIVE, 1,
1525 [Kernel has a sb_has_quota_active])
1526 AC_MSG_RESULT([yes])
1532 # 2.6.27 exported add_to_page_cache_lru.
1533 AC_DEFUN([LC_EXPORT_ADD_TO_PAGE_CACHE_LRU],
1534 [LB_CHECK_SYMBOL_EXPORT([add_to_page_cache_lru],
1536 AC_DEFINE(HAVE_ADD_TO_PAGE_CACHE_LRU, 1,
1537 [add_to_page_cache_lru functions are present])
1543 # 2.6.29 introduce sb_any_quota_loaded.
1545 AC_DEFUN([LC_SB_ANY_QUOTA_LOADED],
1546 [AC_MSG_CHECKING([Kernel has sb_any_quota_loaded])
1547 LB_LINUX_TRY_COMPILE([
1548 #include <linux/quotaops.h>
1550 sb_any_quota_loaded(NULL);
1552 AC_DEFINE(HAVE_SB_ANY_QUOTA_LOADED, 1,
1553 [Kernel has a sb_any_quota_loaded])
1554 AC_MSG_RESULT([yes])
1560 # 2.6.30 x86 node_to_cpumask has been removed. must use cpumask_of_node
1561 AC_DEFUN([LC_EXPORT_CPUMASK_OF_NODE],
1562 [LB_CHECK_SYMBOL_EXPORT([node_to_cpumask_map],
1563 [arch/$LINUX_ARCH/mm/numa.c],
1564 [AC_DEFINE(HAVE_CPUMASK_OF_NODE, 1,
1565 [node_to_cpumask_map is exported by
1566 the kernel])]) # x86_64
1569 # 2.6.31 replaces blk_queue_hardsect_size by blk_queue_logical_block_size function
1570 AC_DEFUN([LC_BLK_QUEUE_LOG_BLK_SIZE],
1571 [AC_MSG_CHECKING([if blk_queue_logical_block_size is defined])
1572 LB_LINUX_TRY_COMPILE([
1573 #include <linux/blkdev.h>
1575 blk_queue_logical_block_size(NULL, 0);
1578 AC_DEFINE(HAVE_BLK_QUEUE_LOG_BLK_SIZE, 1,
1579 [blk_queue_logical_block_size is defined])
1587 # 2.6.32 changes cache_detail's member cache_request to cache_upcall
1588 # in kernel commit bc74b4f5e63a09fb78e245794a0de1e5a2716bbe
1589 AC_DEFUN([LC_CACHE_UPCALL],
1590 [AC_MSG_CHECKING([if cache_detail has cache_upcall field])
1591 LB_LINUX_TRY_COMPILE([
1592 #include <linux/sunrpc/cache.h>
1594 struct cache_detail cd;
1595 cd.cache_upcall = NULL;
1598 AC_DEFINE(HAVE_CACHE_UPCALL, 1,
1599 [cache_detail has cache_upcall field])
1605 # 2.6.32 add a limits member in struct request_queue.
1606 AC_DEFUN([LC_REQUEST_QUEUE_LIMITS],
1607 [AC_MSG_CHECKING([if request_queue has a limits field])
1608 LB_LINUX_TRY_COMPILE([
1609 #include <linux/blkdev.h>
1611 struct request_queue rq;
1612 rq.limits.io_min = 0;
1615 AC_DEFINE(HAVE_REQUEST_QUEUE_LIMITS, 1,
1616 [request_queue has a limits field])
1622 # 2.6.32 has bdi_register() functions.
1623 AC_DEFUN([LC_EXPORT_BDI_REGISTER],
1624 [LB_CHECK_SYMBOL_EXPORT([bdi_register],
1625 [mm/backing-dev.c],[
1626 AC_DEFINE(HAVE_BDI_REGISTER, 1,
1627 [bdi_register function is present])
1632 # 2.6.32 add s_bdi for super block
1633 AC_DEFUN([LC_SB_BDI],
1634 [AC_MSG_CHECKING([if super_block has s_bdi field])
1635 LB_LINUX_TRY_COMPILE([
1636 #include <linux/fs.h>
1638 struct super_block sb;
1642 AC_DEFINE(HAVE_SB_BDI, 1,
1643 [super_block has s_bdi field])
1649 # 2.6.27.15-2 SuSE 11 sp0 kernels lack the name field for BDI
1650 AC_DEFUN([LC_BDI_NAME],
1651 [AC_MSG_CHECKING([if backing_device_info has name field])
1652 LB_LINUX_TRY_COMPILE([
1653 #include <linux/blkkdev.h>
1655 struct backing_dev_info bdi;
1659 AC_DEFINE(HAVE_BDI_NAME, 1,
1660 [backing_device_info has name field])
1666 # 2.6.32 removes blk_queue_max_sectors and add blk_queue_max_hw_sectors
1667 # check blk_queue_max_sectors and use it until disappear.
1668 AC_DEFUN([LC_BLK_QUEUE_MAX_SECTORS],
1669 [AC_MSG_CHECKING([if blk_queue_max_sectors is defined])
1670 LB_LINUX_TRY_COMPILE([
1671 #include <linux/blkdev.h>
1673 blk_queue_max_sectors(NULL, 0);
1676 AC_DEFINE(HAVE_BLK_QUEUE_MAX_SECTORS, 1,
1677 [blk_queue_max_sectors is defined])
1683 # 2.6.32 replaces 2 functions blk_queue_max_phys_segments and blk_queue_max_hw_segments by blk_queue_max_segments
1684 AC_DEFUN([LC_BLK_QUEUE_MAX_SEGMENTS],
1685 [AC_MSG_CHECKING([if blk_queue_max_segments is defined])
1686 LB_LINUX_TRY_COMPILE([
1687 #include <linux/blkdev.h>
1689 blk_queue_max_segments(NULL, 0);
1692 AC_DEFINE(HAVE_BLK_QUEUE_MAX_SEGMENTS, 1,
1693 [blk_queue_max_segments is defined])
1702 # Check if kernel has been patched for 64-bit quota limits support.
1703 # The upstream version of this patch in RHEL6 2.6.32 kernels introduces
1704 # the constant QFMT_VFS_V1 in include/linux/quota.h, so we can check for
1705 # that in the absence of quotaio_v1.h in the kernel headers.
1707 AC_DEFUN([LC_QUOTA64],[
1708 AC_MSG_CHECKING([if kernel has 64-bit quota limits support])
1709 tmp_flags="$EXTRA_KCFLAGS"
1710 EXTRA_KCFLAGS="-I$LINUX/fs"
1711 LB_LINUX_TRY_COMPILE([
1712 #include <linux/kernel.h>
1713 #include <linux/fs.h>
1714 #ifdef HAVE_QUOTAIO_H
1715 # include <linux/quotaio_v2.h>
1716 int versions[] = V2_INITQVERSIONS_R1;
1717 struct v2_disk_dqblk_r1 dqblk_r1;
1718 #elif defined(HAVE_FS_QUOTA_QUOTAIO_H)
1719 # include <quota/quotaio_v2.h>
1720 struct v2r1_disk_dqblk dqblk_r1;
1721 #elif defined(HAVE_FS_QUOTAIO_H)
1722 # include <quotaio_v2.h>
1723 struct v2r1_disk_dqblk dqblk_r1;
1725 #include <linux/quota.h>
1726 int ver = QFMT_VFS_V1;
1729 AC_DEFINE(HAVE_QUOTA64, 1, [have quota64])
1730 AC_MSG_RESULT([yes])
1732 LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],[
1733 AC_MSG_ERROR([You have got no 64-bit kernel quota support.])
1737 EXTRA_KCFLAGS=$tmp_flags
1740 # 2.6.32 set_cpus_allowed is no more defined if CONFIG_CPUMASK_OFFSTACK=yes
1741 AC_DEFUN([LC_SET_CPUS_ALLOWED],
1742 [AC_MSG_CHECKING([if kernel defines set_cpus_allowed])
1743 LB_LINUX_TRY_COMPILE(
1744 [#include <linux/sched.h>],
1745 [struct task_struct *p = NULL;
1746 cpumask_t mask = { { 0 } };
1747 (void) set_cpus_allowed(p, mask);],
1748 [AC_MSG_RESULT([yes])
1749 AC_DEFINE(HAVE_SET_CPUS_ALLOWED, 1,
1750 [set_cpus_allowed is exported by the kernel])],
1751 [AC_MSG_RESULT([no])] )])
1753 # 2.6.32 introduces selinux_is_enabled()
1754 AC_DEFUN([LC_SELINUX_IS_ENABLED],
1755 [AC_MSG_CHECKING([if selinux_is_enabled is available])
1756 LB_LINUX_TRY_COMPILE([
1757 #include <linux/selinux.h>
1759 selinux_is_enabled();
1761 AC_MSG_RESULT([yes])
1762 AC_DEFINE(HAVE_SELINUX_IS_ENABLED, 1,
1763 [selinux_is_enabled is defined])
1771 # starting from 2.6.28 kernel replaces d_alloc_anon() with
1772 # d_obtain_alias() for getting anonymous dentries
1773 # RHEL5(2.6.18) has d_obtain_alias but SLES11SP0(2.6.27) not
1775 AC_DEFUN([LC_D_OBTAIN_ALIAS],
1776 [AC_MSG_CHECKING([d_obtain_alias exist in kernel])
1777 LB_LINUX_TRY_COMPILE([
1778 #include <linux/dcache.h>
1780 d_obtain_alias(NULL);
1782 AC_DEFINE(HAVE_D_OBTAIN_ALIAS, 1,
1783 [d_obtain_alias exist in kernel])
1784 AC_MSG_RESULT([yes])
1791 # LC_EXPORT_GENERIC_ERROR_REMOVE_PAGE
1793 AC_DEFUN([LC_EXPORT_GENERIC_ERROR_REMOVE_PAGE],
1794 [LB_CHECK_SYMBOL_EXPORT(
1795 [generic_error_remove_page],
1797 [AC_DEFINE(HAS_GENERIC_ERROR_REMOVE_PAGE, 1,
1798 [kernel export generic_error_remove_page])],
1804 # 2.6.36 fs_struct.lock use spinlock instead of rwlock.
1806 AC_DEFUN([LC_FS_STRUCT_RWLOCK],
1807 [AC_MSG_CHECKING([if fs_struct.lock use rwlock])
1808 LB_LINUX_TRY_COMPILE([
1809 #include <asm/atomic.h>
1810 #include <linux/spinlock.h>
1811 #include <linux/fs_struct.h>
1813 ((struct fs_struct *)0)->lock = (rwlock_t){ 0 };
1815 AC_DEFINE(HAVE_FS_STRUCT_RWLOCK, 1,
1816 [fs_struct.lock use rwlock])
1817 AC_MSG_RESULT([yes])
1824 # 2.6.36 super_operations add evict_inode method. it hybird of
1825 # delete_inode & clear_inode.
1827 AC_DEFUN([LC_SBOPS_EVICT_INODE],
1828 [AC_MSG_CHECKING([if super_operations.evict_inode exist])
1829 LB_LINUX_TRY_COMPILE([
1830 #include <linux/fs.h>
1832 ((struct super_operations *)0)->evict_inode(NULL);
1834 AC_DEFINE(HAVE_SBOPS_EVICT_INODE, 1,
1835 [super_operations.evict_inode() is exist in kernel])
1836 AC_MSG_RESULT([yes])
1843 # 2.6.35 file_operations.fsync taken 2 arguments.
1844 # 3.0.0 file_operations.fsync takes 4 arguments.
1846 AC_DEFUN([LC_FILE_FSYNC],
1847 [AC_MSG_CHECKING([if file_operations.fsync takes 4 or 2 arguments])
1848 LB_LINUX_TRY_COMPILE([
1849 #include <linux/fs.h>
1851 ((struct file_operations *)0)->fsync(NULL, 0, 0, 0);
1853 AC_DEFINE(HAVE_FILE_FSYNC_4ARGS, 1,
1854 [file_operations.fsync takes 4 arguments])
1855 AC_MSG_RESULT([yes, 4 args])
1857 LB_LINUX_TRY_COMPILE([
1858 #include <linux/fs.h>
1860 ((struct file_operations *)0)->fsync(NULL, 0);
1862 AC_DEFINE(HAVE_FILE_FSYNC_2ARGS, 1,
1863 [file_operations.fsync takes 2 arguments])
1864 AC_MSG_RESULT([yes, 2 args])
1872 # 2.6.38 export blkdev_get_by_dev
1874 AC_DEFUN([LC_BLKDEV_GET_BY_DEV],
1875 [LB_CHECK_SYMBOL_EXPORT([blkdev_get_by_dev],
1877 AC_DEFINE(HAVE_BLKDEV_GET_BY_DEV, 1,
1878 [blkdev_get_by_dev is exported by the kernel])
1884 # 2.6.38 vfsmount.mnt_count doesn't use atomic_t
1886 AC_DEFUN([LC_ATOMIC_MNT_COUNT],
1887 [AC_MSG_CHECKING([if vfsmount.mnt_count is atomic_t])
1888 LB_LINUX_TRY_COMPILE([
1889 #include <asm/atomic.h>
1890 #include <linux/fs.h>
1891 #include <linux/mount.h>
1893 ((struct vfsmount *)0)->mnt_count = ((atomic_t) { 0 });
1895 AC_DEFINE(HAVE_ATOMIC_MNT_COUNT, 1,
1896 [vfsmount.mnt_count is atomic_t])
1897 AC_MSG_RESULT([yes])
1904 # 2.6.38 use path as 4th parameter in quota_on.
1906 AC_DEFUN([LC_QUOTA_ON_USE_PATH],
1907 [AC_MSG_CHECKING([quota_on use path as parameter])
1908 tmp_flags="$EXTRA_KCFLAGS"
1909 EXTRA_KCFLAGS="-Werror"
1910 LB_LINUX_TRY_COMPILE([
1911 #include <linux/fs.h>
1912 #include <linux/quota.h>
1914 ((struct quotactl_ops *)0)->quota_on(NULL, 0, 0, ((struct path*)0));
1916 AC_DEFINE(HAVE_QUOTA_ON_USE_PATH, 1,
1917 [quota_on use path as 4th paramter])
1918 AC_MSG_RESULT([yes])
1922 EXTRA_KCFLAGS="$tmp_flags"
1926 # 2.6.39 remove unplug_fn from request_queue.
1928 AC_DEFUN([LC_REQUEST_QUEUE_UNPLUG_FN],
1929 [AC_MSG_CHECKING([if request_queue has unplug_fn field])
1930 LB_LINUX_TRY_COMPILE([
1931 #include <linux/blkdev.h>
1933 do{ }while(sizeof(((struct request_queue *)0)->unplug_fn));
1935 AC_DEFINE(HAVE_REQUEST_QUEUE_UNPLUG_FN, 1,
1936 [request_queue has unplug_fn field])
1937 AC_MSG_RESULT([yes])
1944 # 2.6.38 generic_permission taken 4 paremater.
1945 # in fact, it means rcu-walk aware permission bring.
1947 AC_DEFUN([LC_GENERIC_PERMISSION],
1948 [AC_MSG_CHECKING([if generic_permission take 4 arguments])
1949 LB_LINUX_TRY_COMPILE([
1950 #include <linux/fs.h>
1952 generic_permission(NULL, 0, 0, NULL);
1954 AC_DEFINE(HAVE_GENERIC_PERMISSION_4ARGS, 1,
1955 [generic_permission taken 4 arguments])
1956 AC_MSG_RESULT([yes])
1963 # 2.6.38 export simple_setattr
1965 AC_DEFUN([LC_EXPORT_SIMPLE_SETATTR],
1966 [LB_CHECK_SYMBOL_EXPORT([simple_setattr],
1968 AC_DEFINE(HAVE_SIMPLE_SETATTR, 1,
1969 [simple_setattr is exported by the kernel])
1977 # Lustre linux kernel checks
1979 AC_DEFUN([LC_PROG_LINUX],
1983 LC_CONFIG_LIBLUSTRE_RECOVERY
1984 LC_CONFIG_HEALTH_CHECK_WRITE
1985 LC_CONFIG_LRU_RESIZE
1987 LC_LLITE_LLOOP_MODULE
1990 LC_EXPORT_TRUNCATE_COMPLETE
1991 LC_EXPORT_D_REHASH_COND
1992 LC_EXPORT___D_REHASH
1993 LC_EXPORT_NODE_TO_CPUMASK
2004 LC_COOKIE_FOLLOW_LINK
2020 LC_SECURITY_PLUG # for SLES10 SP2
2028 LC_STATFS_DENTRY_PARAM
2029 LC_UMOUNTBEGIN_HAS_VFSMOUNT
2031 if test x$enable_server = xyes ; then
2032 LC_EXPORT_INVALIDATE_MAPPING_PAGES
2035 #2.6.18 + RHEL5 (fc6)
2046 LC_CANCEL_DIRTY_PAGE
2048 # raid5-zerocopy patch
2052 LC_INVALIDATE_BDEV_2ARG
2053 LC_ASYNC_BLOCK_CIPHER
2055 LC_STRUCT_BLKCIPHER_DESC
2056 LC_FS_RENAME_DOES_D_MOVE
2059 LC_UNREGISTER_BLKDEV_RETURN_INT
2060 LC_KERNEL_SPLICE_READ
2065 LC_EXPORTFS_DECODE_FH
2075 LC_FS_STRUCT_USE_PATH
2078 LC_PGMKWRITE_USE_VMFAULT
2079 LC_INODE_PERMISION_2ARGS
2082 LC_READ_INODE_IN_SBOPS
2083 LC_EXPORT_INODE_PERMISSION
2089 # 2.6.27.15-2 sles11
2093 LC_SB_ANY_QUOTA_ACTIVE
2094 LC_SB_HAS_QUOTA_ACTIVE
2095 LC_EXPORT_ADD_TO_PAGE_CACHE_LRU
2098 LC_SB_ANY_QUOTA_LOADED
2101 LC_EXPORT_CPUMASK_OF_NODE
2104 LC_BLK_QUEUE_LOG_BLK_SIZE
2107 LC_REQUEST_QUEUE_LIMITS
2108 LC_EXPORT_BDI_REGISTER
2110 LC_BLK_QUEUE_MAX_SECTORS
2111 LC_BLK_QUEUE_MAX_SEGMENTS
2114 LC_EXPORT_GENERIC_ERROR_REMOVE_PAGE
2115 LC_SELINUX_IS_ENABLED
2119 LC_EXPORT_SIMPLE_SETATTR
2123 LC_SBOPS_EVICT_INODE
2127 LC_BLKDEV_GET_BY_DEV
2128 LC_GENERIC_PERMISSION
2129 LC_QUOTA_ON_USE_PATH
2132 LC_REQUEST_QUEUE_UNPLUG_FN
2135 if test x$enable_server = xyes ; then
2136 AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server])
2137 LC_FUNC_DEV_SET_RDONLY
2144 # LC_CONFIG_CLIENT_SERVER
2146 # Build client/server sides of Lustre
2148 AC_DEFUN([LC_CONFIG_CLIENT_SERVER],
2149 [AC_MSG_CHECKING([whether to build Lustre server support])
2150 AC_ARG_ENABLE([server],
2151 AC_HELP_STRING([--disable-server],
2152 [disable Lustre server support]),
2153 [],[enable_server='yes'])
2154 AC_MSG_RESULT([$enable_server])
2156 AC_MSG_CHECKING([whether to build Lustre client support])
2157 AC_ARG_ENABLE([client],
2158 AC_HELP_STRING([--disable-client],
2159 [disable Lustre client support]),
2160 [],[enable_client='yes'])
2161 AC_MSG_RESULT([$enable_client])])
2164 # LC_CONFIG_LIBLUSTRE
2166 # whether to build liblustre
2168 AC_DEFUN([LC_CONFIG_LIBLUSTRE],
2169 [AC_MSG_CHECKING([whether to build Lustre library])
2170 AC_ARG_ENABLE([liblustre],
2171 AC_HELP_STRING([--disable-liblustre],
2172 [disable building of Lustre library]),
2173 [],[enable_liblustre=$with_sysio])
2174 AC_MSG_RESULT([$enable_liblustre])
2175 # only build sysio if liblustre is built
2176 with_sysio="$enable_liblustre"
2178 AC_MSG_CHECKING([whether to build liblustre tests])
2179 AC_ARG_ENABLE([liblustre-tests],
2180 AC_HELP_STRING([--enable-liblustre-tests],
2181 [enable liblustre tests, if --disable-tests is used]),
2182 [],[enable_liblustre_tests=$enable_tests])
2183 if test x$enable_liblustre != xyes ; then
2184 enable_liblustre_tests='no'
2186 AC_MSG_RESULT([$enable_liblustre_tests])
2188 AC_MSG_CHECKING([whether to enable liblustre acl])
2189 AC_ARG_ENABLE([liblustre-acl],
2190 AC_HELP_STRING([--disable-liblustre-acl],
2191 [disable ACL support for liblustre]),
2192 [],[enable_liblustre_acl=yes])
2193 AC_MSG_RESULT([$enable_liblustre_acl])
2194 if test x$enable_liblustre_acl = xyes ; then
2195 AC_DEFINE(LIBLUSTRE_POSIX_ACL, 1, Liblustre Support ACL-enabled MDS)
2198 # 2.6.29 change prepare/commit_write to write_begin/end
2199 AC_DEFUN([LC_WRITE_BEGIN_END],
2200 [AC_MSG_CHECKING([if kernel has .write_begin/end])
2201 LB_LINUX_TRY_COMPILE([
2202 #include <linux/fs.h>
2203 #include <linux/pagemap.h>
2204 #ifdef HAVE_LINUX_MMTYPES_H
2205 #include <linux/mm_types.h>
2208 struct address_space_operations aops;
2211 aops.write_begin = NULL;
2212 aops.write_end = NULL;
2213 page = grab_cache_page_write_begin(NULL, 0, 0);
2215 AC_MSG_RESULT([yes])
2216 AC_DEFINE(HAVE_KERNEL_WRITE_BEGIN_END, 1,
2217 [kernel has .write_begin/end])
2223 # 2.6.29 blkdev_put has 2 arguments
2224 AC_DEFUN([LC_BLKDEV_PUT_2ARGS],
2225 [AC_MSG_CHECKING([blkdev_put needs 2 parameters])
2226 LB_LINUX_TRY_COMPILE([
2227 #include <linux/fs.h>
2229 blkdev_put(NULL, 0);
2231 AC_DEFINE(HAVE_BLKDEV_PUT_2ARGS, 1,
2232 [blkdev_put needs 2 paramters])
2233 AC_MSG_RESULT([yes])
2239 # 2.6.29 dentry_open has 4 arguments
2240 AC_DEFUN([LC_DENTRY_OPEN_4ARGS],
2241 [AC_MSG_CHECKING([dentry_open needs 4 parameters])
2242 LB_LINUX_TRY_COMPILE([
2243 #include <linux/fs.h>
2245 dentry_open(NULL, NULL, 0, NULL);
2247 AC_DEFINE(HAVE_DENTRY_OPEN_4ARGS, 1,
2248 [dentry_open needs 4 paramters])
2249 AC_MSG_RESULT([yes])
2255 # 2.6.29 split file and anonymous page queues
2256 AC_DEFUN([LC_PAGEVEC_LRU_ADD_FILE],
2257 [AC_MSG_CHECKING([if kernel has .pagevec_lru_add_file])
2258 LB_LINUX_TRY_COMPILE([
2259 #include <linux/mm.h>
2260 #include <linux/pagevec.h>
2262 struct pagevec lru_pagevec;
2264 pagevec_init(&lru_pagevec, 0);
2265 pagevec_lru_add_file(&lru_pagevec);
2267 AC_MSG_RESULT([yes])
2268 AC_DEFINE(HAVE_PAGEVEC_LRU_ADD_FILE, 1,
2269 [kernel has .pagevec_lru_add_file])
2278 AC_ARG_ENABLE(mpitests,
2279 AC_HELP_STRING([--enable-mpitests=yes|no|mpicc wrapper],
2280 [include mpi tests]),
2291 MPICC_WRAPPER=$enableval
2301 if test x$enable_mpitests != xno; then
2302 AC_MSG_CHECKING([whether mpitests can be built])
2310 MPI_Initialized(&flag);
2313 AC_MSG_RESULT([yes])
2320 AC_SUBST(MPICC_WRAPPER)
2322 AC_MSG_NOTICE([Enabling Lustre configure options for libsysio])
2323 ac_configure_args="$ac_configure_args --with-lustre-hack --with-sockets"
2326 LC_CONFIG_LIBLUSTRE_RECOVERY
2332 # whether to enable quota support global control
2334 AC_DEFUN([LC_CONFIG_QUOTA],
2335 [AC_ARG_ENABLE([quota],
2336 AC_HELP_STRING([--enable-quota],
2337 [enable quota support]),
2338 [],[enable_quota='yes'])
2341 AC_DEFUN([LC_QUOTA],
2345 AC_CHECK_HEADER(sys/quota.h,
2346 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1, [Define to 1 if you have <sys/quota.h>.])],
2347 [AC_MSG_ERROR([don't find <sys/quota.h> in your system])])
2353 # whether to enable split support
2355 AC_DEFUN([LC_CONFIG_SPLIT],
2356 [AC_MSG_CHECKING([whether to enable split support])
2357 AC_ARG_ENABLE([split],
2358 AC_HELP_STRING([--enable-split],
2359 [enable split support]),
2360 [],[enable_split='no'])
2361 AC_MSG_RESULT([$enable_split])
2362 if test x$enable_split != xno; then
2363 AC_DEFINE(HAVE_SPLIT_SUPPORT, 1, [enable split support])
2367 # RHEL5(2.6.18) has tux_info
2368 AC_DEFUN([LC_TASK_CLENV_TUX_INFO],
2369 [AC_MSG_CHECKING([tux_info])
2370 LB_LINUX_TRY_COMPILE([
2371 #include <linux/sched.h>
2373 struct task_struct task;
2376 AC_MSG_RESULT([yes])
2377 AC_DEFINE(LL_TASK_CL_ENV, tux_info, [have tux_info])
2378 have_task_clenv_store='yes'
2385 # LC_LLITE_LLOOP_MODULE
2386 # lloop_llite.ko does not currently work with page sizes
2389 AC_DEFUN([LC_LLITE_LLOOP_MODULE],
2390 [AC_MSG_CHECKING([whether to enable llite_lloop module])
2391 LB_LINUX_TRY_COMPILE([
2392 #include <asm/page.h>
2394 #if PAGE_SIZE >= 65536
2395 #error "PAGE_SIZE >= 65536"
2398 enable_llite_lloop_module='yes'
2399 AC_MSG_RESULT([yes])
2401 enable_llite_lloop_module='no'
2409 # other configure checks
2411 AC_DEFUN([LC_CONFIGURE],
2412 [LC_CONFIG_OBD_BUFFER_SIZE
2414 if test $target_cpu == "i686" -o $target_cpu == "x86_64"; then
2415 CFLAGS="$CFLAGS -Werror"
2418 # maximum MDS thread count
2421 # include/liblustre.h
2422 AC_CHECK_HEADERS([sys/user.h sys/vfs.h stdint.h blkid/blkid.h])
2424 # liblustre/llite_lib.h
2425 AC_CHECK_HEADERS([xtio.h file.h])
2428 AC_CHECK_HEADERS([linux/types.h sys/types.h linux/unistd.h unistd.h])
2431 AC_CHECK_HEADERS([netinet/in.h arpa/inet.h catamount/data.h])
2432 AC_CHECK_FUNCS([inet_ntoa])
2434 # libsysio/src/readlink.c
2437 # lvfs/prng.c - depends on linux/types.h from liblustre/dir.c
2438 AC_CHECK_HEADERS([linux/random.h], [], [],
2439 [#ifdef HAVE_LINUX_TYPES_H
2440 # include <linux/types.h>
2445 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
2447 # check for -lz support
2451 [AC_CHECK_HEADERS([zlib.h],
2453 AC_DEFINE([HAVE_ADLER], 1,
2454 [support alder32 checksum type])],
2455 [AC_MSG_WARN([No zlib-devel package found,
2456 unable to use adler32 checksum])])],
2457 [AC_MSG_WARN([No zlib package found, unable to use adler32 checksum])]
2462 AC_ARG_ENABLE([mindf],
2463 AC_HELP_STRING([--enable-mindf],
2464 [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
2466 if test "$enable_mindf" = "yes" ; then
2467 AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])
2470 AC_ARG_ENABLE([fail_alloc],
2471 AC_HELP_STRING([--disable-fail-alloc],
2472 [disable randomly alloc failure]),
2473 [],[enable_fail_alloc=yes])
2474 AC_MSG_CHECKING([whether to randomly failing memory alloc])
2475 AC_MSG_RESULT([$enable_fail_alloc])
2476 if test x$enable_fail_alloc != xno ; then
2477 AC_DEFINE([RANDOM_FAIL_ALLOC], 1, [enable randomly alloc failure])
2480 AC_ARG_ENABLE([invariants],
2481 AC_HELP_STRING([--enable-invariants],
2482 [enable invariant checking (cpu intensive)]),
2484 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
2485 AC_MSG_RESULT([$enable_invariants])
2486 if test x$enable_invariants = xyes ; then
2487 AC_DEFINE([INVARIANT_CHECK], 1, [enable invariant checking])
2490 AC_ARG_ENABLE([lu_ref],
2491 AC_HELP_STRING([--enable-lu_ref],
2492 [enable lu_ref reference tracking code]),
2494 AC_MSG_CHECKING([whether to track references with lu_ref])
2495 AC_MSG_RESULT([$enable_lu_ref])
2496 if test x$enable_lu_ref = xyes ; then
2497 AC_DEFINE([USE_LU_REF], 1, [enable lu_ref reference tracking code])
2500 AC_ARG_ENABLE([pgstate-track],
2501 AC_HELP_STRING([--enable-pgstate-track],
2502 [enable page state tracking]),
2503 [enable_pgstat_track='yes'],[])
2504 AC_MSG_CHECKING([whether to enable page state tracking])
2505 AC_MSG_RESULT([$enable_pgstat_track])
2506 if test x$enable_pgstat_track = xyes ; then
2507 AC_DEFINE([LUSTRE_PAGESTATE_TRACKING], 1,
2508 [enable page state tracking code])
2515 LC_DENTRY_OPEN_4ARGS
2516 LC_PAGEVEC_LRU_ADD_FILE
2523 # AM_CONDITIONALS for lustre
2525 AC_DEFUN([LC_CONDITIONALS],
2526 [AM_CONDITIONAL(LIBLUSTRE, test x$enable_liblustre = xyes)
2527 AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno)
2528 AM_CONDITIONAL(LIBLUSTRE_TESTS, test x$enable_liblustre_tests = xyes)
2529 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
2530 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
2531 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
2532 AM_CONDITIONAL(QUOTA, test x$enable_quota_module = xyes)
2533 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
2534 AM_CONDITIONAL(BLKID, test x$ac_cv_header_blkid_blkid_h = xyes)
2535 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
2536 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
2537 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
2538 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
2539 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
2540 AM_CONDITIONAL(LLITE_LLOOP, test x$enable_llite_lloop_module = xyes)
2546 # files that should be generated with AC_OUTPUT
2548 AC_DEFUN([LC_CONFIG_FILES],
2552 lustre/autoconf/Makefile
2553 lustre/conf/Makefile
2554 lustre/contrib/Makefile
2556 lustre/include/Makefile
2557 lustre/include/lustre_ver.h
2558 lustre/include/linux/Makefile
2559 lustre/include/darwin/Makefile
2560 lustre/include/lustre/Makefile
2561 lustre/kernel_patches/targets/2.6-rhel6.target
2562 lustre/kernel_patches/targets/2.6-rhel5.target
2563 lustre/kernel_patches/targets/2.6-sles10.target
2564 lustre/kernel_patches/targets/2.6-sles11.target
2565 lustre/kernel_patches/targets/2.6-oel5.target
2566 lustre/kernel_patches/targets/2.6-fc11.target
2567 lustre/kernel_patches/targets/2.6-fc12.target
2568 lustre/ldlm/Makefile
2570 lustre/fid/autoMakefile
2571 lustre/liblustre/Makefile
2572 lustre/liblustre/tests/Makefile
2573 lustre/liblustre/tests/mpi/Makefile
2574 lustre/llite/Makefile
2575 lustre/llite/autoMakefile
2576 lustre/lclient/Makefile
2578 lustre/lov/autoMakefile
2579 lustre/lvfs/Makefile
2580 lustre/lvfs/autoMakefile
2582 lustre/mdc/autoMakefile
2584 lustre/lmv/autoMakefile
2586 lustre/mds/autoMakefile
2588 lustre/mdt/autoMakefile
2590 lustre/cmm/autoMakefile
2592 lustre/mdd/autoMakefile
2594 lustre/fld/autoMakefile
2595 lustre/obdclass/Makefile
2596 lustre/obdclass/autoMakefile
2597 lustre/obdclass/linux/Makefile
2598 lustre/obdecho/Makefile
2599 lustre/obdecho/autoMakefile
2600 lustre/obdfilter/Makefile
2601 lustre/obdfilter/autoMakefile
2603 lustre/osc/autoMakefile
2605 lustre/ost/autoMakefile
2606 lustre/osd-ldiskfs/Makefile
2607 lustre/osd-ldiskfs/autoMakefile
2609 lustre/mgc/autoMakefile
2611 lustre/mgs/autoMakefile
2612 lustre/ptlrpc/Makefile
2613 lustre/ptlrpc/autoMakefile
2614 lustre/ptlrpc/gss/Makefile
2615 lustre/ptlrpc/gss/autoMakefile
2616 lustre/quota/Makefile
2617 lustre/quota/autoMakefile
2618 lustre/scripts/Makefile
2619 lustre/tests/Makefile
2620 lustre/tests/mpi/Makefile
2621 lustre/utils/Makefile
2622 lustre/utils/gss/Makefile
2623 lustre/obdclass/darwin/Makefile