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])
15 # lustre specific paths
17 AC_DEFUN([LC_PATH_DEFAULTS],
18 [# ptlrpc kernel build requires this
26 demodir='$(docdir)/demo'
29 pkgexampledir='${pkgdatadir}/examples'
30 AC_SUBST(pkgexampledir)
36 # is the target os supported?
38 AC_DEFUN([LC_TARGET_SUPPORTED],
52 # that ext3 is enabled in the kernel
54 AC_DEFUN([LC_CONFIG_EXT3],
55 [LB_LINUX_CONFIG([EXT3_FS],[],[
56 LB_LINUX_CONFIG([EXT3_FS_MODULE],[],[$2])
58 LB_LINUX_CONFIG([EXT3_FS_XATTR],[$1],[$3])
64 # If we have (and can build) fshooks.h
66 AC_DEFUN([LC_FSHOOKS],
67 [LB_CHECK_FILE([$LINUX/include/linux/fshooks.h],[
68 AC_MSG_CHECKING([if fshooks.h can be compiled])
69 LB_LINUX_TRY_COMPILE([
70 #include <linux/fshooks.h>
75 AC_MSG_WARN([You might have better luck with gcc 3.3.x.])
76 AC_MSG_WARN([You can set CC=gcc33 before running configure.])
77 AC_MSG_ERROR([Your compiler cannot build fshooks.h.])
88 # rh 2.4.18 has iobuf->dovary, but other kernels do not
90 AC_DEFUN([LC_STRUCT_KIOBUF],
91 [AC_MSG_CHECKING([if struct kiobuf has a dovary field])
92 LB_LINUX_TRY_COMPILE([
93 #include <linux/iobuf.h>
99 AC_DEFINE(HAVE_KIOBUF_DOVARY, 1, [struct kiobuf has a dovary field])
106 # LC_FUNC_COND_RESCHED
108 # cond_resched() was introduced in 2.4.20
110 AC_DEFUN([LC_FUNC_COND_RESCHED],
111 [AC_MSG_CHECKING([if kernel offers cond_resched])
112 LB_LINUX_TRY_COMPILE([
113 #include <linux/sched.h>
118 AC_DEFINE(HAVE_COND_RESCHED, 1, [cond_resched found])
125 # LC_FUNC_ZAP_PAGE_RANGE
127 # if zap_page_range() takes a vma arg
129 AC_DEFUN([LC_FUNC_ZAP_PAGE_RANGE],
130 [AC_MSG_CHECKING([if zap_page_range with vma parameter])
131 ZAP_PAGE_RANGE_VMA="`grep -c 'zap_page_range.*struct vm_area_struct' $LINUX/include/linux/mm.h`"
132 if test "$ZAP_PAGE_RANGE_VMA" != 0 ; then
133 AC_DEFINE(ZAP_PAGE_RANGE_VMA, 1, [zap_page_range with vma parameter])
143 # if proc_fs.h defines PDE()
145 AC_DEFUN([LC_FUNC_PDE],
146 [AC_MSG_CHECKING([if kernel defines PDE])
147 HAVE_PDE="`grep -c 'proc_dir_entry..PDE' $LINUX/include/linux/proc_fs.h`"
148 if test "$HAVE_PDE" != 0 ; then
149 AC_DEFINE(HAVE_PDE, 1, [the kernel defines PDE])
157 # LC_FUNC_FILEMAP_FDATASYNC
159 # if filemap_fdatasync() exists
161 AC_DEFUN([LC_FUNC_FILEMAP_FDATAWRITE],
162 [AC_MSG_CHECKING([whether filemap_fdatawrite() is defined])
163 LB_LINUX_TRY_COMPILE([
164 #include <linux/fs.h>
166 int (*foo)(struct address_space *)= filemap_fdatawrite;
169 AC_DEFINE(HAVE_FILEMAP_FDATAWRITE, 1, [filemap_fdatawrite() found])
178 # if direct_IO takes a struct file argument
180 AC_DEFUN([LC_FUNC_DIRECT_IO],
181 [AC_MSG_CHECKING([if kernel passes struct file to direct_IO])
182 HAVE_DIO_FILE="`grep -c 'direct_IO.*struct file' $LINUX/include/linux/fs.h`"
183 if test "$HAVE_DIO_FILE" != 0 ; then
184 AC_DEFINE(HAVE_DIO_FILE, 1, [the kernel passes struct file to direct_IO])
192 # LC_HEADER_MM_INLINE
194 # RHEL kernels define page_count in mm_inline.h
196 AC_DEFUN([LC_HEADER_MM_INLINE],
197 [AC_MSG_CHECKING([if kernel has mm_inline.h header])
198 LB_LINUX_TRY_COMPILE([
199 #include <linux/mm_inline.h>
202 #error mm_inline.h does not define page_count
206 AC_DEFINE(HAVE_MM_INLINE, 1, [mm_inline found])
215 # if inode->i_alloc_sem exists
217 AC_DEFUN([LC_STRUCT_INODE],
218 [AC_MSG_CHECKING([if struct inode has i_alloc_sem])
219 LB_LINUX_TRY_COMPILE([
220 #include <linux/fs.h>
221 #include <linux/version.h>
223 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,24))
224 #error "down_read_trylock broken before 2.4.24"
227 return (char *)&i.i_alloc_sem - (char *)&i;
230 AC_DEFINE(HAVE_I_ALLOC_SEM, 1, [struct inode has i_alloc_sem])
237 # LC_FUNC_REGISTER_CACHE
239 # if register_cache() is defined by kernel
241 AC_DEFUN([LC_FUNC_REGISTER_CACHE],
242 [AC_MSG_CHECKING([if kernel defines register_cache()])
243 LB_LINUX_TRY_COMPILE([
244 #include <linux/list.h>
245 #include <linux/cache_def.h>
247 struct cache_definition cache;
250 AC_DEFINE(HAVE_REGISTER_CACHE, 1, [register_cache found])
251 AC_MSG_CHECKING([if kernel expects return from cache shrink function])
252 HAVE_CACHE_RETURN_INT="`grep -c 'int.*shrink' $LINUX/include/linux/cache_def.h`"
253 if test "$HAVE_CACHE_RETURN_INT" != 0 ; then
254 AC_DEFINE(HAVE_CACHE_RETURN_INT, 1, [kernel expects return from shrink_cache])
265 # LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP
267 # check for our patched grab_cache_page_nowait_gfp() function
269 AC_DEFUN([LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP],
270 [AC_MSG_CHECKING([if kernel defines grab_cache_page_nowait_gfp()])
271 HAVE_GCPN_GFP="`grep -c 'grab_cache_page_nowait_gfp' $LINUX/include/linux/pagemap.h`"
272 if test "$HAVE_GCPN_GFP" != 0 ; then
273 AC_DEFINE(HAVE_GRAB_CACHE_PAGE_NOWAIT_GFP, 1,
274 [kernel has grab_cache_page_nowait_gfp()])
282 # LC_FUNC_DEV_SET_RDONLY
284 # check for the old-style dev_set_rdonly which took an extra "devno" param
285 # and can only set a single device to discard writes at one time
287 AC_DEFUN([LC_FUNC_DEV_SET_RDONLY],
288 [AC_MSG_CHECKING([if kernel has new dev_set_rdonly])
289 LB_LINUX_TRY_COMPILE([
290 #include <linux/fs.h>
292 #ifndef HAVE_CLEAR_RDONLY_ON_PUT
293 #error needs to be patched by lustre kernel patches from Lustre version 1.4.3 or above.
297 AC_DEFINE(HAVE_DEV_SET_RDONLY, 1, [kernel has new dev_set_rdonly])
299 AC_MSG_RESULT([no, Linux kernel source needs to be patches by lustre
300 kernel patches from Lustre version 1.4.3 or above.])
305 # LC_CONFIG_BACKINGFS
307 # setup, check the backing filesystem
309 AC_DEFUN([LC_CONFIG_BACKINGFS],
313 if test x$with_ldiskfs = xno ; then
316 if test x$linux25$enable_server = xyesyes ; then
317 AC_MSG_ERROR([ldiskfs is required for 2.6-based servers.])
320 # --- Check that ext3 and ext3 xattr are enabled in the kernel
322 AC_MSG_ERROR([Lustre requires that ext3 is enabled in the kernel])
324 AC_MSG_WARN([Lustre requires that extended attributes for ext3 are enabled in the kernel])
325 AC_MSG_WARN([This build may fail.])
329 LB_DEFINE_LDISKFS_OPTIONS
332 AC_MSG_CHECKING([which backing filesystem to use])
333 AC_MSG_RESULT([$BACKINGFS])
340 # the pinger is temporary, until we have the recovery node in place
342 AC_DEFUN([LC_CONFIG_PINGER],
343 [AC_MSG_CHECKING([whether to enable pinger support])
344 AC_ARG_ENABLE([pinger],
345 AC_HELP_STRING([--disable-pinger],
346 [disable recovery pinger support]),
347 [],[enable_pinger='yes'])
348 AC_MSG_RESULT([$enable_pinger])
349 if test x$enable_pinger != xno ; then
350 AC_DEFINE(ENABLE_PINGER, 1, Use the Pinger)
357 # do checksum of bulk data between client and OST
359 AC_DEFUN([LC_CONFIG_CHECKSUM],
360 [AC_MSG_CHECKING([whether to enable data checksum support])
361 AC_ARG_ENABLE([checksum],
362 AC_HELP_STRING([--disable-checksum],
363 [disable data checksum support]),
364 [],[enable_checksum='yes'])
365 AC_MSG_RESULT([$enable_checksum])
366 if test x$enable_checksum != xno ; then
367 AC_DEFINE(ENABLE_CHECKSUM, 1, do data checksums)
372 # LC_CONFIG_HEALTH_CHECK_WRITE
374 # Turn off the actual write to the disk
376 AC_DEFUN([LC_CONFIG_HEALTH_CHECK_WRITE],
377 [AC_MSG_CHECKING([whether to enable a write with the health check])
378 AC_ARG_ENABLE([health_write],
379 AC_HELP_STRING([--enable-health_write],
380 [enable disk writes when doing health check]),
381 [],[enable_health_write='no'])
382 AC_MSG_RESULT([$enable_health_write])
383 if test x$enable_health_write != xno ; then
384 AC_DEFINE(USE_HEALTH_CHECK_WRITE, 1, Write when Checking Health)
389 # LC_CONFIG_LIBLUSTRE_RECOVERY
391 AC_DEFUN([LC_CONFIG_LIBLUSTRE_RECOVERY],
392 [AC_MSG_CHECKING([whether to enable liblustre recovery support])
393 AC_ARG_ENABLE([liblustre-recovery],
394 AC_HELP_STRING([--disable-liblustre-recovery],
395 [disable liblustre recovery support]),
396 [],[enable_liblustre_recovery='yes'])
397 AC_MSG_RESULT([$enable_liblustre_recovery])
398 if test x$enable_liblustre_recovery != xno ; then
399 AC_DEFINE(ENABLE_LIBLUSTRE_RECOVERY, 1, Liblustre Can Recover)
404 # LC_CONFIG_OBD_BUFFER_SIZE
406 # the maximum buffer size of lctl ioctls
408 AC_DEFUN([LC_CONFIG_OBD_BUFFER_SIZE],
409 [AC_MSG_CHECKING([maximum OBD ioctl size])
410 AC_ARG_WITH([obd-buffer-size],
411 AC_HELP_STRING([--with-obd-buffer-size=[size]],
412 [set lctl ioctl maximum bytes (default=8192)]),
414 OBD_BUFFER_SIZE=$with_obd_buffer_size
418 AC_MSG_RESULT([$OBD_BUFFER_SIZE bytes])
419 AC_DEFINE_UNQUOTED(OBD_MAX_IOCTL_BUFFER, $OBD_BUFFER_SIZE, [IOCTL Buffer Size])
425 # AIX does not have statfs.f_namelen
427 AC_DEFUN([LC_STRUCT_STATFS],
428 [AC_MSG_CHECKING([if struct statfs has a f_namelen field])
429 LB_LINUX_TRY_COMPILE([
430 #include <linux/vfs.h>
436 AC_DEFINE(HAVE_STATFS_NAMELEN, 1, [struct statfs has a namelen field])
443 # LC_READLINK_SSIZE_T
445 AC_DEFUN([LC_READLINK_SSIZE_T],
446 [AC_MSG_CHECKING([if readlink returns ssize_t])
450 ssize_t readlink(const char *, char *, size_t);
453 AC_DEFINE(HAVE_POSIX_1003_READLINK, 1, [readlink returns ssize_t])
459 AC_DEFUN([LC_FUNC_PAGE_MAPPED],
460 [AC_MSG_CHECKING([if kernel offers page_mapped])
461 LB_LINUX_TRY_COMPILE([
462 #include <linux/mm.h>
467 AC_DEFINE(HAVE_PAGE_MAPPED, 1, [page_mapped found])
473 AC_DEFUN([LC_STRUCT_FILE_OPS_UNLOCKED_IOCTL],
474 [AC_MSG_CHECKING([if struct file_operations has an unlocked_ioctl field])
475 LB_LINUX_TRY_COMPILE([
476 #include <linux/fs.h>
478 struct file_operations fops;
479 &fops.unlocked_ioctl;
482 AC_DEFINE(HAVE_UNLOCKED_IOCTL, 1, [struct file_operations has an unlock ed_ioctl field])
488 AC_DEFUN([LC_FILEMAP_POPULATE],
489 [AC_MSG_CHECKING([for exported filemap_populate])
490 LB_LINUX_TRY_COMPILE([
491 #include <asm/page.h>
492 #include <linux/mm.h>
494 filemap_populate(NULL, 0, 0, __pgprot(0), 0, 0);
497 AC_DEFINE(HAVE_FILEMAP_POPULATE, 1, [Kernel exports filemap_populate])
503 AC_DEFUN([LC_D_ADD_UNIQUE],
504 [AC_MSG_CHECKING([for d_add_unique])
505 LB_LINUX_TRY_COMPILE([
506 #include <linux/dcache.h>
508 d_add_unique(NULL, NULL);
511 AC_DEFINE(HAVE_D_ADD_UNIQUE, 1, [Kernel has d_add_unique])
517 AC_DEFUN([LC_BIT_SPINLOCK_H],
518 [LB_CHECK_FILE([$LINUX/include/linux/bit_spinlock.h],[
519 AC_MSG_CHECKING([if bit_spinlock.h can be compiled])
520 LB_LINUX_TRY_COMPILE([
521 #include <asm/processor.h>
522 #include <linux/spinlock.h>
523 #include <linux/bit_spinlock.h>
526 AC_DEFINE(HAVE_BIT_SPINLOCK_H, 1, [Kernel has bit_spinlock.h])
537 # If we have xattr_acl.h
539 AC_DEFUN([LC_XATTR_ACL],
540 [LB_CHECK_FILE([$LINUX/include/linux/xattr_acl.h],[
541 AC_MSG_CHECKING([if xattr_acl.h can be compiled])
542 LB_LINUX_TRY_COMPILE([
543 #include <linux/xattr_acl.h>
546 AC_DEFINE(HAVE_XATTR_ACL, 1, [Kernel has xattr_acl])
554 AC_DEFUN([LC_STRUCT_INTENT_FILE],
555 [AC_MSG_CHECKING([if struct open_intent has a file field])
556 LB_LINUX_TRY_COMPILE([
557 #include <linux/fs.h>
558 #include <linux/namei.h>
560 struct open_intent intent;
564 AC_DEFINE(HAVE_FILE_IN_STRUCT_INTENT, 1, [struct open_intent has a file field])
571 AC_DEFUN([LC_POSIX_ACL_XATTR_H],
572 [LB_CHECK_FILE([$LINUX/include/linux/posix_acl_xattr.h],[
573 AC_MSG_CHECKING([if linux/posix_acl_xattr.h can be compiled])
574 LB_LINUX_TRY_COMPILE([
575 #include <linux/posix_acl_xattr.h>
578 AC_DEFINE(HAVE_LINUX_POSIX_ACL_XATTR_H, 1, [linux/posix_acl_xattr.h found])
591 # starting from 2.6.19 linux kernel exports __iget()
593 AC_DEFUN([LC_EXPORT___IGET],
594 [LB_CHECK_SYMBOL_EXPORT([__iget],
596 AC_DEFINE(HAVE_EXPORT___IGET, 1, [kernel exports __iget])
602 AC_DEFUN([LC_LUSTRE_VERSION_H],
603 [LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],[
604 rm -f "$LUSTRE/include/linux/lustre_version.h"
606 touch "$LUSTRE/include/linux/lustre_version.h"
607 if test x$enable_server = xyes ; then
608 AC_MSG_WARN([Unpatched kernel detected.])
609 AC_MSG_WARN([Lustre servers cannot be built with an unpatched kernel;])
610 AC_MSG_WARN([disabling server build])
616 AC_DEFUN([LC_FUNC_SET_FS_PWD],
617 [LB_CHECK_SYMBOL_EXPORT([set_fs_pwd],
619 AC_DEFINE(HAVE_SET_FS_PWD, 1, [set_fs_pwd is exported])
627 AC_DEFUN([LC_CAPA_CRYPTO],
628 [LB_LINUX_CONFIG_IM([CRYPTO],[],[
629 AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO is enabled in your kernel.])
631 LB_LINUX_CONFIG_IM([CRYPTO_HMAC],[],[
632 AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_HMAC is enabled in your kernel.])
634 LB_LINUX_CONFIG_IM([CRYPTO_SHA1],[],[
635 AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_SHA1 is enabled in your kernel.])
639 AC_DEFUN([LC_SUNRPC_CACHE],
640 [AC_MSG_CHECKING([if sunrpc struct cache_head uses kref])
641 LB_LINUX_TRY_COMPILE([
642 #include <linux/sunrpc/cache.h>
644 struct cache_head ch;
648 AC_DEFINE(HAVE_SUNRPC_CACHE_V2, 1, [sunrpc cache facility v2])
654 AC_DEFUN([LC_CONFIG_SUNRPC],
655 [LB_LINUX_CONFIG_IM([SUNRPC],[],
656 [AC_MSG_ERROR([kernel SUNRPC support is required by using GSS.])])
661 # LC_CONFIG_GSS_KEYRING (default enabled, if gss is enabled)
663 AC_DEFUN([LC_CONFIG_GSS_KEYRING],
664 [AC_MSG_CHECKING([whether to enable gss keyring backend])
665 AC_ARG_ENABLE([gss_keyring],
666 [AC_HELP_STRING([--disable-gss-keyring],
667 [disable gss keyring backend])],
668 [],[enable_gss_keyring='yes'])
669 AC_MSG_RESULT([$enable_gss_keyring])
671 if test x$enable_gss_keyring != xno; then
672 LB_LINUX_CONFIG_IM([KEYS],[],
673 [AC_MSG_ERROR([GSS keyring backend require that CONFIG_KEYS be enabled in your kernel.])])
675 AC_CHECK_LIB([keyutils], [keyctl_search], [],
676 [AC_MSG_ERROR([libkeyutils is not found, which is required by gss keyring backend])],)
678 AC_DEFINE([HAVE_GSS_KEYRING], [1],
679 [Define this if you enable gss keyring backend])
683 m4_pattern_allow(AC_KERBEROS_V5)
686 # LC_CONFIG_GSS (default disabled)
688 # Build gss and related tools of Lustre. Currently both kernel and user space
689 # parts are depend on linux platform.
691 AC_DEFUN([LC_CONFIG_GSS],
692 [AC_MSG_CHECKING([whether to enable gss/krb5 support])
694 [AC_HELP_STRING([--enable-gss], [enable gss/krb5 support])],
695 [],[enable_gss='no'])
696 AC_MSG_RESULT([$enable_gss])
698 if test x$enable_gss == xyes; then
699 LC_CONFIG_GSS_KEYRING
702 LB_LINUX_CONFIG_IM([CRYPTO_DES],[],
703 [AC_MSG_WARN([kernel DES support is recommended by using GSS.])])
704 LB_LINUX_CONFIG_IM([CRYPTO_MD5],[],
705 [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
706 LB_LINUX_CONFIG_IM([CRYPTO_SHA256],[],
707 [AC_MSG_WARN([kernel SHA256 support is recommended by using GSS.])])
708 LB_LINUX_CONFIG_IM([CRYPTO_SHA512],[],
709 [AC_MSG_WARN([kernel SHA512 support is recommended by using GSS.])])
710 LB_LINUX_CONFIG_IM([CRYPTO_ARC4],[],
711 [AC_MSG_WARN([kernel ARC4 support is recommended by using GSS.])])
714 dnl the AES symbol usually tied with arch, e.g. CRYPTO_AES_586
716 LB_LINUX_CONFIG_IM([CRYPTO_AES],[],
717 [AC_MSG_WARN([kernel AES support is recommended by using GSS.])])
719 AC_CHECK_LIB([gssapi], [gss_init_sec_context],
720 [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi"],
721 [AC_MSG_ERROR([libgssapi is not found, which is required by GSS.])],)
723 AC_SUBST(GSSAPI_LIBS)
729 # LC_FUNC_MS_FLOCK_LOCK
731 # SLES9 kernel has MS_FLOCK_LOCK sb flag
733 AC_DEFUN([LC_FUNC_MS_FLOCK_LOCK],
734 [AC_MSG_CHECKING([if kernel has MS_FLOCK_LOCK sb flag])
735 LB_LINUX_TRY_COMPILE([
736 #include <linux/fs.h>
738 int flags = MS_FLOCK_LOCK;
740 AC_DEFINE(HAVE_MS_FLOCK_LOCK, 1,
741 [kernel has MS_FLOCK_LOCK flag])
749 # LC_FUNC_HAVE_CAN_SLEEP_ARG
751 # SLES9 kernel has third arg can_sleep
752 # in fs/locks.c: flock_lock_file_wait()
754 AC_DEFUN([LC_FUNC_HAVE_CAN_SLEEP_ARG],
755 [AC_MSG_CHECKING([if kernel has third arg can_sleep in fs/locks.c: flock_lock_file_wait()])
756 LB_LINUX_TRY_COMPILE([
757 #include <linux/fs.h>
761 struct file_lock *file_lock;
762 flock_lock_file_wait(file, file_lock, cansleep);
764 AC_DEFINE(HAVE_CAN_SLEEP_ARG, 1,
765 [kernel has third arg can_sleep in fs/locks.c: flock_lock_file_wait()])
775 # rhel4.2 kernel has f_op->flock field
777 AC_DEFUN([LC_FUNC_F_OP_FLOCK],
778 [AC_MSG_CHECKING([if struct file_operations has flock field])
779 LB_LINUX_TRY_COMPILE([
780 #include <linux/fs.h>
782 struct file_operations ll_file_operations_flock;
783 ll_file_operations_flock.flock = NULL;
785 AC_DEFINE(HAVE_F_OP_FLOCK, 1,
786 [struct file_operations has flock field])
796 # task struct has p_pptr instead of parent
798 AC_DEFUN([LC_TASK_PPTR],
799 [AC_MSG_CHECKING([task p_pptr found])
800 LB_LINUX_TRY_COMPILE([
801 #include <linux/sched.h>
803 struct task_struct *p;
808 AC_DEFINE(HAVE_TASK_PPTR, 1, [task p_pptr found])
817 # rhel4.2 kernel has f_op->flock field
819 AC_DEFUN([LC_FUNC_F_OP_FLOCK],
820 [AC_MSG_CHECKING([if struct file_operations has flock field])
821 LB_LINUX_TRY_COMPILE([
822 #include <linux/fs.h>
824 struct file_operations ll_file_operations_flock;
825 ll_file_operations_flock.flock = NULL;
827 AC_DEFINE(HAVE_F_OP_FLOCK, 1,
828 [struct file_operations has flock field])
836 # after 2.6.15 inode have i_mutex intead of i_sem
837 AC_DEFUN([LC_INODE_I_MUTEX],
838 [AC_MSG_CHECKING([use inode have i_mutex ])
839 LB_LINUX_TRY_COMPILE([
840 #include <linux/mutex.h>
841 #include <linux/fs.h>
846 mutex_unlock(&i.i_mutex);
849 AC_DEFINE(HAVE_INODE_I_MUTEX, 1,
850 [after 2.6.15 inode have i_mutex intead of i_sem])
857 # SLES 9 uses a different name for this file - unsure about vanilla kernels
858 # around this version, but it matters for servers only.
859 AC_DEFUN([LC_SYMVERFILE],
860 [AC_MSG_CHECKING([name of symverfile])
861 if grep -q Modules.symvers $LINUX/scripts/Makefile.modpost ; then
862 SYMVERFILE=Modules.symvers
864 SYMVERFILE=Module.symvers
866 AC_MSG_RESULT($SYMVERFILE)
867 AC_SUBST(SYMVERFILE)])
870 # after 2.6.17 dquote use mutex instead if semaphore
871 AC_DEFUN([LC_DQUOTOFF_MUTEX],
872 [AC_MSG_CHECKING([use dqonoff_mutex])
873 LB_LINUX_TRY_COMPILE([
874 #include <linux/mutex.h>
875 #include <linux/fs.h>
876 #include <linux/quota.h>
878 struct quota_info dq;
880 mutex_unlock(&dq.dqonoff_mutex);
883 AC_DEFINE(HAVE_DQUOTOFF_MUTEX, 1,
884 [after 2.6.17 dquote use mutex instead if semaphore])
891 # LC_STATFS_DENTRY_PARAM
892 # starting from 2.6.18 linux kernel uses dentry instead of
893 # super_block for first vfs_statfs argument
895 AC_DEFUN([LC_STATFS_DENTRY_PARAM],
896 [AC_MSG_CHECKING([first vfs_statfs parameter is dentry])
897 LB_LINUX_TRY_COMPILE([
898 #include <linux/fs.h>
900 int vfs_statfs(struct dentry *, struct kstatfs *);
902 AC_DEFINE(HAVE_STATFS_DENTRY_PARAM, 1,
903 [first parameter of vfs_statfs is dentry])
912 # starting from 2.6.18 kernel don't export do_kern_mount
913 # and want to use vfs_kern_mount instead.
915 AC_DEFUN([LC_VFS_KERN_MOUNT],
916 [AC_MSG_CHECKING([vfs_kern_mount exist in kernel])
917 LB_LINUX_TRY_COMPILE([
918 #include <linux/mount.h>
920 vfs_kern_mount(NULL, 0, NULL, NULL);
922 AC_DEFINE(HAVE_VFS_KERN_MOUNT, 1,
923 [vfs_kern_mount exist in kernel])
931 # LC_INVALIDATEPAGE_RETURN_INT
932 # more 2.6 api changes. return type for the invalidatepage
933 # address_space_operation is 'void' in new kernels but 'int' in old
935 AC_DEFUN([LC_INVALIDATEPAGE_RETURN_INT],
936 [AC_MSG_CHECKING([invalidatepage has return int])
937 LB_LINUX_TRY_COMPILE([
938 #include <linux/buffer_head.h>
940 int rc = block_invalidatepage(NULL, 0);
943 AC_DEFINE(HAVE_INVALIDATEPAGE_RETURN_INT, 1,
944 [Define if return type of invalidatepage should be int])
950 # LC_UMOUNTBEGIN_HAS_VFSMOUNT
951 # more 2.6 API changes. 2.6.18 umount_begin has different parameters
952 AC_DEFUN([LC_UMOUNTBEGIN_HAS_VFSMOUNT],
953 [AC_MSG_CHECKING([if umount_begin needs vfsmount parameter instead of super_block])
954 tmp_flags="$EXTRA_KCFLAGS"
955 EXTRA_KCFLAGS="-Werror"
956 LB_LINUX_TRY_COMPILE([
957 #include <linux/fs.h>
960 static void cfg_umount_begin (struct vfsmount *v, int flags)
965 static struct super_operations cfg_super_operations = {
966 .umount_begin = cfg_umount_begin,
969 cfg_super_operations.umount_begin(NULL,0);
972 AC_DEFINE(HAVE_UMOUNTBEGIN_VFSMOUNT, 1,
973 [Define umount_begin need second argument])
977 EXTRA_KCFLAGS="$tmp_flags"
981 # inode don't have i_blksize field
982 AC_DEFUN([LC_INODE_BLKSIZE],
983 [AC_MSG_CHECKING([inode has i_blksize field])
984 LB_LINUX_TRY_COMPILE([
985 #include <linux/fs.h>
991 AC_DEFINE(HAVE_INODE_BLKSIZE, 1,
992 [struct inode has i_blksize field])
998 # LC_VFS_READDIR_U64_INO
999 # 2.6.19 use u64 for inode number instead of inode_t
1000 AC_DEFUN([LC_VFS_READDIR_U64_INO],
1001 [AC_MSG_CHECKING([check vfs_readdir need 64bit inode number])
1002 tmp_flags="$EXTRA_KCFLAGS"
1003 EXTRA_KCFLAGS="-Werror"
1004 LB_LINUX_TRY_COMPILE([
1005 #include <linux/fs.h>
1006 int fillonedir(void * __buf, const char * name, int namlen, loff_t offset,
1007 u64 ino, unsigned int d_type)
1014 filter = fillonedir;
1018 AC_DEFINE(HAVE_VFS_READDIR_U64_INO, 1,
1019 [if vfs_readdir need 64bit inode number])
1023 EXTRA_KCFLAGS="$tmp_flags"
1026 # LC_GENERIC_FILE_WRITE
1027 # 2.6.19 introduce do_sync_write instead of
1028 # generic_file_write
1029 AC_DEFUN([LC_GENERIC_FILE_WRITE],
1030 [AC_MSG_CHECKING([use generic_file_write])
1031 LB_LINUX_TRY_COMPILE([
1032 #include <linux/fs.h>
1034 int result = generic_file_read(NULL, NULL, 0, 0);
1037 AC_DEFINE(HAVE_GENERIC_FILE_WRITE, 1,
1038 [use generic_file_write])
1044 # LC_GENERIC_FILE_READ
1045 # 2.6.19 need to use do_sync_read instead of
1047 AC_DEFUN([LC_GENERIC_FILE_READ],
1048 [AC_MSG_CHECKING([use generic_file_read])
1049 LB_LINUX_TRY_COMPILE([
1050 #include <linux/fs.h>
1052 int result = generic_file_read(NULL, NULL, 0, 0);
1055 AC_DEFINE(HAVE_GENERIC_FILE_READ, 1,
1056 [use generic_file_read])
1063 # 2.6.18 don't export nr_pagecahe
1064 AC_DEFUN([LC_NR_PAGECACHE],
1065 [AC_MSG_CHECKING([kernel export nr_pagecache])
1066 LB_LINUX_TRY_COMPILE([
1067 #include <linux/pagemap.h>
1069 return atomic_read(&nr_pagecache);
1072 AC_DEFINE(HAVE_NR_PAGECACHE, 1,
1073 [is kernel export nr_pagecache])
1079 # LC_CANCEL_DIRTY_PAGE
1080 # 2.6.20 introduse cancel_dirty_page instead of
1082 AC_DEFUN([LC_CANCEL_DIRTY_PAGE],
1083 [AC_MSG_CHECKING([kernel has cancel_dirty_page])
1084 LB_LINUX_TRY_COMPILE([
1085 #include <linux/page-flags.h>
1087 cancel_dirty_page(NULL, 0);
1090 AC_DEFINE(HAVE_CANCEL_DIRTY_PAGE, 1,
1091 [kernel has cancel_dirty_page instead of clear_page_dirty])
1100 # In order to support raid5 zerocopy patch, we have to patch the kernel to make
1101 # it support constant page, which means the page won't be modified during the
1104 AC_DEFUN([LC_PAGE_CONSTANT],
1105 [AC_MSG_CHECKING([if kernel have PageConstant defined])
1106 LB_LINUX_TRY_COMPILE([
1107 #include <linux/page-flags.h>
1110 #error "Have no raid5 zcopy patch"
1114 AC_DEFINE(HAVE_PAGE_CONSTANT, 1, [kernel have PageConstant supported])
1120 # RHEL5 in FS-cache patch rename PG_checked flag
1122 AC_DEFUN([LC_PG_FS_MISC],
1123 [AC_MSG_CHECKING([kernel has PG_fs_misc])
1124 LB_LINUX_TRY_COMPILE([
1125 #include <linux/page-flags.h>
1128 #error PG_fs_misc not defined in kernel
1132 AC_DEFINE(HAVE_PG_FS_MISC, 1,
1133 [is kernel have PG_fs_misc])
1139 # RHEL5 PageChecked and SetPageChecked defined
1140 AC_DEFUN([LC_PAGE_CHECKED],
1141 [AC_MSG_CHECKING([kernel has PageChecked and SetPageChecked])
1142 LB_LINUX_TRY_COMPILE([
1143 #include <linux/page-flags.h>
1146 #error PageChecked not defined in kernel
1148 #ifndef SetPageChecked
1149 #error SetPageChecked not defined in kernel
1153 AC_DEFINE(HAVE_PAGE_CHECKED, 1,
1154 [does kernel have PageChecked and SetPageChecked])
1160 AC_DEFUN([LC_EXPORT_TRUNCATE_COMPLETE],
1161 [LB_CHECK_SYMBOL_EXPORT([truncate_complete_page],
1163 AC_DEFINE(HAVE_TRUNCATE_COMPLETE_PAGE, 1,
1164 [kernel export truncate_complete_page])
1169 AC_DEFUN([LC_EXPORT_D_REHASH_COND],
1170 [LB_CHECK_SYMBOL_EXPORT([d_rehash_cond],
1172 AC_DEFINE(HAVE_D_REHASH_COND, 1,
1173 [d_rehash_cond is exported by the kernel])
1178 AC_DEFUN([LC_EXPORT___D_REHASH],
1179 [LB_CHECK_SYMBOL_EXPORT([__d_rehash],
1181 AC_DEFINE(HAVE___D_REHASH, 1,
1182 [__d_rehash is exported by the kernel])
1187 AC_DEFUN([LC_EXPORT_D_MOVE_LOCKED],
1188 [LB_CHECK_SYMBOL_EXPORT([d_move_locked],
1190 AC_DEFINE(HAVE_D_MOVE_LOCKED, 1,
1191 [d_move_locked is exported by the kernel])
1196 AC_DEFUN([LC_EXPORT___D_MOVE],
1197 [LB_CHECK_SYMBOL_EXPORT([__d_move],
1199 AC_DEFINE(HAVE___D_MOVE, 1,
1200 [__d_move is exported by the kernel])
1205 # The actual symbol exported varies among architectures, so we need
1206 # to check many symbols (but only in the current architecture.) No
1207 # matter what symbol is exported, the kernel #defines node_to_cpumask
1208 # to the appropriate function and that's what we use.
1209 AC_DEFUN([LC_EXPORT_NODE_TO_CPUMASK],
1211 LB_CHECK_SYMBOL_EXPORT([node_to_cpumask],
1212 [arch/$LINUX_ARCH/mm/numa.c],
1213 [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1,
1214 [node_to_cpumask is exported by
1215 the kernel])]) # x86_64
1216 LB_CHECK_SYMBOL_EXPORT([node_to_cpu_mask],
1217 [arch/$LINUX_ARCH/kernel/smpboot.c],
1218 [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1,
1219 [node_to_cpumask is exported by
1220 the kernel])]) # ia64
1221 LB_CHECK_SYMBOL_EXPORT([node_2_cpu_mask],
1222 [arch/$LINUX_ARCH/kernel/smpboot.c],
1223 [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1,
1224 [node_to_cpumask is exported by
1225 the kernel])]) # i386
1228 # 2.6.22 lost second parameter for invalidate_bdev
1229 AC_DEFUN([LC_INVALIDATE_BDEV_2ARG],
1230 [AC_MSG_CHECKING([if invalidate_bdev has second argument])
1231 LB_LINUX_TRY_COMPILE([
1232 #include <linux/buffer_head.h>
1234 invalidate_bdev(NULL,0);
1236 AC_MSG_RESULT([yes])
1237 AC_DEFINE(HAVE_INVALIDATE_BDEV_2ARG, 1,
1238 [invalidate_bdev has second argument])
1244 # 2.6.23 have return type 'void' for unregister_blkdev
1245 AC_DEFUN([LC_UNREGISTER_BLKDEV_RETURN_INT],
1246 [AC_MSG_CHECKING([if unregister_blkdev return int])
1247 LB_LINUX_TRY_COMPILE([
1248 #include <linux/fs.h>
1250 int i = unregister_blkdev(0,NULL);
1252 AC_MSG_RESULT([yes])
1253 AC_DEFINE(HAVE_UNREGISTER_BLKDEV_RETURN_INT, 1,
1254 [unregister_blkdev return int])
1260 # 2.6.23 change .sendfile to .splice_read
1261 AC_DEFUN([LC_KERNEL_SPLICE_READ],
1262 [AC_MSG_CHECKING([if kernel has .splice_read])
1263 LB_LINUX_TRY_COMPILE([
1264 #include <linux/fs.h>
1266 struct file_operations file;
1268 file.splice_read = NULL;
1270 AC_MSG_RESULT([yes])
1271 AC_DEFINE(HAVE_KERNEL_SPLICE_READ, 1,
1272 [kernel has .slice_read])
1278 # 2.6.23 extract nfs export related data into exportfs.h
1279 AC_DEFUN([LC_HAVE_EXPORTFS_H],
1282 CFLAGS="$CFLAGS -I$LINUX_OBJ/include"
1283 AC_CHECK_HEADERS([linux/exportfs.h])
1288 # LC_VFS_INTENT_PATCHES
1290 # check if the kernel has the VFS intent patches
1291 AC_DEFUN([LC_VFS_INTENT_PATCHES],
1292 [AC_MSG_CHECKING([if the kernel has the VFS intent patches])
1293 LB_LINUX_TRY_COMPILE([
1294 #include <linux/fs.h>
1295 #include <linux/namei.h>
1297 struct nameidata nd;
1298 struct lookup_intent *it;
1301 intent_init(it, IT_OPEN);
1302 it->d.lustre.it_disposition = 0;
1303 it->d.lustre.it_data = NULL;
1305 AC_MSG_RESULT([yes])
1306 AC_DEFINE(HAVE_VFS_INTENT_PATCHES, 1, [VFS intent patches are applied])
1312 AC_DEFUN([LC_S_TIME_GRAN],
1313 [AC_MSG_CHECKING([if super block has s_time_gran member])
1314 LB_LINUX_TRY_COMPILE([
1315 #include <linux/fs.h>
1317 struct super_block sb;
1319 return sb.s_time_gran;
1321 AC_MSG_RESULT([yes])
1322 AC_DEFINE(HAVE_S_TIME_GRAN, 1, [super block has s_time_gran member])
1328 AC_DEFUN([LC_SB_TIME_GRAN],
1329 [AC_MSG_CHECKING([if kernel has old get_sb_time_gran])
1330 LB_LINUX_TRY_COMPILE([
1331 #include <linux/fs.h>
1333 return get_sb_time_gran(NULL);
1335 AC_MSG_RESULT([yes])
1336 AC_DEFINE(HAVE_SB_TIME_GRAN, 1, [kernel has old get_sb_time_gran])
1343 # ~2.6.12 merge patch from oracle to convert tree_lock from spinlock to rwlock
1344 AC_DEFUN([LC_RW_TREE_LOCK],
1345 [AC_MSG_CHECKING([if kernel has tree_lock as rwlock])
1346 tmp_flags="$EXTRA_KCFLAGS"
1347 EXTRA_KCFLAGS="-Werror"
1348 LB_LINUX_TRY_COMPILE([
1349 #include <linux/fs.h>
1351 struct address_space a;
1353 write_lock(&a.tree_lock);
1355 AC_MSG_RESULT([yes])
1356 AC_DEFINE(HAVE_RW_TREE_LOCK, 1, [kernel has tree_lock as rw_lock])
1360 EXTRA_KCFLAGS="$tmp_flags"
1363 AC_DEFUN([LC_CONST_ACL_SIZE],
1364 [AC_MSG_CHECKING([calc acl size])
1366 CFLAGS="$CFLAGS -I $LINUX_OBJ/include $EXTRA_KCFLAGS"
1369 #include <linux/autoconf.h>
1370 #include <linux/types.h>
1373 #define __LINUX_POSIX_ACL_H
1375 # ifdef CONFIG_FS_POSIX_ACL
1376 # ifdef HAVE_XATTR_ACL
1377 # include <linux/xattr_acl.h>
1379 # ifdef HAVE_LINUX_POSIX_ACL_XATTR_H
1380 # include <linux/posix_acl_xattr.h>
1384 #include <linux/lustre_acl.h>
1390 int size = mds_xattr_acl_size(LUSTRE_POSIX_ACL_MAX_ENTRIES);
1391 FILE *f = fopen("acl.size","w+");
1392 fprintf(f,"%d", size);
1399 acl_size=`cat acl.size`
1400 AC_MSG_RESULT([ACL size $acl_size])
1401 AC_DEFINE_UNQUOTED(XATTR_ACL_SIZE, AS_TR_SH([$acl_size]), [size of xattr acl])
1403 AC_ERROR([ACL size can't computed])
1412 # Lustre linux kernel checks
1414 AC_DEFUN([LC_PROG_LINUX],
1415 [LC_LUSTRE_VERSION_H
1416 if test x$enable_server = xyes ; then
1417 AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server])
1422 LC_CONFIG_LIBLUSTRE_RECOVERY
1424 LC_CONFIG_HEALTH_CHECK_WRITE
1425 LC_CONFIG_LRU_RESIZE
1429 LC_EXPORT_TRUNCATE_COMPLETE
1430 LC_EXPORT_D_REHASH_COND
1431 LC_EXPORT___D_REHASH
1432 LC_EXPORT_D_MOVE_LOCKED
1434 LC_EXPORT_NODE_TO_CPUMASK
1437 LC_FUNC_COND_RESCHED
1438 LC_FUNC_ZAP_PAGE_RANGE
1443 LC_FUNC_REGISTER_CACHE
1444 LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP
1445 LC_FUNC_DEV_SET_RDONLY
1446 LC_FUNC_FILEMAP_FDATAWRITE
1449 LC_STRUCT_FILE_OPS_UNLOCKED_IOCTL
1455 LC_POSIX_ACL_XATTR_H
1458 LC_STRUCT_INTENT_FILE
1463 LC_FUNC_MS_FLOCK_LOCK
1464 LC_FUNC_HAVE_CAN_SLEEP_ARG
1467 LC_COOKIE_FOLLOW_LINK
1470 # does the kernel have VFS intent patches?
1471 LC_VFS_INTENT_PATCHES
1483 # SLES 10 (at least)
1491 LC_STATFS_DENTRY_PARAM
1493 LC_INVALIDATEPAGE_RETURN_INT
1494 LC_UMOUNTBEGIN_HAS_VFSMOUNT
1496 #2.6.18 + RHEL5 (fc6)
1502 LC_VFS_READDIR_U64_INO
1503 LC_GENERIC_FILE_READ
1504 LC_GENERIC_FILE_WRITE
1507 LC_CANCEL_DIRTY_PAGE
1509 # raid5-zerocopy patch
1513 LC_INVALIDATE_BDEV_2ARG
1515 LC_UNREGISTER_BLKDEV_RETURN_INT
1516 LC_KERNEL_SPLICE_READ
1521 # LC_CONFIG_CLIENT_SERVER
1523 # Build client/server sides of Lustre
1525 AC_DEFUN([LC_CONFIG_CLIENT_SERVER],
1526 [AC_MSG_CHECKING([whether to build Lustre server support])
1527 AC_ARG_ENABLE([server],
1528 AC_HELP_STRING([--disable-server],
1529 [disable Lustre server support]),
1530 [],[enable_server='yes'])
1531 AC_MSG_RESULT([$enable_server])
1533 AC_MSG_CHECKING([whether to build Lustre client support])
1534 AC_ARG_ENABLE([client],
1535 AC_HELP_STRING([--disable-client],
1536 [disable Lustre client support]),
1537 [],[enable_client='yes'])
1538 AC_MSG_RESULT([$enable_client])])
1541 # LC_CONFIG_LIBLUSTRE
1543 # whether to build liblustre
1545 AC_DEFUN([LC_CONFIG_LIBLUSTRE],
1546 [AC_MSG_CHECKING([whether to build Lustre library])
1547 AC_ARG_ENABLE([liblustre],
1548 AC_HELP_STRING([--disable-liblustre],
1549 [disable building of Lustre library]),
1550 [],[enable_liblustre=$with_sysio])
1551 AC_MSG_RESULT([$enable_liblustre])
1552 # only build sysio if liblustre is built
1553 with_sysio="$enable_liblustre"
1555 AC_MSG_CHECKING([whether to build liblustre tests])
1556 AC_ARG_ENABLE([liblustre-tests],
1557 AC_HELP_STRING([--enable-liblustre-tests],
1558 [enable liblustre tests, if --disable-tests is used]),
1559 [],[enable_liblustre_tests=$enable_tests])
1560 if test x$enable_liblustre != xyes ; then
1561 enable_liblustre_tests='no'
1563 AC_MSG_RESULT([$enable_liblustre_tests])
1565 AC_MSG_CHECKING([whether to enable liblustre acl])
1566 AC_ARG_ENABLE([liblustre-acl],
1567 AC_HELP_STRING([--disable-liblustre-acl],
1568 [disable ACL support for liblustre]),
1569 [],[enable_liblustre_acl=yes])
1570 if test x$enable_liblustre != xyes ; then
1571 enable_liblustre_acl='no'
1573 AC_MSG_RESULT([$enable_liblustre_acl])
1574 if test x$enable_liblustre_acl != xno ; then
1575 AC_DEFINE(LIBLUSTRE_POSIX_ACL, 1, Liblustre Support ACL-enabled MDS)
1578 AC_MSG_CHECKING([whether to build mpitests])
1579 AC_ARG_ENABLE([mpitests],
1580 AC_HELP_STRING([--enable-mpitests],
1581 [build liblustre mpi tests]),
1582 [],[enable_mpitests=no])
1583 AC_MSG_RESULT([$enable_mpitests])
1585 AC_MSG_NOTICE([Enabling Lustre configure options for libsysio])
1586 ac_configure_args="$ac_configure_args --with-lustre-hack --with-sockets"
1589 LC_CONFIG_LIBLUSTRE_RECOVERY
1592 AC_DEFUN([LC_CONFIG_LRU_RESIZE],
1593 [AC_MSG_CHECKING([whether to enable lru self-adjusting])
1594 AC_ARG_ENABLE([lru_resize],
1595 AC_HELP_STRING([--enable-lru-resize],
1596 [enable lru resize support]),
1597 [],[enable_lru_resize='yes'])
1598 AC_MSG_RESULT([$enable_lru_resize])
1599 if test x$enable_lru_resize != xno; then
1600 AC_DEFINE(HAVE_LRU_RESIZE_SUPPORT, 1, [Enable lru resize support])
1607 # whether to enable quota support
1609 AC_DEFUN([LC_CONFIG_QUOTA],
1610 [AC_MSG_CHECKING([whether to disable quota support])
1611 AC_ARG_ENABLE([quota],
1612 AC_HELP_STRING([--disable-quota],
1613 [disable quota support]),
1614 [],[enable_quota='yes'])
1615 AC_MSG_RESULT([$enable_quota])
1616 if test x$linux25 != xyes; then
1619 if test x$enable_quota != xno; then
1620 AC_DEFINE(HAVE_QUOTA_SUPPORT, 1, [Enable quota support])
1627 # whether to enable split support
1629 AC_DEFUN([LC_CONFIG_SPLIT],
1630 [AC_MSG_CHECKING([whether to enable split support])
1631 AC_ARG_ENABLE([split],
1632 AC_HELP_STRING([--enable-split],
1633 [enable split support]),
1634 [],[enable_split='no'])
1635 AC_MSG_RESULT([$enable_split])
1636 if test x$enable_split != xno; then
1637 AC_DEFINE(HAVE_SPLIT_SUPPORT, 1, [enable split support])
1641 AC_DEFUN([LC_QUOTA_READ],
1642 [AC_MSG_CHECKING([if kernel supports quota_read])
1643 LB_LINUX_TRY_COMPILE([
1644 #include <linux/fs.h>
1646 struct super_operations sp;
1647 void *i = (void *)sp.quota_read;
1649 AC_MSG_RESULT([yes])
1650 AC_DEFINE(KERNEL_SUPPORTS_QUOTA_READ, 1, [quota_read found])
1657 # LC_COOKIE_FOLLOW_LINK
1659 # kernel 2.6.13+ ->follow_link returns a cookie
1662 AC_DEFUN([LC_COOKIE_FOLLOW_LINK],
1663 [AC_MSG_CHECKING([if inode_operations->follow_link returns a cookie])
1664 LB_LINUX_TRY_COMPILE([
1665 #include <linux/fs.h>
1666 #include <linux/namei.h>
1668 struct dentry dentry;
1669 struct nameidata nd;
1671 dentry.d_inode->i_op->put_link(&dentry, &nd, NULL);
1673 AC_DEFINE(HAVE_COOKIE_FOLLOW_LINK, 1, [inode_operations->follow_link returns a cookie])
1674 AC_MSG_RESULT([yes])
1683 # kernels prior than 2.6.0(?) have no RCU supported; in kernel 2.6.5(SUSE),
1684 # call_rcu takes three parameters.
1686 AC_DEFUN([LC_FUNC_RCU],
1687 [AC_MSG_CHECKING([if kernel have RCU supported])
1688 LB_LINUX_TRY_COMPILE([
1689 #include <linux/rcupdate.h>
1691 AC_DEFINE(HAVE_RCU, 1, [have RCU defined])
1692 AC_MSG_RESULT([yes])
1694 AC_MSG_CHECKING([if call_rcu takes three parameters])
1695 LB_LINUX_TRY_COMPILE([
1696 #include <linux/rcupdate.h>
1699 call_rcu(&rh, (void (*)(struct rcu_head *))1, NULL);
1701 AC_DEFINE(HAVE_CALL_RCU_PARAM, 1, [call_rcu takes three parameters])
1702 AC_MSG_RESULT([yes])
1714 # other configure checks
1716 AC_DEFUN([LC_CONFIGURE],
1717 [LC_CONFIG_OBD_BUFFER_SIZE
1719 # include/liblustre.h
1720 AC_CHECK_HEADERS([asm/page.h sys/user.h sys/vfs.h stdint.h blkid/blkid.h])
1722 # include/lustre/lustre_user.h
1723 # See note there re: __ASM_X86_64_PROCESSOR_H
1724 AC_CHECK_HEADERS([linux/fs.h linux/quota.h])
1726 # liblustre/llite_lib.h
1727 AC_CHECK_HEADERS([xtio.h file.h])
1730 AC_CHECK_HEADERS([linux/types.h sys/types.h linux/unistd.h unistd.h])
1733 AC_CHECK_HEADERS([netinet/in.h arpa/inet.h catamount/data.h])
1734 AC_CHECK_FUNCS([inet_ntoa])
1736 # libsysio/src/readlink.c
1740 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
1743 AC_ARG_ENABLE([mindf],
1744 AC_HELP_STRING([--enable-mindf],
1745 [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
1747 if test "$enable_mindf" = "yes" ; then
1748 AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])
1751 AC_ARG_ENABLE([fail_alloc],
1752 AC_HELP_STRING([--disable-fail-alloc],
1753 [disable randomly alloc failure]),
1754 [],[enable_fail_alloc=yes])
1755 AC_MSG_CHECKING([whether to randomly failing memory alloc])
1756 AC_MSG_RESULT([$enable_fail_alloc])
1757 if test x$enable_fail_alloc != xno ; then
1758 AC_DEFINE([RANDOM_FAIL_ALLOC], 1, [enable randomly alloc failure])
1766 # AM_CONDITIONALS for lustre
1768 AC_DEFUN([LC_CONDITIONALS],
1769 [AM_CONDITIONAL(LIBLUSTRE, test x$enable_liblustre = xyes)
1770 AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno)
1771 AM_CONDITIONAL(LIBLUSTRE_TESTS, test x$enable_liblustre_tests = xyes)
1772 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
1773 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
1774 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
1775 AM_CONDITIONAL(QUOTA, test x$enable_quota = xyes)
1776 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
1777 AM_CONDITIONAL(BLKID, test x$ac_cv_header_blkid_blkid_h = xyes)
1778 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
1779 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
1780 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
1781 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
1782 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
1788 # files that should be generated with AC_OUTPUT
1790 AC_DEFUN([LC_CONFIG_FILES],
1794 lustre/autoconf/Makefile
1795 lustre/contrib/Makefile
1797 lustre/include/Makefile
1798 lustre/include/lustre_ver.h
1799 lustre/include/linux/Makefile
1800 lustre/include/lustre/Makefile
1801 lustre/kernel_patches/targets/2.6-vanilla.target
1802 lustre/kernel_patches/targets/2.6-rhel4.target
1803 lustre/kernel_patches/targets/2.6-rhel5.target
1804 lustre/kernel_patches/targets/2.6-fc5.target
1805 lustre/kernel_patches/targets/2.6-patchless.target
1806 lustre/kernel_patches/targets/2.6-sles10.target
1807 lustre/ldlm/Makefile
1809 lustre/fid/autoMakefile
1810 lustre/liblustre/Makefile
1811 lustre/liblustre/tests/Makefile
1812 lustre/llite/Makefile
1813 lustre/llite/autoMakefile
1815 lustre/lov/autoMakefile
1816 lustre/lvfs/Makefile
1817 lustre/lvfs/autoMakefile
1819 lustre/mdc/autoMakefile
1821 lustre/lmv/autoMakefile
1823 lustre/mds/autoMakefile
1825 lustre/mdt/autoMakefile
1827 lustre/cmm/autoMakefile
1829 lustre/mdd/autoMakefile
1831 lustre/fld/autoMakefile
1832 lustre/obdclass/Makefile
1833 lustre/obdclass/autoMakefile
1834 lustre/obdclass/linux/Makefile
1835 lustre/obdecho/Makefile
1836 lustre/obdecho/autoMakefile
1837 lustre/obdfilter/Makefile
1838 lustre/obdfilter/autoMakefile
1840 lustre/osc/autoMakefile
1842 lustre/ost/autoMakefile
1844 lustre/osd/autoMakefile
1846 lustre/mgc/autoMakefile
1848 lustre/mgs/autoMakefile
1849 lustre/ptlrpc/Makefile
1850 lustre/ptlrpc/autoMakefile
1851 lustre/ptlrpc/gss/Makefile
1852 lustre/ptlrpc/gss/autoMakefile
1853 lustre/quota/Makefile
1854 lustre/quota/autoMakefile
1855 lustre/scripts/Makefile
1856 lustre/scripts/version_tag.pl
1857 lustre/tests/Makefile
1858 lustre/utils/Makefile
1859 lustre/utils/gss/Makefile
1861 case $lb_target_os in
1863 AC_CONFIG_FILES([ lustre/obdclass/darwin/Makefile ])