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])
86 # LC_FUNC_DEV_SET_RDONLY
88 # check whether dev_set_rdonly is exported. This is needed until we
89 # have another mechanism to fence IO from the underlying device.
91 AC_DEFUN([LC_FUNC_DEV_SET_RDONLY],
92 [LB_CHECK_SYMBOL_EXPORT([dev_set_rdonly],
93 [block/ll_rw_block.c,block/blk-core.c],[
94 AC_DEFINE(HAVE_DEV_SET_RDONLY, 1, [kernel exports dev_set_rdonly])
96 AC_MSG_WARN([kernel missing dev_set_rdonly patch for testing])
101 # Ensure stack size big than 8k in Lustre server (all kernels)
103 AC_DEFUN([LC_STACK_SIZE],
104 [AC_MSG_CHECKING([stack size big than 8k])
105 LB_LINUX_TRY_COMPILE([
106 #include <linux/thread_info.h>
108 #if THREAD_SIZE < 8192
109 #error "stack size < 8192"
114 AC_MSG_ERROR([Lustre requires that Linux is configured with at least a 8KB stack.])
119 # Allow the user to set the MDS thread upper limit
121 AC_DEFUN([LC_MDS_MAX_THREADS],
123 AC_ARG_WITH([mds_max_threads],
124 AC_HELP_STRING([--with-mds-max-threads=count],
125 [maximum threads available on the MDS: (default=512)]),
127 MDS_THREAD_COUNT=$with_mds_max_threads
128 AC_DEFINE_UNQUOTED(MDS_MAX_THREADS, $MDS_THREAD_COUNT, [maximum number of MDS threads])
135 # the pinger is temporary, until we have the recovery node in place
137 AC_DEFUN([LC_CONFIG_PINGER],
138 [AC_MSG_CHECKING([whether to enable pinger support])
139 AC_ARG_ENABLE([pinger],
140 AC_HELP_STRING([--disable-pinger],
141 [disable recovery pinger support]),
142 [],[enable_pinger='yes'])
143 AC_MSG_RESULT([$enable_pinger])
144 if test x$enable_pinger != xno ; then
145 AC_DEFINE(ENABLE_PINGER, 1, Use the Pinger)
152 # do checksum of bulk data between client and OST
154 AC_DEFUN([LC_CONFIG_CHECKSUM],
155 [AC_MSG_CHECKING([whether to enable data checksum support])
156 AC_ARG_ENABLE([checksum],
157 AC_HELP_STRING([--disable-checksum],
158 [disable data checksum support]),
159 [],[enable_checksum='yes'])
160 AC_MSG_RESULT([$enable_checksum])
161 if test x$enable_checksum != xno ; then
162 AC_DEFINE(ENABLE_CHECKSUM, 1, do data checksums)
167 # LC_CONFIG_LIBLUSTRE_RECOVERY
169 AC_DEFUN([LC_CONFIG_LIBLUSTRE_RECOVERY],
170 [AC_MSG_CHECKING([whether to enable liblustre recovery support])
171 AC_ARG_ENABLE([liblustre-recovery],
172 AC_HELP_STRING([--disable-liblustre-recovery],
173 [disable liblustre recovery support]),
174 [],[enable_liblustre_recovery='yes'])
175 AC_MSG_RESULT([$enable_liblustre_recovery])
176 if test x$enable_liblustre_recovery != xno ; then
177 AC_DEFINE(ENABLE_LIBLUSTRE_RECOVERY, 1, Liblustre Can Recover)
182 # LC_CONFIG_HEALTH_CHECK_WRITE
184 # Turn off the actual write to the disk
186 AC_DEFUN([LC_CONFIG_HEALTH_CHECK_WRITE],
187 [AC_MSG_CHECKING([whether to enable a write with the health check])
188 AC_ARG_ENABLE([health_write],
189 AC_HELP_STRING([--enable-health_write],
190 [enable disk writes when doing health check]),
191 [],[enable_health_write='no'])
192 AC_MSG_RESULT([$enable_health_write])
193 if test x$enable_health_write != xno ; then
194 AC_DEFINE(USE_HEALTH_CHECK_WRITE, 1, Write when Checking Health)
198 AC_DEFUN([LC_CONFIG_LRU_RESIZE],
199 [AC_MSG_CHECKING([whether to enable lru self-adjusting])
200 AC_ARG_ENABLE([lru_resize],
201 AC_HELP_STRING([--enable-lru-resize],
202 [enable lru resize support]),
203 [],[enable_lru_resize='yes'])
204 AC_MSG_RESULT([$enable_lru_resize])
205 if test x$enable_lru_resize != xno; then
206 AC_DEFINE(HAVE_LRU_RESIZE_SUPPORT, 1, [Enable lru resize support])
211 # Quota support. The kernel must support CONFIG_QUOTA.
213 AC_DEFUN([LC_QUOTA_CONFIG],
214 [LB_LINUX_CONFIG_IM([QUOTA],[],[
215 AC_MSG_ERROR([Lustre quota requires that CONFIG_QUOTA is enabled in your kernel.])
219 # truncate_complete_page() was exported from RHEL5/SLES10, but not in SLES11 SP0 (2.6.27)
220 # remove_from_page_cache() was exported between 2.6.35 and 2.6.38
221 # delete_from_page_cache() is exported from 2.6.39
222 AC_DEFUN([LC_EXPORT_TRUNCATE_COMPLETE],
223 [LB_CHECK_SYMBOL_EXPORT([truncate_complete_page],
225 [AC_DEFINE(HAVE_TRUNCATE_COMPLETE_PAGE, 1,
226 [kernel export truncate_complete_page])])
227 LB_CHECK_SYMBOL_EXPORT([remove_from_page_cache],
229 [AC_DEFINE(HAVE_REMOVE_FROM_PAGE_CACHE, 1,
230 [kernel export remove_from_page_cache])])
231 LB_CHECK_SYMBOL_EXPORT([delete_from_page_cache],
233 [AC_DEFINE(HAVE_DELETE_FROM_PAGE_CACHE, 1,
234 [kernel export delete_from_page_cache])])
240 AC_DEFUN([LC_BIT_SPINLOCK_H],
241 [LB_CHECK_FILE([$LINUX/include/linux/bit_spinlock.h],[
242 AC_MSG_CHECKING([if bit_spinlock.h can be compiled])
243 LB_LINUX_TRY_COMPILE([
244 #include <asm/processor.h>
245 #include <linux/spinlock.h>
246 #include <linux/bit_spinlock.h>
249 AC_DEFINE(HAVE_BIT_SPINLOCK_H, 1, [Kernel has bit_spinlock.h])
260 AC_DEFUN([LC_CAPA_CRYPTO],
261 [LB_LINUX_CONFIG_IM([CRYPTO],[],[
262 AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO is enabled in your kernel.])
264 LB_LINUX_CONFIG_IM([CRYPTO_HMAC],[],[
265 AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_HMAC is enabled in your kernel.])
267 LB_LINUX_CONFIG_IM([CRYPTO_SHA1],[],[
268 AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_SHA1 is enabled in your kernel.])
273 # LC_CONFIG_RMTCLIENT
276 dnl the AES symbol usually tied with arch, e.g. CRYPTO_AES_586
278 AC_DEFUN([LC_CONFIG_RMTCLIENT],
279 [LB_LINUX_CONFIG_IM([CRYPTO_AES],[],[
280 AC_MSG_WARN([Lustre remote client require that CONFIG_CRYPTO_AES is enabled in your kernel.])
285 # LC_CONFIG_GSS_KEYRING (default enabled, if gss is enabled)
287 AC_DEFUN([LC_CONFIG_GSS_KEYRING],
288 [AC_MSG_CHECKING([whether to enable gss keyring backend])
289 AC_ARG_ENABLE([gss_keyring],
290 [AC_HELP_STRING([--disable-gss-keyring],
291 [disable gss keyring backend])],
292 [],[enable_gss_keyring='yes'])
293 AC_MSG_RESULT([$enable_gss_keyring])
295 if test x$enable_gss_keyring != xno; then
296 LB_LINUX_CONFIG_IM([KEYS],[],
297 [AC_MSG_ERROR([GSS keyring backend require that CONFIG_KEYS be enabled in your kernel.])])
299 AC_CHECK_LIB([keyutils], [keyctl_search], [],
300 [AC_MSG_ERROR([libkeyutils is not found, which is required by gss keyring backend])],)
302 AC_DEFINE([HAVE_GSS_KEYRING], [1],
303 [Define this if you enable gss keyring backend])
307 AC_DEFUN([LC_CONFIG_SUNRPC],
308 [LB_LINUX_CONFIG_IM([SUNRPC],[],
309 [AC_MSG_ERROR([kernel SUNRPC support is required by using GSS.])])
313 # LC_CONFIG_GSS (default disabled)
315 # Build gss and related tools of Lustre. Currently both kernel and user space
316 # parts are depend on linux platform.
318 AC_DEFUN([LC_CONFIG_GSS],
319 [AC_MSG_CHECKING([whether to enable gss/krb5 support])
321 [AC_HELP_STRING([--enable-gss], [enable gss/krb5 support])],
322 [],[enable_gss='no'])
323 AC_MSG_RESULT([$enable_gss])
325 if test x$enable_gss == xyes; then
326 LC_CONFIG_GSS_KEYRING
329 AC_DEFINE([HAVE_GSS], [1], [Define this if you enable gss])
331 LB_LINUX_CONFIG_IM([CRYPTO_MD5],[],
332 [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
333 LB_LINUX_CONFIG_IM([CRYPTO_SHA1],[],
334 [AC_MSG_WARN([kernel SHA1 support is recommended by using GSS.])])
335 LB_LINUX_CONFIG_IM([CRYPTO_SHA256],[],
336 [AC_MSG_WARN([kernel SHA256 support is recommended by using GSS.])])
337 LB_LINUX_CONFIG_IM([CRYPTO_SHA512],[],
338 [AC_MSG_WARN([kernel SHA512 support is recommended by using GSS.])])
340 AC_CHECK_LIB([gssapi], [gss_export_lucid_sec_context],
341 [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi"],
342 [AC_CHECK_LIB([gssglue], [gss_export_lucid_sec_context],
343 [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssglue"],
344 [AC_MSG_ERROR([libgssapi or libgssglue is not found, which is required by GSS.])])],)
346 AC_SUBST(GSSAPI_LIBS)
354 # ~2.6.12 merge patch from oracle to convert tree_lock from spinlock to rwlock
355 # yet tree_lock is converted from rwlock to spin_lock since v2.6.26
356 AC_DEFUN([LC_RW_TREE_LOCK],
357 [AC_MSG_CHECKING([if kernel has tree_lock as rwlock])
358 tmp_flags="$EXTRA_KCFLAGS"
359 EXTRA_KCFLAGS="-Werror"
360 LB_LINUX_TRY_COMPILE([
361 #include <linux/fs.h>
363 struct address_space a;
365 write_lock(&a.tree_lock);
368 AC_DEFINE(HAVE_RW_TREE_LOCK, 1, [kernel has tree_lock as rw_lock])
372 EXTRA_KCFLAGS="$tmp_flags"
375 #2.6.18 + RHEL5 (fc6)
380 # fiemap.h is added since v2.6.28
381 # RHEL5 2.6.18 has it, while SLES10 2.6.27 does not
383 AC_DEFUN([LC_LINUX_FIEMAP_H],
384 [LB_CHECK_FILE([$LINUX/include/linux/fiemap.h],[
385 AC_MSG_CHECKING([if fiemap.h can be compiled])
386 LB_LINUX_TRY_COMPILE([
387 #include <linux/types.h>
388 #include <linux/fiemap.h>
391 AC_DEFINE(HAVE_LINUX_FIEMAP_H, 1, [Kernel has fiemap.h])
399 # raid5-zerocopy patch
404 # In order to support raid5 zerocopy patch, we have to patch the kernel to make
405 # it support constant page, which means the page won't be modified during the
408 AC_DEFUN([LC_PAGE_CONSTANT],
409 [AC_MSG_CHECKING([if kernel have PageConstant defined])
410 LB_LINUX_TRY_COMPILE([
411 #include <linux/mm.h>
412 #include <linux/page-flags.h>
415 #error "Have no raid5 zcopy patch"
419 AC_DEFINE(HAVE_PAGE_CONSTANT, 1, [kernel have PageConstant supported])
428 # 2.6.19 check for FS_RENAME_DOES_D_MOVE flag
430 AC_DEFUN([LC_FS_RENAME_DOES_D_MOVE],
431 [AC_MSG_CHECKING([if kernel has FS_RENAME_DOES_D_MOVE flag])
432 LB_LINUX_TRY_COMPILE([
433 #include <linux/fs.h>
435 int v __attribute__ ((unused));
436 v = FS_RENAME_DOES_D_MOVE;
439 AC_DEFINE(HAVE_FS_RENAME_DOES_D_MOVE, 1, [kernel has FS_RENAME_DOES_D_MOVE flag])
447 # 2.6.23 have return type 'void' for unregister_blkdev
448 AC_DEFUN([LC_UNREGISTER_BLKDEV_RETURN_INT],
449 [AC_MSG_CHECKING([if unregister_blkdev return int])
450 LB_LINUX_TRY_COMPILE([
451 #include <linux/fs.h>
453 int i __attribute__ ((unused));
454 i = unregister_blkdev(0,NULL);
457 AC_DEFINE(HAVE_UNREGISTER_BLKDEV_RETURN_INT, 1,
458 [unregister_blkdev return int])
466 # 2.6.24 has bio_endio with 2 args
467 AC_DEFUN([LC_BIO_ENDIO_2ARG],
468 [AC_MSG_CHECKING([if kernel has bio_endio with 2 args])
469 LB_LINUX_TRY_COMPILE([
470 #include <linux/bio.h>
475 AC_DEFINE(HAVE_BIO_ENDIO_2ARG, 1,
476 [kernel has bio_endio with 2 args])
482 # 2.6.24 removes long aged procfs entry -> deleted member
483 AC_DEFUN([LC_PROCFS_DELETED],
484 [AC_MSG_CHECKING([if kernel has deleted member in procfs entry struct])
485 LB_LINUX_TRY_COMPILE([
486 #include <linux/proc_fs.h>
488 struct proc_dir_entry pde;
490 pde.deleted = sizeof(pde);
493 AC_DEFINE(HAVE_PROCFS_DELETED, 1,
494 [kernel has deleted member in procfs entry struct])
502 # 2.6.26 isn't export set_fs_pwd and change paramter in fs struct
503 AC_DEFUN([LC_FS_STRUCT_USE_PATH],
504 [AC_MSG_CHECKING([fs_struct use path structure])
505 LB_LINUX_TRY_COMPILE([
506 #include <asm/atomic.h>
507 #include <linux/spinlock.h>
508 #include <linux/fs_struct.h>
512 fs.pwd = *((struct path *)sizeof(fs));
515 AC_DEFINE(HAVE_FS_STRUCT_USE_PATH, 1,
516 [fs_struct use path structure])
526 # LC_SECURITY_PLUG # for SLES10 SP2 (2.6.27)
527 # check security plug in sles10 sp2 kernel
528 AC_DEFUN([LC_SECURITY_PLUG],
529 [AC_MSG_CHECKING([If kernel has security plug support])
530 LB_LINUX_TRY_COMPILE([
531 #include <linux/fs.h>
532 #include <linux/stddef.h>
534 notify_change(NULL, NULL, NULL);
537 AC_DEFINE(HAVE_SECURITY_PLUG, 1,
538 [SLES10 SP2 use extra parameter in vfs])
544 AC_DEFUN([LC_INODE_PERMISION_2ARGS],
545 [AC_MSG_CHECKING([inode_operations->permission has two args])
546 LB_LINUX_TRY_COMPILE([
547 #include <linux/fs.h>
549 struct inode *inode __attribute__ ((unused));
552 inode->i_op->permission(NULL, 0);
554 AC_DEFINE(HAVE_INODE_PERMISION_2ARGS, 1,
555 [inode_operations->permission has two args])
562 # 2.6.27 use 5th parameter in quota_on for remount.
563 AC_DEFUN([LC_QUOTA_ON_5ARGS],
564 [AC_MSG_CHECKING([quota_on needs 5 parameters])
565 LB_LINUX_TRY_COMPILE([
566 #include <linux/fs.h>
567 #include <linux/quota.h>
569 struct quotactl_ops *qop = NULL;
570 qop->quota_on(NULL, 0, 0, NULL, 0);
572 AC_DEFINE(HAVE_QUOTA_ON_5ARGS, 1,
573 [quota_on needs 5 paramters])
580 # 2.6.27 use 3th parameter in quota_off for remount.
581 AC_DEFUN([LC_QUOTA_OFF_3ARGS],
582 [AC_MSG_CHECKING([quota_off needs 3 parameters])
583 LB_LINUX_TRY_COMPILE([
584 #include <linux/fs.h>
585 #include <linux/quota.h>
587 struct quotactl_ops *qop = NULL;
588 qop->quota_off(NULL, 0, 0);
590 AC_DEFINE(HAVE_QUOTA_OFF_3ARGS, 1,
591 [quota_off needs 3 paramters])
598 # 2.6.34 has quotactl_ops->[sg]et_dqblk that take struct fs_disk_quota
599 AC_DEFUN([LC_HAVE_DQUOT_FS_DISK_QUOTA],
600 tmp_flags="$EXTRA_KCFLAGS"
601 EXTRA_KCFLAGS="-Werror"
602 [AC_MSG_CHECKING([if quotactl_ops.set_dqblk takes struct fs_disk_quota])
603 LB_LINUX_TRY_COMPILE([
604 #include <linux/fs.h>
605 #include <linux/quota.h>
607 struct quotactl_ops qops = {};
608 struct fs_disk_quota fdq;
609 qops.set_dqblk(NULL, 0, 0, &fdq);
611 AC_DEFINE(HAVE_DQUOT_FS_DISK_QUOTA, 1, [quotactl_ops.set_dqblk takes struct fs_disk_quota])
616 EXTRA_KCFLAGS="$tmp_flags"
619 # 2.6.34 has renamed dquot options to dquot_*, check for dquot_suspend
620 AC_DEFUN([LC_HAVE_DQUOT_SUSPEND],
621 [AC_MSG_CHECKING([if dquot_suspend is defined])
622 LB_LINUX_TRY_COMPILE([
623 #include <linux/quotaops.h>
625 dquot_suspend(NULL, -1);
627 AC_DEFINE(HAVE_DQUOT_SUSPEND, 1, [dquot_suspend is defined])
634 # LC_LOCK_MAP_ACQUIRE
635 # after 2.6.27 lock_map_acquire replaces lock_acquire
636 AC_DEFUN([LC_LOCK_MAP_ACQUIRE],
637 [AC_MSG_CHECKING([if lock_map_acquire is defined])
638 LB_LINUX_TRY_COMPILE([
639 #include <linux/lockdep.h>
641 lock_map_acquire(NULL);
644 AC_DEFINE(HAVE_LOCK_MAP_ACQUIRE, 1,
645 [lock_map_acquire is defined])
653 # 2.6.27 sles11 remove the bi_hw_segments
654 AC_DEFUN([LC_BI_HW_SEGMENTS],
655 [AC_MSG_CHECKING([struct bio has a bi_hw_segments field])
656 LB_LINUX_TRY_COMPILE([
657 #include <linux/bio.h>
660 io.bi_hw_segments = sizeof(io);
662 AC_DEFINE(HAVE_BI_HW_SEGMENTS, 1,
663 [struct bio has a bi_hw_segments field])
671 # 2.6.27 sles11 move the quotaio_v1{2}.h from include/linux to fs
672 # 2.6.32 move the quotaio_v1{2}.h from fs to fs/quota
673 AC_DEFUN([LC_HAVE_QUOTAIO_H],
674 [LB_CHECK_FILE([$LINUX/include/linux/quotaio_v2.h],[
675 AC_DEFINE(HAVE_QUOTAIO_H, 1,
676 [kernel has include/linux/quotaio_v2.h])
677 ],[LB_CHECK_FILE([$LINUX/fs/quotaio_v2.h],[
678 AC_DEFINE(HAVE_FS_QUOTAIO_H, 1,
679 [kernel has fs/quotaio_v1.h])
680 ],[LB_CHECK_FILE([$LINUX/fs/quota/quotaio_v2.h],[
681 AC_DEFINE(HAVE_FS_QUOTA_QUOTAIO_H, 1,
682 [kernel has fs/quota/quotaio_v2.h])
692 # 2.6.32 replaces 2 functions blk_queue_max_phys_segments and blk_queue_max_hw_segments by blk_queue_max_segments
693 AC_DEFUN([LC_BLK_QUEUE_MAX_SEGMENTS],
694 [AC_MSG_CHECKING([if blk_queue_max_segments is defined])
695 LB_LINUX_TRY_COMPILE([
696 #include <linux/blkdev.h>
698 blk_queue_max_segments(NULL, 0);
701 AC_DEFINE(HAVE_BLK_QUEUE_MAX_SEGMENTS, 1,
702 [blk_queue_max_segments is defined])
711 # Check if kernel has been patched for 64-bit quota limits support.
712 # The upstream version of this patch in RHEL6 2.6.32 kernels introduces
713 # the constant QFMT_VFS_V1 in include/linux/quota.h, so we can check for
714 # that in the absence of quotaio_v1.h in the kernel headers.
716 AC_DEFUN([LC_QUOTA64],[
717 AC_MSG_CHECKING([if kernel has 64-bit quota limits support])
718 tmp_flags="$EXTRA_KCFLAGS"
719 EXTRA_KCFLAGS="-I$LINUX/fs"
720 LB_LINUX_TRY_COMPILE([
721 #include <linux/kernel.h>
722 #include <linux/fs.h>
723 #if defined(HAVE_FS_QUOTA_QUOTAIO_H)
724 # include <quota/quotaio_v2.h>
725 struct v2r1_disk_dqblk dqblk_r1;
727 #include <linux/quota.h>
728 int ver = QFMT_VFS_V1;
731 AC_DEFINE(HAVE_QUOTA64, 1, [have quota64])
734 LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],[
735 AC_MSG_ERROR([You have got no 64-bit kernel quota support.])
739 EXTRA_KCFLAGS=$tmp_flags
743 # 2.6.36 fs_struct.lock use spinlock instead of rwlock.
745 AC_DEFUN([LC_FS_STRUCT_RWLOCK],
746 [AC_MSG_CHECKING([if fs_struct.lock use rwlock])
747 LB_LINUX_TRY_COMPILE([
748 #include <asm/atomic.h>
749 #include <linux/spinlock.h>
750 #include <linux/fs_struct.h>
752 ((struct fs_struct *)0)->lock = (rwlock_t){ 0 };
754 AC_DEFINE(HAVE_FS_STRUCT_RWLOCK, 1,
755 [fs_struct.lock use rwlock])
763 # 2.6.36 super_operations add evict_inode method. it hybird of
764 # delete_inode & clear_inode.
766 AC_DEFUN([LC_SBOPS_EVICT_INODE],
767 [AC_MSG_CHECKING([if super_operations.evict_inode exist])
768 LB_LINUX_TRY_COMPILE([
769 #include <linux/fs.h>
771 ((struct super_operations *)0)->evict_inode(NULL);
773 AC_DEFINE(HAVE_SBOPS_EVICT_INODE, 1,
774 [super_operations.evict_inode() is exist in kernel])
782 # 2.6.35 file_operations.fsync taken 2 arguments.
783 # 3.0.0 file_operations.fsync takes 4 arguments.
785 AC_DEFUN([LC_FILE_FSYNC],
786 [AC_MSG_CHECKING([if file_operations.fsync takes 4 or 2 arguments])
787 LB_LINUX_TRY_COMPILE([
788 #include <linux/fs.h>
790 ((struct file_operations *)0)->fsync(NULL, 0, 0, 0);
792 AC_DEFINE(HAVE_FILE_FSYNC_4ARGS, 1,
793 [file_operations.fsync takes 4 arguments])
794 AC_MSG_RESULT([yes, 4 args])
796 LB_LINUX_TRY_COMPILE([
797 #include <linux/fs.h>
799 ((struct file_operations *)0)->fsync(NULL, 0);
801 AC_DEFINE(HAVE_FILE_FSYNC_2ARGS, 1,
802 [file_operations.fsync takes 2 arguments])
803 AC_MSG_RESULT([yes, 2 args])
811 # 2.6.37 remove kernel_locked
813 AC_DEFUN([LC_KERNEL_LOCKED],
814 [AC_MSG_CHECKING([if kernel_locked is defined])
815 LB_LINUX_TRY_COMPILE([
816 #include <linux/smp_lock.h>
821 AC_DEFINE(HAVE_KERNEL_LOCKED, 1,
822 [kernel_locked is defined])
829 # 2.6.38 dentry_operations.d_compare() taken 7 arguments.
831 AC_DEFUN([LC_D_COMPARE_7ARGS],
832 [AC_MSG_CHECKING([if d_compare taken 7 arguments])
833 LB_LINUX_TRY_COMPILE([
834 #include <linux/dcache.h>
836 ((struct dentry_operations*)0)->d_compare(NULL,NULL,NULL,NULL,0,NULL,NULL);
838 AC_DEFINE(HAVE_D_COMPARE_7ARGS, 1,
839 [d_compare need 7 arguments])
847 # 2.6.38 dentry_operations.d_delete() defined 'const' for 1st parameter.
849 AC_DEFUN([LC_D_DELETE_CONST],
850 [AC_MSG_CHECKING([if d_delete has const declare on first parameter])
851 tmp_flags="$EXTRA_KCFLAGS"
852 EXTRA_KCFLAGS="-Werror"
853 LB_LINUX_TRY_COMPILE([
854 #include <linux/dcache.h>
856 const struct dentry *d = NULL;
857 ((struct dentry_operations*)0)->d_delete(d);
859 AC_DEFINE(HAVE_D_DELETE_CONST, const,
860 [d_delete first parameter declared const])
863 AC_DEFINE(HAVE_D_DELETE_CONST, , [])
866 EXTRA_KCFLAGS="$tmp_flags"
870 # 2.6.38 dcache_lock removed. rcu-walk commited.
872 AC_DEFUN([LC_DCACHE_LOCK],
873 [AC_MSG_CHECKING([if dcache_lock is exist])
874 LB_LINUX_TRY_COMPILE([
875 #include <linux/dcache.h>
877 spin_lock(&dcache_lock);
879 AC_DEFINE(HAVE_DCACHE_LOCK, 1,
880 [dcache_lock is exist])
888 # 2.6.38 inode.i_rcu added.
890 AC_DEFUN([LC_INODE_I_RCU],
891 [AC_MSG_CHECKING([if inode.i_rcu exists])
892 LB_LINUX_TRY_COMPILE([
893 #include <linux/fs.h>
896 struct rcu_head rcu = {};
899 AC_DEFINE(HAVE_INODE_I_RCU, 1,
900 [inode.i_rcu exists])
908 # 2.6.38 export blkdev_get_by_dev
910 AC_DEFUN([LC_BLKDEV_GET_BY_DEV],
911 [LB_CHECK_SYMBOL_EXPORT([blkdev_get_by_dev],
913 AC_DEFINE(HAVE_BLKDEV_GET_BY_DEV, 1,
914 [blkdev_get_by_dev is exported by the kernel])
920 # 2.6.38 use path as 4th parameter in quota_on.
922 AC_DEFUN([LC_QUOTA_ON_USE_PATH],
923 [AC_MSG_CHECKING([quota_on use path as parameter])
924 tmp_flags="$EXTRA_KCFLAGS"
925 EXTRA_KCFLAGS="-Werror"
926 LB_LINUX_TRY_COMPILE([
927 #include <linux/fs.h>
928 #include <linux/quota.h>
930 ((struct quotactl_ops *)0)->quota_on(NULL, 0, 0, ((struct path*)0));
932 AC_DEFINE(HAVE_QUOTA_ON_USE_PATH, 1,
933 [quota_on use path as 4th paramter])
938 EXTRA_KCFLAGS="$tmp_flags"
942 # 2.6.38 export simple_setattr
944 AC_DEFUN([LC_EXPORT_SIMPLE_SETATTR],
945 [LB_CHECK_SYMBOL_EXPORT([simple_setattr],
947 AC_DEFINE(HAVE_SIMPLE_SETATTR, 1,
948 [simple_setattr is exported by the kernel])
954 # 2.6.39 remove unplug_fn from request_queue.
956 AC_DEFUN([LC_REQUEST_QUEUE_UNPLUG_FN],
957 [AC_MSG_CHECKING([if request_queue has unplug_fn field])
958 LB_LINUX_TRY_COMPILE([
959 #include <linux/blkdev.h>
961 do{ }while(sizeof(((struct request_queue *)0)->unplug_fn));
963 AC_DEFINE(HAVE_REQUEST_QUEUE_UNPLUG_FN, 1,
964 [request_queue has unplug_fn field])
972 # 2.6.39 replace get_sb with mount in struct file_system_type
974 AC_DEFUN([LC_HAVE_FSTYPE_MOUNT],
975 [AC_MSG_CHECKING([if file_system_type has mount field])
976 LB_LINUX_TRY_COMPILE([
977 #include <linux/fs.h>
979 struct file_system_type fst;
980 void *i = (void *) fst.mount;
982 AC_DEFINE(HAVE_FSTYPE_MOUNT, 1,
983 [struct file_system_type has mount field])
991 # 3.0 dirty_inode() has a flag parameter
992 # see kernel commit aa38572954ade525817fe88c54faebf85e5a61c0
994 AC_DEFUN([LC_DIRTY_INODE_WITH_FLAG],
995 [AC_MSG_CHECKING([if dirty_inode super_operation takes flag])
996 LB_LINUX_TRY_COMPILE([
997 #include <linux/fs.h>
1000 inode->i_sb->s_op->dirty_inode(NULL, 0);
1002 AC_DEFINE(HAVE_DIRTY_INODE_HAS_FLAG, 1,
1003 [dirty_inode super_operation takes flag])
1004 AC_MSG_RESULT([yes])
1011 # 2.6.38 generic_permission taken 4 parameters.
1012 # in fact, it means rcu-walk aware permission bring.
1014 # 3.1 generic_permission taken 2 parameters.
1015 # see kernel commit 2830ba7f34ebb27c4e5b8b6ef408cd6d74860890
1017 AC_DEFUN([LC_GENERIC_PERMISSION],
1018 [AC_MSG_CHECKING([if generic_permission take 2 or 4 arguments])
1019 LB_LINUX_TRY_COMPILE([
1020 #include <linux/fs.h>
1022 generic_permission(NULL, 0);
1024 AC_DEFINE(HAVE_GENERIC_PERMISSION_2ARGS, 1,
1025 [generic_permission taken 2 arguments])
1026 AC_MSG_RESULT([yes, 2 args])
1028 LB_LINUX_TRY_COMPILE([
1029 #include <linux/fs.h>
1031 generic_permission(NULL, 0, 0, NULL);
1033 AC_DEFINE(HAVE_GENERIC_PERMISSION_4ARGS, 1,
1034 [generic_permission taken 4 arguments])
1035 AC_MSG_RESULT([yes, 4 args])
1043 # 3.1 renames lock-manager ops(lock_manager_operations) from fl_xxx to lm_xxx
1044 # see kernel commit 8fb47a4fbf858a164e973b8ea8ef5e83e61f2e50
1046 AC_DEFUN([LC_LM_XXX_LOCK_MANAGER_OPS],
1047 [AC_MSG_CHECKING([if lock-manager ops renamed to lm_xxx])
1048 LB_LINUX_TRY_COMPILE([
1049 #include <linux/fs.h>
1051 struct lock_manager_operations lm_ops;
1052 lm_ops.lm_compare_owner = NULL;
1054 AC_DEFINE(HAVE_LM_XXX_LOCK_MANAGER_OPS, 1,
1055 [lock-manager ops renamed to lm_xxx])
1056 AC_MSG_RESULT([yes])
1063 # 3.1 kills inode->i_alloc_sem, use i_dio_count and inode_dio_wait/
1064 # inode_dio_done instead.
1065 # see kernel commit bd5fe6c5eb9c548d7f07fe8f89a150bb6705e8e3
1067 AC_DEFUN([LC_INODE_DIO_WAIT],
1068 [AC_MSG_CHECKING([if inode->i_alloc_sem is killed and use inode_dio_wait/done.])
1069 LB_LINUX_TRY_COMPILE([
1070 #include <linux/fs.h>
1072 inode_dio_wait((struct inode *)0);
1073 inode_dio_done((struct inode *)0);
1075 AC_DEFINE(HAVE_INODE_DIO_WAIT, 1,
1076 [inode->i_alloc_sem is killed and use inode_dio_wait/done])
1077 AC_MSG_RESULT([yes])
1084 # 3.1 adds get_acl method to inode_operations to read ACL from disk.
1085 # see kernel commit 4e34e719e457f2e031297175410fc0bd4016a085
1087 AC_DEFUN([LC_IOP_GET_ACL],
1088 [AC_MSG_CHECKING([inode_operations has .get_acl member function])
1089 LB_LINUX_TRY_COMPILE([
1090 #include <linux/fs.h>
1092 struct inode_operations iop;
1095 AC_DEFINE(HAVE_IOP_GET_ACL, 1,
1096 [inode_operations has .get_acl member function])
1097 AC_MSG_RESULT([yes])
1104 # 3.1.1 has ext4_blocks_for_truncate
1106 AC_DEFUN([LC_BLOCKS_FOR_TRUNCATE],
1107 [AC_MSG_CHECKING([if kernel has ext4_blocks_for_truncate])
1108 LB_LINUX_TRY_COMPILE([
1109 #include <linux/fs.h>
1110 #include "$LINUX/fs/ext4/ext4_jbd2.h"
1111 #include "$LINUX/fs/ext4/truncate.h"
1113 ext4_blocks_for_truncate(NULL);
1115 AC_MSG_RESULT([yes])
1116 AC_DEFINE(HAVE_BLOCKS_FOR_TRUNCATE, 1,
1117 [kernel has ext4_blocks_for_truncate])
1124 # 3.1 introduced generic_file_llseek_size()
1126 AC_DEFUN([LC_FILE_LLSEEK_SIZE],
1127 [LB_CHECK_SYMBOL_EXPORT([generic_file_llseek_size],
1129 [AC_DEFINE(HAVE_FILE_LLSEEK_SIZE, 1,
1130 [generic_file_llseek_size is exported by the kernel])])
1134 # 3.2 request_queue.make_request_fn defined as function returns with void
1135 # see kernel commit 5a7bbad27a410350e64a2d7f5ec18fc73836c14f
1137 AC_DEFUN([LC_HAVE_VOID_MAKE_REQUEST_FN],
1138 [AC_MSG_CHECKING([if request_queue.make_request_fn returns void but not int])
1139 LB_LINUX_TRY_COMPILE([
1140 #include <linux/blkdev.h>
1143 make_request_fn *mrf;
1144 ret = mrf(NULL, NULL);
1148 AC_DEFINE(HAVE_VOID_MAKE_REQUEST_FN, 1,
1149 [request_queue.make_request_fn returns void but not int])
1150 AC_MSG_RESULT([yes])
1155 # 3.2 protects inode->i_nlink from direct modification
1156 # see kernel commit a78ef704a8dd430225955f0709b22d4a6ba21deb
1157 # at the same time adds set_nlink(), so checks set_nlink() for it.
1159 AC_DEFUN([LC_HAVE_PROTECT_I_NLINK],
1160 [AC_MSG_CHECKING([if inode->i_nlink is protected from direct modification])
1161 LB_LINUX_TRY_COMPILE([
1162 #include <linux/fs.h>
1167 AC_DEFINE(HAVE_PROTECT_I_NLINK, 1,
1168 [inode->i_nlink is protected from direct modification])
1169 AC_MSG_RESULT([yes])
1176 # 3.3 introduces migrate_mode.h and migratepage has 4 args
1178 AC_DEFUN([LC_HAVE_MIGRATE_HEADER],
1179 [LB_CHECK_FILE([$LINUX/include/linux/migrate.h],[
1180 AC_DEFINE(HAVE_MIGRATE_H, 1,
1181 [kernel has include/linux/migrate.h])
1182 ],[LB_CHECK_FILE([$LINUX/include/linux/migrate_mode.h],[
1183 AC_DEFINE(HAVE_MIGRATE_MODE_H, 1,
1184 [kernel has include/linux/migrate_mode.h])
1191 AC_DEFUN([LC_MIGRATEPAGE_4ARGS],
1192 [AC_MSG_CHECKING([if address_space_operations.migratepage has 4 args])
1193 LB_LINUX_TRY_COMPILE([
1194 #include <linux/fs.h>
1195 #ifdef HAVE_MIGRATE_H
1196 #include <linux/migrate.h>
1197 #elif defined(HAVE_MIGRATE_MODE_H)
1198 #include <linux/migrate_mode.h>
1201 struct address_space_operations aops;
1203 aops.migratepage(NULL, NULL, NULL, MIGRATE_ASYNC);
1205 AC_DEFINE(HAVE_MIGRATEPAGE_4ARGS, 1,
1206 [address_space_operations.migratepage has 4 args])
1207 AC_MSG_RESULT([yes])
1214 # 3.3 switchs super_operations to use dentry as parameter (but not vfsmount)
1215 # see kernel commit 34c80b1d93e6e20ca9dea0baf583a5b5510d92d4
1217 AC_DEFUN([LC_SUPEROPS_USE_DENTRY],
1218 [AC_MSG_CHECKING([if super_operations use dentry as parameter])
1219 tmp_flags="$EXTRA_KCFLAGS"
1220 EXTRA_KCFLAGS="-Werror"
1221 LB_LINUX_TRY_COMPILE([
1222 #include <linux/fs.h>
1223 int show_options(struct seq_file *seq, struct dentry *root){
1227 struct super_operations ops;
1228 ops.show_options = show_options;
1230 AC_DEFINE(HAVE_SUPEROPS_USE_DENTRY, 1,
1231 [super_operations use dentry as parameter])
1232 AC_MSG_RESULT([yes])
1236 EXTRA_KCFLAGS="$tmp_flags"
1240 # 3.3 switchs inode_operations to use umode_t as parameter (but not int)
1241 # see kernel commit 1a67aafb5f72a436ca044293309fa7e6351d6a35
1243 AC_DEFUN([LC_INODEOPS_USE_UMODE_T],
1244 [AC_MSG_CHECKING([if inode_operations use umode_t as parameter])
1245 tmp_flags="$EXTRA_KCFLAGS"
1246 EXTRA_KCFLAGS="-Werror"
1247 LB_LINUX_TRY_COMPILE([
1248 #include <linux/fs.h>
1249 #include <linux/types.h>
1250 int my_mknod(struct inode *dir, struct dentry *dchild,
1251 umode_t mode, dev_t dev)
1256 struct inode_operations ops;
1257 ops.mknod = my_mknod;
1259 AC_DEFINE(HAVE_INODEOPS_USE_UMODE_T, 1,
1260 [inode_operations use umode_t as parameter])
1261 AC_MSG_RESULT([yes])
1265 EXTRA_KCFLAGS="$tmp_flags"
1268 # 3.4 kmap_atomic removes second argument
1269 # see kernel commit 1ec9c5ddc17aa398f05646abfcbaf315b544e62f
1271 AC_DEFUN([LC_KMAP_ATOMIC_HAS_1ARG],
1272 [AC_MSG_CHECKING([if kmap_atomic has only 1 argument])
1273 LB_LINUX_TRY_COMPILE([
1274 #include <linux/highmem.h>
1278 AC_DEFINE(HAVE_KMAP_ATOMIC_HAS_1ARG, 1,
1279 [have kmap_atomic has only 1 argument])
1280 AC_MSG_RESULT([yes])
1287 # 3.4 switchs touch_atime to struct path
1288 # see kernel commit 68ac1234fb949b66941d94dce4157742799fc581
1290 AC_DEFUN([LC_TOUCH_ATIME_1ARG],
1291 [AC_MSG_CHECKING([if touch_atime use one argument])
1292 LB_LINUX_TRY_COMPILE([
1293 #include <linux/fs.h>
1295 touch_atime((struct path *)NULL);
1297 AC_DEFINE(HAVE_TOUCH_ATIME_1ARG, 1,
1298 [touch_atime use one argument])
1299 AC_MSG_RESULT([yes])
1306 # 3.4 converts d_alloc_root to d_make_root
1307 # see kernel commit 32991ab305ace7017c62f8eecbe5eb36dc32e13b
1309 AC_DEFUN([LC_HAVE_D_MAKE_ROOT],
1310 [AC_MSG_CHECKING([if have d_make_root])
1311 LB_LINUX_TRY_COMPILE([
1312 #include <linux/fs.h>
1314 d_make_root((struct inode *)NULL);
1316 AC_DEFINE(HAVE_D_MAKE_ROOT, 1,
1318 AC_MSG_RESULT([yes])
1325 # 3.5 renames end_writeback() back to clear_inode()...
1326 # see kernel commit dbd5768f87ff6fb0a4fe09c4d7b6c4a24de99430
1328 AC_DEFUN([LC_HAVE_CLEAR_INODE],
1329 [AC_MSG_CHECKING([if have clear_inode])
1330 LB_LINUX_TRY_COMPILE([
1331 #include <linux/fs.h>
1333 clear_inode((struct inode *)NULL);
1335 AC_DEFINE(HAVE_CLEAR_INODE, 1,
1337 AC_MSG_RESULT([yes])
1344 # 3.5 encode_fh has parent inode passed in directly
1345 # see kernel commit b0b0382b
1347 AC_DEFUN([LC_HAVE_ENCODE_FH_PARENT],
1348 [AC_MSG_CHECKING([if encode_fh have parent inode as parameter])
1349 tmp_flags="$EXTRA_KCFLAGS"
1350 EXTRA_KCFLAGS="-Werror"
1351 LB_LINUX_TRY_COMPILE([
1352 #include <linux/exportfs.h>
1353 #include <linux/fs.h>
1354 #include <linux/types.h>
1355 int ll_encode_fh(struct inode *i, __u32 *a, int *b, struct inode *p)
1360 struct export_operations exp_op;
1361 exp_op.encode_fh = ll_encode_fh;
1363 AC_DEFINE(HAVE_ENCODE_FH_PARENT, 1,
1364 [have parent inode as parameter])
1365 AC_MSG_RESULT([yes])
1369 EXTRA_KCFLAGS="$tmp_flags"
1372 # 3.5 has generic_file_llseek_size with 5 args
1373 AC_DEFUN([LC_FILE_LLSEEK_SIZE_5ARG],
1374 [AC_MSG_CHECKING([if kernel has generic_file_llseek_size with 5 args])
1375 LB_LINUX_TRY_COMPILE([
1376 #include <linux/fs.h>
1378 generic_file_llseek_size(NULL, 0, 0, 0, 0);
1380 AC_MSG_RESULT([yes])
1381 AC_DEFINE(HAVE_FILE_LLSEEK_SIZE_5ARGS, 1,
1382 [kernel has generic_file_llseek_size with 5 args])
1389 # 3.6 switch i_dentry/d_alias from list to hlist
1391 AC_DEFUN([LC_HAVE_DENTRY_D_ALIAS_HLIST],
1392 [AC_MSG_CHECKING([if i_dentry/d_alias uses hlist])
1393 tmp_flags="$EXTRA_KCFLAGS"
1394 EXTRA_KCFLAGS="-Werror"
1395 LB_LINUX_TRY_COMPILE([
1396 #include <linux/fs.h>
1397 #include <linux/list.h>
1400 struct dentry dentry;
1401 struct hlist_head head;
1402 struct hlist_node node;
1403 inode.i_dentry = head;
1404 dentry.d_alias = node;
1406 AC_DEFINE(HAVE_DENTRY_D_ALIAS_HLIST, 1,
1407 [have i_dentry/d_alias uses hlist])
1408 AC_MSG_RESULT([yes])
1412 EXTRA_KCFLAGS="$tmp_flags"
1416 # 3.6 dentry_open uses struct path as first argument
1417 # see kernel commit 765927b2
1419 AC_DEFUN([LC_DENTRY_OPEN_USE_PATH],
1420 [AC_MSG_CHECKING([if dentry_open uses struct path as first argument])
1421 tmp_flags="$EXTRA_KCFLAGS"
1422 EXTRA_KCFLAGS="-Werror"
1423 LB_LINUX_TRY_COMPILE([
1424 #include <linux/fs.h>
1425 #include <linux/path.h>
1428 dentry_open(&path, 0, NULL);
1430 AC_DEFINE(HAVE_DENTRY_OPEN_USE_PATH, 1,
1431 [dentry_open uses struct path as first argument])
1432 AC_MSG_RESULT([yes])
1436 EXTRA_KCFLAGS="$tmp_flags"
1440 # 3.6 vfs adds iop->atomic_open
1442 AC_DEFUN([LC_HAVE_IOP_ATOMIC_OPEN],
1443 [AC_MSG_CHECKING([if iop has atomic_open])
1444 LB_LINUX_TRY_COMPILE([
1445 #include <linux/fs.h>
1447 struct inode_operations iop;
1448 iop.atomic_open = NULL;
1450 AC_DEFINE(HAVE_IOP_ATOMIC_OPEN, 1,
1451 [have iop atomic_open])
1452 AC_MSG_RESULT([yes])
1459 # 3.7 posix_acl_{to,from}_xattr take struct user_namespace
1461 AC_DEFUN([LC_HAVE_POSIXACL_USER_NS],
1462 [AC_MSG_CHECKING([if posix_acl_to_xattr takes struct user_namespace])
1463 LB_LINUX_TRY_COMPILE([
1464 #include <linux/fs.h>
1465 #include <linux/posix_acl_xattr.h>
1467 posix_acl_to_xattr((struct user_namespace *)NULL, NULL, NULL, 0);
1469 AC_DEFINE(HAVE_POSIXACL_USER_NS, 1,
1470 [posix_acl_to_xattr takes struct user_namespace])
1471 AC_MSG_RESULT([yes])
1478 # 3.9 uses hlist_for_each_entry with 3 args
1479 # b67bfe0d42cac56c512dd5da4b1b347a23f4b70a
1481 AC_DEFUN([LC_HAVE_HLIST_FOR_EACH_3ARG],
1482 [AC_MSG_CHECKING([if hlist_for_each_entry has 3 args])
1483 LB_LINUX_TRY_COMPILE([
1484 #include <linux/list.h>
1485 #include <linux/fs.h>
1487 struct inode *inode;
1488 struct dentry *dentry;
1489 hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) {
1493 AC_DEFINE(HAVE_HLIST_FOR_EACH_3ARG, 1, [3 args])
1494 AC_MSG_RESULT([yes])
1501 # 3.9 killed f_vfsmnt by
1502 # 182be684784334598eee1d90274e7f7aa0063616
1503 # replacement is f_path.mnt
1505 AC_DEFUN([LC_HAVE_F_PATH_MNT],
1506 [AC_MSG_CHECKING([if struct file has f_path.mnt])
1507 LB_LINUX_TRY_COMPILE([
1508 #include <linux/fs.h>
1510 struct file *fp = NULL;
1513 path.mnt = fp->f_path.mnt;
1515 AC_DEFINE(HAVE_F_PATH_MNT,1,[yes])
1516 AC_MSG_RESULT([yes])
1525 # Lustre linux kernel checks
1527 AC_DEFUN([LC_PROG_LINUX],
1531 LC_CONFIG_LIBLUSTRE_RECOVERY
1532 LC_CONFIG_HEALTH_CHECK_WRITE
1533 LC_CONFIG_LRU_RESIZE
1534 LC_LLITE_LLOOP_MODULE
1537 LC_EXPORT_TRUNCATE_COMPLETE
1548 #2.6.18 + RHEL5 (fc6)
1551 # raid5-zerocopy patch
1555 LC_FS_RENAME_DOES_D_MOVE
1558 LC_UNREGISTER_BLKDEV_RETURN_INT
1565 LC_FS_STRUCT_USE_PATH
1568 LC_SECURITY_PLUG # for SLES10 SP2
1569 LC_INODE_PERMISION_2ARGS
1574 # 2.6.27.15-2 sles11
1579 LC_BLK_QUEUE_MAX_SEGMENTS
1582 LC_HAVE_DQUOT_FS_DISK_QUOTA
1583 LC_HAVE_DQUOT_SUSPEND
1587 LC_EXPORT_SIMPLE_SETATTR
1591 LC_SBOPS_EVICT_INODE
1597 LC_BLKDEV_GET_BY_DEV
1598 LC_GENERIC_PERMISSION
1599 LC_QUOTA_ON_USE_PATH
1606 LC_REQUEST_QUEUE_UNPLUG_FN
1607 LC_HAVE_FSTYPE_MOUNT
1610 LC_DIRTY_INODE_WITH_FLAG
1613 LC_LM_XXX_LOCK_MANAGER_OPS
1619 LC_BLOCKS_FOR_TRUNCATE
1622 LC_HAVE_VOID_MAKE_REQUEST_FN
1623 LC_HAVE_PROTECT_I_NLINK
1626 LC_HAVE_MIGRATE_HEADER
1627 LC_MIGRATEPAGE_4ARGS
1628 LC_SUPEROPS_USE_DENTRY
1629 LC_INODEOPS_USE_UMODE_T
1634 LC_KMAP_ATOMIC_HAS_1ARG
1638 LC_HAVE_ENCODE_FH_PARENT
1639 LC_FILE_LLSEEK_SIZE_5ARG
1642 LC_HAVE_DENTRY_D_ALIAS_HLIST
1643 LC_DENTRY_OPEN_USE_PATH
1644 LC_HAVE_IOP_ATOMIC_OPEN
1647 LC_HAVE_POSIXACL_USER_NS
1650 LC_HAVE_HLIST_FOR_EACH_3ARG
1654 if test x$enable_server = xyes ; then
1655 AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server])
1656 LC_FUNC_DEV_SET_RDONLY
1664 # LC_CONFIG_CLIENT_SERVER
1666 # Build client/server sides of Lustre
1668 AC_DEFUN([LC_CONFIG_CLIENT_SERVER],
1669 [AC_MSG_CHECKING([whether to build Lustre server support])
1670 AC_ARG_ENABLE([server],
1671 AC_HELP_STRING([--disable-server],
1672 [disable Lustre server support]),
1673 [],[enable_server='yes'])
1674 AC_MSG_RESULT([$enable_server])
1676 AC_MSG_CHECKING([whether to build Lustre client support])
1677 AC_ARG_ENABLE([client],
1678 AC_HELP_STRING([--disable-client],
1679 [disable Lustre client support]),
1680 [],[enable_client='yes'])
1681 AC_MSG_RESULT([$enable_client])])
1684 # LC_CONFIG_LIBLUSTRE
1686 # whether to build liblustre
1688 AC_DEFUN([LC_CONFIG_LIBLUSTRE],
1689 [AC_MSG_CHECKING([whether to build Lustre library])
1690 AC_ARG_ENABLE([liblustre],
1691 AC_HELP_STRING([--disable-liblustre],
1692 [disable building of Lustre library]),
1693 [],[enable_liblustre=$with_sysio])
1694 AC_MSG_RESULT([$enable_liblustre])
1695 # only build sysio if liblustre is built
1696 with_sysio="$enable_liblustre"
1698 AC_MSG_CHECKING([whether to build liblustre tests])
1699 AC_ARG_ENABLE([liblustre-tests],
1700 AC_HELP_STRING([--enable-liblustre-tests],
1701 [enable liblustre tests, if --disable-tests is used]),
1702 [],[enable_liblustre_tests=$enable_tests])
1703 if test x$enable_liblustre != xyes ; then
1704 enable_liblustre_tests='no'
1706 AC_MSG_RESULT([$enable_liblustre_tests])
1708 AC_MSG_CHECKING([whether to enable liblustre acl])
1709 AC_ARG_ENABLE([liblustre-acl],
1710 AC_HELP_STRING([--disable-liblustre-acl],
1711 [disable ACL support for liblustre]),
1712 [],[enable_liblustre_acl=yes])
1713 AC_MSG_RESULT([$enable_liblustre_acl])
1714 if test x$enable_liblustre_acl = xyes ; then
1715 AC_DEFINE(LIBLUSTRE_POSIX_ACL, 1, Liblustre Support ACL-enabled MDS)
1721 AC_ARG_ENABLE(mpitests,
1722 AC_HELP_STRING([--enable-mpitests=yes|no|mpicc wrapper],
1723 [include mpi tests]),
1734 MPICC_WRAPPER=$enableval
1744 if test x$enable_mpitests != xno; then
1745 AC_MSG_CHECKING([whether mpitests can be built])
1753 MPI_Initialized(&flag);
1756 AC_MSG_RESULT([yes])
1763 AC_SUBST(MPICC_WRAPPER)
1765 AC_MSG_NOTICE([Enabling Lustre configure options for libsysio])
1766 ac_configure_args="$ac_configure_args --with-lustre-hack --with-sockets"
1769 LC_CONFIG_LIBLUSTRE_RECOVERY
1775 # whether to enable quota support global control
1777 AC_DEFUN([LC_CONFIG_QUOTA],
1778 [AC_ARG_ENABLE([quota],
1779 AC_HELP_STRING([--enable-quota],
1780 [enable quota support]),
1781 [],[enable_quota='yes'])
1784 AC_DEFUN([LC_QUOTA],
1788 AC_CHECK_HEADER(sys/quota.h,
1789 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1, [Define to 1 if you have <sys/quota.h>.])],
1790 [AC_MSG_ERROR([don't find <sys/quota.h> in your system])])
1796 # whether to enable split support
1798 AC_DEFUN([LC_CONFIG_SPLIT],
1799 [AC_MSG_CHECKING([whether to enable split support])
1800 AC_ARG_ENABLE([split],
1801 AC_HELP_STRING([--enable-split],
1802 [enable split support]),
1803 [],[enable_split='no'])
1804 AC_MSG_RESULT([$enable_split])
1805 if test x$enable_split != xno; then
1806 AC_DEFINE(HAVE_SPLIT_SUPPORT, 1, [enable split support])
1811 # LC_LLITE_LLOOP_MODULE
1812 # lloop_llite.ko does not currently work with page sizes
1815 AC_DEFUN([LC_LLITE_LLOOP_MODULE],
1816 [AC_MSG_CHECKING([whether to enable llite_lloop module])
1817 LB_LINUX_TRY_COMPILE([
1818 #include <asm/page.h>
1820 #if PAGE_SIZE >= 65536
1821 #error "PAGE_SIZE >= 65536"
1824 enable_llite_lloop_module='yes'
1825 AC_MSG_RESULT([yes])
1827 enable_llite_lloop_module='no'
1835 # configure support for optional OSD implementation
1837 AC_DEFUN([LC_OSD_ADDON],
1838 [AC_MSG_CHECKING([for osd])
1840 AC_HELP_STRING([--with-osd=path],
1841 [set path to optional osd]),
1844 no) ENABLEOSDADDON=0
1846 *) OSDADDON="${with_osd}"
1853 if test $ENABLEOSDADDON -eq 0; then
1857 OSDMODNAME=`basename $OSDADDON`
1858 if test -e $LUSTRE/$OSDMODNAME; then
1859 AC_MSG_RESULT([can't link])
1861 elif ln -s $OSDADDON $LUSTRE/$OSDMODNAME; then
1862 AC_MSG_RESULT([$OSDMODNAME])
1863 OSDADDON="subdir-m += $OSDMODNAME"
1865 AC_MSG_RESULT([can't link])
1875 # other configure checks
1877 AC_DEFUN([LC_CONFIGURE],
1878 [LC_CONFIG_OBD_BUFFER_SIZE
1880 if test $target_cpu == "i686" -o $target_cpu == "x86_64"; then
1881 CFLAGS="$CFLAGS -Werror"
1884 # maximum MDS thread count
1887 # include/liblustre.h
1888 AC_CHECK_HEADERS([sys/user.h sys/vfs.h stdint.h blkid/blkid.h])
1890 # liblustre/llite_lib.h
1891 AC_CHECK_HEADERS([xtio.h file.h])
1894 AC_CHECK_HEADERS([linux/types.h sys/types.h linux/unistd.h unistd.h])
1897 AC_CHECK_HEADERS([netinet/in.h arpa/inet.h catamount/data.h])
1898 AC_CHECK_FUNCS([inet_ntoa])
1900 # libsysio/src/readlink.c
1903 # lvfs/prng.c - depends on linux/types.h from liblustre/dir.c
1904 AC_CHECK_HEADERS([linux/random.h], [], [],
1905 [#ifdef HAVE_LINUX_TYPES_H
1906 # include <linux/types.h>
1911 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
1913 # check for -lz support
1917 [AC_CHECK_HEADERS([zlib.h],
1919 AC_DEFINE([HAVE_ADLER], 1,
1920 [support alder32 checksum type])],
1921 [AC_MSG_WARN([No zlib-devel package found,
1922 unable to use adler32 checksum])])],
1923 [AC_MSG_WARN([No zlib package found, unable to use adler32 checksum])]
1928 AC_CHECK_LIB([selinux],
1929 [is_selinux_enabled],
1930 [AC_CHECK_HEADERS([selinux.h],
1931 [SELINUX="-lselinux"
1932 AC_DEFINE([HAVE_SELINUX], 1,
1933 [support for selinux ])],
1934 [AC_MSG_WARN([No selinux-devel package found,
1935 unable to build selinux enabled
1937 [AC_MSG_WARN([No selinux package found, unable to build selinux
1943 AC_ARG_ENABLE([mindf],
1944 AC_HELP_STRING([--enable-mindf],
1945 [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
1947 if test "$enable_mindf" = "yes" ; then
1948 AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])
1951 AC_ARG_ENABLE([fail_alloc],
1952 AC_HELP_STRING([--disable-fail-alloc],
1953 [disable randomly alloc failure]),
1954 [],[enable_fail_alloc=yes])
1955 AC_MSG_CHECKING([whether to randomly failing memory alloc])
1956 AC_MSG_RESULT([$enable_fail_alloc])
1957 if test x$enable_fail_alloc != xno ; then
1958 AC_DEFINE([RANDOM_FAIL_ALLOC], 1, [enable randomly alloc failure])
1961 AC_ARG_ENABLE([invariants],
1962 AC_HELP_STRING([--enable-invariants],
1963 [enable invariant checking (cpu intensive)]),
1965 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
1966 AC_MSG_RESULT([$enable_invariants])
1967 if test x$enable_invariants = xyes ; then
1968 AC_DEFINE([CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK], 1, [enable invariant checking])
1971 AC_ARG_ENABLE([lu_ref],
1972 AC_HELP_STRING([--enable-lu_ref],
1973 [enable lu_ref reference tracking code]),
1975 AC_MSG_CHECKING([whether to track references with lu_ref])
1976 AC_MSG_RESULT([$enable_lu_ref])
1977 if test x$enable_lu_ref = xyes ; then
1978 AC_DEFINE([USE_LU_REF], 1, [enable lu_ref reference tracking code])
1981 AC_ARG_ENABLE([pgstate-track],
1982 AC_HELP_STRING([--enable-pgstate-track],
1983 [enable page state tracking]),
1984 [enable_pgstat_track='yes'],[])
1985 AC_MSG_CHECKING([whether to enable page state tracking])
1986 AC_MSG_RESULT([$enable_pgstat_track])
1987 if test x$enable_pgstat_track = xyes ; then
1988 AC_DEFINE([CONFIG_DEBUG_PAGESTATE_TRACKING], 1,
1989 [enable page state tracking code])
1996 # AM_CONDITIONALS for lustre
1998 AC_DEFUN([LC_CONDITIONALS],
1999 [AM_CONDITIONAL(LIBLUSTRE, test x$enable_liblustre = xyes)
2000 AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno)
2001 AM_CONDITIONAL(LIBLUSTRE_TESTS, test x$enable_liblustre_tests = xyes)
2002 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
2003 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
2004 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
2005 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
2006 AM_CONDITIONAL(BLKID, test x$ac_cv_header_blkid_blkid_h = xyes)
2007 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
2008 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
2009 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
2010 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
2011 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
2012 AM_CONDITIONAL(LLITE_LLOOP, test x$enable_llite_lloop_module = xyes)
2018 # files that should be generated with AC_OUTPUT
2020 AC_DEFUN([LC_CONFIG_FILES],
2024 lustre/autoconf/Makefile
2025 lustre/conf/Makefile
2026 lustre/contrib/Makefile
2028 lustre/include/Makefile
2029 lustre/include/lustre_ver.h
2030 lustre/include/linux/Makefile
2031 lustre/include/darwin/Makefile
2032 lustre/include/lustre/Makefile
2033 lustre/kernel_patches/targets/2.6-rhel6.target
2034 lustre/kernel_patches/targets/2.6-rhel5.target
2035 lustre/kernel_patches/targets/2.6-sles11.target
2036 lustre/kernel_patches/targets/3.0-sles11.target
2037 lustre/kernel_patches/targets/2.6-fc11.target
2038 lustre/kernel_patches/targets/2.6-fc12.target
2039 lustre/kernel_patches/targets/2.6-fc15.target
2040 lustre/kernel_patches/targets/3.x-fc18.target
2041 lustre/ldlm/Makefile
2043 lustre/fid/autoMakefile
2044 lustre/liblustre/Makefile
2045 lustre/liblustre/tests/Makefile
2046 lustre/liblustre/tests/mpi/Makefile
2047 lustre/llite/Makefile
2048 lustre/llite/autoMakefile
2049 lustre/lclient/Makefile
2051 lustre/lov/autoMakefile
2052 lustre/lvfs/Makefile
2053 lustre/lvfs/autoMakefile
2055 lustre/mdc/autoMakefile
2057 lustre/lmv/autoMakefile
2058 lustre/lfsck/Makefile
2059 lustre/lfsck/autoMakefile
2061 lustre/mdt/autoMakefile
2063 lustre/mdd/autoMakefile
2065 lustre/fld/autoMakefile
2066 lustre/obdclass/Makefile
2067 lustre/obdclass/autoMakefile
2068 lustre/obdclass/linux/Makefile
2069 lustre/obdecho/Makefile
2070 lustre/obdecho/autoMakefile
2072 lustre/ofd/autoMakefile
2074 lustre/osc/autoMakefile
2076 lustre/ost/autoMakefile
2077 lustre/osd-ldiskfs/Makefile
2078 lustre/osd-ldiskfs/autoMakefile
2079 lustre/osd-zfs/Makefile
2080 lustre/osd-zfs/autoMakefile
2082 lustre/mgc/autoMakefile
2084 lustre/mgs/autoMakefile
2085 lustre/target/Makefile
2086 lustre/ptlrpc/Makefile
2087 lustre/ptlrpc/autoMakefile
2088 lustre/ptlrpc/gss/Makefile
2089 lustre/ptlrpc/gss/autoMakefile
2090 lustre/quota/Makefile
2091 lustre/quota/autoMakefile
2092 lustre/scripts/Makefile
2093 lustre/tests/Makefile
2094 lustre/tests/mpi/Makefile
2095 lustre/utils/Makefile
2096 lustre/utils/gss/Makefile
2098 lustre/osp/autoMakefile
2100 lustre/lod/autoMakefile
2101 lustre/obdclass/darwin/Makefile