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])
213 # Quota support. The kernel must support CONFIG_QUOTA.
215 AC_DEFUN([LC_QUOTA_CONFIG],
216 [LB_LINUX_CONFIG_IM([QUOTA],[AC_DEFINE(HAVE_QUOTA_SUPPORT, 1, [support quota])],[
217 AC_MSG_ERROR([Lustre quota requires that CONFIG_QUOTA is enabled in your kernel.])
221 # truncate_complete_page() was exported from RHEL5/SLES10, but not in SLES11 SP0 (2.6.27)
222 # remove_from_page_cache() was exported between 2.6.35 and 2.6.38
223 # delete_from_page_cache() is exported from 2.6.39
224 AC_DEFUN([LC_EXPORT_TRUNCATE_COMPLETE],
225 [LB_CHECK_SYMBOL_EXPORT([truncate_complete_page],
227 [AC_DEFINE(HAVE_TRUNCATE_COMPLETE_PAGE, 1,
228 [kernel export truncate_complete_page])])
229 LB_CHECK_SYMBOL_EXPORT([remove_from_page_cache],
231 [AC_DEFINE(HAVE_REMOVE_FROM_PAGE_CACHE, 1,
232 [kernel export remove_from_page_cache])])
233 LB_CHECK_SYMBOL_EXPORT([delete_from_page_cache],
235 [AC_DEFINE(HAVE_DELETE_FROM_PAGE_CACHE, 1,
236 [kernel export delete_from_page_cache])])
239 AC_DEFUN([LC_EXPORT_D_REHASH_COND],
240 [LB_CHECK_SYMBOL_EXPORT([d_rehash_cond],
242 AC_DEFINE(HAVE_D_REHASH_COND, 1,
243 [d_rehash_cond is exported by the kernel])
248 AC_DEFUN([LC_EXPORT___D_REHASH],
249 [LB_CHECK_SYMBOL_EXPORT([__d_rehash],
251 AC_DEFINE(HAVE___D_REHASH, 1,
252 [__d_rehash is exported by the kernel])
257 # The actual symbol exported varies among architectures, so we need
258 # to check many symbols (but only in the current architecture.) No
259 # matter what symbol is exported, the kernel #defines node_to_cpumask
260 # to the appropriate function and that's what we use.
261 AC_DEFUN([LC_EXPORT_NODE_TO_CPUMASK],
262 [LB_CHECK_SYMBOL_EXPORT([node_to_cpumask],
263 [arch/$LINUX_ARCH/mm/numa.c],
264 [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1,
265 [node_to_cpumask is exported by
266 the kernel])]) # x86_64
267 LB_CHECK_SYMBOL_EXPORT([node_to_cpu_mask],
268 [arch/$LINUX_ARCH/kernel/smpboot.c],
269 [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1,
270 [node_to_cpumask is exported by
271 the kernel])]) # ia64
272 LB_CHECK_SYMBOL_EXPORT([node_2_cpu_mask],
273 [arch/$LINUX_ARCH/kernel/smpboot.c],
274 [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1,
275 [node_to_cpumask is exported by
276 the kernel])]) # i386
281 # between 2.6.5 - 2.6.22 filemap_populate is exported in some kernels
283 AC_DEFUN([LC_FILEMAP_POPULATE],
284 [AC_MSG_CHECKING([for exported filemap_populate])
285 LB_LINUX_TRY_COMPILE([
286 #include <asm/page.h>
287 #include <linux/mm.h>
289 filemap_populate(NULL, 0, 0, __pgprot(0), 0, 0);
292 AC_DEFINE(HAVE_FILEMAP_POPULATE, 1, [Kernel exports filemap_populate])
301 AC_DEFUN([LC_BIT_SPINLOCK_H],
302 [LB_CHECK_FILE([$LINUX/include/linux/bit_spinlock.h],[
303 AC_MSG_CHECKING([if bit_spinlock.h can be compiled])
304 LB_LINUX_TRY_COMPILE([
305 #include <asm/processor.h>
306 #include <linux/spinlock.h>
307 #include <linux/bit_spinlock.h>
310 AC_DEFINE(HAVE_BIT_SPINLOCK_H, 1, [Kernel has bit_spinlock.h])
321 AC_DEFUN([LC_CONST_ACL_SIZE],
322 [AC_MSG_CHECKING([calc acl size])
324 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"
327 #include <linux/types.h>
330 #define __LINUX_POSIX_ACL_H
332 #ifdef CONFIG_FS_POSIX_ACL
333 # include <linux/posix_acl_xattr.h>
340 /* LUSTRE_POSIX_ACL_MAX_ENTRIES = 32 */
341 int size = posix_acl_xattr_size(32);
342 FILE *f = fopen("acl.size","w+");
343 fprintf(f,"%d", size);
349 acl_size=`cat acl.size`
350 AC_MSG_RESULT([ACL size $acl_size])
351 AC_DEFINE_UNQUOTED(XATTR_ACL_SIZE, AS_TR_SH([$acl_size]), [size of xattr acl])
353 AC_ERROR([ACL size can't be computed])
355 AC_MSG_RESULT([can't check ACL size, make it 260])
356 AC_DEFINE_UNQUOTED(XATTR_ACL_SIZE,260)
364 AC_DEFUN([LC_CAPA_CRYPTO],
365 [LB_LINUX_CONFIG_IM([CRYPTO],[],[
366 AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO is enabled in your kernel.])
368 LB_LINUX_CONFIG_IM([CRYPTO_HMAC],[],[
369 AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_HMAC is enabled in your kernel.])
371 LB_LINUX_CONFIG_IM([CRYPTO_SHA1],[],[
372 AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_SHA1 is enabled in your kernel.])
377 # LC_CONFIG_RMTCLIENT
380 dnl the AES symbol usually tied with arch, e.g. CRYPTO_AES_586
382 AC_DEFUN([LC_CONFIG_RMTCLIENT],
383 [LB_LINUX_CONFIG_IM([CRYPTO_AES],[],[
384 AC_MSG_WARN([Lustre remote client require that CONFIG_CRYPTO_AES is enabled in your kernel.])
389 # LC_CONFIG_GSS_KEYRING (default enabled, if gss is enabled)
391 AC_DEFUN([LC_CONFIG_GSS_KEYRING],
392 [AC_MSG_CHECKING([whether to enable gss keyring backend])
393 AC_ARG_ENABLE([gss_keyring],
394 [AC_HELP_STRING([--disable-gss-keyring],
395 [disable gss keyring backend])],
396 [],[enable_gss_keyring='yes'])
397 AC_MSG_RESULT([$enable_gss_keyring])
399 if test x$enable_gss_keyring != xno; then
400 LB_LINUX_CONFIG_IM([KEYS],[],
401 [AC_MSG_ERROR([GSS keyring backend require that CONFIG_KEYS be enabled in your kernel.])])
403 AC_CHECK_LIB([keyutils], [keyctl_search], [],
404 [AC_MSG_ERROR([libkeyutils is not found, which is required by gss keyring backend])],)
406 AC_DEFINE([HAVE_GSS_KEYRING], [1],
407 [Define this if you enable gss keyring backend])
411 AC_DEFUN([LC_CONFIG_SUNRPC],
412 [LB_LINUX_CONFIG_IM([SUNRPC],[],
413 [AC_MSG_ERROR([kernel SUNRPC support is required by using GSS.])])
417 # LC_CONFIG_GSS (default disabled)
419 # Build gss and related tools of Lustre. Currently both kernel and user space
420 # parts are depend on linux platform.
422 AC_DEFUN([LC_CONFIG_GSS],
423 [AC_MSG_CHECKING([whether to enable gss/krb5 support])
425 [AC_HELP_STRING([--enable-gss], [enable gss/krb5 support])],
426 [],[enable_gss='no'])
427 AC_MSG_RESULT([$enable_gss])
429 if test x$enable_gss == xyes; then
430 LC_CONFIG_GSS_KEYRING
433 AC_DEFINE([HAVE_GSS], [1], [Define this if you enable gss])
435 LB_LINUX_CONFIG_IM([CRYPTO_MD5],[],
436 [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
437 LB_LINUX_CONFIG_IM([CRYPTO_SHA1],[],
438 [AC_MSG_WARN([kernel SHA1 support is recommended by using GSS.])])
439 LB_LINUX_CONFIG_IM([CRYPTO_SHA256],[],
440 [AC_MSG_WARN([kernel SHA256 support is recommended by using GSS.])])
441 LB_LINUX_CONFIG_IM([CRYPTO_SHA512],[],
442 [AC_MSG_WARN([kernel SHA512 support is recommended by using GSS.])])
444 AC_CHECK_LIB([gssapi], [gss_init_sec_context],
445 [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi"],
446 [AC_CHECK_LIB([gssglue], [gss_init_sec_context],
447 [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssglue"],
448 [AC_MSG_ERROR([libgssapi or libgssglue is not found, which is required by GSS.])])],)
450 AC_SUBST(GSSAPI_LIBS)
456 AC_DEFUN([LC_QUOTA_READ],
457 [AC_MSG_CHECKING([if kernel supports quota_read])
458 LB_LINUX_TRY_COMPILE([
459 #include <linux/fs.h>
461 struct super_operations sp;
462 void *i = (void *)sp.quota_read;
465 AC_DEFINE(KERNEL_SUPPORTS_QUOTA_READ, 1, [quota_read found])
472 # LC_COOKIE_FOLLOW_LINK
474 # kernel 2.6.13+ ->follow_link returns a cookie
476 AC_DEFUN([LC_COOKIE_FOLLOW_LINK],
477 [AC_MSG_CHECKING([if inode_operations->follow_link returns a cookie])
478 LB_LINUX_TRY_COMPILE([
479 #include <linux/fs.h>
480 #include <linux/namei.h>
482 struct dentry *dentry = NULL;
485 dentry->d_inode->i_op->put_link(dentry, &nd, NULL);
487 AC_DEFINE(HAVE_COOKIE_FOLLOW_LINK, 1, [inode_operations->follow_link returns a cookie])
497 # kernels prior than 2.6.0(?) have no RCU supported; in kernel 2.6.5(SUSE),
498 # call_rcu takes three parameters.
500 AC_DEFUN([LC_FUNC_RCU],
501 [AC_MSG_CHECKING([if kernel have RCU supported])
502 LB_LINUX_TRY_COMPILE([
503 #include <linux/rcupdate.h>
505 AC_DEFINE(HAVE_RCU, 1, [have RCU defined])
508 AC_MSG_CHECKING([if call_rcu takes three parameters])
509 LB_LINUX_TRY_COMPILE([
510 #include <linux/rcupdate.h>
513 call_rcu(&rh, (void (*)(struct rcu_head *))1, NULL);
515 AC_DEFINE(HAVE_CALL_RCU_PARAM, 1, [call_rcu takes three parameters])
526 AC_DEFUN([LC_PERCPU_COUNTER],
527 [AC_MSG_CHECKING([if have struct percpu_counter defined])
528 LB_LINUX_TRY_COMPILE([
529 #include <linux/percpu_counter.h>
531 AC_DEFINE(HAVE_PERCPU_COUNTER, 1, [percpu_counter found])
534 AC_MSG_CHECKING([if percpu_counter_inc takes the 2nd argument])
535 LB_LINUX_TRY_COMPILE([
536 #include <linux/percpu_counter.h>
538 struct percpu_counter c;
539 percpu_counter_init(&c, 0);
541 AC_DEFINE(HAVE_PERCPU_2ND_ARG, 1, [percpu_counter_init has two
552 AC_DEFUN([LC_TASK_CLENV_STORE],
554 AC_MSG_CHECKING([if we can store cl_env in task_struct])
555 if test x$have_task_clenv_store != xyes ; then
556 LC_TASK_CLENV_TUX_INFO
562 AC_DEFUN([LC_S_TIME_GRAN],
563 [AC_MSG_CHECKING([if super block has s_time_gran member])
564 LB_LINUX_TRY_COMPILE([
565 #include <linux/fs.h>
567 struct super_block *sb = NULL;
569 return sb->s_time_gran;
572 AC_DEFINE(HAVE_S_TIME_GRAN, 1, [super block has s_time_gran member])
578 AC_DEFUN([LC_SB_TIME_GRAN],
579 [AC_MSG_CHECKING([if kernel has old get_sb_time_gran])
580 LB_LINUX_TRY_COMPILE([
581 #include <linux/fs.h>
583 return get_sb_time_gran(NULL);
586 AC_DEFINE(HAVE_SB_TIME_GRAN, 1, [kernel has old get_sb_time_gran])
594 # ~2.6.12 merge patch from oracle to convert tree_lock from spinlock to rwlock
595 AC_DEFUN([LC_RW_TREE_LOCK],
596 [AC_MSG_CHECKING([if kernel has tree_lock as rwlock])
597 tmp_flags="$EXTRA_KCFLAGS"
598 EXTRA_KCFLAGS="-Werror"
599 LB_LINUX_TRY_COMPILE([
600 #include <linux/fs.h>
602 struct address_space a;
604 write_lock(&a.tree_lock);
607 AC_DEFINE(HAVE_RW_TREE_LOCK, 1, [kernel has tree_lock as rw_lock])
611 EXTRA_KCFLAGS="$tmp_flags"
617 # after 2.6.15 inode have i_mutex intead of i_sem
618 AC_DEFUN([LC_INODE_I_MUTEX],
619 [AC_MSG_CHECKING([if inode has i_mutex ])
620 LB_LINUX_TRY_COMPILE([
621 #include <linux/mutex.h>
622 #include <linux/fs.h>
627 mutex_unlock(&i.i_mutex);
630 AC_DEFINE(HAVE_INODE_I_MUTEX, 1,
631 [after 2.6.15 inode have i_mutex intead of i_sem])
639 # LC_SECURITY_PLUG # for SLES10 SP2
640 # check security plug in sles10 sp2 kernel
641 AC_DEFUN([LC_SECURITY_PLUG],
642 [AC_MSG_CHECKING([If kernel has security plug support])
643 LB_LINUX_TRY_COMPILE([
644 #include <linux/fs.h>
645 #include <linux/stddef.h>
647 notify_change(NULL, NULL, NULL);
650 AC_DEFINE(HAVE_SECURITY_PLUG, 1,
651 [SLES10 SP2 use extra parameter in vfs])
659 # inode have i_private field since 2.6.17
660 AC_DEFUN([LC_INODE_IPRIVATE],
661 [AC_MSG_CHECKING([if inode has a i_private field])
662 LB_LINUX_TRY_COMPILE([
663 #include <linux/fs.h>
669 AC_DEFINE(HAVE_INODE_IPRIVATE, 1,
670 [struct inode has i_private field])
677 # after 2.6.17 dquote use mutex instead if semaphore
678 AC_DEFUN([LC_DQUOTOFF_MUTEX],
679 [AC_MSG_CHECKING([use dqonoff_mutex])
680 LB_LINUX_TRY_COMPILE([
681 #include <linux/mutex.h>
682 #include <linux/fs.h>
683 #include <linux/quota.h>
685 struct quota_info dq;
687 mutex_unlock(&dq.dqonoff_mutex);
690 AC_DEFINE(HAVE_DQUOTOFF_MUTEX, 1,
691 [after 2.6.17 dquote use mutex instead if semaphore])
700 # 2.6.18 don't export nr_pagecahe
701 AC_DEFUN([LC_NR_PAGECACHE],
702 [AC_MSG_CHECKING([kernel export nr_pagecache])
703 LB_LINUX_TRY_COMPILE([
704 #include <linux/pagemap.h>
706 return atomic_read(&nr_pagecache);
709 AC_DEFINE(HAVE_NR_PAGECACHE, 1,
710 [is kernel export nr_pagecache])
717 # LC_STATFS_DENTRY_PARAM
718 # starting from 2.6.18 linux kernel uses dentry instead of super_block
719 # for the first parameter of the super_operations->statfs() callback.
722 AC_DEFUN([LC_STATFS_DENTRY_PARAM],
723 [AC_MSG_CHECKING([if super_ops.statfs() first parameter is dentry])
724 tmp_flags="$EXTRA_KCFLAGS"
725 EXTRA_KCFLAGS="-Werror"
726 LB_LINUX_TRY_COMPILE([
727 #include <linux/fs.h>
729 ((struct super_operations *)0)->statfs((struct dentry *)0, (struct kstatfs*)0);
731 AC_DEFINE(HAVE_STATFS_DENTRY_PARAM, 1,
732 [super_ops.statfs() first parameter is dentry])
737 EXTRA_KCFLAGS="$tmp_flags"
740 # LC_UMOUNTBEGIN_HAS_VFSMOUNT
741 # 2.6.18~2.6.25 umount_begin has different parameters
742 AC_DEFUN([LC_UMOUNTBEGIN_HAS_VFSMOUNT],
743 [AC_MSG_CHECKING([if umount_begin needs vfsmount parameter instead of super_block])
744 tmp_flags="$EXTRA_KCFLAGS"
745 EXTRA_KCFLAGS="-Werror"
746 LB_LINUX_TRY_COMPILE([
747 #include <linux/fs.h>
750 static void cfg_umount_begin (struct vfsmount *v, int flags)
755 static struct super_operations cfg_super_operations = {
756 .umount_begin = cfg_umount_begin,
759 cfg_super_operations.umount_begin(NULL,0);
762 AC_DEFINE(HAVE_UMOUNTBEGIN_VFSMOUNT, 1,
763 [Define umount_begin need second argument])
767 EXTRA_KCFLAGS="$tmp_flags"
771 # starting from 2.6.18 the file_operations .flush
772 # method has a new "fl_owner_t id" parameter
774 AC_DEFUN([LC_FLUSH_OWNER_ID],
775 [AC_MSG_CHECKING([if file_operations .flush has an fl_owner_t id])
776 LB_LINUX_TRY_COMPILE([
777 #include <linux/fs.h>
779 struct file_operations *fops = NULL;
780 fl_owner_t id = NULL;
783 i = fops->flush(NULL, id);
785 AC_DEFINE(HAVE_FLUSH_OWNER_ID, 1,
786 [file_operations .flush method has an fl_owner_t id])
794 # LC_EXPORT_INVALIDATE_MAPPING_PAGES
796 # SLES9, RHEL4, RHEL5, vanilla 2.6.24 export invalidate_mapping_pages() but
797 # SLES10 2.6.16 does not, for some reason. For filter cache invalidation.
799 AC_DEFUN([LC_EXPORT_INVALIDATE_MAPPING_PAGES],
800 [LB_CHECK_SYMBOL_EXPORT([invalidate_mapping_pages], [mm/truncate.c], [
801 AC_DEFINE(HAVE_INVALIDATE_MAPPING_PAGES, 1,
802 [exported invalidate_mapping_pages])],
803 [LB_CHECK_SYMBOL_EXPORT([invalidate_inode_pages], [mm/truncate.c], [
804 AC_DEFINE(HAVE_INVALIDATE_INODE_PAGES, 1,
805 [exported invalidate_inode_pages])], [
806 AC_MSG_ERROR([no way to invalidate pages])
811 #2.6.18 + RHEL5 (fc6)
813 # RHEL5 in FS-cache patch rename PG_checked flag into PG_fs_misc
814 AC_DEFUN([LC_PG_FS_MISC],
815 [AC_MSG_CHECKING([kernel has PG_fs_misc])
816 LB_LINUX_TRY_COMPILE([
817 #include <linux/mm.h>
818 #include <linux/page-flags.h>
821 #error PG_fs_misc not defined in kernel
825 AC_DEFINE(HAVE_PG_FS_MISC, 1,
826 [is kernel have PG_fs_misc])
832 # RHEL5 PageChecked and SetPageChecked defined
833 AC_DEFUN([LC_PAGE_CHECKED],
834 [AC_MSG_CHECKING([kernel has PageChecked and SetPageChecked])
835 LB_LINUX_TRY_COMPILE([
836 #include <linux/mm.h>
837 #ifdef HAVE_LINUX_MMTYPES_H
838 #include <linux/mm_types.h>
840 #include <linux/page-flags.h>
842 struct page *p = NULL;
844 /* before 2.6.26 this define*/
846 /* 2.6.26 use function instead of define for it */
852 AC_DEFINE(HAVE_PAGE_CHECKED, 1,
853 [does kernel have PageChecked and SetPageChecked])
862 # If we have fiemap.h
863 # after 2.6.27 use fiemap.h in include/linux
865 AC_DEFUN([LC_LINUX_FIEMAP_H],
866 [LB_CHECK_FILE([$LINUX/include/linux/fiemap.h],[
867 AC_MSG_CHECKING([if fiemap.h can be compiled])
868 LB_LINUX_TRY_COMPILE([
869 #include <linux/types.h>
870 #include <linux/fiemap.h>
873 AC_DEFINE(HAVE_LINUX_FIEMAP_H, 1, [Kernel has fiemap.h])
884 # inode don't have i_blksize field
885 AC_DEFUN([LC_INODE_BLKSIZE],
886 [AC_MSG_CHECKING([inode has i_blksize field])
887 LB_LINUX_TRY_COMPILE([
888 #include <linux/fs.h>
894 AC_DEFINE(HAVE_INODE_BLKSIZE, 1,
895 [struct inode has i_blksize field])
902 # 2.6.19 replaced writev with aio_write
903 AC_DEFUN([LC_FILE_WRITEV],
904 [AC_MSG_CHECKING([writev in fops])
905 LB_LINUX_TRY_COMPILE([
906 #include <linux/fs.h>
908 struct file_operations *fops = NULL;
912 AC_DEFINE(HAVE_FILE_WRITEV, 1,
920 # 2.6.19 replaced readv with aio_read
921 AC_DEFUN([LC_FILE_READV],
922 [AC_MSG_CHECKING([readv in fops])
923 LB_LINUX_TRY_COMPILE([
924 #include <linux/fs.h>
926 struct file_operations *fops = NULL;
930 AC_DEFINE(HAVE_FILE_READV, 1,
939 # LC_CANCEL_DIRTY_PAGE
940 # 2.6.20 introduced cancel_dirty_page instead of clear_page_dirty.
941 AC_DEFUN([LC_CANCEL_DIRTY_PAGE],
942 [AC_MSG_CHECKING([kernel has cancel_dirty_page])
943 # the implementation of cancel_dirty_page in OFED 1.4.1's SLES10 SP2
944 # backport is broken, so ignore it
945 if test -f $OFED_BACKPORT_PATH/linux/mm.h &&
946 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
949 LB_LINUX_TRY_COMPILE([
950 #include <linux/mm.h>
951 #include <linux/page-flags.h>
953 cancel_dirty_page(NULL, 0);
956 AC_DEFINE(HAVE_CANCEL_DIRTY_PAGE, 1,
957 [kernel has cancel_dirty_page instead of clear_page_dirty])
964 # raid5-zerocopy patch
969 # In order to support raid5 zerocopy patch, we have to patch the kernel to make
970 # it support constant page, which means the page won't be modified during the
973 AC_DEFUN([LC_PAGE_CONSTANT],
974 [AC_MSG_CHECKING([if kernel have PageConstant defined])
975 LB_LINUX_TRY_COMPILE([
976 #include <linux/mm.h>
977 #include <linux/page-flags.h>
980 #error "Have no raid5 zcopy patch"
984 AC_DEFINE(HAVE_PAGE_CONSTANT, 1, [kernel have PageConstant supported])
992 # 2.6.22 lost second parameter for invalidate_bdev
993 AC_DEFUN([LC_INVALIDATE_BDEV_2ARG],
994 [AC_MSG_CHECKING([if invalidate_bdev has second argument])
995 LB_LINUX_TRY_COMPILE([
996 #include <linux/buffer_head.h>
998 invalidate_bdev(NULL,0);
1000 AC_MSG_RESULT([yes])
1001 AC_DEFINE(HAVE_INVALIDATE_BDEV_2ARG, 1,
1002 [invalidate_bdev has second argument])
1009 # check for crypto API
1011 AC_DEFUN([LC_ASYNC_BLOCK_CIPHER],
1012 [AC_MSG_CHECKING([if kernel has block cipher support])
1013 LB_LINUX_TRY_COMPILE([
1014 #include <linux/err.h>
1015 #include <linux/crypto.h>
1017 struct crypto_blkcipher *tfm;
1018 tfm = crypto_alloc_blkcipher("aes", 0, sizeof(tfm) );
1020 AC_MSG_RESULT([yes])
1021 AC_DEFINE(HAVE_ASYNC_BLOCK_CIPHER, 1, [kernel has block cipher support])
1028 # check for struct hash_desc
1030 AC_DEFUN([LC_STRUCT_HASH_DESC],
1031 [AC_MSG_CHECKING([if kernel has struct hash_desc])
1032 LB_LINUX_TRY_COMPILE([
1033 #include <linux/err.h>
1034 #include <linux/crypto.h>
1036 struct hash_desc foo __attribute__ ((unused));
1038 AC_MSG_RESULT([yes])
1039 AC_DEFINE(HAVE_STRUCT_HASH_DESC, 1, [kernel has struct hash_desc])
1046 # check for struct blkcipher_desc
1048 AC_DEFUN([LC_STRUCT_BLKCIPHER_DESC],
1049 [AC_MSG_CHECKING([if kernel has struct blkcipher_desc])
1050 LB_LINUX_TRY_COMPILE([
1051 #include <linux/err.h>
1052 #include <linux/crypto.h>
1054 struct blkcipher_desc foo __attribute__ ((unused));
1056 AC_MSG_RESULT([yes])
1057 AC_DEFINE(HAVE_STRUCT_BLKCIPHER_DESC, 1, [kernel has struct blkcipher_desc])
1064 # 2.6.19 check for FS_RENAME_DOES_D_MOVE flag
1066 AC_DEFUN([LC_FS_RENAME_DOES_D_MOVE],
1067 [AC_MSG_CHECKING([if kernel has FS_RENAME_DOES_D_MOVE flag])
1068 LB_LINUX_TRY_COMPILE([
1069 #include <linux/fs.h>
1071 int v __attribute__ ((unused));
1072 v = FS_RENAME_DOES_D_MOVE;
1074 AC_MSG_RESULT([yes])
1075 AC_DEFINE(HAVE_FS_RENAME_DOES_D_MOVE, 1, [kernel has FS_RENAME_DOES_D_MOVE flag])
1083 # 2.6.23 have return type 'void' for unregister_blkdev
1084 AC_DEFUN([LC_UNREGISTER_BLKDEV_RETURN_INT],
1085 [AC_MSG_CHECKING([if unregister_blkdev return int])
1086 LB_LINUX_TRY_COMPILE([
1087 #include <linux/fs.h>
1089 int i __attribute__ ((unused));
1090 i = unregister_blkdev(0,NULL);
1092 AC_MSG_RESULT([yes])
1093 AC_DEFINE(HAVE_UNREGISTER_BLKDEV_RETURN_INT, 1,
1094 [unregister_blkdev return int])
1100 # 2.6.23 change .sendfile to .splice_read
1101 AC_DEFUN([LC_KERNEL_SPLICE_READ],
1102 [AC_MSG_CHECKING([if kernel has .splice_read])
1103 LB_LINUX_TRY_COMPILE([
1104 #include <linux/fs.h>
1106 struct file_operations file;
1108 file.splice_read = NULL;
1110 AC_MSG_RESULT([yes])
1111 AC_DEFINE(HAVE_KERNEL_SPLICE_READ, 1,
1112 [kernel has .slice_read])
1118 # 2.6.23 change .sendfile to .splice_read
1119 # RHEL4 (-92 kernel) have both sendfile and .splice_read API
1120 AC_DEFUN([LC_KERNEL_SENDFILE],
1121 [AC_MSG_CHECKING([if kernel has .sendfile])
1122 LB_LINUX_TRY_COMPILE([
1123 #include <linux/fs.h>
1125 struct file_operations file;
1127 file.sendfile = NULL;
1129 AC_MSG_RESULT([yes])
1130 AC_DEFINE(HAVE_KERNEL_SENDFILE, 1,
1131 [kernel has .sendfile])
1137 # 2.6.23 extract nfs export related data into exportfs.h
1138 AC_DEFUN([LC_HAVE_EXPORTFS_H],
1139 [LB_CHECK_FILE([$LINUX/include/linux/exportfs.h], [
1140 AC_DEFINE(HAVE_LINUX_EXPORTFS_H, 1,
1141 [kernel has include/exportfs.h])
1147 # 2.6.23 has new page fault handling API
1148 AC_DEFUN([LC_VM_OP_FAULT],
1149 [AC_MSG_CHECKING([kernel has .fault in vm_operation_struct])
1150 LB_LINUX_TRY_COMPILE([
1151 #include <linux/mm.h>
1153 struct vm_operations_struct op;
1157 AC_MSG_RESULT([yes])
1158 AC_DEFINE(HAVE_VM_OP_FAULT, 1,
1159 [kernel has .fault in vm_operation_struct])
1165 # 2.6.23 add code to wait other users to complete before removing procfs entry
1166 AC_DEFUN([LC_PROCFS_USERS],
1167 [AC_MSG_CHECKING([if kernel has pde_users member in procfs entry struct])
1168 LB_LINUX_TRY_COMPILE([
1169 #include <linux/proc_fs.h>
1171 struct proc_dir_entry pde;
1175 AC_MSG_RESULT([yes])
1176 AC_DEFINE(HAVE_PROCFS_USERS, 1,
1177 [kernel has pde_users member in procfs entry struct])
1183 # 2.6.23 exports exportfs_decode_fh
1184 AC_DEFUN([LC_EXPORTFS_DECODE_FH],
1185 [LB_CHECK_SYMBOL_EXPORT([exportfs_decode_fh],
1186 [fs/exportfs/expfs.c],[
1187 AC_DEFINE(HAVE_EXPORTFS_DECODE_FH, 1,
1188 [exportfs_decode_fh has been export])
1195 # 2.6.24 need linux/mm_types.h included
1196 AC_DEFUN([LC_HAVE_MMTYPES_H],
1197 [LB_CHECK_FILE([$LINUX/include/linux/mm_types.h], [
1198 AC_DEFINE(HAVE_LINUX_MMTYPES_H, 1,
1199 [kernel has include/mm_types.h])
1205 # 2.6.24 has bio_endio with 2 args
1206 AC_DEFUN([LC_BIO_ENDIO_2ARG],
1207 [AC_MSG_CHECKING([if kernel has bio_endio with 2 args])
1208 LB_LINUX_TRY_COMPILE([
1209 #include <linux/bio.h>
1213 AC_MSG_RESULT([yes])
1214 AC_DEFINE(HAVE_BIO_ENDIO_2ARG, 1,
1215 [kernel has bio_endio with 2 args])
1221 # 2.6.24 has new members in exports struct.
1222 AC_DEFUN([LC_FH_TO_DENTRY],
1223 [AC_MSG_CHECKING([if kernel has .fh_to_dentry member in export_operations struct])
1224 LB_LINUX_TRY_COMPILE([
1225 #include <linux/fs.h>
1226 #ifdef HAVE_LINUX_EXPORTFS_H
1227 #include <linux/exportfs.h>
1230 do{ }while(sizeof(((struct export_operations *)0)->fh_to_dentry));
1232 AC_MSG_RESULT([yes])
1233 AC_DEFINE(HAVE_FH_TO_DENTRY, 1,
1234 [kernel has .fh_to_dentry member in export_operations struct])
1240 # 2.6.24 removes long aged procfs entry -> deleted member
1241 AC_DEFUN([LC_PROCFS_DELETED],
1242 [AC_MSG_CHECKING([if kernel has deleted member in procfs entry struct])
1243 LB_LINUX_TRY_COMPILE([
1244 #include <linux/proc_fs.h>
1246 struct proc_dir_entry pde;
1248 pde.deleted = sizeof(pde);
1250 AC_MSG_RESULT([yes])
1251 AC_DEFINE(HAVE_PROCFS_DELETED, 1,
1252 [kernel has deleted member in procfs entry struct])
1258 # 2.6.24 has bdi_init()/bdi_destroy() functions.
1259 AC_DEFUN([LC_EXPORT_BDI_INIT],
1260 [LB_CHECK_SYMBOL_EXPORT([bdi_init],
1261 [mm/backing-dev.c],[
1262 AC_DEFINE(HAVE_BDI_INIT, 1,
1263 [bdi_init/bdi_destroy functions are present])
1270 # 2.6.26 isn't export set_fs_pwd and change paramter in fs struct
1271 AC_DEFUN([LC_FS_STRUCT_USE_PATH],
1272 [AC_MSG_CHECKING([fs_struct use path structure])
1273 LB_LINUX_TRY_COMPILE([
1274 #include <asm/atomic.h>
1275 #include <linux/spinlock.h>
1276 #include <linux/fs_struct.h>
1278 struct fs_struct fs;
1280 fs.pwd = *((struct path *)sizeof(fs));
1282 AC_MSG_RESULT([yes])
1283 AC_DEFINE(HAVE_FS_STRUCT_USE_PATH, 1,
1284 [fs_struct use path structure])
1294 AC_DEFUN([LC_PGMKWRITE_USE_VMFAULT],
1295 [AC_MSG_CHECKING([kernel .page_mkwrite uses struct vm_fault *])
1296 tmp_flags="$EXTRA_KCFLAGS"
1297 EXTRA_KCFLAGS="-Werror"
1298 LB_LINUX_TRY_COMPILE([
1299 #include <linux/mm.h>
1301 ((struct vm_operations_struct *)0)->page_mkwrite((struct vm_area_struct *)0, (struct vm_fault *)0);
1303 AC_MSG_RESULT([yes])
1304 AC_DEFINE(HAVE_PGMKWRITE_USE_VMFAULT, 1,
1305 [kernel vm_operation_struct.page_mkwrite uses struct vm_fault * as second parameter])
1309 EXTRA_KCFLAGS="$tmp_flags"
1312 AC_DEFUN([LC_INODE_PERMISION_2ARGS],
1313 [AC_MSG_CHECKING([inode_operations->permission has two args])
1314 LB_LINUX_TRY_COMPILE([
1315 #include <linux/fs.h>
1317 struct inode *inode __attribute__ ((unused));
1320 inode->i_op->permission(NULL, 0);
1322 AC_DEFINE(HAVE_INODE_PERMISION_2ARGS, 1,
1323 [inode_operations->permission has two args])
1324 AC_MSG_RESULT([yes])
1330 # 2.6.27 has file_remove_suid instead of remove_suid
1331 AC_DEFUN([LC_FILE_REMOVE_SUID],
1332 [AC_MSG_CHECKING([kernel has file_remove_suid])
1333 LB_LINUX_TRY_COMPILE([
1334 #include <linux/fs.h>
1336 file_remove_suid(NULL);
1338 AC_DEFINE(HAVE_FILE_REMOVE_SUID, 1,
1339 [kernel have file_remove_suid])
1340 AC_MSG_RESULT([yes])
1346 # 2.6.27 have new page locking API
1347 AC_DEFUN([LC_TRYLOCKPAGE],
1348 [AC_MSG_CHECKING([kernel uses trylock_page for page lock])
1349 LB_LINUX_TRY_COMPILE([
1350 #include <linux/pagemap.h>
1354 AC_DEFINE(HAVE_TRYLOCK_PAGE, 1,
1355 [kernel uses trylock_page for page lock])
1356 AC_MSG_RESULT([yes])
1362 # 2.6.27 removed the read_inode from super_operations.
1363 AC_DEFUN([LC_READ_INODE_IN_SBOPS],
1364 [AC_MSG_CHECKING([super_operations has a read_inode field])
1365 LB_LINUX_TRY_COMPILE([
1366 #include <linux/fs.h>
1368 struct super_operations *sop;
1369 sop->read_inode(NULL);
1371 AC_DEFINE(HAVE_READ_INODE_IN_SBOPS, 1,
1372 [super_operations has a read_inode])
1373 AC_MSG_RESULT([yes])
1379 # 2.6.27 has inode_permission instead of permisson
1380 AC_DEFUN([LC_EXPORT_INODE_PERMISSION],
1381 [LB_CHECK_SYMBOL_EXPORT([inode_permission],
1383 AC_DEFINE(HAVE_EXPORT_INODE_PERMISSION, 1,
1384 [inode_permission is exported by the kernel])
1389 # 2.6.27 use 5th parameter in quota_on for remount.
1390 AC_DEFUN([LC_QUOTA_ON_5ARGS],
1391 [AC_MSG_CHECKING([quota_on needs 5 parameters])
1392 LB_LINUX_TRY_COMPILE([
1393 #include <linux/fs.h>
1394 #include <linux/quota.h>
1396 struct quotactl_ops *qop = NULL;
1397 qop->quota_on(NULL, 0, 0, NULL, 0);
1399 AC_DEFINE(HAVE_QUOTA_ON_5ARGS, 1,
1400 [quota_on needs 5 paramters])
1401 AC_MSG_RESULT([yes])
1407 # 2.6.27 use 3th parameter in quota_off for remount.
1408 AC_DEFUN([LC_QUOTA_OFF_3ARGS],
1409 [AC_MSG_CHECKING([quota_off needs 3 parameters])
1410 LB_LINUX_TRY_COMPILE([
1411 #include <linux/fs.h>
1412 #include <linux/quota.h>
1414 struct quotactl_ops *qop = NULL;
1415 qop->quota_off(NULL, 0, 0);
1417 AC_DEFINE(HAVE_QUOTA_OFF_3ARGS, 1,
1418 [quota_off needs 3 paramters])
1419 AC_MSG_RESULT([yes])
1425 # 2.6.27 has vfs_dq_off inline function.
1426 AC_DEFUN([LC_VFS_DQ_OFF],
1427 [AC_MSG_CHECKING([vfs_dq_off is defined])
1428 LB_LINUX_TRY_COMPILE([
1429 #include <linux/quotaops.h>
1431 vfs_dq_off(NULL, 0);
1433 AC_DEFINE(HAVE_VFS_DQ_OFF, 1, [vfs_dq_off is defined])
1434 AC_MSG_RESULT([yes])
1440 # LC_LOCK_MAP_ACQUIRE
1441 # after 2.6.27 lock_map_acquire replaces lock_acquire
1442 AC_DEFUN([LC_LOCK_MAP_ACQUIRE],
1443 [AC_MSG_CHECKING([if lock_map_acquire is defined])
1444 LB_LINUX_TRY_COMPILE([
1445 #include <linux/lockdep.h>
1447 lock_map_acquire(NULL);
1450 AC_DEFINE(HAVE_LOCK_MAP_ACQUIRE, 1,
1451 [lock_map_acquire is defined])
1457 # 2.6.27.15-2 sles11
1459 # 2.6.27 sles11 remove the bi_hw_segments
1460 AC_DEFUN([LC_BI_HW_SEGMENTS],
1461 [AC_MSG_CHECKING([struct bio has a bi_hw_segments field])
1462 LB_LINUX_TRY_COMPILE([
1463 #include <linux/bio.h>
1466 io.bi_hw_segments = sizeof(io);
1468 AC_DEFINE(HAVE_BI_HW_SEGMENTS, 1,
1469 [struct bio has a bi_hw_segments field])
1470 AC_MSG_RESULT([yes])
1477 # 2.6.27 sles11 move the quotaio_v1{2}.h from include/linux to fs
1478 # 2.6.32 move the quotaio_v1{2}.h from fs to fs/quota
1479 AC_DEFUN([LC_HAVE_QUOTAIO_H],
1480 [LB_CHECK_FILE([$LINUX/include/linux/quotaio_v2.h],[
1481 AC_DEFINE(HAVE_QUOTAIO_H, 1,
1482 [kernel has include/linux/quotaio_v2.h])
1483 ],[LB_CHECK_FILE([$LINUX/fs/quotaio_v2.h],[
1484 AC_DEFINE(HAVE_FS_QUOTAIO_H, 1,
1485 [kernel has fs/quotaio_v1.h])
1486 ],[LB_CHECK_FILE([$LINUX/fs/quota/quotaio_v2.h],[
1487 AC_DEFINE(HAVE_FS_QUOTA_QUOTAIO_H, 1,
1488 [kernel has fs/quota/quotaio_v2.h])
1496 # 2.6.27 sles11 has sb_any_quota_active
1497 AC_DEFUN([LC_SB_ANY_QUOTA_ACTIVE],
1498 [AC_MSG_CHECKING([Kernel has sb_any_quota_active])
1499 LB_LINUX_TRY_COMPILE([
1500 #include <linux/quotaops.h>
1502 sb_any_quota_active(NULL);
1504 AC_DEFINE(HAVE_SB_ANY_QUOTA_ACTIVE, 1,
1505 [Kernel has a sb_any_quota_active])
1506 AC_MSG_RESULT([yes])
1512 # 2.6.27 sles11 has sb_has_quota_active
1513 AC_DEFUN([LC_SB_HAS_QUOTA_ACTIVE],
1514 [AC_MSG_CHECKING([Kernel has sb_has_quota_active])
1515 LB_LINUX_TRY_COMPILE([
1516 #include <linux/quotaops.h>
1518 sb_has_quota_active(NULL, 0);
1520 AC_DEFINE(HAVE_SB_HAS_QUOTA_ACTIVE, 1,
1521 [Kernel has a sb_has_quota_active])
1522 AC_MSG_RESULT([yes])
1528 # 2.6.27 exported add_to_page_cache_lru.
1529 AC_DEFUN([LC_EXPORT_ADD_TO_PAGE_CACHE_LRU],
1530 [LB_CHECK_SYMBOL_EXPORT([add_to_page_cache_lru],
1532 AC_DEFINE(HAVE_ADD_TO_PAGE_CACHE_LRU, 1,
1533 [add_to_page_cache_lru functions are present])
1539 # 2.6.29 introduce sb_any_quota_loaded.
1541 AC_DEFUN([LC_SB_ANY_QUOTA_LOADED],
1542 [AC_MSG_CHECKING([Kernel has sb_any_quota_loaded])
1543 LB_LINUX_TRY_COMPILE([
1544 #include <linux/quotaops.h>
1546 sb_any_quota_loaded(NULL);
1548 AC_DEFINE(HAVE_SB_ANY_QUOTA_LOADED, 1,
1549 [Kernel has a sb_any_quota_loaded])
1550 AC_MSG_RESULT([yes])
1556 # 2.6.30 x86 node_to_cpumask has been removed. must use cpumask_of_node
1557 AC_DEFUN([LC_EXPORT_CPUMASK_OF_NODE],
1558 [LB_CHECK_SYMBOL_EXPORT([node_to_cpumask_map],
1559 [arch/$LINUX_ARCH/mm/numa.c],
1560 [AC_DEFINE(HAVE_CPUMASK_OF_NODE, 1,
1561 [node_to_cpumask_map is exported by
1562 the kernel])]) # x86_64
1565 # 2.6.31 replaces blk_queue_hardsect_size by blk_queue_logical_block_size function
1566 AC_DEFUN([LC_BLK_QUEUE_LOG_BLK_SIZE],
1567 [AC_MSG_CHECKING([if blk_queue_logical_block_size is defined])
1568 LB_LINUX_TRY_COMPILE([
1569 #include <linux/blkdev.h>
1571 blk_queue_logical_block_size(NULL, 0);
1574 AC_DEFINE(HAVE_BLK_QUEUE_LOG_BLK_SIZE, 1,
1575 [blk_queue_logical_block_size is defined])
1583 # 2.6.32 changes cache_detail's member cache_request to cache_upcall
1584 # in kernel commit bc74b4f5e63a09fb78e245794a0de1e5a2716bbe
1585 AC_DEFUN([LC_CACHE_UPCALL],
1586 [AC_MSG_CHECKING([if cache_detail has cache_upcall field])
1587 LB_LINUX_TRY_COMPILE([
1588 #include <linux/sunrpc/cache.h>
1590 struct cache_detail cd;
1591 cd.cache_upcall = NULL;
1594 AC_DEFINE(HAVE_CACHE_UPCALL, 1,
1595 [cache_detail has cache_upcall field])
1601 # 2.6.32 add a limits member in struct request_queue.
1602 AC_DEFUN([LC_REQUEST_QUEUE_LIMITS],
1603 [AC_MSG_CHECKING([if request_queue has a limits field])
1604 LB_LINUX_TRY_COMPILE([
1605 #include <linux/blkdev.h>
1607 struct request_queue rq;
1608 rq.limits.io_min = 0;
1611 AC_DEFINE(HAVE_REQUEST_QUEUE_LIMITS, 1,
1612 [request_queue has a limits field])
1618 # 2.6.32 has bdi_register() functions.
1619 AC_DEFUN([LC_EXPORT_BDI_REGISTER],
1620 [LB_CHECK_SYMBOL_EXPORT([bdi_register],
1621 [mm/backing-dev.c],[
1622 AC_DEFINE(HAVE_BDI_REGISTER, 1,
1623 [bdi_register function is present])
1628 # 2.6.32 add s_bdi for super block
1629 AC_DEFUN([LC_SB_BDI],
1630 [AC_MSG_CHECKING([if super_block has s_bdi field])
1631 LB_LINUX_TRY_COMPILE([
1632 #include <linux/fs.h>
1634 struct super_block sb;
1638 AC_DEFINE(HAVE_SB_BDI, 1,
1639 [super_block has s_bdi field])
1645 # 2.6.27.15-2 SuSE 11 sp0 kernels lack the name field for BDI
1646 AC_DEFUN([LC_BDI_NAME],
1647 [AC_MSG_CHECKING([if backing_device_info has name field])
1648 LB_LINUX_TRY_COMPILE([
1649 #include <linux/blkkdev.h>
1651 struct backing_dev_info bdi;
1655 AC_DEFINE(HAVE_BDI_NAME, 1,
1656 [backing_device_info has name field])
1662 # 2.6.32 removes blk_queue_max_sectors and add blk_queue_max_hw_sectors
1663 # check blk_queue_max_sectors and use it until disappear.
1664 AC_DEFUN([LC_BLK_QUEUE_MAX_SECTORS],
1665 [AC_MSG_CHECKING([if blk_queue_max_sectors is defined])
1666 LB_LINUX_TRY_COMPILE([
1667 #include <linux/blkdev.h>
1669 blk_queue_max_sectors(NULL, 0);
1672 AC_DEFINE(HAVE_BLK_QUEUE_MAX_SECTORS, 1,
1673 [blk_queue_max_sectors is defined])
1679 # 2.6.32 replaces 2 functions blk_queue_max_phys_segments and blk_queue_max_hw_segments by blk_queue_max_segments
1680 AC_DEFUN([LC_BLK_QUEUE_MAX_SEGMENTS],
1681 [AC_MSG_CHECKING([if blk_queue_max_segments is defined])
1682 LB_LINUX_TRY_COMPILE([
1683 #include <linux/blkdev.h>
1685 blk_queue_max_segments(NULL, 0);
1688 AC_DEFINE(HAVE_BLK_QUEUE_MAX_SEGMENTS, 1,
1689 [blk_queue_max_segments is defined])
1698 # Check if kernel has been patched for 64-bit quota limits support.
1699 # The upstream version of this patch in RHEL6 2.6.32 kernels introduces
1700 # the constant QFMT_VFS_V1 in include/linux/quota.h, so we can check for
1701 # that in the absence of quotaio_v1.h in the kernel headers.
1703 AC_DEFUN([LC_QUOTA64],[
1704 AC_MSG_CHECKING([if kernel has 64-bit quota limits support])
1705 tmp_flags="$EXTRA_KCFLAGS"
1706 EXTRA_KCFLAGS="-I$LINUX/fs"
1707 LB_LINUX_TRY_COMPILE([
1708 #include <linux/kernel.h>
1709 #include <linux/fs.h>
1710 #ifdef HAVE_QUOTAIO_H
1711 # include <linux/quotaio_v2.h>
1712 int versions[] = V2_INITQVERSIONS_R1;
1713 struct v2_disk_dqblk_r1 dqblk_r1;
1714 #elif defined(HAVE_FS_QUOTA_QUOTAIO_H)
1715 # include <quota/quotaio_v2.h>
1716 struct v2r1_disk_dqblk dqblk_r1;
1717 #elif defined(HAVE_FS_QUOTAIO_H)
1718 # include <quotaio_v2.h>
1719 struct v2r1_disk_dqblk dqblk_r1;
1721 #include <linux/quota.h>
1722 int ver = QFMT_VFS_V1;
1725 AC_DEFINE(HAVE_QUOTA64, 1, [have quota64])
1726 AC_MSG_RESULT([yes])
1728 LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],[
1729 AC_MSG_ERROR([You have got no 64-bit kernel quota support.])
1733 EXTRA_KCFLAGS=$tmp_flags
1736 # 2.6.32 set_cpus_allowed is no more defined if CONFIG_CPUMASK_OFFSTACK=yes
1737 AC_DEFUN([LC_SET_CPUS_ALLOWED],
1738 [AC_MSG_CHECKING([if kernel defines set_cpus_allowed])
1739 LB_LINUX_TRY_COMPILE(
1740 [#include <linux/sched.h>],
1741 [struct task_struct *p = NULL;
1742 cpumask_t mask = { { 0 } };
1743 (void) set_cpus_allowed(p, mask);],
1744 [AC_MSG_RESULT([yes])
1745 AC_DEFINE(HAVE_SET_CPUS_ALLOWED, 1,
1746 [set_cpus_allowed is exported by the kernel])],
1747 [AC_MSG_RESULT([no])] )])
1749 # 2.6.32 introduces selinux_is_enabled()
1750 AC_DEFUN([LC_SELINUX_IS_ENABLED],
1751 [AC_MSG_CHECKING([if selinux_is_enabled is available])
1752 LB_LINUX_TRY_COMPILE([
1753 #include <linux/selinux.h>
1755 selinux_is_enabled();
1757 AC_MSG_RESULT([yes])
1758 AC_DEFINE(HAVE_SELINUX_IS_ENABLED, 1,
1759 [selinux_is_enabled is defined])
1767 # starting from 2.6.28 kernel replaces d_alloc_anon() with
1768 # d_obtain_alias() for getting anonymous dentries
1769 # RHEL5(2.6.18) has d_obtain_alias but SLES11SP0(2.6.27) not
1771 AC_DEFUN([LC_D_OBTAIN_ALIAS],
1772 [AC_MSG_CHECKING([d_obtain_alias exist in kernel])
1773 LB_LINUX_TRY_COMPILE([
1774 #include <linux/dcache.h>
1776 d_obtain_alias(NULL);
1778 AC_DEFINE(HAVE_D_OBTAIN_ALIAS, 1,
1779 [d_obtain_alias exist in kernel])
1780 AC_MSG_RESULT([yes])
1787 # LC_EXPORT_GENERIC_ERROR_REMOVE_PAGE
1789 AC_DEFUN([LC_EXPORT_GENERIC_ERROR_REMOVE_PAGE],
1790 [LB_CHECK_SYMBOL_EXPORT(
1791 [generic_error_remove_page],
1793 [AC_DEFINE(HAS_GENERIC_ERROR_REMOVE_PAGE, 1,
1794 [kernel export generic_error_remove_page])],
1799 # 2.6.32 if kernel export access_process_vm().
1800 AC_DEFUN([LC_EXPORT_ACCESS_PROCESS_VM],
1801 [LB_CHECK_SYMBOL_EXPORT([access_process_vm],
1803 [AC_DEFINE(HAVE_ACCESS_PROCESS_VM, 1,
1804 [access_process_vm function is present])],
1810 # 2.6.36 fs_struct.lock use spinlock instead of rwlock.
1812 AC_DEFUN([LC_FS_STRUCT_RWLOCK],
1813 [AC_MSG_CHECKING([if fs_struct.lock use rwlock])
1814 LB_LINUX_TRY_COMPILE([
1815 #include <asm/atomic.h>
1816 #include <linux/spinlock.h>
1817 #include <linux/fs_struct.h>
1819 ((struct fs_struct *)0)->lock = (rwlock_t){ 0 };
1821 AC_DEFINE(HAVE_FS_STRUCT_RWLOCK, 1,
1822 [fs_struct.lock use rwlock])
1823 AC_MSG_RESULT([yes])
1830 # 2.6.36 super_operations add evict_inode method. it hybird of
1831 # delete_inode & clear_inode.
1833 AC_DEFUN([LC_SBOPS_EVICT_INODE],
1834 [AC_MSG_CHECKING([if super_operations.evict_inode exist])
1835 LB_LINUX_TRY_COMPILE([
1836 #include <linux/fs.h>
1838 ((struct super_operations *)0)->evict_inode(NULL);
1840 AC_DEFINE(HAVE_SBOPS_EVICT_INODE, 1,
1841 [super_operations.evict_inode() is exist in kernel])
1842 AC_MSG_RESULT([yes])
1849 # 2.6.35 file_operations.fsync taken 2 arguments.
1850 # 3.0.0 file_operations.fsync takes 4 arguments.
1852 AC_DEFUN([LC_FILE_FSYNC],
1853 [AC_MSG_CHECKING([if file_operations.fsync takes 4 or 2 arguments])
1854 LB_LINUX_TRY_COMPILE([
1855 #include <linux/fs.h>
1857 ((struct file_operations *)0)->fsync(NULL, 0, 0, 0);
1859 AC_DEFINE(HAVE_FILE_FSYNC_4ARGS, 1,
1860 [file_operations.fsync takes 4 arguments])
1861 AC_MSG_RESULT([yes, 4 args])
1863 LB_LINUX_TRY_COMPILE([
1864 #include <linux/fs.h>
1866 ((struct file_operations *)0)->fsync(NULL, 0);
1868 AC_DEFINE(HAVE_FILE_FSYNC_2ARGS, 1,
1869 [file_operations.fsync takes 2 arguments])
1870 AC_MSG_RESULT([yes, 2 args])
1878 # 2.6.37 remove kernel_locked
1880 AC_DEFUN([LC_KERNEL_LOCKED],
1881 [AC_MSG_CHECKING([if kernel_locked is defined])
1882 LB_LINUX_TRY_COMPILE([
1883 #include <linux/smp_lock.h>
1887 AC_MSG_RESULT([yes])
1888 AC_DEFINE(HAVE_KERNEL_LOCKED, 1,
1889 [kernel_locked is defined])
1896 # 2.6.38 export blkdev_get_by_dev
1898 AC_DEFUN([LC_BLKDEV_GET_BY_DEV],
1899 [LB_CHECK_SYMBOL_EXPORT([blkdev_get_by_dev],
1901 AC_DEFINE(HAVE_BLKDEV_GET_BY_DEV, 1,
1902 [blkdev_get_by_dev is exported by the kernel])
1908 # 2.6.38 vfsmount.mnt_count doesn't use atomic_t
1910 AC_DEFUN([LC_ATOMIC_MNT_COUNT],
1911 [AC_MSG_CHECKING([if vfsmount.mnt_count is atomic_t])
1912 LB_LINUX_TRY_COMPILE([
1913 #include <asm/atomic.h>
1914 #include <linux/fs.h>
1915 #include <linux/mount.h>
1917 ((struct vfsmount *)0)->mnt_count = ((atomic_t) { 0 });
1919 AC_DEFINE(HAVE_ATOMIC_MNT_COUNT, 1,
1920 [vfsmount.mnt_count is atomic_t])
1921 AC_MSG_RESULT([yes])
1928 # 2.6.38 use path as 4th parameter in quota_on.
1930 AC_DEFUN([LC_QUOTA_ON_USE_PATH],
1931 [AC_MSG_CHECKING([quota_on use path as parameter])
1932 tmp_flags="$EXTRA_KCFLAGS"
1933 EXTRA_KCFLAGS="-Werror"
1934 LB_LINUX_TRY_COMPILE([
1935 #include <linux/fs.h>
1936 #include <linux/quota.h>
1938 ((struct quotactl_ops *)0)->quota_on(NULL, 0, 0, ((struct path*)0));
1940 AC_DEFINE(HAVE_QUOTA_ON_USE_PATH, 1,
1941 [quota_on use path as 4th paramter])
1942 AC_MSG_RESULT([yes])
1946 EXTRA_KCFLAGS="$tmp_flags"
1950 # 2.6.39 remove unplug_fn from request_queue.
1952 AC_DEFUN([LC_REQUEST_QUEUE_UNPLUG_FN],
1953 [AC_MSG_CHECKING([if request_queue has unplug_fn field])
1954 LB_LINUX_TRY_COMPILE([
1955 #include <linux/blkdev.h>
1957 do{ }while(sizeof(((struct request_queue *)0)->unplug_fn));
1959 AC_DEFINE(HAVE_REQUEST_QUEUE_UNPLUG_FN, 1,
1960 [request_queue has unplug_fn field])
1961 AC_MSG_RESULT([yes])
1968 # 2.6.38 generic_permission taken 4 paremater.
1969 # in fact, it means rcu-walk aware permission bring.
1971 AC_DEFUN([LC_GENERIC_PERMISSION],
1972 [AC_MSG_CHECKING([if generic_permission take 4 arguments])
1973 LB_LINUX_TRY_COMPILE([
1974 #include <linux/fs.h>
1976 generic_permission(NULL, 0, 0, NULL);
1978 AC_DEFINE(HAVE_GENERIC_PERMISSION_4ARGS, 1,
1979 [generic_permission taken 4 arguments])
1980 AC_MSG_RESULT([yes])
1987 # 2.6.38 export simple_setattr
1989 AC_DEFUN([LC_EXPORT_SIMPLE_SETATTR],
1990 [LB_CHECK_SYMBOL_EXPORT([simple_setattr],
1992 AC_DEFINE(HAVE_SIMPLE_SETATTR, 1,
1993 [simple_setattr is exported by the kernel])
2001 # Lustre linux kernel checks
2003 AC_DEFUN([LC_PROG_LINUX],
2007 LC_CONFIG_LIBLUSTRE_RECOVERY
2008 LC_CONFIG_HEALTH_CHECK_WRITE
2009 LC_CONFIG_LRU_RESIZE
2010 LC_LLITE_LLOOP_MODULE
2013 LC_EXPORT_TRUNCATE_COMPLETE
2014 LC_EXPORT_D_REHASH_COND
2015 LC_EXPORT___D_REHASH
2016 LC_EXPORT_NODE_TO_CPUMASK
2027 LC_COOKIE_FOLLOW_LINK
2043 LC_SECURITY_PLUG # for SLES10 SP2
2051 LC_STATFS_DENTRY_PARAM
2052 LC_UMOUNTBEGIN_HAS_VFSMOUNT
2054 if test x$enable_server = xyes ; then
2055 LC_EXPORT_INVALIDATE_MAPPING_PAGES
2058 #2.6.18 + RHEL5 (fc6)
2069 LC_CANCEL_DIRTY_PAGE
2071 # raid5-zerocopy patch
2075 LC_INVALIDATE_BDEV_2ARG
2076 LC_ASYNC_BLOCK_CIPHER
2078 LC_STRUCT_BLKCIPHER_DESC
2079 LC_FS_RENAME_DOES_D_MOVE
2082 LC_UNREGISTER_BLKDEV_RETURN_INT
2083 LC_KERNEL_SPLICE_READ
2088 LC_EXPORTFS_DECODE_FH
2098 LC_FS_STRUCT_USE_PATH
2101 LC_PGMKWRITE_USE_VMFAULT
2102 LC_INODE_PERMISION_2ARGS
2105 LC_READ_INODE_IN_SBOPS
2106 LC_EXPORT_INODE_PERMISSION
2112 # 2.6.27.15-2 sles11
2116 LC_SB_ANY_QUOTA_ACTIVE
2117 LC_SB_HAS_QUOTA_ACTIVE
2118 LC_EXPORT_ADD_TO_PAGE_CACHE_LRU
2121 LC_SB_ANY_QUOTA_LOADED
2124 LC_EXPORT_CPUMASK_OF_NODE
2127 LC_BLK_QUEUE_LOG_BLK_SIZE
2130 LC_REQUEST_QUEUE_LIMITS
2131 LC_EXPORT_BDI_REGISTER
2133 LC_BLK_QUEUE_MAX_SECTORS
2134 LC_BLK_QUEUE_MAX_SEGMENTS
2137 LC_EXPORT_GENERIC_ERROR_REMOVE_PAGE
2138 LC_SELINUX_IS_ENABLED
2139 LC_EXPORT_ACCESS_PROCESS_VM
2143 LC_EXPORT_SIMPLE_SETATTR
2147 LC_SBOPS_EVICT_INODE
2154 LC_BLKDEV_GET_BY_DEV
2155 LC_GENERIC_PERMISSION
2156 LC_QUOTA_ON_USE_PATH
2159 LC_REQUEST_QUEUE_UNPLUG_FN
2162 if test x$enable_server = xyes ; then
2163 AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server])
2164 LC_FUNC_DEV_SET_RDONLY
2172 # LC_CONFIG_CLIENT_SERVER
2174 # Build client/server sides of Lustre
2176 AC_DEFUN([LC_CONFIG_CLIENT_SERVER],
2177 [AC_MSG_CHECKING([whether to build Lustre server support])
2178 AC_ARG_ENABLE([server],
2179 AC_HELP_STRING([--disable-server],
2180 [disable Lustre server support]),
2181 [],[enable_server='yes'])
2182 AC_MSG_RESULT([$enable_server])
2184 AC_MSG_CHECKING([whether to build Lustre client support])
2185 AC_ARG_ENABLE([client],
2186 AC_HELP_STRING([--disable-client],
2187 [disable Lustre client support]),
2188 [],[enable_client='yes'])
2189 AC_MSG_RESULT([$enable_client])])
2192 # LC_CONFIG_LIBLUSTRE
2194 # whether to build liblustre
2196 AC_DEFUN([LC_CONFIG_LIBLUSTRE],
2197 [AC_MSG_CHECKING([whether to build Lustre library])
2198 AC_ARG_ENABLE([liblustre],
2199 AC_HELP_STRING([--disable-liblustre],
2200 [disable building of Lustre library]),
2201 [],[enable_liblustre=$with_sysio])
2202 AC_MSG_RESULT([$enable_liblustre])
2203 # only build sysio if liblustre is built
2204 with_sysio="$enable_liblustre"
2206 AC_MSG_CHECKING([whether to build liblustre tests])
2207 AC_ARG_ENABLE([liblustre-tests],
2208 AC_HELP_STRING([--enable-liblustre-tests],
2209 [enable liblustre tests, if --disable-tests is used]),
2210 [],[enable_liblustre_tests=$enable_tests])
2211 if test x$enable_liblustre != xyes ; then
2212 enable_liblustre_tests='no'
2214 AC_MSG_RESULT([$enable_liblustre_tests])
2216 AC_MSG_CHECKING([whether to enable liblustre acl])
2217 AC_ARG_ENABLE([liblustre-acl],
2218 AC_HELP_STRING([--disable-liblustre-acl],
2219 [disable ACL support for liblustre]),
2220 [],[enable_liblustre_acl=yes])
2221 AC_MSG_RESULT([$enable_liblustre_acl])
2222 if test x$enable_liblustre_acl = xyes ; then
2223 AC_DEFINE(LIBLUSTRE_POSIX_ACL, 1, Liblustre Support ACL-enabled MDS)
2226 # 2.6.29 change prepare/commit_write to write_begin/end
2227 AC_DEFUN([LC_WRITE_BEGIN_END],
2228 [AC_MSG_CHECKING([if kernel has .write_begin/end])
2229 LB_LINUX_TRY_COMPILE([
2230 #include <linux/fs.h>
2231 #include <linux/pagemap.h>
2232 #ifdef HAVE_LINUX_MMTYPES_H
2233 #include <linux/mm_types.h>
2236 struct address_space_operations aops;
2239 aops.write_begin = NULL;
2240 aops.write_end = NULL;
2241 page = grab_cache_page_write_begin(NULL, 0, 0);
2243 AC_MSG_RESULT([yes])
2244 AC_DEFINE(HAVE_KERNEL_WRITE_BEGIN_END, 1,
2245 [kernel has .write_begin/end])
2251 # 2.6.29 blkdev_put has 2 arguments
2252 AC_DEFUN([LC_BLKDEV_PUT_2ARGS],
2253 [AC_MSG_CHECKING([blkdev_put needs 2 parameters])
2254 LB_LINUX_TRY_COMPILE([
2255 #include <linux/fs.h>
2257 blkdev_put(NULL, 0);
2259 AC_DEFINE(HAVE_BLKDEV_PUT_2ARGS, 1,
2260 [blkdev_put needs 2 paramters])
2261 AC_MSG_RESULT([yes])
2267 # 2.6.29 dentry_open has 4 arguments
2268 AC_DEFUN([LC_DENTRY_OPEN_4ARGS],
2269 [AC_MSG_CHECKING([dentry_open needs 4 parameters])
2270 LB_LINUX_TRY_COMPILE([
2271 #include <linux/fs.h>
2273 dentry_open(NULL, NULL, 0, NULL);
2275 AC_DEFINE(HAVE_DENTRY_OPEN_4ARGS, 1,
2276 [dentry_open needs 4 paramters])
2277 AC_MSG_RESULT([yes])
2283 # 2.6.29 split file and anonymous page queues
2284 AC_DEFUN([LC_PAGEVEC_LRU_ADD_FILE],
2285 [AC_MSG_CHECKING([if kernel has .pagevec_lru_add_file])
2286 LB_LINUX_TRY_COMPILE([
2287 #include <linux/mm.h>
2288 #include <linux/pagevec.h>
2290 struct pagevec lru_pagevec;
2292 pagevec_init(&lru_pagevec, 0);
2293 pagevec_lru_add_file(&lru_pagevec);
2295 AC_MSG_RESULT([yes])
2296 AC_DEFINE(HAVE_PAGEVEC_LRU_ADD_FILE, 1,
2297 [kernel has .pagevec_lru_add_file])
2306 AC_ARG_ENABLE(mpitests,
2307 AC_HELP_STRING([--enable-mpitests=yes|no|mpicc wrapper],
2308 [include mpi tests]),
2319 MPICC_WRAPPER=$enableval
2329 if test x$enable_mpitests != xno; then
2330 AC_MSG_CHECKING([whether mpitests can be built])
2338 MPI_Initialized(&flag);
2341 AC_MSG_RESULT([yes])
2348 AC_SUBST(MPICC_WRAPPER)
2350 AC_MSG_NOTICE([Enabling Lustre configure options for libsysio])
2351 ac_configure_args="$ac_configure_args --with-lustre-hack --with-sockets"
2354 LC_CONFIG_LIBLUSTRE_RECOVERY
2360 # whether to enable quota support global control
2362 AC_DEFUN([LC_CONFIG_QUOTA],
2363 [AC_ARG_ENABLE([quota],
2364 AC_HELP_STRING([--enable-quota],
2365 [enable quota support]),
2366 [],[enable_quota='yes'])
2369 AC_DEFUN([LC_QUOTA],
2373 AC_CHECK_HEADER(sys/quota.h,
2374 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1, [Define to 1 if you have <sys/quota.h>.])],
2375 [AC_MSG_ERROR([don't find <sys/quota.h> in your system])])
2381 # whether to enable split support
2383 AC_DEFUN([LC_CONFIG_SPLIT],
2384 [AC_MSG_CHECKING([whether to enable split support])
2385 AC_ARG_ENABLE([split],
2386 AC_HELP_STRING([--enable-split],
2387 [enable split support]),
2388 [],[enable_split='no'])
2389 AC_MSG_RESULT([$enable_split])
2390 if test x$enable_split != xno; then
2391 AC_DEFINE(HAVE_SPLIT_SUPPORT, 1, [enable split support])
2395 # RHEL5(2.6.18) has tux_info
2396 AC_DEFUN([LC_TASK_CLENV_TUX_INFO],
2397 [AC_MSG_CHECKING([tux_info])
2398 LB_LINUX_TRY_COMPILE([
2399 #include <linux/sched.h>
2401 struct task_struct task;
2404 AC_MSG_RESULT([yes])
2405 AC_DEFINE(LL_TASK_CL_ENV, tux_info, [have tux_info])
2406 have_task_clenv_store='yes'
2413 # LC_LLITE_LLOOP_MODULE
2414 # lloop_llite.ko does not currently work with page sizes
2417 AC_DEFUN([LC_LLITE_LLOOP_MODULE],
2418 [AC_MSG_CHECKING([whether to enable llite_lloop module])
2419 LB_LINUX_TRY_COMPILE([
2420 #include <asm/page.h>
2422 #if PAGE_SIZE >= 65536
2423 #error "PAGE_SIZE >= 65536"
2426 enable_llite_lloop_module='yes'
2427 AC_MSG_RESULT([yes])
2429 enable_llite_lloop_module='no'
2437 # other configure checks
2439 AC_DEFUN([LC_CONFIGURE],
2440 [LC_CONFIG_OBD_BUFFER_SIZE
2442 if test $target_cpu == "i686" -o $target_cpu == "x86_64"; then
2443 CFLAGS="$CFLAGS -Werror"
2446 # maximum MDS thread count
2449 # include/liblustre.h
2450 AC_CHECK_HEADERS([sys/user.h sys/vfs.h stdint.h blkid/blkid.h])
2452 # liblustre/llite_lib.h
2453 AC_CHECK_HEADERS([xtio.h file.h])
2456 AC_CHECK_HEADERS([linux/types.h sys/types.h linux/unistd.h unistd.h])
2459 AC_CHECK_HEADERS([netinet/in.h arpa/inet.h catamount/data.h])
2460 AC_CHECK_FUNCS([inet_ntoa])
2462 # libsysio/src/readlink.c
2465 # lvfs/prng.c - depends on linux/types.h from liblustre/dir.c
2466 AC_CHECK_HEADERS([linux/random.h], [], [],
2467 [#ifdef HAVE_LINUX_TYPES_H
2468 # include <linux/types.h>
2473 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
2475 # check for -lz support
2479 [AC_CHECK_HEADERS([zlib.h],
2481 AC_DEFINE([HAVE_ADLER], 1,
2482 [support alder32 checksum type])],
2483 [AC_MSG_WARN([No zlib-devel package found,
2484 unable to use adler32 checksum])])],
2485 [AC_MSG_WARN([No zlib package found, unable to use adler32 checksum])]
2490 AC_ARG_ENABLE([mindf],
2491 AC_HELP_STRING([--enable-mindf],
2492 [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
2494 if test "$enable_mindf" = "yes" ; then
2495 AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])
2498 AC_ARG_ENABLE([fail_alloc],
2499 AC_HELP_STRING([--disable-fail-alloc],
2500 [disable randomly alloc failure]),
2501 [],[enable_fail_alloc=yes])
2502 AC_MSG_CHECKING([whether to randomly failing memory alloc])
2503 AC_MSG_RESULT([$enable_fail_alloc])
2504 if test x$enable_fail_alloc != xno ; then
2505 AC_DEFINE([RANDOM_FAIL_ALLOC], 1, [enable randomly alloc failure])
2508 AC_ARG_ENABLE([invariants],
2509 AC_HELP_STRING([--enable-invariants],
2510 [enable invariant checking (cpu intensive)]),
2512 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
2513 AC_MSG_RESULT([$enable_invariants])
2514 if test x$enable_invariants = xyes ; then
2515 AC_DEFINE([INVARIANT_CHECK], 1, [enable invariant checking])
2518 AC_ARG_ENABLE([lu_ref],
2519 AC_HELP_STRING([--enable-lu_ref],
2520 [enable lu_ref reference tracking code]),
2522 AC_MSG_CHECKING([whether to track references with lu_ref])
2523 AC_MSG_RESULT([$enable_lu_ref])
2524 if test x$enable_lu_ref = xyes ; then
2525 AC_DEFINE([USE_LU_REF], 1, [enable lu_ref reference tracking code])
2528 AC_ARG_ENABLE([pgstate-track],
2529 AC_HELP_STRING([--enable-pgstate-track],
2530 [enable page state tracking]),
2531 [enable_pgstat_track='yes'],[])
2532 AC_MSG_CHECKING([whether to enable page state tracking])
2533 AC_MSG_RESULT([$enable_pgstat_track])
2534 if test x$enable_pgstat_track = xyes ; then
2535 AC_DEFINE([LUSTRE_PAGESTATE_TRACKING], 1,
2536 [enable page state tracking code])
2543 LC_DENTRY_OPEN_4ARGS
2544 LC_PAGEVEC_LRU_ADD_FILE
2551 # AM_CONDITIONALS for lustre
2553 AC_DEFUN([LC_CONDITIONALS],
2554 [AM_CONDITIONAL(LIBLUSTRE, test x$enable_liblustre = xyes)
2555 AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno)
2556 AM_CONDITIONAL(LIBLUSTRE_TESTS, test x$enable_liblustre_tests = xyes)
2557 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
2558 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
2559 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
2560 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
2561 AM_CONDITIONAL(BLKID, test x$ac_cv_header_blkid_blkid_h = xyes)
2562 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
2563 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
2564 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
2565 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
2566 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
2567 AM_CONDITIONAL(LLITE_LLOOP, test x$enable_llite_lloop_module = xyes)
2573 # files that should be generated with AC_OUTPUT
2575 AC_DEFUN([LC_CONFIG_FILES],
2579 lustre/autoconf/Makefile
2580 lustre/conf/Makefile
2581 lustre/contrib/Makefile
2583 lustre/include/Makefile
2584 lustre/include/lustre_ver.h
2585 lustre/include/linux/Makefile
2586 lustre/include/darwin/Makefile
2587 lustre/include/lustre/Makefile
2588 lustre/kernel_patches/targets/2.6-rhel6.target
2589 lustre/kernel_patches/targets/2.6-rhel5.target
2590 lustre/kernel_patches/targets/2.6-sles10.target
2591 lustre/kernel_patches/targets/2.6-sles11.target
2592 lustre/kernel_patches/targets/2.6-oel5.target
2593 lustre/kernel_patches/targets/2.6-fc11.target
2594 lustre/kernel_patches/targets/2.6-fc12.target
2595 lustre/ldlm/Makefile
2597 lustre/fid/autoMakefile
2598 lustre/liblustre/Makefile
2599 lustre/liblustre/tests/Makefile
2600 lustre/liblustre/tests/mpi/Makefile
2601 lustre/llite/Makefile
2602 lustre/llite/autoMakefile
2603 lustre/lclient/Makefile
2605 lustre/lov/autoMakefile
2606 lustre/lvfs/Makefile
2607 lustre/lvfs/autoMakefile
2609 lustre/mdc/autoMakefile
2611 lustre/lmv/autoMakefile
2613 lustre/mds/autoMakefile
2615 lustre/mdt/autoMakefile
2617 lustre/cmm/autoMakefile
2619 lustre/mdd/autoMakefile
2621 lustre/fld/autoMakefile
2622 lustre/obdclass/Makefile
2623 lustre/obdclass/autoMakefile
2624 lustre/obdclass/linux/Makefile
2625 lustre/obdecho/Makefile
2626 lustre/obdecho/autoMakefile
2627 lustre/obdfilter/Makefile
2628 lustre/obdfilter/autoMakefile
2630 lustre/ofd/autoMakefile
2632 lustre/osc/autoMakefile
2634 lustre/ost/autoMakefile
2635 lustre/osd-ldiskfs/Makefile
2636 lustre/osd-ldiskfs/autoMakefile
2638 lustre/mgc/autoMakefile
2640 lustre/mgs/autoMakefile
2641 lustre/ptlrpc/Makefile
2642 lustre/ptlrpc/autoMakefile
2643 lustre/ptlrpc/gss/Makefile
2644 lustre/ptlrpc/gss/autoMakefile
2645 lustre/quota/Makefile
2646 lustre/quota/autoMakefile
2647 lustre/scripts/Makefile
2648 lustre/tests/Makefile
2649 lustre/tests/mpi/Makefile
2650 lustre/utils/Makefile
2651 lustre/utils/gss/Makefile
2652 lustre/obdclass/darwin/Makefile