4 # Wrapper for AC_CONFIG_SUBDIR
6 AC_DEFUN([LC_CONFIG_SRCDIR],
7 [AC_CONFIG_SRCDIR([lustre/obdclass/obdo.c])
15 # lustre specific paths
17 AC_DEFUN([LC_PATH_DEFAULTS],
18 [# ptlrpc kernel build requires this
23 rootsbindir='$(CROSS_PATH)/sbin'
26 demodir='$(docdir)/demo'
29 pkgexampledir='${pkgdatadir}/examples'
30 AC_SUBST(pkgexampledir)
36 # is the target os supported?
38 AC_DEFUN([LC_TARGET_SUPPORTED],
50 # LC_CONFIG_OBD_BUFFER_SIZE
52 # the maximum buffer size of lctl ioctls
54 AC_DEFUN([LC_CONFIG_OBD_BUFFER_SIZE],
55 [AC_MSG_CHECKING([maximum OBD ioctl size])
56 AC_ARG_WITH([obd-buffer-size],
57 AC_HELP_STRING([--with-obd-buffer-size=[size]],
58 [set lctl ioctl maximum bytes (default=8192)]),
60 OBD_BUFFER_SIZE=$with_obd_buffer_size
64 AC_MSG_RESULT([$OBD_BUFFER_SIZE bytes])
65 AC_DEFINE_UNQUOTED(CONFIG_LUSTRE_OBD_MAX_IOCTL_BUFFER, $OBD_BUFFER_SIZE, [IOCTL Buffer Size])
71 AC_DEFUN([LC_READLINK_SSIZE_T],
72 [AC_MSG_CHECKING([if readlink returns ssize_t])
76 ssize_t readlink(const char *, char *, size_t);
79 AC_DEFINE(HAVE_POSIX_1003_READLINK, 1, [readlink returns ssize_t])
85 AC_DEFUN([LC_GLIBC_SUPPORT_FHANDLES],
86 [AC_CHECK_FUNCS([name_to_handle_at],[
87 AC_DEFINE(HAVE_FHANDLE_GLIBC_SUPPORT, 1,
88 [file handle and related syscalls are supported])
90 AC_MSG_WARN([file handle and related syscalls are not supported])
95 # LC_FUNC_DEV_SET_RDONLY
97 # check whether dev_set_rdonly is exported. This is needed until we
98 # have another mechanism to fence IO from the underlying device.
100 AC_DEFUN([LC_FUNC_DEV_SET_RDONLY],
101 [LB_CHECK_SYMBOL_EXPORT([dev_set_rdonly],
102 [block/ll_rw_block.c,block/blk-core.c],[
103 AC_DEFINE(HAVE_DEV_SET_RDONLY, 1, [kernel exports dev_set_rdonly])
105 AC_MSG_WARN([kernel missing dev_set_rdonly patch for testing])
110 # Ensure stack size big than 8k in Lustre server (all kernels)
112 AC_DEFUN([LC_STACK_SIZE],
113 [AC_MSG_CHECKING([stack size big than 8k])
114 LB_LINUX_TRY_COMPILE([
115 #include <linux/thread_info.h>
117 #if THREAD_SIZE < 8192
118 #error "stack size < 8192"
123 AC_MSG_ERROR([Lustre requires that Linux is configured with at least a 8KB stack.])
128 # Allow the user to set the MDS thread upper limit
130 AC_DEFUN([LC_MDS_MAX_THREADS],
132 AC_ARG_WITH([mds_max_threads],
133 AC_HELP_STRING([--with-mds-max-threads=count],
134 [maximum threads available on the MDS: (default=512)]),
136 MDS_THREAD_COUNT=$with_mds_max_threads
137 AC_DEFINE_UNQUOTED(MDS_MAX_THREADS, $MDS_THREAD_COUNT, [maximum number of MDS threads])
144 # the pinger is temporary, until we have the recovery node in place
146 AC_DEFUN([LC_CONFIG_PINGER],
147 [AC_MSG_CHECKING([whether to enable pinger support])
148 AC_ARG_ENABLE([pinger],
149 AC_HELP_STRING([--disable-pinger],
150 [disable recovery pinger support]),
151 [],[enable_pinger='yes'])
152 AC_MSG_RESULT([$enable_pinger])
153 if test x$enable_pinger != xno ; then
154 AC_DEFINE(ENABLE_PINGER, 1, Use the Pinger)
161 # do checksum of bulk data between client and OST
163 AC_DEFUN([LC_CONFIG_CHECKSUM],
164 [AC_MSG_CHECKING([whether to enable data checksum support])
165 AC_ARG_ENABLE([checksum],
166 AC_HELP_STRING([--disable-checksum],
167 [disable data checksum support]),
168 [],[enable_checksum='yes'])
169 AC_MSG_RESULT([$enable_checksum])
170 if test x$enable_checksum != xno ; then
171 AC_DEFINE(ENABLE_CHECKSUM, 1, do data checksums)
176 # LC_CONFIG_LIBLUSTRE_RECOVERY
178 AC_DEFUN([LC_CONFIG_LIBLUSTRE_RECOVERY],
179 [AC_MSG_CHECKING([whether to enable liblustre recovery support])
180 AC_ARG_ENABLE([liblustre-recovery],
181 AC_HELP_STRING([--disable-liblustre-recovery],
182 [disable liblustre recovery support]),
183 [],[enable_liblustre_recovery='yes'])
184 AC_MSG_RESULT([$enable_liblustre_recovery])
185 if test x$enable_liblustre_recovery != xno ; then
186 AC_DEFINE(ENABLE_LIBLUSTRE_RECOVERY, 1, Liblustre Can Recover)
191 # LC_CONFIG_HEALTH_CHECK_WRITE
193 # Turn off the actual write to the disk
195 AC_DEFUN([LC_CONFIG_HEALTH_CHECK_WRITE],
196 [AC_MSG_CHECKING([whether to enable a write with the health check])
197 AC_ARG_ENABLE([health_write],
198 AC_HELP_STRING([--enable-health_write],
199 [enable disk writes when doing health check]),
200 [],[enable_health_write='no'])
201 AC_MSG_RESULT([$enable_health_write])
202 if test x$enable_health_write != xno ; then
203 AC_DEFINE(USE_HEALTH_CHECK_WRITE, 1, Write when Checking Health)
207 AC_DEFUN([LC_CONFIG_LRU_RESIZE],
208 [AC_MSG_CHECKING([whether to enable lru self-adjusting])
209 AC_ARG_ENABLE([lru_resize],
210 AC_HELP_STRING([--enable-lru-resize],
211 [enable lru resize support]),
212 [],[enable_lru_resize='yes'])
213 AC_MSG_RESULT([$enable_lru_resize])
214 if test x$enable_lru_resize != xno; then
215 AC_DEFINE(HAVE_LRU_RESIZE_SUPPORT, 1, [Enable lru resize support])
220 # Quota support. The kernel must support CONFIG_QUOTA.
222 AC_DEFUN([LC_QUOTA_CONFIG],
223 [LB_LINUX_CONFIG_IM([QUOTA],[],[
224 AC_MSG_ERROR([Lustre quota requires that CONFIG_QUOTA is enabled in your kernel.])
228 # truncate_complete_page() has never been exported from an upstream kernel
229 # remove_from_page_cache() was exported between 2.6.35 and 2.6.38
230 # delete_from_page_cache() is exported from 2.6.39
231 AC_DEFUN([LC_EXPORT_TRUNCATE_COMPLETE_PAGE],
232 [LB_CHECK_SYMBOL_EXPORT([truncate_complete_page],
234 [AC_DEFINE(HAVE_TRUNCATE_COMPLETE_PAGE, 1,
235 [kernel export truncate_complete_page])])
236 LB_CHECK_SYMBOL_EXPORT([remove_from_page_cache],
238 [AC_DEFINE(HAVE_REMOVE_FROM_PAGE_CACHE, 1,
239 [kernel export remove_from_page_cache])])
240 LB_CHECK_SYMBOL_EXPORT([delete_from_page_cache],
242 [AC_DEFINE(HAVE_DELETE_FROM_PAGE_CACHE, 1,
243 [kernel export delete_from_page_cache])])
249 AC_DEFUN([LC_CAPA_CRYPTO],
250 [LB_LINUX_CONFIG_IM([CRYPTO],[],[
251 AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO is enabled in your kernel.])
253 LB_LINUX_CONFIG_IM([CRYPTO_HMAC],[],[
254 AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_HMAC is enabled in your kernel.])
256 LB_LINUX_CONFIG_IM([CRYPTO_SHA1],[],[
257 AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_SHA1 is enabled in your kernel.])
262 # LC_CONFIG_RMTCLIENT
265 dnl the AES symbol usually tied with arch, e.g. CRYPTO_AES_586
267 AC_DEFUN([LC_CONFIG_RMTCLIENT],
268 [LB_LINUX_CONFIG_IM([CRYPTO_AES],[],[
271 Lustre remote client require that CONFIG_CRYPTO_AES is enabled in your kernel.
277 # LC_CONFIG_GSS_KEYRING (default 'auto', tests for dependencies, if found, enables; only called if gss is enabled)
279 AC_DEFUN([LC_CONFIG_GSS_KEYRING],
280 [AC_MSG_CHECKING([whether to enable gss keyring backend])
281 AC_ARG_ENABLE([gss_keyring],
282 [AC_HELP_STRING([--disable-gss-keyring],
283 [disable gss keyring backend])],
284 [],[enable_gss_keyring='auto'])
285 AC_MSG_RESULT([$enable_gss_keyring])
287 if test x$enable_gss_keyring != xno; then
288 LB_LINUX_CONFIG_IM([KEYS],[],
289 [gss_keyring_conf_test='fail';
292 GSS keyring backend require that CONFIG_KEYS be enabled in your kernel.
295 AC_CHECK_LIB([keyutils], [keyctl_search], [],
296 [gss_keyring_conf_test='fail';
299 libkeyutils is not found, which is required by gss keyring backend
302 if test x$gss_keyring_conf_test != xfail; then
303 AC_DEFINE([HAVE_GSS_KEYRING], [1], [Define this if you enable gss keyring backend])
304 enable_gss_keyring='yes'
306 if test x$enable_gss_keyring == xyes; then
309 Cannot enable gss_keyring. See above for details.
314 Cannot enable gss keyring. See above for details.
321 AC_DEFUN([LC_CONFIG_SUNRPC],
322 [LB_LINUX_CONFIG_IM([SUNRPC],[],
323 [if test x$sunrpc_required == xyes; then
326 kernel SUNRPC support is required by using GSS.
332 # LC_CONFIG_GSS (default 'auto' (tests for dependencies, if found, enables))
334 # Build gss and related tools of Lustre. Currently both kernel and user space
335 # parts are depend on linux platform.
337 AC_DEFUN([LC_CONFIG_GSS],
338 [AC_MSG_CHECKING([whether to enable gss/krb5 support])
340 [AC_HELP_STRING([--enable-gss], [enable gss/krb5 support])],
341 [],[enable_gss='auto'])
342 AC_MSG_RESULT([$enable_gss])
344 if test x$enable_gss != xno; then
345 LC_CONFIG_GSS_KEYRING
346 sunrpc_required=$enable_gss
350 LB_LINUX_CONFIG_IM([CRYPTO_MD5],[],
351 [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
352 LB_LINUX_CONFIG_IM([CRYPTO_SHA1],[],
353 [AC_MSG_WARN([kernel SHA1 support is recommended by using GSS.])])
354 LB_LINUX_CONFIG_IM([CRYPTO_SHA256],[],
355 [AC_MSG_WARN([kernel SHA256 support is recommended by using GSS.])])
356 LB_LINUX_CONFIG_IM([CRYPTO_SHA512],[],
357 [AC_MSG_WARN([kernel SHA512 support is recommended by using GSS.])])
359 require_krb5=$enable_gss
363 if test x$KRBDIR != x; then
364 AC_CHECK_LIB([gssapi], [gss_export_lucid_sec_context],
365 [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi";
366 gss_conf_test='success'],
367 [AC_CHECK_LIB([gssglue], [gss_export_lucid_sec_context],
368 [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssglue";
369 gss_conf_test='success'],
370 [if test x$enable_gss == xyes; then
373 libgssapi or libgssglue is not found, which is required by GSS.
378 libgssapi or libgssglue is not found, which is required by GSS.
381 AC_SUBST(GSSAPI_LIBS)
384 if test x$gss_conf_test == xsuccess; then
385 AC_DEFINE([HAVE_GSS], [1], [Define this is if you enable gss])
392 # up to v2.6.27 had a 3 arg version (inode, mask, nameidata)
393 # v2.6.27->v2.6.37 had a 2 arg version (inode, mask)
394 # v2.6.37->v3.0 had a 3 arg version (inode, mask, nameidata)
395 # v3.1 onward have a 2 arg version (inode, mask)
396 AC_DEFUN([LC_INODE_PERMISION_2ARGS],
397 [AC_MSG_CHECKING([inode_operations->permission has two args])
398 LB_LINUX_TRY_COMPILE([
399 #include <linux/fs.h>
401 struct inode *inode __attribute__ ((unused));
404 inode->i_op->permission(NULL, 0);
406 AC_DEFINE(HAVE_INODE_PERMISION_2ARGS, 1,
407 [inode_operations->permission has two args])
414 # 2.6.32 replaces 2 functions blk_queue_max_phys_segments and blk_queue_max_hw_segments by blk_queue_max_segments
415 AC_DEFUN([LC_BLK_QUEUE_MAX_SEGMENTS],
416 [AC_MSG_CHECKING([if blk_queue_max_segments is defined])
417 LB_LINUX_TRY_COMPILE([
418 #include <linux/blkdev.h>
420 blk_queue_max_segments(NULL, 0);
423 AC_DEFINE(HAVE_BLK_QUEUE_MAX_SEGMENTS, 1,
424 [blk_queue_max_segments is defined])
430 # 2.6.34 has quotactl_ops->[sg]et_dqblk that take struct fs_disk_quota
431 AC_DEFUN([LC_HAVE_DQUOT_FS_DISK_QUOTA],
432 tmp_flags="$EXTRA_KCFLAGS"
433 EXTRA_KCFLAGS="-Werror"
434 [AC_MSG_CHECKING([if quotactl_ops.set_dqblk takes struct fs_disk_quota])
435 LB_LINUX_TRY_COMPILE([
436 #include <linux/fs.h>
437 #include <linux/quota.h>
439 ((struct quotactl_ops *)0)->set_dqblk(NULL, 0, 0, (struct fs_disk_quota*)0);
441 AC_DEFINE(HAVE_DQUOT_FS_DISK_QUOTA, 1, [quotactl_ops.set_dqblk takes struct fs_disk_quota])
445 AC_MSG_CHECKING([if quotactl_ops.set_dqblk takes struct kqid & fs_disk_quota])
446 LB_LINUX_TRY_COMPILE([
447 #include <linux/fs.h>
448 #include <linux/quota.h>
450 ((struct quotactl_ops *)0)->set_dqblk((struct super_block*)0, *((struct kqid*)0), (struct fs_disk_quota*)0);
452 AC_DEFINE(HAVE_DQUOT_FS_DISK_QUOTA, 1, [quotactl_ops.set_dqblk takes struct fs_disk_quota])
453 AC_DEFINE(HAVE_DQUOT_KQID, 1, [quotactl_ops.set_dqblk takes struct kqid])
459 EXTRA_KCFLAGS="$tmp_flags"
462 # 2.6.34 has renamed dquot options to dquot_*, check for dquot_suspend
463 AC_DEFUN([LC_HAVE_DQUOT_SUSPEND],
464 [AC_MSG_CHECKING([if dquot_suspend is defined])
465 LB_LINUX_TRY_COMPILE([
466 #include <linux/quotaops.h>
468 dquot_suspend(NULL, -1);
470 AC_DEFINE(HAVE_DQUOT_SUSPEND, 1, [dquot_suspend is defined])
480 # Check if kernel has been patched for 64-bit quota limits support.
481 # The upstream version of this patch in RHEL6 2.6.32 kernels introduces
482 # the constant QFMT_VFS_V1 in include/linux/quota.h, so we can check for
483 # that in the absence of quotaio_v1.h in the kernel headers.
485 AC_DEFUN([LC_QUOTA64],[
486 AC_MSG_CHECKING([if kernel has 64-bit quota limits support])
487 tmp_flags="$EXTRA_KCFLAGS"
488 EXTRA_KCFLAGS="-I$LINUX/fs"
489 LB_LINUX_TRY_COMPILE([
490 #include <linux/kernel.h>
491 #include <linux/fs.h>
492 #if defined(HAVE_FS_QUOTA_QUOTAIO_H)
493 # include <quota/quotaio_v2.h>
494 struct v2r1_disk_dqblk dqblk_r1;
496 #include <linux/quota.h>
497 int ver = QFMT_VFS_V1;
500 AC_DEFINE(HAVE_QUOTA64, 1, [have quota64])
503 LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],[
504 AC_MSG_ERROR([You have got no 64-bit kernel quota support.])
508 EXTRA_KCFLAGS=$tmp_flags
512 # 2.6.36 fs_struct.lock use spinlock instead of rwlock.
514 AC_DEFUN([LC_FS_STRUCT_RWLOCK],
515 [AC_MSG_CHECKING([if fs_struct.lock use rwlock])
516 LB_LINUX_TRY_COMPILE([
517 #include <asm/atomic.h>
518 #include <linux/spinlock.h>
519 #include <linux/fs_struct.h>
521 ((struct fs_struct *)0)->lock = (rwlock_t){ 0 };
523 AC_DEFINE(HAVE_FS_STRUCT_RWLOCK, 1,
524 [fs_struct.lock use rwlock])
532 # 2.6.36 super_operations add evict_inode method. it hybird of
533 # delete_inode & clear_inode.
535 AC_DEFUN([LC_SBOPS_EVICT_INODE],
536 [AC_MSG_CHECKING([if super_operations.evict_inode exist])
537 LB_LINUX_TRY_COMPILE([
538 #include <linux/fs.h>
540 ((struct super_operations *)0)->evict_inode(NULL);
542 AC_DEFINE(HAVE_SBOPS_EVICT_INODE, 1,
543 [super_operations.evict_inode() is exist in kernel])
551 # 2.6.35 file_operations.fsync taken 2 arguments.
552 # 3.0.0 file_operations.fsync takes 4 arguments.
554 AC_DEFUN([LC_FILE_FSYNC],
555 [AC_MSG_CHECKING([if file_operations.fsync takes 4 or 2 arguments])
556 LB_LINUX_TRY_COMPILE([
557 #include <linux/fs.h>
559 ((struct file_operations *)0)->fsync(NULL, 0, 0, 0);
561 AC_DEFINE(HAVE_FILE_FSYNC_4ARGS, 1,
562 [file_operations.fsync takes 4 arguments])
563 AC_MSG_RESULT([yes, 4 args])
565 LB_LINUX_TRY_COMPILE([
566 #include <linux/fs.h>
568 ((struct file_operations *)0)->fsync(NULL, 0);
570 AC_DEFINE(HAVE_FILE_FSYNC_2ARGS, 1,
571 [file_operations.fsync takes 2 arguments])
572 AC_MSG_RESULT([yes, 2 args])
580 # 2.6.37 remove kernel_locked
582 AC_DEFUN([LC_KERNEL_LOCKED],
583 [AC_MSG_CHECKING([if kernel_locked is defined])
584 LB_LINUX_TRY_COMPILE([
585 #include <linux/smp_lock.h>
590 AC_DEFINE(HAVE_KERNEL_LOCKED, 1,
591 [kernel_locked is defined])
598 # 2.6.38 dentry_operations.d_compare() taken 7 arguments.
600 AC_DEFUN([LC_D_COMPARE_7ARGS],
601 [AC_MSG_CHECKING([if d_compare taken 7 arguments])
602 LB_LINUX_TRY_COMPILE([
603 #include <linux/dcache.h>
605 ((struct dentry_operations*)0)->d_compare(NULL,NULL,NULL,NULL,0,NULL,NULL);
607 AC_DEFINE(HAVE_D_COMPARE_7ARGS, 1,
608 [d_compare need 7 arguments])
616 # 2.6.38 dentry_operations.d_delete() defined 'const' for 1st parameter.
618 AC_DEFUN([LC_D_DELETE_CONST],
619 [AC_MSG_CHECKING([if d_delete has const declare on first parameter])
620 tmp_flags="$EXTRA_KCFLAGS"
621 EXTRA_KCFLAGS="-Werror"
622 LB_LINUX_TRY_COMPILE([
623 #include <linux/dcache.h>
625 const struct dentry *d = NULL;
626 ((struct dentry_operations*)0)->d_delete(d);
628 AC_DEFINE(HAVE_D_DELETE_CONST, const,
629 [d_delete first parameter declared const])
632 AC_DEFINE(HAVE_D_DELETE_CONST, , [])
635 EXTRA_KCFLAGS="$tmp_flags"
639 # 2.6.38 dcache_lock removed. rcu-walk commited.
641 AC_DEFUN([LC_DCACHE_LOCK],
642 [AC_MSG_CHECKING([if dcache_lock is exist])
643 LB_LINUX_TRY_COMPILE([
644 #include <linux/dcache.h>
646 spin_lock(&dcache_lock);
648 AC_DEFINE(HAVE_DCACHE_LOCK, 1,
649 [dcache_lock is exist])
657 # 2.6.38 inode.i_rcu added.
659 AC_DEFUN([LC_INODE_I_RCU],
660 [AC_MSG_CHECKING([if inode.i_rcu exists])
661 LB_LINUX_TRY_COMPILE([
662 #include <linux/fs.h>
665 struct rcu_head rcu = {};
668 AC_DEFINE(HAVE_INODE_I_RCU, 1,
669 [inode.i_rcu exists])
677 # 2.6.38 export blkdev_get_by_dev
679 AC_DEFUN([LC_BLKDEV_GET_BY_DEV],
680 [LB_CHECK_SYMBOL_EXPORT([blkdev_get_by_dev],
682 AC_DEFINE(HAVE_BLKDEV_GET_BY_DEV, 1,
683 [blkdev_get_by_dev is exported by the kernel])
689 # 2.6.38 export simple_setattr
691 AC_DEFUN([LC_EXPORT_SIMPLE_SETATTR],
692 [LB_CHECK_SYMBOL_EXPORT([simple_setattr],
694 AC_DEFINE(HAVE_SIMPLE_SETATTR, 1,
695 [simple_setattr is exported by the kernel])
701 # truncate callback removed since 2.6.39
703 AC_DEFUN([LC_IOP_TRUNCATE],
704 [AC_MSG_CHECKING([inode_operations has .truncate member function])
705 LB_LINUX_TRY_COMPILE([
706 #include <linux/fs.h>
708 ((struct inode_operations *)0)->truncate(NULL);
710 AC_DEFINE(HAVE_INODEOPS_TRUNCATE, 1,
711 [inode_operations has .truncate member function])
719 # 2.6.39 remove unplug_fn from request_queue.
721 AC_DEFUN([LC_REQUEST_QUEUE_UNPLUG_FN],
722 [AC_MSG_CHECKING([if request_queue has unplug_fn field])
723 LB_LINUX_TRY_COMPILE([
724 #include <linux/blkdev.h>
726 do{ }while(sizeof(((struct request_queue *)0)->unplug_fn));
728 AC_DEFINE(HAVE_REQUEST_QUEUE_UNPLUG_FN, 1,
729 [request_queue has unplug_fn field])
737 # 2.6.39 replace get_sb with mount in struct file_system_type
739 AC_DEFUN([LC_HAVE_FSTYPE_MOUNT],
740 [AC_MSG_CHECKING([if file_system_type has mount field])
741 LB_LINUX_TRY_COMPILE([
742 #include <linux/fs.h>
744 struct file_system_type fst;
745 void *i = (void *) fst.mount;
747 AC_DEFINE(HAVE_FSTYPE_MOUNT, 1,
748 [struct file_system_type has mount field])
756 # 2.6.39 The open_by_handle_at() and name_to_handle_at() system calls were
757 # added to Linux kernel 2.6.39.
758 # Check if client supports these functions
760 AC_DEFUN([LC_HAVE_FHANDLE_SYSCALLS],
761 [LB_LINUX_CONFIG_IM([FHANDLE],[
762 AC_DEFINE(HAVE_FHANDLE_SYSCALLS, 1,
763 [kernel supports fhandles and related syscalls])
768 # 2.6.39 renames is_owner_or_cap to inode_owner_or_capable
770 AC_DEFUN([LC_HAVE_INODE_OWNER_OR_CAPABLE],
771 [AC_MSG_CHECKING([if inode_owner_or_capable exist])
772 LB_LINUX_TRY_COMPILE([
773 #include <linux/fs.h>
775 inode_owner_or_capable(NULL);
777 AC_DEFINE(HAVE_INODE_OWNER_OR_CAPABLE, 1,
778 [inode_owner_or_capable exist])
786 # 3.0 dirty_inode() has a flag parameter
787 # see kernel commit aa38572954ade525817fe88c54faebf85e5a61c0
789 AC_DEFUN([LC_DIRTY_INODE_WITH_FLAG],
790 [AC_MSG_CHECKING([if dirty_inode super_operation takes flag])
791 LB_LINUX_TRY_COMPILE([
792 #include <linux/fs.h>
795 inode->i_sb->s_op->dirty_inode(NULL, 0);
797 AC_DEFINE(HAVE_DIRTY_INODE_HAS_FLAG, 1,
798 [dirty_inode super_operation takes flag])
806 # 2.6.38 generic_permission taken 4 parameters.
807 # in fact, it means rcu-walk aware permission bring.
809 # 3.1 generic_permission taken 2 parameters.
810 # see kernel commit 2830ba7f34ebb27c4e5b8b6ef408cd6d74860890
812 AC_DEFUN([LC_GENERIC_PERMISSION],
813 [AC_MSG_CHECKING([if generic_permission take 2 or 4 arguments])
814 LB_LINUX_TRY_COMPILE([
815 #include <linux/fs.h>
817 generic_permission(NULL, 0);
819 AC_DEFINE(HAVE_GENERIC_PERMISSION_2ARGS, 1,
820 [generic_permission taken 2 arguments])
821 AC_MSG_RESULT([yes, 2 args])
823 LB_LINUX_TRY_COMPILE([
824 #include <linux/fs.h>
826 generic_permission(NULL, 0, 0, NULL);
828 AC_DEFINE(HAVE_GENERIC_PERMISSION_4ARGS, 1,
829 [generic_permission taken 4 arguments])
830 AC_MSG_RESULT([yes, 4 args])
838 # 3.1 renames lock-manager ops(lock_manager_operations) from fl_xxx to lm_xxx
839 # see kernel commit 8fb47a4fbf858a164e973b8ea8ef5e83e61f2e50
841 AC_DEFUN([LC_LM_XXX_LOCK_MANAGER_OPS],
842 [AC_MSG_CHECKING([if lock-manager ops renamed to lm_xxx])
843 LB_LINUX_TRY_COMPILE([
844 #include <linux/fs.h>
846 struct lock_manager_operations lm_ops;
847 lm_ops.lm_compare_owner = NULL;
849 AC_DEFINE(HAVE_LM_XXX_LOCK_MANAGER_OPS, 1,
850 [lock-manager ops renamed to lm_xxx])
858 # 3.1 kills inode->i_alloc_sem, use i_dio_count and inode_dio_wait/
859 # inode_dio_done instead.
860 # see kernel commit bd5fe6c5eb9c548d7f07fe8f89a150bb6705e8e3
862 AC_DEFUN([LC_INODE_DIO_WAIT],
863 [AC_MSG_CHECKING([if inode->i_alloc_sem is killed and use inode_dio_wait/done.])
864 LB_LINUX_TRY_COMPILE([
865 #include <linux/fs.h>
867 inode_dio_wait((struct inode *)0);
868 inode_dio_done((struct inode *)0);
870 AC_DEFINE(HAVE_INODE_DIO_WAIT, 1,
871 [inode->i_alloc_sem is killed and use inode_dio_wait/done])
879 # 3.1 adds get_acl method to inode_operations to read ACL from disk.
880 # see kernel commit 4e34e719e457f2e031297175410fc0bd4016a085
882 AC_DEFUN([LC_IOP_GET_ACL],
883 [AC_MSG_CHECKING([inode_operations has .get_acl member function])
884 LB_LINUX_TRY_COMPILE([
885 #include <linux/fs.h>
887 struct inode_operations iop;
890 AC_DEFINE(HAVE_IOP_GET_ACL, 1,
891 [inode_operations has .get_acl member function])
899 # 3.1 introduced generic_file_llseek_size()
901 AC_DEFUN([LC_FILE_LLSEEK_SIZE],
902 [LB_CHECK_SYMBOL_EXPORT([generic_file_llseek_size],
904 [AC_DEFINE(HAVE_FILE_LLSEEK_SIZE, 1,
905 [generic_file_llseek_size is exported by the kernel])])
909 # 3.2 request_queue.make_request_fn defined as function returns with void
910 # see kernel commit 5a7bbad27a410350e64a2d7f5ec18fc73836c14f
912 AC_DEFUN([LC_HAVE_VOID_MAKE_REQUEST_FN],
913 [AC_MSG_CHECKING([if request_queue.make_request_fn returns void but not int])
914 LB_LINUX_TRY_COMPILE([
915 #include <linux/blkdev.h>
918 make_request_fn *mrf;
919 ret = mrf(NULL, NULL);
923 AC_DEFINE(HAVE_VOID_MAKE_REQUEST_FN, 1,
924 [request_queue.make_request_fn returns void but not int])
930 # 3.2 protects inode->i_nlink from direct modification
931 # see kernel commit a78ef704a8dd430225955f0709b22d4a6ba21deb
932 # at the same time adds set_nlink(), so checks set_nlink() for it.
934 AC_DEFUN([LC_HAVE_PROTECT_I_NLINK],
935 [AC_MSG_CHECKING([if inode->i_nlink is protected from direct modification])
936 LB_LINUX_TRY_COMPILE([
937 #include <linux/fs.h>
942 AC_DEFINE(HAVE_PROTECT_I_NLINK, 1,
943 [inode->i_nlink is protected from direct modification])
951 # 3.3 introduces migrate_mode.h and migratepage has 4 args
953 AC_DEFUN([LC_HAVE_MIGRATE_HEADER],
954 [LB_CHECK_FILE([$LINUX/include/linux/migrate.h],[
955 AC_DEFINE(HAVE_MIGRATE_H, 1,
956 [kernel has include/linux/migrate.h])
957 ],[LB_CHECK_FILE([$LINUX/include/linux/migrate_mode.h],[
958 AC_DEFINE(HAVE_MIGRATE_MODE_H, 1,
959 [kernel has include/linux/migrate_mode.h])
966 AC_DEFUN([LC_MIGRATEPAGE_4ARGS],
967 [AC_MSG_CHECKING([if address_space_operations.migratepage has 4 args])
968 LB_LINUX_TRY_COMPILE([
969 #include <linux/fs.h>
970 #ifdef HAVE_MIGRATE_H
971 #include <linux/migrate.h>
972 #elif defined(HAVE_MIGRATE_MODE_H)
973 #include <linux/migrate_mode.h>
976 struct address_space_operations aops;
978 aops.migratepage(NULL, NULL, NULL, MIGRATE_ASYNC);
980 AC_DEFINE(HAVE_MIGRATEPAGE_4ARGS, 1,
981 [address_space_operations.migratepage has 4 args])
989 # 3.3 switchs super_operations to use dentry as parameter (but not vfsmount)
990 # see kernel commit 34c80b1d93e6e20ca9dea0baf583a5b5510d92d4
992 AC_DEFUN([LC_SUPEROPS_USE_DENTRY],
993 [AC_MSG_CHECKING([if super_operations use dentry as parameter])
994 tmp_flags="$EXTRA_KCFLAGS"
995 EXTRA_KCFLAGS="-Werror"
996 LB_LINUX_TRY_COMPILE([
997 #include <linux/fs.h>
998 int show_options(struct seq_file *seq, struct dentry *root){
1002 struct super_operations ops;
1003 ops.show_options = show_options;
1005 AC_DEFINE(HAVE_SUPEROPS_USE_DENTRY, 1,
1006 [super_operations use dentry as parameter])
1007 AC_MSG_RESULT([yes])
1011 EXTRA_KCFLAGS="$tmp_flags"
1015 # 3.3 switchs inode_operations to use umode_t as parameter (but not int)
1016 # see kernel commit 1a67aafb5f72a436ca044293309fa7e6351d6a35
1018 AC_DEFUN([LC_INODEOPS_USE_UMODE_T],
1019 [AC_MSG_CHECKING([if inode_operations use umode_t as parameter])
1020 tmp_flags="$EXTRA_KCFLAGS"
1021 EXTRA_KCFLAGS="-Werror"
1022 LB_LINUX_TRY_COMPILE([
1023 #include <linux/fs.h>
1024 #include <linux/types.h>
1025 int my_mknod(struct inode *dir, struct dentry *dchild,
1026 umode_t mode, dev_t dev)
1031 struct inode_operations ops;
1032 ops.mknod = my_mknod;
1034 AC_DEFINE(HAVE_INODEOPS_USE_UMODE_T, 1,
1035 [inode_operations use umode_t as parameter])
1036 AC_MSG_RESULT([yes])
1040 EXTRA_KCFLAGS="$tmp_flags"
1043 # 3.4 kmap_atomic removes second argument
1044 # see kernel commit 1ec9c5ddc17aa398f05646abfcbaf315b544e62f
1046 AC_DEFUN([LC_KMAP_ATOMIC_HAS_1ARG],
1047 [AC_MSG_CHECKING([if kmap_atomic has only 1 argument])
1048 LB_LINUX_TRY_COMPILE([
1049 #include <linux/highmem.h>
1053 AC_DEFINE(HAVE_KMAP_ATOMIC_HAS_1ARG, 1,
1054 [have kmap_atomic has only 1 argument])
1055 AC_MSG_RESULT([yes])
1062 # 3.4 converts d_alloc_root to d_make_root
1063 # see kernel commit 32991ab305ace7017c62f8eecbe5eb36dc32e13b
1065 AC_DEFUN([LC_HAVE_D_MAKE_ROOT],
1066 [AC_MSG_CHECKING([if have d_make_root])
1067 LB_LINUX_TRY_COMPILE([
1068 #include <linux/fs.h>
1070 d_make_root((struct inode *)NULL);
1072 AC_DEFINE(HAVE_D_MAKE_ROOT, 1,
1074 AC_MSG_RESULT([yes])
1081 # 3.4 cache_register/cache_unregister are removed
1082 # see kernel commit 2c5f846747526e2b83c5f1b8e69016be0e2e87c0
1083 # Note, since 2.6.37 cache_register_net/cache_unregister_net
1084 # are defined, but not exported.
1085 # 3.3 cache_register_net/cache_unregister_net are
1086 # exported and replacing cache_register/cache_unregister in 3.4
1088 AC_DEFUN([LC_HAVE_CACHE_REGISTER],
1089 [AC_MSG_CHECKING([if have cache_register])
1090 LB_LINUX_TRY_COMPILE([
1091 #include <linux/sunrpc/cache.h>
1093 cache_register(NULL);
1095 AC_DEFINE(HAVE_CACHE_REGISTER, 1,
1096 [have cache_register])
1097 AC_MSG_RESULT([yes])
1104 # 3.5 renames end_writeback() back to clear_inode()...
1105 # see kernel commit dbd5768f87ff6fb0a4fe09c4d7b6c4a24de99430
1107 AC_DEFUN([LC_HAVE_CLEAR_INODE],
1108 [AC_MSG_CHECKING([if have clear_inode])
1109 LB_LINUX_TRY_COMPILE([
1110 #include <linux/fs.h>
1112 clear_inode((struct inode *)NULL);
1114 AC_DEFINE(HAVE_CLEAR_INODE, 1,
1116 AC_MSG_RESULT([yes])
1123 # 3.5 encode_fh has parent inode passed in directly
1124 # see kernel commit b0b0382b
1126 AC_DEFUN([LC_HAVE_ENCODE_FH_PARENT],
1127 [AC_MSG_CHECKING([if encode_fh have parent inode as parameter])
1128 tmp_flags="$EXTRA_KCFLAGS"
1129 EXTRA_KCFLAGS="-Werror"
1130 LB_LINUX_TRY_COMPILE([
1131 #include <linux/exportfs.h>
1132 #include <linux/fs.h>
1133 #include <linux/types.h>
1134 int ll_encode_fh(struct inode *i, __u32 *a, int *b, struct inode *p)
1139 struct export_operations exp_op;
1140 exp_op.encode_fh = ll_encode_fh;
1142 AC_DEFINE(HAVE_ENCODE_FH_PARENT, 1,
1143 [have parent inode as parameter])
1144 AC_MSG_RESULT([yes])
1148 EXTRA_KCFLAGS="$tmp_flags"
1151 # 3.5 has generic_file_llseek_size with 5 args
1152 AC_DEFUN([LC_FILE_LLSEEK_SIZE_5ARG],
1153 [AC_MSG_CHECKING([if kernel has generic_file_llseek_size with 5 args])
1154 LB_LINUX_TRY_COMPILE([
1155 #include <linux/fs.h>
1157 generic_file_llseek_size(NULL, 0, 0, 0, 0);
1159 AC_MSG_RESULT([yes])
1160 AC_DEFINE(HAVE_FILE_LLSEEK_SIZE_5ARGS, 1,
1161 [kernel has generic_file_llseek_size with 5 args])
1168 # 3.6 switch i_dentry/d_alias from list to hlist
1170 AC_DEFUN([LC_HAVE_DENTRY_D_ALIAS_HLIST],
1171 [AC_MSG_CHECKING([if i_dentry/d_alias uses hlist])
1172 tmp_flags="$EXTRA_KCFLAGS"
1173 EXTRA_KCFLAGS="-Werror"
1174 LB_LINUX_TRY_COMPILE([
1175 #include <linux/fs.h>
1176 #include <linux/list.h>
1179 struct dentry dentry;
1180 struct hlist_head head;
1181 struct hlist_node node;
1182 inode.i_dentry = head;
1183 dentry.d_alias = node;
1185 AC_DEFINE(HAVE_DENTRY_D_ALIAS_HLIST, 1,
1186 [have i_dentry/d_alias uses hlist])
1187 AC_MSG_RESULT([yes])
1191 EXTRA_KCFLAGS="$tmp_flags"
1195 # 3.6 dentry_open uses struct path as first argument
1196 # see kernel commit 765927b2
1198 AC_DEFUN([LC_DENTRY_OPEN_USE_PATH],
1199 [AC_MSG_CHECKING([if dentry_open uses struct path as first argument])
1200 tmp_flags="$EXTRA_KCFLAGS"
1201 EXTRA_KCFLAGS="-Werror"
1202 LB_LINUX_TRY_COMPILE([
1203 #include <linux/fs.h>
1204 #include <linux/path.h>
1207 dentry_open(&path, 0, NULL);
1209 AC_DEFINE(HAVE_DENTRY_OPEN_USE_PATH, 1,
1210 [dentry_open uses struct path as first argument])
1211 AC_MSG_RESULT([yes])
1215 EXTRA_KCFLAGS="$tmp_flags"
1219 # 3.6 vfs adds iop->atomic_open
1221 AC_DEFUN([LC_HAVE_IOP_ATOMIC_OPEN],
1222 [AC_MSG_CHECKING([if iop has atomic_open])
1223 LB_LINUX_TRY_COMPILE([
1224 #include <linux/fs.h>
1226 struct inode_operations iop;
1227 iop.atomic_open = NULL;
1229 AC_DEFINE(HAVE_IOP_ATOMIC_OPEN, 1,
1230 [have iop atomic_open])
1231 AC_MSG_RESULT([yes])
1238 # 3.7 posix_acl_{to,from}_xattr take struct user_namespace
1240 AC_DEFUN([LC_HAVE_POSIXACL_USER_NS],
1241 [AC_MSG_CHECKING([if posix_acl_to_xattr takes struct user_namespace])
1242 LB_LINUX_TRY_COMPILE([
1243 #include <linux/fs.h>
1244 #include <linux/posix_acl_xattr.h>
1246 posix_acl_to_xattr((struct user_namespace *)NULL, NULL, NULL, 0);
1248 AC_DEFINE(HAVE_POSIXACL_USER_NS, 1,
1249 [posix_acl_to_xattr takes struct user_namespace])
1250 AC_MSG_RESULT([yes])
1257 # 3.8 struct file has new member f_inode
1259 AC_DEFUN([LC_HAVE_FILE_F_INODE],
1260 [AC_MSG_CHECKING([if struct file has memeber f_inode])
1261 LB_LINUX_TRY_COMPILE([
1262 #include <linux/fs.h>
1264 ((struct file *)0)->f_inode = NULL;
1266 AC_DEFINE(HAVE_FILE_F_INODE, 1,
1267 [struct file has memeber f_inode])
1268 AC_MSG_RESULT([yes])
1274 AC_DEFUN([LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS],
1275 [AC_MSG_CHECKING([if sunrpc_cache_pipe_upcall takes 3 args])
1276 LB_LINUX_TRY_COMPILE([
1277 #include <linux/sunrpc/cache.h>
1279 sunrpc_cache_pipe_upcall(NULL, NULL, NULL);
1281 AC_DEFINE(HAVE_SUNRPC_UPCALL_HAS_3ARGS, 1,
1282 [sunrpc_cache_pipe_upcall takes 3 args])
1283 AC_MSG_RESULT([yes])
1290 # 3.9 uses hlist_for_each_entry with 3 args
1291 # b67bfe0d42cac56c512dd5da4b1b347a23f4b70a
1293 AC_DEFUN([LC_HAVE_HLIST_FOR_EACH_3ARG],
1294 [AC_MSG_CHECKING([if hlist_for_each_entry has 3 args])
1295 LB_LINUX_TRY_COMPILE([
1296 #include <linux/list.h>
1297 #include <linux/fs.h>
1299 struct inode *inode;
1300 struct dentry *dentry;
1301 hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) {
1305 AC_DEFINE(HAVE_HLIST_FOR_EACH_3ARG, 1, [3 args])
1306 AC_MSG_RESULT([yes])
1313 # 3.10+ only supports procfs seq_files handling
1315 AC_DEFUN([LC_HAVE_ONLY_PROCFS_SEQ],
1316 [AC_MSG_CHECKING([if procfs only supports using seq_files])
1317 LB_LINUX_TRY_COMPILE([
1318 #include <linux/proc_fs.h>
1320 ((struct proc_dir_entry *)0)->write_proc(NULL, NULL, 0, NULL);
1324 AC_DEFINE(HAVE_ONLY_PROCFS_SEQ, 1, [only seq_files supported])
1325 AC_MSG_RESULT([yes])
1329 # 3.10 release for block device doesn't return int
1330 AC_DEFUN([LC_BLKDEV_RELEASE_RETURN_INT],
1331 [AC_MSG_CHECKING([if block_device_operations release returns int])
1332 LB_LINUX_TRY_COMPILE([
1333 #include <linux/blkdev.h>
1335 struct block_device_operations fops;
1336 int i __attribute__ ((unused));
1338 i = fops.release(NULL,0);
1340 AC_MSG_RESULT([yes])
1341 AC_DEFINE(HAVE_BLKDEV_RELEASE_RETURN_INT, 1,
1342 [block device release returns int])
1349 # 3.11 invalidatepage requires the length of the range to invalidate
1351 AC_DEFUN([LC_INVALIDATE_RANGE],
1352 [AC_MSG_CHECKING([if address_space_operations.invalidatepage requires 3 arguments])
1353 LB_LINUX_TRY_COMPILE([
1354 #include <linux/fs.h>
1356 struct address_space_operations a_ops;
1358 a_ops.invalidatepage(NULL,0,0);
1360 AC_DEFINE(HAVE_INVALIDATE_RANGE, 1, [address_space_operations.invalidatepage needs 3 arguments])
1361 AC_MSG_RESULT([yes])
1368 # 3.11 readdir now takes the new struct dir_context
1370 AC_DEFUN([LC_HAVE_DIR_CONTEXT],
1371 [AC_MSG_CHECKING([if dir_context exist])
1372 LB_LINUX_TRY_COMPILE([
1373 #include <linux/fs.h>
1375 struct dir_context ctx;
1379 AC_DEFINE(HAVE_DIR_CONTEXT, 1, [dir_context exist])
1380 AC_MSG_RESULT([yes])
1387 # 3.11 dentry_operations.d_compare() taken 5 arguments.
1389 AC_DEFUN([LC_D_COMPARE_5ARGS],
1390 [AC_MSG_CHECKING([if d_compare taken 5 arguments])
1391 LB_LINUX_TRY_COMPILE([
1392 #include <linux/dcache.h>
1394 ((struct dentry_operations*)0)->d_compare(NULL,NULL,0,NULL,NULL);
1396 AC_DEFINE(HAVE_D_COMPARE_5ARGS, 1,
1397 [d_compare need 5 arguments])
1398 AC_MSG_RESULT([yes])
1405 # 3.11 need to access d_count to get dentry reference count
1407 AC_DEFUN([LC_HAVE_DCOUNT],
1408 [AC_MSG_CHECKING([if d_count exist])
1409 LB_LINUX_TRY_COMPILE([
1410 #include <linux/dcache.h>
1416 AC_DEFINE(HAVE_D_COUNT, 1, [d_count exist])
1417 AC_MSG_RESULT([yes])
1424 # 3.12 truncate_pagecache without oldsize parameter
1426 AC_DEFUN([LC_OLDSIZE_TRUNCATE_PAGECACHE],
1427 [AC_MSG_CHECKING([if truncate_pagecache with old_size parameter])
1428 LB_LINUX_TRY_COMPILE([
1429 #include <linux/mm.h>
1431 truncate_pagecache(NULL, 0, 0);
1433 AC_DEFINE(HAVE_OLDSIZE_TRUNCATE_PAGECACHE, 1, [with oldsize])
1434 AC_MSG_RESULT([yes])
1441 # 3.12 ki_left removed from struct kiocb
1443 AC_DEFUN([LC_KIOCB_KI_LEFT],
1444 [AC_MSG_CHECKING([if struct kiocb with ki_left member])
1445 LB_LINUX_TRY_COMPILE([
1446 #include <linux/aio.h>
1448 ((struct kiocb*)0)->ki_left = 0;
1450 AC_DEFINE(HAVE_KIOCB_KI_LEFT, 1, [ki_left exist])
1451 AC_MSG_RESULT([yes])
1457 # 3.13 has vfs_renane with 5 args
1458 AC_DEFUN([LC_VFS_RENAME_5ARGS],
1459 [AC_MSG_CHECKING([if kernel has vfs_rename with 5 args])
1460 LB_LINUX_TRY_COMPILE([
1461 #include <linux/fs.h>
1463 vfs_rename(NULL, NULL, NULL, NULL, NULL);
1465 AC_MSG_RESULT([yes])
1466 AC_DEFINE(HAVE_VFS_RENAME_5ARGS, 1,
1467 [kernel has vfs_rename with 5 args])
1476 # Lustre linux kernel checks
1478 AC_DEFUN([LC_PROG_LINUX],
1482 LC_CONFIG_LIBLUSTRE_RECOVERY
1483 LC_CONFIG_HEALTH_CHECK_WRITE
1484 LC_CONFIG_LRU_RESIZE
1485 LC_LLITE_LLOOP_MODULE
1487 LC_GLIBC_SUPPORT_FHANDLES
1493 LC_BLK_QUEUE_MAX_SEGMENTS
1496 LC_HAVE_DQUOT_FS_DISK_QUOTA
1497 LC_HAVE_DQUOT_SUSPEND
1501 LC_EXPORT_SIMPLE_SETATTR
1502 LC_EXPORT_TRUNCATE_COMPLETE_PAGE
1506 LC_SBOPS_EVICT_INODE
1512 LC_BLKDEV_GET_BY_DEV
1513 LC_GENERIC_PERMISSION
1520 LC_REQUEST_QUEUE_UNPLUG_FN
1521 LC_HAVE_FHANDLE_SYSCALLS
1522 LC_HAVE_FSTYPE_MOUNT
1524 LC_HAVE_INODE_OWNER_OR_CAPABLE
1527 LC_DIRTY_INODE_WITH_FLAG
1530 LC_LM_XXX_LOCK_MANAGER_OPS
1534 LC_INODE_PERMISION_2ARGS
1537 LC_HAVE_VOID_MAKE_REQUEST_FN
1538 LC_HAVE_PROTECT_I_NLINK
1541 LC_HAVE_MIGRATE_HEADER
1542 LC_MIGRATEPAGE_4ARGS
1543 LC_SUPEROPS_USE_DENTRY
1544 LC_INODEOPS_USE_UMODE_T
1545 LC_HAVE_CACHE_REGISTER
1549 LC_KMAP_ATOMIC_HAS_1ARG
1553 LC_HAVE_ENCODE_FH_PARENT
1554 LC_FILE_LLSEEK_SIZE_5ARG
1557 LC_HAVE_DENTRY_D_ALIAS_HLIST
1558 LC_DENTRY_OPEN_USE_PATH
1559 LC_HAVE_IOP_ATOMIC_OPEN
1562 LC_HAVE_POSIXACL_USER_NS
1565 LC_HAVE_FILE_F_INODE
1566 LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS
1569 LC_HAVE_HLIST_FOR_EACH_3ARG
1572 LC_HAVE_ONLY_PROCFS_SEQ
1573 LC_BLKDEV_RELEASE_RETURN_INT
1582 LC_OLDSIZE_TRUNCATE_PAGECACHE
1589 if test x$enable_server != xno ; then
1590 LC_FUNC_DEV_SET_RDONLY
1600 # Check whether to build the client side of Lustre
1602 AC_DEFUN([LC_CONFIG_CLIENT],
1603 [AC_MSG_CHECKING([whether to build Lustre client support])
1604 AC_ARG_ENABLE([client],
1605 AC_HELP_STRING([--disable-client],
1606 [disable Lustre client support]),
1607 [],[enable_client='yes'])
1608 AC_MSG_RESULT([$enable_client])
1612 # LC_CONFIG_LIBLUSTRE
1614 # whether to build liblustre
1616 AC_DEFUN([LC_CONFIG_LIBLUSTRE],
1617 [AC_MSG_CHECKING([whether to build Lustre library])
1618 AC_ARG_ENABLE([liblustre],
1619 AC_HELP_STRING([--disable-liblustre],
1620 [disable building of Lustre library]),
1621 [],[enable_liblustre=$with_sysio])
1622 AC_MSG_RESULT([$enable_liblustre])
1623 # only build sysio if liblustre is built
1624 with_sysio="$enable_liblustre"
1626 AC_MSG_CHECKING([whether to build liblustre tests])
1627 AC_ARG_ENABLE([liblustre-tests],
1628 AC_HELP_STRING([--enable-liblustre-tests],
1629 [enable liblustre tests, if --disable-tests is used]),
1630 [],[enable_liblustre_tests=$enable_tests])
1631 if test x$enable_liblustre != xyes ; then
1632 enable_liblustre_tests='no'
1634 AC_MSG_RESULT([$enable_liblustre_tests])
1636 AC_MSG_CHECKING([whether to enable liblustre acl])
1637 AC_ARG_ENABLE([liblustre-acl],
1638 AC_HELP_STRING([--disable-liblustre-acl],
1639 [disable ACL support for liblustre]),
1640 [],[enable_liblustre_acl=yes])
1641 AC_MSG_RESULT([$enable_liblustre_acl])
1642 if test x$enable_liblustre_acl = xyes ; then
1643 AC_DEFINE(LIBLUSTRE_POSIX_ACL, 1, Liblustre Support ACL-enabled MDS)
1649 AC_ARG_ENABLE(mpitests,
1650 AC_HELP_STRING([--enable-mpitests=yes|no|mpicc wrapper],
1651 [include mpi tests]),
1662 MPICC_WRAPPER=$enableval
1672 if test x$enable_mpitests != xno; then
1673 AC_MSG_CHECKING([whether mpitests can be built])
1681 MPI_Initialized(&flag);
1684 AC_MSG_RESULT([yes])
1691 AC_SUBST(MPICC_WRAPPER)
1693 AC_MSG_NOTICE([Enabling Lustre configure options for libsysio])
1694 ac_configure_args="$ac_configure_args --with-lustre-hack --with-sockets"
1697 LC_CONFIG_LIBLUSTRE_RECOVERY
1703 # whether to enable quota support global control
1705 AC_DEFUN([LC_CONFIG_QUOTA],
1706 [AC_ARG_ENABLE([quota],
1707 AC_HELP_STRING([--enable-quota],
1708 [enable quota support]),
1709 [],[enable_quota='yes'])
1712 AC_DEFUN([LC_QUOTA],
1716 if test x$enable_quota != xno -a x$enable_utils != xno; then
1717 AC_CHECK_HEADER(sys/quota.h,
1718 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1, [Define to 1 if you have <sys/quota.h>.])],
1719 [AC_MSG_ERROR([don't find <sys/quota.h> in your system])])
1726 # whether to enable split support
1728 AC_DEFUN([LC_CONFIG_SPLIT],
1729 [AC_MSG_CHECKING([whether to enable split support])
1730 AC_ARG_ENABLE([split],
1731 AC_HELP_STRING([--enable-split],
1732 [enable split support]),
1733 [],[enable_split='no'])
1734 AC_MSG_RESULT([$enable_split])
1735 if test x$enable_split != xno; then
1736 AC_DEFINE(HAVE_SPLIT_SUPPORT, 1, [enable split support])
1741 # LC_CONFIG_NODEMAP_PROC_DEBUG
1743 # enable nodemap proc file debugging
1745 AC_DEFUN([LC_NODEMAP_PROC_DEBUG],
1746 [AC_MSG_CHECKING([whether to enable nodemap proc debug])
1747 AC_ARG_ENABLE([nodemap_proc_debug],
1748 AC_HELP_STRING([--enable-nodemap-proc-debug],
1749 [enable nodemap proc debug]),
1750 [],[enable_nodemap_proc_debug='no'])
1751 AC_MSG_RESULT([$enable_nodemap_proc_debug])
1752 if test x$enable_nodemap_proc_debug != xno; then
1753 AC_DEFINE(NODEMAP_PROC_DEBUG, 1, [enable nodemap proc debug support])
1758 # LC_LLITE_LLOOP_MODULE
1759 # lloop_llite.ko does not currently work with page sizes
1762 AC_DEFUN([LC_LLITE_LLOOP_MODULE],
1763 [AC_MSG_CHECKING([whether to enable llite_lloop module])
1764 LB_LINUX_TRY_COMPILE([
1765 #include <asm/page.h>
1767 #if PAGE_SIZE >= 65536
1768 #error "PAGE_SIZE >= 65536"
1771 enable_llite_lloop_module='yes'
1772 AC_MSG_RESULT([yes])
1774 enable_llite_lloop_module='no'
1782 # configure support for optional OSD implementation
1784 AC_DEFUN([LC_OSD_ADDON],
1785 [AC_MSG_CHECKING([for osd])
1787 AC_HELP_STRING([--with-osd=path],
1788 [set path to optional osd]),
1791 no) ENABLEOSDADDON=0
1793 *) OSDADDON="${with_osd}"
1800 if test $ENABLEOSDADDON -eq 0; then
1804 OSDMODNAME=`basename $OSDADDON`
1805 if test -e $LUSTRE/$OSDMODNAME; then
1806 AC_MSG_RESULT([can't link])
1808 elif ln -s $OSDADDON $LUSTRE/$OSDMODNAME; then
1809 AC_MSG_RESULT([$OSDMODNAME])
1810 OSDADDON="subdir-m += $OSDMODNAME"
1812 AC_MSG_RESULT([can't link])
1822 # other configure checks
1824 AC_DEFUN([LC_CONFIGURE],
1825 [LC_CONFIG_OBD_BUFFER_SIZE
1827 if test $target_cpu == "i686" -o $target_cpu == "x86_64"; then
1828 CFLAGS="$CFLAGS -Werror"
1831 # maximum MDS thread count
1834 # include/liblustre.h
1835 AC_CHECK_HEADERS([sys/user.h sys/vfs.h stdint.h blkid/blkid.h])
1837 # liblustre/llite_lib.h
1838 AC_CHECK_HEADERS([xtio.h file.h])
1841 AC_CHECK_HEADERS([linux/types.h sys/types.h linux/unistd.h unistd.h])
1844 AC_CHECK_HEADERS([netinet/in.h arpa/inet.h catamount/data.h])
1845 AC_CHECK_FUNCS([inet_ntoa])
1847 # libsysio/src/readlink.c
1850 # libcfs prng.c - depends on linux/types.h from liblustre/dir.c
1851 AC_CHECK_HEADERS([linux/random.h], [], [],
1852 [#ifdef HAVE_LINUX_TYPES_H
1853 # include <linux/types.h>
1858 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
1860 # check for -lz support
1864 [AC_CHECK_HEADERS([zlib.h],
1866 AC_DEFINE([HAVE_ADLER], 1,
1867 [support alder32 checksum type])],
1870 No zlib-devel package found, unable to use adler32 checksum
1874 No zlib package found, unable to use adler32 checksum
1880 AC_CHECK_LIB([selinux],
1881 [is_selinux_enabled],
1882 [AC_CHECK_HEADERS([selinux.h],
1883 [SELINUX="-lselinux"
1884 AC_DEFINE([HAVE_SELINUX], 1,
1885 [support for selinux ])],
1888 No selinux-devel package found, unable to build selinux enabled tools
1892 No selinux package found, unable to build selinux enabled tools
1898 AC_ARG_ENABLE([mindf],
1899 AC_HELP_STRING([--enable-mindf],
1900 [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
1902 if test "$enable_mindf" = "yes" ; then
1903 AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])
1906 AC_ARG_ENABLE([fail_alloc],
1907 AC_HELP_STRING([--disable-fail-alloc],
1908 [disable randomly alloc failure]),
1909 [],[enable_fail_alloc=yes])
1910 AC_MSG_CHECKING([whether to randomly failing memory alloc])
1911 AC_MSG_RESULT([$enable_fail_alloc])
1912 if test x$enable_fail_alloc != xno ; then
1913 AC_DEFINE([RANDOM_FAIL_ALLOC], 1, [enable randomly alloc failure])
1916 AC_ARG_ENABLE([invariants],
1917 AC_HELP_STRING([--enable-invariants],
1918 [enable invariant checking (cpu intensive)]),
1920 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
1921 AC_MSG_RESULT([$enable_invariants])
1922 if test x$enable_invariants = xyes ; then
1923 AC_DEFINE([CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK], 1, [enable invariant checking])
1926 AC_ARG_ENABLE([lu_ref],
1927 AC_HELP_STRING([--enable-lu_ref],
1928 [enable lu_ref reference tracking code]),
1930 AC_MSG_CHECKING([whether to track references with lu_ref])
1931 AC_MSG_RESULT([$enable_lu_ref])
1932 if test x$enable_lu_ref = xyes ; then
1933 AC_DEFINE([USE_LU_REF], 1, [enable lu_ref reference tracking code])
1936 AC_ARG_ENABLE([pgstate-track],
1937 AC_HELP_STRING([--enable-pgstate-track],
1938 [enable page state tracking]),
1939 [enable_pgstat_track='yes'],[])
1940 AC_MSG_CHECKING([whether to enable page state tracking])
1941 AC_MSG_RESULT([$enable_pgstat_track])
1942 if test x$enable_pgstat_track = xyes ; then
1943 AC_DEFINE([CONFIG_DEBUG_PAGESTATE_TRACKING], 1,
1944 [enable page state tracking code])
1951 # AM_CONDITIONALS for lustre
1953 AC_DEFUN([LC_CONDITIONALS],
1954 [AM_CONDITIONAL(LIBLUSTRE, test x$enable_liblustre = xyes)
1955 AM_CONDITIONAL(LIBLUSTRE_TESTS, test x$enable_liblustre_tests = xyes)
1956 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
1957 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
1958 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
1959 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
1960 AM_CONDITIONAL(BLKID, test x$ac_cv_header_blkid_blkid_h = xyes)
1961 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
1962 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
1963 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
1964 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
1965 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
1966 AM_CONDITIONAL(LLITE_LLOOP, test x$enable_llite_lloop_module = xyes)
1972 # files that should be generated with AC_OUTPUT
1974 AC_DEFUN([LC_CONFIG_FILES],
1978 lustre/autoconf/Makefile
1979 lustre/conf/Makefile
1980 lustre/contrib/Makefile
1982 lustre/include/Makefile
1983 lustre/include/lustre_ver.h
1984 lustre/include/linux/Makefile
1985 lustre/include/darwin/Makefile
1986 lustre/include/lustre/Makefile
1987 lustre/kernel_patches/targets/2.6-rhel6.target
1988 lustre/kernel_patches/targets/2.6-rhel5.target
1989 lustre/kernel_patches/targets/2.6-sles11.target
1990 lustre/kernel_patches/targets/3.0-sles11.target
1991 lustre/kernel_patches/targets/3.0-sles11sp3.target
1992 lustre/kernel_patches/targets/2.6-fc11.target
1993 lustre/kernel_patches/targets/2.6-fc12.target
1994 lustre/kernel_patches/targets/2.6-fc15.target
1995 lustre/kernel_patches/targets/3.x-fc18.target
1996 lustre/ldlm/Makefile
1998 lustre/fid/autoMakefile
1999 lustre/liblustre/Makefile
2000 lustre/liblustre/tests/Makefile
2001 lustre/liblustre/tests/mpi/Makefile
2002 lustre/llite/Makefile
2003 lustre/llite/autoMakefile
2004 lustre/lclient/Makefile
2006 lustre/lov/autoMakefile
2008 lustre/mdc/autoMakefile
2010 lustre/lmv/autoMakefile
2011 lustre/lfsck/Makefile
2012 lustre/lfsck/autoMakefile
2014 lustre/mdt/autoMakefile
2015 lustre/nodemap/Makefile
2016 lustre/nodemap/autoMakefile
2018 lustre/mdd/autoMakefile
2020 lustre/fld/autoMakefile
2021 lustre/obdclass/Makefile
2022 lustre/obdclass/autoMakefile
2023 lustre/obdclass/linux/Makefile
2024 lustre/obdecho/Makefile
2025 lustre/obdecho/autoMakefile
2027 lustre/ofd/autoMakefile
2029 lustre/osc/autoMakefile
2031 lustre/ost/autoMakefile
2032 lustre/osd-ldiskfs/Makefile
2033 lustre/osd-ldiskfs/autoMakefile
2034 lustre/osd-zfs/Makefile
2035 lustre/osd-zfs/autoMakefile
2037 lustre/mgc/autoMakefile
2039 lustre/mgs/autoMakefile
2040 lustre/target/Makefile
2041 lustre/ptlrpc/Makefile
2042 lustre/ptlrpc/autoMakefile
2043 lustre/ptlrpc/gss/Makefile
2044 lustre/ptlrpc/gss/autoMakefile
2045 lustre/quota/Makefile
2046 lustre/quota/autoMakefile
2047 lustre/scripts/Makefile
2048 lustre/tests/Makefile
2049 lustre/tests/mpi/Makefile
2050 lustre/utils/Makefile
2051 lustre/utils/gss/Makefile
2053 lustre/osp/autoMakefile
2055 lustre/lod/autoMakefile
2056 lustre/obdclass/darwin/Makefile