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], [
47 ]) # 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([for 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)]),
59 [OBD_BUFFER_SIZE=$with_obd_buffer_size],
60 [OBD_BUFFER_SIZE=8192])
61 AC_MSG_RESULT([$OBD_BUFFER_SIZE bytes])
62 AC_DEFINE_UNQUOTED(CONFIG_LUSTRE_OBD_MAX_IOCTL_BUFFER, $OBD_BUFFER_SIZE,
64 ]) # LC_CONFIG_OBD_BUFFER_SIZE
67 # LC_GLIBC_SUPPORT_FHANDLES
69 AC_DEFUN([LC_GLIBC_SUPPORT_FHANDLES], [
70 AC_CHECK_FUNCS([name_to_handle_at],
71 [AC_DEFINE(HAVE_FHANDLE_GLIBC_SUPPORT, 1,
72 [file handle and related syscalls are supported])],
73 [AC_MSG_WARN([file handle and related syscalls are not supported])])
74 ]) # LC_GLIBC_SUPPORT_FHANDLES
77 # LC_FUNC_DEV_SET_RDONLY
79 # check whether dev_set_rdonly is exported. This is needed until we
80 # have another mechanism to fence IO from the underlying device.
82 AC_DEFUN([LC_FUNC_DEV_SET_RDONLY], [
83 LB_CHECK_EXPORT([dev_set_rdonly], [block/ll_rw_block.c block/blk-core.c],
84 [AC_DEFINE(HAVE_DEV_SET_RDONLY, 1,
85 [kernel exports dev_set_rdonly])],
86 [AC_MSG_WARN([kernel missing dev_set_rdonly patch for testing])])
87 ]) # LC_FUNC_DEV_SET_RDONLY
92 # Ensure stack size big than 8k in Lustre server (all kernels)
94 AC_DEFUN([LC_STACK_SIZE], [
95 LB_CHECK_COMPILE([if stack size big than 8k],
97 #include <linux/thread_info.h>
99 #if THREAD_SIZE < 8192
100 #error "stack size < 8192"
102 ], [], [AC_MSG_ERROR([
104 Lustre requires that Linux is configured with at least a 8KB stack.
111 # Allow the user to set the MDS thread upper limit
113 AC_DEFUN([LC_MDS_MAX_THREADS], [
114 AC_MSG_CHECKING([for maximum number of MDS threads])
115 AC_ARG_WITH([mds_max_threads],
116 AC_HELP_STRING([--with-mds-max-threads=count],
117 [maximum threads available on the MDS: (default=512)]),
118 [AC_DEFINE_UNQUOTED(MDS_MAX_THREADS, $with_mds_max_threads,
119 [maximum number of MDS threads])])
120 AC_MSG_RESULT([$with_mds_max_threads])
121 ]) # LC_MDS_MAX_THREADS
126 # the pinger is temporary, until we have the recovery node in place
128 AC_DEFUN([LC_CONFIG_PINGER], [
129 AC_MSG_CHECKING([whether to enable Lustre pinger support])
130 AC_ARG_ENABLE([pinger],
131 AC_HELP_STRING([--disable-pinger],
132 [disable recovery pinger support]),
133 [], [enable_pinger="yes"])
134 AC_MSG_RESULT([$enable_pinger])
135 AS_IF([test "x$enable_pinger" != xno],
136 [AC_DEFINE(ENABLE_PINGER, 1,[Use the Pinger])])
137 ]) # LC_CONFIG_PINGER
142 # do checksum of bulk data between client and OST
144 AC_DEFUN([LC_CONFIG_CHECKSUM], [
145 AC_MSG_CHECKING([whether to enable data checksum support])
146 AC_ARG_ENABLE([checksum],
147 AC_HELP_STRING([--disable-checksum],
148 [disable data checksum support]),
149 [], [enable_checksum="yes"])
150 AC_MSG_RESULT([$enable_checksum])
151 AS_IF([test "x$enable_checksum" != xno],
152 [AC_DEFINE(ENABLE_CHECKSUM, 1, [do data checksums])])
153 ]) # LC_CONFIG_CHECKSUM
156 # LC_CONFIG_HEALTH_CHECK_WRITE
158 # Turn off the actual write to the disk
160 AC_DEFUN([LC_CONFIG_HEALTH_CHECK_WRITE], [
161 AC_MSG_CHECKING([whether to enable a write with the health check])
162 AC_ARG_ENABLE([health_write],
163 AC_HELP_STRING([--enable-health_write],
164 [enable disk writes when doing health check]),
165 [], [enable_health_write="no"])
166 AC_MSG_RESULT([$enable_health_write])
167 AS_IF([test "x$enable_health_write" != xno],
168 [AC_DEFINE(USE_HEALTH_CHECK_WRITE, 1, [Write when Checking Health])])
169 ]) # LC_CONFIG_HEALTH_CHECK_WRITE
172 # LC_CONFIG_LRU_RESIZE
174 AC_DEFUN([LC_CONFIG_LRU_RESIZE], [
175 AC_MSG_CHECKING([whether to enable lru self-adjusting])
176 AC_ARG_ENABLE([lru_resize],
177 AC_HELP_STRING([--enable-lru-resize],
178 [enable lru resize support]),
179 [], [enable_lru_resize="yes"])
180 AC_MSG_RESULT([$enable_lru_resize])
181 AS_IF([test "x$enable_lru_resize" != xno],
182 [AC_DEFINE(HAVE_LRU_RESIZE_SUPPORT, 1, [Enable lru resize support])])
183 ]) # LC_CONFIG_LRU_RESIZE
188 # Quota support. The kernel must support CONFIG_QUOTA.
190 AC_DEFUN([LC_QUOTA_CONFIG], [
191 LB_CHECK_CONFIG_IM([QUOTA], [],
194 Lustre quota requires that CONFIG_QUOTA is enabled in your kernel.
199 # LC_EXPORT_TRUNCATE_COMPLETE_PAGE
201 # truncate_complete_page() has never been exported from an upstream kernel
202 # remove_from_page_cache() was exported between 2.6.35 and 2.6.38
203 # delete_from_page_cache() is exported from 2.6.39
205 AC_DEFUN([LC_EXPORT_TRUNCATE_COMPLETE_PAGE], [
206 LB_CHECK_EXPORT([truncate_complete_page], [mm/truncate.c],
207 [AC_DEFINE(HAVE_TRUNCATE_COMPLETE_PAGE, 1,
208 [kernel export truncate_complete_page])])
209 LB_CHECK_EXPORT([remove_from_page_cache], [mm/filemap.c],
210 [AC_DEFINE(HAVE_REMOVE_FROM_PAGE_CACHE, 1,
211 [kernel export remove_from_page_cache])])
212 LB_CHECK_EXPORT([delete_from_page_cache], [mm/filemap.c],
213 [AC_DEFINE(HAVE_DELETE_FROM_PAGE_CACHE, 1,
214 [kernel export delete_from_page_cache])])
215 ]) # LC_EXPORT_TRUNCATE_COMPLETE_PAGE
218 # LC_CONFIG_RMTCLIENT
221 dnl the AES symbol usually tied with arch, e.g. CRYPTO_AES_586
223 AC_DEFUN([LC_CONFIG_RMTCLIENT], [
224 LB_CHECK_CONFIG_IM([CRYPTO_AES], [],
227 Lustre remote client require that CONFIG_CRYPTO_AES is enabled in your kernel.
229 ]) # LC_CONFIG_RMTCLIENT
232 # LC_CONFIG_GSS_KEYRING
234 # default 'auto', tests for dependencies, if found, enables;
235 # only called if gss is enabled
237 AC_DEFUN([LC_CONFIG_GSS_KEYRING], [
238 AC_MSG_CHECKING([whether to enable gss keyring backend])
239 AC_ARG_ENABLE([gss_keyring],
240 [AC_HELP_STRING([--disable-gss-keyring],
241 [disable gss keyring backend])],
242 [], [enable_gss_keyring="auto"])
243 AC_MSG_RESULT([$enable_gss_keyring])
244 AS_IF([test "x$enable_gss_keyring" != xno], [
245 LB_CHECK_CONFIG_IM([KEYS], [], [
246 gss_keyring_conf_test="fail"
249 GSS keyring backend require that CONFIG_KEYS be enabled in your kernel.
252 AC_CHECK_LIB([keyutils], [keyctl_search], [], [
253 gss_keyring_conf_test="fail"
256 libkeyutils is not found, which is required by gss keyring backend
259 AS_IF([test "x$gss_keyring_conf_test" != xfail], [
260 AC_DEFINE([HAVE_GSS_KEYRING], [1],
261 [Define this if you enable gss keyring backend])
262 enable_gss_keyring="yes"
264 AS_IF([test "x$enable_gss_keyring" = xyes], [
267 Cannot enable gss_keyring. See above for details.
272 Cannot enable gss keyring. See above for details.
277 ]) # LC_CONFIG_GSS_KEYRING
282 AC_DEFUN([LC_CONFIG_SUNRPC], [
283 LB_CHECK_CONFIG_IM([SUNRPC], [], [
284 AS_IF([test "x$sunrpc_required" = xyes], [
287 kernel SUNRPC support is required by using GSS.
290 ]) # LC_CONFIG_SUNRPC
293 # LC_CONFIG_GSS (default 'auto' (tests for dependencies, if found, enables))
295 # Build gss and related tools of Lustre. Currently both kernel and user space
296 # parts are depend on linux platform.
298 AC_DEFUN([LC_CONFIG_GSS], [
299 AC_MSG_CHECKING([whether to enable gss/krb5 support])
301 [AC_HELP_STRING([--enable-gss], [enable gss/krb5 support])],
302 [], [enable_gss="auto"])
303 AC_MSG_RESULT([$enable_gss])
305 AS_IF([test "x$enable_gss" != xno], [
306 LC_CONFIG_GSS_KEYRING
307 sunrpc_required=$enable_gss
311 LB_CHECK_CONFIG_IM([CRYPTO_MD5], [],
312 [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
313 LB_CHECK_CONFIG_IM([CRYPTO_SHA1], [],
314 [AC_MSG_WARN([kernel SHA1 support is recommended by using GSS.])])
315 LB_CHECK_CONFIG_IM([CRYPTO_SHA256], [],
316 [AC_MSG_WARN([kernel SHA256 support is recommended by using GSS.])])
317 LB_CHECK_CONFIG_IM([CRYPTO_SHA512], [],
318 [AC_MSG_WARN([kernel SHA512 support is recommended by using GSS.])])
320 require_krb5=$enable_gss
324 AS_IF([test -n "$KRBDIR"], [
325 AC_CHECK_LIB([gssapi], [gss_export_lucid_sec_context], [
326 GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi"
327 gss_conf_test="success"
329 AC_CHECK_LIB([gssglue], [gss_export_lucid_sec_context], [
330 GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssglue"
331 gss_conf_test="success"
333 AS_IF([test "x$enable_gss" = xyes], [
336 libgssapi or libgssglue is not found, which is required by GSS.
341 libgssapi or libgssglue is not found, which is required by GSS.
346 AC_SUBST(GSSAPI_LIBS)
349 AS_IF([test "x$gss_conf_test" = xsuccess], [
350 AC_DEFINE([HAVE_GSS], [1], [Define this is if you enable gss])
357 # LC_INODE_PERMISION_2ARGS
359 # up to v2.6.27 had a 3 arg version (inode, mask, nameidata)
360 # v2.6.27->v2.6.37 had a 2 arg version (inode, mask)
361 # v2.6.37->v3.0 had a 3 arg version (inode, mask, nameidata)
362 # v3.1 onward have a 2 arg version (inode, mask)
364 AC_DEFUN([LC_INODE_PERMISION_2ARGS], [
365 LB_CHECK_COMPILE([if 'inode_operations->permission' has two args],
366 inode_ops_permission_2args, [
367 #include <linux/fs.h>
369 struct inode *inode __attribute__ ((unused));
372 inode->i_op->permission(NULL, 0);
374 AC_DEFINE(HAVE_INODE_PERMISION_2ARGS, 1,
375 [inode_operations->permission has two args])
377 ]) # LC_INODE_PERMISION_2ARGS
380 # LC_BLK_QUEUE_MAX_SEGMENTS
382 # 2.6.32 replaces 2 functions blk_queue_max_phys_segments and blk_queue_max_hw_segments by blk_queue_max_segments
384 AC_DEFUN([LC_BLK_QUEUE_MAX_SEGMENTS], [
385 LB_CHECK_COMPILE([if 'blk_queue_max_segments' is defined],
386 blk_queue_max_segments, [
387 #include <linux/blkdev.h>
389 blk_queue_max_segments(NULL, 0);
391 AC_DEFINE(HAVE_BLK_QUEUE_MAX_SEGMENTS, 1,
392 [blk_queue_max_segments is defined])
394 ]) # LC_BLK_QUEUE_MAX_SEGMENTS
397 # LC_HAVE_DQUOT_FS_DISK_QUOTA
399 # 2.6.34 has quotactl_ops->[sg]et_dqblk that take struct fs_disk_quota
401 AC_DEFUN([LC_HAVE_DQUOT_FS_DISK_QUOTA], [
402 tmp_flags="$EXTRA_KCFLAGS"
403 EXTRA_KCFLAGS="-Werror"
404 LB_CHECK_COMPILE([if 'quotactl_ops.set_dqblk' takes struct fs_disk_quota],
406 #include <linux/fs.h>
407 #include <linux/quota.h>
409 ((struct quotactl_ops *)0)->set_dqblk(NULL, 0, 0, (struct fs_disk_quota*)0);
411 AC_DEFINE(HAVE_DQUOT_FS_DISK_QUOTA, 1,
412 [quotactl_ops.set_dqblk takes struct fs_disk_quota])
414 LB_CHECK_COMPILE([if 'quotactl_ops.set_dqblk' takes struct kqid & fs_disk_quota],
415 kqid_fs_disk_quota, [
416 #include <linux/fs.h>
417 #include <linux/quota.h>
419 ((struct quotactl_ops *)0)->set_dqblk((struct super_block*)0, *((struct kqid*)0), (struct fs_disk_quota*)0);
421 AC_DEFINE(HAVE_DQUOT_FS_DISK_QUOTA, 1,
422 [quotactl_ops.set_dqblk takes struct fs_disk_quota])
423 AC_DEFINE(HAVE_DQUOT_KQID, 1,
424 [quotactl_ops.set_dqblk takes struct kqid])
427 EXTRA_KCFLAGS="$tmp_flags"
428 ]) # LC_HAVE_DQUOT_FS_DISK_QUOTA
431 # LC_HAVE_DQUOT_SUSPEND
433 # 2.6.34 has renamed dquot options to dquot_*, check for dquot_suspend
435 AC_DEFUN([LC_HAVE_DQUOT_SUSPEND], [
436 LB_CHECK_COMPILE([if 'dquot_suspend' is defined],
438 #include <linux/quotaops.h>
440 dquot_suspend(NULL, -1);
442 AC_DEFINE(HAVE_DQUOT_SUSPEND, 1, [dquot_suspend is defined])
444 ]) # LC_HAVE_DQUOT_SUSPEND
449 # Check if kernel has been patched for 64-bit quota limits support.
450 # The upstream version of this patch in RHEL6 2.6.32 kernels introduces
451 # the constant QFMT_VFS_V1 in include/linux/quota.h, so we can check for
452 # that in the absence of quotaio_v1.h in the kernel headers.
454 AC_DEFUN([LC_QUOTA64], [
455 tmp_flags="$EXTRA_KCFLAGS"
456 EXTRA_KCFLAGS="-I$LINUX/fs"
457 LB_CHECK_COMPILE([if kernel has 64-bit quota limits support],
459 #include <linux/kernel.h>
460 #include <linux/fs.h>
461 #if defined(HAVE_FS_QUOTA_QUOTAIO_H)
462 #include <quota/quotaio_v2.h>
463 struct v2r1_disk_dqblk dqblk_r1;
465 #include <linux/quota.h>
466 int ver = QFMT_VFS_V1;
469 AC_DEFINE(HAVE_QUOTA64, 1, [have quota64])
471 LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],
472 [AC_MSG_ERROR([You have got no 64-bit kernel quota support.])])
474 EXTRA_KCFLAGS=$tmp_flags
478 # LC_HAVE_ADD_WAIT_QUEUE_EXCLUSIVE
480 # 2.6.34 adds __add_wait_queue_exclusive
482 AC_DEFUN([LC_HAVE_ADD_WAIT_QUEUE_EXCLUSIVE], [
483 LB_CHECK_COMPILE([if '__add_wait_queue_exclusive' exists],
484 __add_wait_queue_exclusive, [
485 #include <linux/wait.h>
487 wait_queue_head_t queue;
489 __add_wait_queue_exclusive(&queue, &wait);
491 AC_DEFINE(HAVE___ADD_WAIT_QUEUE_EXCLUSIVE, 1,
492 [__add_wait_queue_exclusive exists])
494 ]) # LC_HAVE_ADD_WAIT_QUEUE_EXCLUSIVE
497 # LC_FS_STRUCT_RWLOCK
499 # 2.6.36 fs_struct.lock use spinlock instead of rwlock.
501 AC_DEFUN([LC_FS_STRUCT_RWLOCK], [
502 LB_CHECK_COMPILE([if 'fs_struct.lock' use rwlock],
504 #include <asm/atomic.h>
505 #include <linux/spinlock.h>
506 #include <linux/fs_struct.h>
508 ((struct fs_struct *)0)->lock = (rwlock_t){ 0 };
510 AC_DEFINE(HAVE_FS_STRUCT_RWLOCK, 1, [fs_struct.lock use rwlock])
512 ]) # LC_FS_STRUCT_RWLOCK
515 # LC_SBOPS_EVICT_INODE
517 # 2.6.36 super_operations add evict_inode method. it hybird of
518 # delete_inode & clear_inode.
520 AC_DEFUN([LC_SBOPS_EVICT_INODE], [
521 LB_CHECK_COMPILE([if 'super_operations.evict_inode' exist],
522 super_ops_evict_inode, [
523 #include <linux/fs.h>
525 ((struct super_operations *)0)->evict_inode(NULL);
527 AC_DEFINE(HAVE_SBOPS_EVICT_INODE, 1,
528 [super_operations.evict_inode() is exist in kernel])
530 ]) # LC_SBOPS_EVICT_INODE
535 # 2.6.35 file_operations.fsync taken 2 arguments.
536 # 3.0.0 file_operations.fsync takes 4 arguments.
538 AC_DEFUN([LC_FILE_FSYNC], [
539 LB_CHECK_COMPILE([if 'file_operations.fsync' takes 4 arguments],
540 file_ops_fsync_4args, [
541 #include <linux/fs.h>
543 ((struct file_operations *)0)->fsync(NULL, 0, 0, 0);
545 AC_DEFINE(HAVE_FILE_FSYNC_4ARGS, 1,
546 [file_operations.fsync takes 4 arguments])
548 LB_CHECK_COMPILE([if 'file_operations.fsync' takes 2 arguments],
549 file_ops_fsync_2args, [
550 #include <linux/fs.h>
552 ((struct file_operations *)0)->fsync(NULL, 0);
554 AC_DEFINE(HAVE_FILE_FSYNC_2ARGS, 1,
555 [file_operations.fsync takes 2 arguments])
563 # 2.6.37 remove kernel_locked
565 AC_DEFUN([LC_KERNEL_LOCKED], [
566 LB_CHECK_COMPILE([if 'kernel_locked' is defined],
568 #include <linux/smp_lock.h>
572 AC_DEFINE(HAVE_KERNEL_LOCKED, 1, [kernel_locked is defined])
574 ]) # LC_KERNEL_LOCKED
579 # 2.6.38 dentry_operations.d_compare() taken 7 arguments.
581 AC_DEFUN([LC_D_COMPARE_7ARGS], [
582 LB_CHECK_COMPILE([if 'dentry_operations.d_compare()' taken 7 arguments],
583 dentry_ops_d_compare_7arg, [
584 #include <linux/dcache.h>
586 ((struct dentry_operations*)0)->d_compare(NULL,NULL,NULL,NULL,0,NULL,NULL);
588 AC_DEFINE(HAVE_D_COMPARE_7ARGS, 1, [d_compare need 7 arguments])
590 ]) # LC_D_COMPARE_7ARGS
595 # 2.6.38 dentry_operations.d_delete() defined 'const' for 1st parameter.
597 AC_DEFUN([LC_D_DELETE_CONST], [
598 tmp_flags="$EXTRA_KCFLAGS"
599 EXTRA_KCFLAGS="-Werror"
600 LB_CHECK_COMPILE([if 'dentry_operations.d_delete()' has const declare on first parameter],
601 dentry_ops_d_delete_1st_const, [
602 #include <linux/dcache.h>
604 const struct dentry *d = NULL;
605 ((struct dentry_operations*)0)->d_delete(d);
607 AC_DEFINE(HAVE_D_DELETE_CONST, const,
608 [d_delete first parameter declared const])
610 AC_DEFINE(HAVE_D_DELETE_CONST, [],
611 [d_delete first parameter declared is not const])
613 EXTRA_KCFLAGS="$tmp_flags"
614 ]) # LC_D_DELETE_CONST
619 # 2.6.38 dcache_lock removed. rcu-walk commited.
621 AC_DEFUN([LC_DCACHE_LOCK], [
622 LB_CHECK_COMPILE([if 'dcache_lock' is exist],
624 #include <linux/dcache.h>
626 spin_lock(&dcache_lock);
628 AC_DEFINE(HAVE_DCACHE_LOCK, 1,
629 [dcache_lock is exist])
636 # 2.6.38 inode.i_rcu added.
638 AC_DEFUN([LC_INODE_I_RCU], [
639 LB_CHECK_COMPILE([if 'inode.i_rcu' exists],
641 #include <linux/fs.h>
644 struct rcu_head rcu = {};
647 AC_DEFINE(HAVE_INODE_I_RCU, 1,
648 [inode.i_rcu exists])
653 # LC_BLKDEV_GET_BY_DEV
655 # 2.6.38 export blkdev_get_by_dev
657 AC_DEFUN([LC_BLKDEV_GET_BY_DEV], [
658 LB_CHECK_EXPORT([blkdev_get_by_dev], [fs/block_dev.c],
659 [AC_DEFINE(HAVE_BLKDEV_GET_BY_DEV, 1,
660 [blkdev_get_by_dev is exported by the kernel])])
661 ]) # LC_BLKDEV_GET_BY_DEV
664 # LC_EXPORT_SIMPLE_SETATTR
666 # 2.6.38 export simple_setattr
668 AC_DEFUN([LC_EXPORT_SIMPLE_SETATTR], [
669 LB_CHECK_EXPORT([simple_setattr], [fs/libfs.c],
670 [AC_DEFINE(HAVE_SIMPLE_SETATTR, 1,
671 [simple_setattr is exported by the kernel])])
672 ]) # LC_EXPORT_SIMPLE_SETATTR
677 # truncate callback removed since 2.6.39
679 AC_DEFUN([LC_IOP_TRUNCATE], [
680 LB_CHECK_COMPILE([if 'inode_operations' has '.truncate' member function],
681 inode_ops_truncate, [
682 #include <linux/fs.h>
684 ((struct inode_operations *)0)->truncate(NULL);
686 AC_DEFINE(HAVE_INODEOPS_TRUNCATE, 1,
687 [inode_operations has .truncate member function])
692 # LC_REQUEST_QUEUE_UNPLUG_FN
694 # 2.6.39 remove unplug_fn from request_queue.
696 AC_DEFUN([LC_REQUEST_QUEUE_UNPLUG_FN], [
697 LB_CHECK_COMPILE([if 'request_queue' has 'unplug_fn' field],
698 request_queue_unplug_fn, [
699 #include <linux/blkdev.h>
701 do {} while(sizeof(((struct request_queue *)0)->unplug_fn));
703 AC_DEFINE(HAVE_REQUEST_QUEUE_UNPLUG_FN, 1,
704 [request_queue has unplug_fn field])
706 ]) # LC_REQUEST_QUEUE_UNPLUG_FN
709 # LC_HAVE_FSTYPE_MOUNT
711 # 2.6.39 replace get_sb with mount in struct file_system_type
713 AC_DEFUN([LC_HAVE_FSTYPE_MOUNT], [
714 LB_CHECK_COMPILE([if 'file_system_type' has 'mount' field],
715 file_system_type_mount, [
716 #include <linux/fs.h>
718 struct file_system_type fst;
719 void *i = (void *) fst.mount;
721 AC_DEFINE(HAVE_FSTYPE_MOUNT, 1,
722 [struct file_system_type has mount field])
724 ]) # LC_HAVE_FSTYPE_MOUNT
727 # LC_HAVE_FHANDLE_SYSCALLS
729 # 2.6.39 The open_by_handle_at() and name_to_handle_at() system calls were
730 # added to Linux kernel 2.6.39.
731 # Check if client supports these functions
733 AC_DEFUN([LC_HAVE_FHANDLE_SYSCALLS], [
734 LB_CHECK_CONFIG_IM([FHANDLE],[
735 AC_DEFINE(HAVE_FHANDLE_SYSCALLS, 1,
736 [kernel supports fhandles and related syscalls])
738 ]) # LC_HAVE_FHANDLE_SYSCALLS
741 # LC_HAVE_INODE_OWNER_OR_CAPABLE
743 # 2.6.39 renames is_owner_or_cap to inode_owner_or_capable
745 AC_DEFUN([LC_HAVE_INODE_OWNER_OR_CAPABLE], [
746 LB_CHECK_COMPILE([if 'inode_owner_or_capable' exist],
747 inode_owner_or_capable, [
748 #include <linux/fs.h>
750 inode_owner_or_capable(NULL);
752 AC_DEFINE(HAVE_INODE_OWNER_OR_CAPABLE, 1,
753 [inode_owner_or_capable exist])
755 ]) # LC_HAVE_INODE_OWNER_OR_CAPABLE
758 # LC_DIRTY_INODE_WITH_FLAG
760 # 3.0 dirty_inode() has a flag parameter
761 # see kernel commit aa38572954ade525817fe88c54faebf85e5a61c0
763 AC_DEFUN([LC_DIRTY_INODE_WITH_FLAG], [
764 LB_CHECK_COMPILE([if 'dirty_inode' super_operation takes flag],
765 dirty_inode_super_operation_flag, [
766 #include <linux/fs.h>
769 inode->i_sb->s_op->dirty_inode(NULL, 0);
771 AC_DEFINE(HAVE_DIRTY_INODE_HAS_FLAG, 1,
772 [dirty_inode super_operation takes flag])
774 ]) # LC_DIRTY_INODE_WITH_FLAG
777 # LC_GENERIC_PERMISSION
779 # 2.6.38 generic_permission taken 4 parameters.
780 # in fact, it means rcu-walk aware permission bring.
782 # 3.1 generic_permission taken 2 parameters.
783 # see kernel commit 2830ba7f34ebb27c4e5b8b6ef408cd6d74860890
785 AC_DEFUN([LC_GENERIC_PERMISSION], [
786 LB_CHECK_COMPILE([if 'generic_permission' take 2 arguments],
787 generic_permission_2args, [
788 #include <linux/fs.h>
790 generic_permission(NULL, 0);
792 AC_DEFINE(HAVE_GENERIC_PERMISSION_2ARGS, 1,
793 [generic_permission taken 2 arguments])
795 LB_CHECK_COMPILE([if 'generic_permission' take 4 arguments],
796 generic_permission_4args, [
797 #include <linux/fs.h>
799 generic_permission(NULL, 0, 0, NULL);
801 AC_DEFINE(HAVE_GENERIC_PERMISSION_4ARGS, 1,
802 [generic_permission taken 4 arguments])
805 ]) # LC_GENERIC_PERMISSION
808 # LC_LM_XXX_LOCK_MANAGER_OPS
810 # 3.1 renames lock-manager ops(lock_manager_operations) from fl_xxx to lm_xxx
811 # see kernel commit 8fb47a4fbf858a164e973b8ea8ef5e83e61f2e50
813 AC_DEFUN([LC_LM_XXX_LOCK_MANAGER_OPS], [
814 LB_CHECK_COMPILE([if 'lock-manager' ops renamed to 'lm_xxx'],
815 lock_manager_ops_lm_xxx, [
816 #include <linux/fs.h>
818 struct lock_manager_operations lm_ops;
819 lm_ops.lm_compare_owner = NULL;
821 AC_DEFINE(HAVE_LM_XXX_LOCK_MANAGER_OPS, 1,
822 [lock-manager ops renamed to lm_xxx])
824 ]) # LC_LM_XXX_LOCK_MANAGER_OPS
829 # 3.1 kills inode->i_alloc_sem, use i_dio_count and inode_dio_wait
831 # see kernel commit bd5fe6c5eb9c548d7f07fe8f89a150bb6705e8e3
833 AC_DEFUN([LC_INODE_DIO_WAIT], [
834 LB_CHECK_COMPILE([if 'inode->i_alloc_sem' is killed and use inode_dio_wait],
836 #include <linux/fs.h>
838 inode_dio_wait((struct inode *)0);
840 AC_DEFINE(HAVE_INODE_DIO_WAIT, 1,
841 [inode->i_alloc_sem is killed and use inode_dio_wait])
843 ]) # LC_INODE_DIO_WAIT
848 # 3.1 adds get_acl method to inode_operations to read ACL from disk.
849 # see kernel commit 4e34e719e457f2e031297175410fc0bd4016a085
851 AC_DEFUN([LC_IOP_GET_ACL], [
852 LB_CHECK_COMPILE([if 'inode_operations' has '.get_acl' member function],
854 #include <linux/fs.h>
856 struct inode_operations iop;
859 AC_DEFINE(HAVE_IOP_GET_ACL, 1,
860 [inode_operations has .get_acl member function])
865 # LC_FILE_LLSEEK_SIZE
867 # 3.1 introduced generic_file_llseek_size()
869 AC_DEFUN([LC_FILE_LLSEEK_SIZE], [
870 LB_CHECK_EXPORT([generic_file_llseek_size], [fs/read_write.c],
871 [AC_DEFINE(HAVE_FILE_LLSEEK_SIZE, 1,
872 [generic_file_llseek_size is exported by the kernel])])
873 ]) # LC_FILE_LLSEEK_SIZE
876 # LC_RADIX_EXCEPTION_ENTRY
877 # 3.1 adds radix_tree_exception_entry.
879 AC_DEFUN([LC_RADIX_EXCEPTION_ENTRY], [
880 LB_CHECK_COMPILE([radix_tree_exceptional_entry exist],
881 radix_tree_exceptional_entry, [
882 #include <linux/radix-tree.h>
884 radix_tree_exceptional_entry(NULL);
886 AC_DEFINE(HAVE_RADIX_EXCEPTION_ENTRY, 1,
887 [radix_tree_exceptional_entry exist])
889 ]) # LC_RADIX_EXCEPTION_ENTRY
892 # LC_HAVE_VOID_MAKE_REQUEST_FN
894 # 3.2 request_queue.make_request_fn defined as function returns with void
895 # see kernel commit 5a7bbad27a410350e64a2d7f5ec18fc73836c14f
897 AC_DEFUN([LC_HAVE_VOID_MAKE_REQUEST_FN], [
898 LB_CHECK_COMPILE([if 'request_queue.make_request_fn' returns void but not int],
899 make_request_fn_void, [
900 #include <linux/blkdev.h>
903 make_request_fn *mrf;
904 ret = mrf(NULL, NULL);
906 AC_DEFINE(HAVE_VOID_MAKE_REQUEST_FN, 1,
907 [request_queue.make_request_fn returns void but not int])
909 ]) # LC_HAVE_VOID_MAKE_REQUEST_FN
912 # LC_HAVE_PROTECT_I_NLINK
914 # 3.2 protects inode->i_nlink from direct modification
915 # see kernel commit a78ef704a8dd430225955f0709b22d4a6ba21deb
916 # at the same time adds set_nlink(), so checks set_nlink() for it.
918 AC_DEFUN([LC_HAVE_PROTECT_I_NLINK], [
919 LB_CHECK_COMPILE([if 'inode->i_nlink' is protected from direct modification],
920 inode_i_nlink_protected, [
921 #include <linux/fs.h>
926 AC_DEFINE(HAVE_PROTECT_I_NLINK, 1,
927 [inode->i_nlink is protected from direct modification])
929 ]) # LC_HAVE_PROTECT_I_NLINK
932 # 2.6.39 security_inode_init_security takes a 'struct qstr' parameter
934 # 3.2 security_inode_init_security takes a callback to set xattrs
936 AC_DEFUN([LC_HAVE_SECURITY_IINITSEC], [
937 LB_CHECK_COMPILE([if security_inode_init_security takes a callback],
938 security_inode_init_security_callback, [
939 #include <linux/security.h>
941 security_inode_init_security(NULL, NULL, NULL, (const initxattrs)NULL, NULL);
943 AC_DEFINE(HAVE_SECURITY_IINITSEC_CALLBACK, 1,
944 [security_inode_init_security takes a callback to set xattrs])
946 LB_CHECK_COMPILE([if security_inode_init_security takes a 'struct qstr' parameter],
947 security_inode_init_security_qstr, [
948 #include <linux/security.h>
950 security_inode_init_security(NULL, NULL, (struct qstr *)NULL, NULL, NULL, NULL);
952 AC_DEFINE(HAVE_SECURITY_IINITSEC_QSTR, 1,
953 [security_inode_init_security takes a 'struct qstr' parameter])
956 ]) # LC_HAVE_SECURITY_IINITSEC
959 # LC_HAVE_MIGRATE_HEADER
961 # 3.3 introduces migrate_mode.h and migratepage has 4 args
963 AC_DEFUN([LC_HAVE_MIGRATE_HEADER], [
964 LB_CHECK_FILE([$LINUX/include/linux/migrate.h], [
965 AC_DEFINE(HAVE_MIGRATE_H, 1,
966 [kernel has include/linux/migrate.h])
968 LB_CHECK_FILE([$LINUX/include/linux/migrate_mode.h], [
969 AC_DEFINE(HAVE_MIGRATE_MODE_H, 1,
970 [kernel has include/linux/migrate_mode.h])
973 ]) # LC_HAVE_MIGRATE_HEADER
976 # LC_MIGRATEPAGE_4ARGS
978 AC_DEFUN([LC_MIGRATEPAGE_4ARGS], [
979 LB_CHECK_COMPILE([if 'address_space_operations.migratepage' has 4 args],
980 address_space_ops_migratepage_4args, [
981 #include <linux/fs.h>
982 #ifdef HAVE_MIGRATE_H
983 #include <linux/migrate.h>
984 #elif defined(HAVE_MIGRATE_MODE_H)
985 #include <linux/migrate_mode.h>
988 struct address_space_operations aops;
989 aops.migratepage(NULL, NULL, NULL, MIGRATE_ASYNC);
991 AC_DEFINE(HAVE_MIGRATEPAGE_4ARGS, 1,
992 [address_space_operations.migratepage has 4 args])
994 ]) # LC_MIGRATEPAGE_4ARGS
997 # LC_SUPEROPS_USE_DENTRY
999 # 3.3 switchs super_operations to use dentry as parameter (but not vfsmount)
1000 # see kernel commit 34c80b1d93e6e20ca9dea0baf583a5b5510d92d4
1002 AC_DEFUN([LC_SUPEROPS_USE_DENTRY], [
1003 tmp_flags="$EXTRA_KCFLAGS"
1004 EXTRA_KCFLAGS="-Werror"
1005 LB_CHECK_COMPILE([if 'super_operations' use 'dentry' as parameter],
1007 #include <linux/fs.h>
1008 int show_options(struct seq_file *seq, struct dentry *root) {
1012 struct super_operations ops;
1013 ops.show_options = show_options;
1015 AC_DEFINE(HAVE_SUPEROPS_USE_DENTRY, 1,
1016 [super_operations use dentry as parameter])
1018 EXTRA_KCFLAGS="$tmp_flags"
1019 ]) # LC_SUPEROPS_USE_DENTRY
1022 # LC_INODEOPS_USE_UMODE_T
1024 # 3.3 switchs inode_operations to use umode_t as parameter (but not int)
1025 # see kernel commit 1a67aafb5f72a436ca044293309fa7e6351d6a35
1027 AC_DEFUN([LC_INODEOPS_USE_UMODE_T], [
1028 tmp_flags="$EXTRA_KCFLAGS"
1029 EXTRA_KCFLAGS="-Werror"
1030 LB_CHECK_COMPILE([if 'inode_operations' use 'umode_t' as parameter],
1031 inode_ops_umode_t, [
1032 #include <linux/fs.h>
1033 #include <linux/types.h>
1034 int my_mknod(struct inode *dir, struct dentry *dchild,
1035 umode_t mode, dev_t dev)
1040 struct inode_operations ops;
1041 ops.mknod = my_mknod;
1043 AC_DEFINE(HAVE_INODEOPS_USE_UMODE_T, 1,
1044 [inode_operations use umode_t as parameter])
1046 EXTRA_KCFLAGS="$tmp_flags"
1047 ]) # LC_INODEOPS_USE_UMODE_T
1050 # LC_KMAP_ATOMIC_HAS_1ARG
1052 # 3.4 kmap_atomic removes second argument
1053 # see kernel commit 1ec9c5ddc17aa398f05646abfcbaf315b544e62f
1055 AC_DEFUN([LC_KMAP_ATOMIC_HAS_1ARG], [
1056 LB_CHECK_COMPILE([if 'kmap_atomic' has only 1 argument],
1058 #include <linux/highmem.h>
1062 AC_DEFINE(HAVE_KMAP_ATOMIC_HAS_1ARG, 1,
1063 [have kmap_atomic has only 1 argument])
1065 ]) # LC_KMAP_ATOMIC_HAS_1ARG
1068 # LC_HAVE_D_MAKE_ROOT
1070 # 3.4 converts d_alloc_root to d_make_root
1071 # see kernel commit 32991ab305ace7017c62f8eecbe5eb36dc32e13b
1073 AC_DEFUN([LC_HAVE_D_MAKE_ROOT], [
1074 LB_CHECK_COMPILE([if have 'd_make_root'],
1076 #include <linux/fs.h>
1078 d_make_root((struct inode *)NULL);
1080 AC_DEFINE(HAVE_D_MAKE_ROOT, 1,
1083 ]) # LC_HAVE_D_MAKE_ROOT
1086 # LC_HAVE_CACHE_REGISTER
1088 # 3.4 cache_register/cache_unregister are removed
1089 # see kernel commit 2c5f846747526e2b83c5f1b8e69016be0e2e87c0
1090 # Note, since 2.6.37 cache_register_net/cache_unregister_net
1091 # are defined, but not exported.
1092 # 3.3 cache_register_net/cache_unregister_net are
1093 # exported and replacing cache_register/cache_unregister in 3.4
1095 AC_DEFUN([LC_HAVE_CACHE_REGISTER], [
1096 LB_CHECK_COMPILE([if have 'cache_register'],
1098 #include <linux/sunrpc/cache.h>
1100 cache_register(NULL);
1102 AC_DEFINE(HAVE_CACHE_REGISTER, 1,
1103 [have cache_register])
1105 ]) # LC_HAVE_CACHE_REGISTER
1108 # LC_HAVE_CLEAR_INODE
1110 # 3.5 renames end_writeback() back to clear_inode()...
1111 # see kernel commit dbd5768f87ff6fb0a4fe09c4d7b6c4a24de99430
1113 AC_DEFUN([LC_HAVE_CLEAR_INODE], [
1114 LB_CHECK_COMPILE([if have 'clear_inode'],
1116 #include <linux/fs.h>
1118 clear_inode((struct inode *)NULL);
1120 AC_DEFINE(HAVE_CLEAR_INODE, 1,
1123 ]) # LC_HAVE_CLEAR_INODE
1126 # LC_HAVE_ENCODE_FH_PARENT
1128 # 3.5 encode_fh has parent inode passed in directly
1129 # see kernel commit b0b0382b
1131 AC_DEFUN([LC_HAVE_ENCODE_FH_PARENT], [
1132 tmp_flags="$EXTRA_KCFLAGS"
1133 EXTRA_KCFLAGS="-Werror"
1134 LB_CHECK_COMPILE([if 'encode_fh' have parent inode as parameter],
1135 encode_fh_parent_inode, [
1136 #include <linux/exportfs.h>
1137 #include <linux/fs.h>
1138 #include <linux/types.h>
1139 int ll_encode_fh(struct inode *i, __u32 *a, int *b, struct inode *p)
1144 struct export_operations exp_op;
1145 exp_op.encode_fh = ll_encode_fh;
1147 AC_DEFINE(HAVE_ENCODE_FH_PARENT, 1,
1148 [have parent inode as parameter])
1150 EXTRA_KCFLAGS="$tmp_flags"
1151 ]) # LC_HAVE_ENCODE_FH_PARENT
1154 # LC_FILE_LLSEEK_SIZE_5ARG
1156 # 3.5 has generic_file_llseek_size with 5 args
1158 AC_DEFUN([LC_FILE_LLSEEK_SIZE_5ARG], [
1159 LB_CHECK_COMPILE([if Linux kernel has 'generic_file_llseek_size' with 5 args],
1160 generic_file_llseek_size_5args, [
1161 #include <linux/fs.h>
1163 generic_file_llseek_size(NULL, 0, 0, 0, 0);
1165 AC_DEFINE(HAVE_FILE_LLSEEK_SIZE_5ARGS, 1,
1166 [kernel has generic_file_llseek_size with 5 args])
1168 ]) # LC_FILE_LLSEEK_SIZE_5ARG
1171 # LC_LLITE_DATA_IS_LIST
1173 # 3.6 switch i_dentry/d_alias from list to hlist
1175 # In the upstream kernels d_alias first changes
1176 # to a hlist and then in later version, 3.11, gets
1177 # moved to the union d_u. Due to some distros having
1178 # d_alias in the d_u union as a struct list, which
1179 # has never existed upstream stream, we can't test
1180 # if d_alias is a list or hlist directly. If ever
1181 # i_dentry and d_alias even up different combos then
1182 # the build will fail. In that case then we will need
1183 # to separate out the i_dentry and d_alias test below.
1185 AC_DEFUN([LC_DATA_FOR_LLITE_IS_LIST], [
1186 tmp_flags="$EXTRA_KCFLAGS"
1187 EXTRA_KCFLAGS="-Werror"
1188 LB_CHECK_COMPILE([if 'i_dentry/d_alias' uses 'list'],
1189 i_dentry_d_alias_list, [
1190 #include <linux/fs.h>
1193 INIT_LIST_HEAD(&inode.i_dentry);
1195 AC_DEFINE(DATA_FOR_LLITE_IS_LIST, 1,
1196 [both i_dentry/d_alias uses list])
1198 EXTRA_KCFLAGS="$tmp_flags"
1199 ]) # LC_DATA_FOR_LLITE_IS_LIST
1202 # LC_DENTRY_OPEN_USE_PATH
1204 # 3.6 dentry_open uses struct path as first argument
1205 # see kernel commit 765927b2
1207 AC_DEFUN([LC_DENTRY_OPEN_USE_PATH], [
1208 tmp_flags="$EXTRA_KCFLAGS"
1209 EXTRA_KCFLAGS="-Werror"
1210 LB_CHECK_COMPILE([if 'dentry_open' uses 'struct path' as first argument],
1212 #include <linux/fs.h>
1213 #include <linux/path.h>
1216 dentry_open(&path, 0, NULL);
1218 AC_DEFINE(HAVE_DENTRY_OPEN_USE_PATH, 1,
1219 [dentry_open uses struct path as first argument])
1221 EXTRA_KCFLAGS="$tmp_flags"
1222 ]) # LC_DENTRY_OPEN_USE_PATH
1225 # LC_HAVE_IOP_ATOMIC_OPEN
1227 # 3.6 vfs adds iop->atomic_open
1229 AC_DEFUN([LC_HAVE_IOP_ATOMIC_OPEN], [
1230 LB_CHECK_COMPILE([if 'iop' has 'atomic_open'],
1231 inode_ops_atomic_open, [
1232 #include <linux/fs.h>
1234 struct inode_operations iop;
1235 iop.atomic_open = NULL;
1237 AC_DEFINE(HAVE_IOP_ATOMIC_OPEN, 1,
1238 [have iop atomic_open])
1240 ]) # LC_HAVE_IOP_ATOMIC_OPEN
1243 # LC_HAVE_POSIXACL_USER_NS
1245 # 3.7 posix_acl_{to,from}_xattr take struct user_namespace
1247 AC_DEFUN([LC_HAVE_POSIXACL_USER_NS], [
1248 LB_CHECK_COMPILE([if 'posix_acl_to_xattr' takes 'struct user_namespace'],
1249 posix_acl_to_xattr_user_namespace, [
1250 #include <linux/fs.h>
1251 #include <linux/posix_acl_xattr.h>
1253 posix_acl_to_xattr((struct user_namespace *)NULL, NULL, NULL, 0);
1255 AC_DEFINE(HAVE_POSIXACL_USER_NS, 1,
1256 [posix_acl_to_xattr takes struct user_namespace])
1258 ]) # LC_HAVE_POSIXACL_USER_NS
1261 # LC_HAVE_FILE_F_INODE
1263 # 3.8 struct file has new member f_inode
1265 AC_DEFUN([LC_HAVE_FILE_F_INODE], [
1266 LB_CHECK_COMPILE([if 'struct file' has member 'f_inode'],
1268 #include <linux/fs.h>
1270 ((struct file *)0)->f_inode = NULL;
1272 AC_DEFINE(HAVE_FILE_F_INODE, 1,
1273 [struct file has member f_inode])
1275 ]) # LC_HAVE_FILE_F_INODE
1278 # LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS
1280 AC_DEFUN([LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS], [
1281 LB_CHECK_COMPILE([if 'sunrpc_cache_pipe_upcall' takes 3 args],
1282 sunrpc_cache_pipe_upcall_3args, [
1283 #include <linux/sunrpc/cache.h>
1285 sunrpc_cache_pipe_upcall(NULL, NULL, NULL);
1287 AC_DEFINE(HAVE_SUNRPC_UPCALL_HAS_3ARGS, 1,
1288 [sunrpc_cache_pipe_upcall takes 3 args])
1290 ]) # LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS
1293 # LC_HAVE_HLIST_FOR_EACH_3ARG
1295 # 3.9 uses hlist_for_each_entry with 3 args
1296 # b67bfe0d42cac56c512dd5da4b1b347a23f4b70a
1298 AC_DEFUN([LC_HAVE_HLIST_FOR_EACH_3ARG], [
1299 LB_CHECK_COMPILE([if 'hlist_for_each_entry' has 3 args],
1300 hlist_for_each_entry_3args, [
1301 #include <linux/list.h>
1302 #include <linux/fs.h>
1304 struct hlist_head *head = NULL;
1305 struct inode *inode;
1307 hlist_for_each_entry(inode, head, i_hash) {
1311 AC_DEFINE(HAVE_HLIST_FOR_EACH_3ARG, 1,
1312 [hlist_for_each_entry has 3 args])
1314 ]) # LC_HAVE_HLIST_FOR_EACH_3ARG
1317 # LC_HAVE_BIO_END_SECTOR
1319 # 3.9 introduces bio_end_sector macro
1320 # f73a1c7d117d07a96d89475066188a2b79e53c48
1322 AC_DEFUN([LC_HAVE_BIO_END_SECTOR], [
1323 LB_CHECK_COMPILE([if 'bio_end_sector' is defined],
1325 #include <linux/bio.h>
1329 bio_end_sector(&bio);
1331 AC_DEFINE(HAVE_BIO_END_SECTOR, 1,
1332 [bio_end_sector is defined])
1334 ]) # LC_HAVE_BIO_END_SECTOR
1337 # LC_HAVE_REMOVE_PROC_SUBTREE
1339 # 3.10 introduced remove_proc_subtree
1341 AC_DEFUN([LC_HAVE_REMOVE_PROC_SUBTREE], [
1342 LB_CHECK_COMPILE([if 'remove_proc_subtree' is defined],
1343 remove_proc_subtree, [
1344 #include <linux/proc_fs.h>
1346 remove_proc_subtree(NULL, NULL);
1348 AC_DEFINE(HAVE_REMOVE_PROC_SUBTREE, 1,
1349 [remove_proc_subtree is defined])
1351 ]) # LC_HAVE_REMOVE_PROC_SUBTREE
1354 # LC_HAVE_PROC_REMOVE
1356 # 3.10 introduced proc_remove
1358 AC_DEFUN([LC_HAVE_PROC_REMOVE], [
1359 LB_CHECK_COMPILE([if 'proc_remove' is defined],
1361 #include <linux/proc_fs.h>
1365 AC_DEFINE(HAVE_PROC_REMOVE, 1,
1366 [proc_remove is defined])
1368 ]) # LC_HAVE_PROC_REMOVE
1371 # LC_BLKDEV_RELEASE_RETURN_INT
1373 # 3.10 release for block device doesn't return int
1375 AC_DEFUN([LC_BLKDEV_RELEASE_RETURN_INT], [
1376 LB_CHECK_COMPILE([if 'block_device_operations' release returns 'int'],
1377 block_device_ops_release_return_int, [
1378 #include <linux/blkdev.h>
1380 struct block_device_operations fops;
1381 int i __attribute__ ((unused));
1383 i = fops.release(NULL, 0);
1385 AC_DEFINE(HAVE_BLKDEV_RELEASE_RETURN_INT, 1,
1386 [block device release returns int])
1388 ]) # LC_BLKDEV_RELEASE_RETURN_INT
1391 # LC_INVALIDATE_RANGE
1393 # 3.11 invalidatepage requires the length of the range to invalidate
1395 AC_DEFUN([LC_INVALIDATE_RANGE], [
1396 LB_CHECK_COMPILE([if 'address_space_operations.invalidatepage' requires 3 arguments],
1397 address_space_ops_invalidatepage_3args, [
1398 #include <linux/fs.h>
1400 struct address_space_operations a_ops;
1401 a_ops.invalidatepage(NULL, 0, 0);
1403 AC_DEFINE(HAVE_INVALIDATE_RANGE, 1,
1404 [address_space_operations.invalidatepage needs 3 arguments])
1406 ]) # LC_INVALIDATE_RANGE
1409 # LC_HAVE_DIR_CONTEXT
1411 # 3.11 readdir now takes the new struct dir_context
1413 AC_DEFUN([LC_HAVE_DIR_CONTEXT], [
1414 LB_CHECK_COMPILE([if 'dir_context' exist],
1416 #include <linux/fs.h>
1418 struct dir_context ctx;
1421 AC_DEFINE(HAVE_DIR_CONTEXT, 1,
1422 [dir_context exist])
1424 ]) # LC_HAVE_DIR_CONTEXT
1427 # LC_D_COMPARE_5ARGS
1429 # 3.11 dentry_operations.d_compare() taken 5 arguments.
1431 AC_DEFUN([LC_D_COMPARE_5ARGS], [
1432 LB_CHECK_COMPILE([if 'd_compare' taken 5 arguments],
1434 #include <linux/dcache.h>
1436 ((struct dentry_operations*)0)->d_compare(NULL,NULL,0,NULL,NULL);
1438 AC_DEFINE(HAVE_D_COMPARE_5ARGS, 1,
1439 [d_compare need 5 arguments])
1441 ]) # LC_D_COMPARE_5ARGS
1446 # 3.11 need to access d_count to get dentry reference count
1448 AC_DEFUN([LC_HAVE_DCOUNT], [
1449 LB_CHECK_COMPILE([if 'd_count' exist],
1451 #include <linux/dcache.h>
1456 AC_DEFINE(HAVE_D_COUNT, 1,
1462 # LC_OLDSIZE_TRUNCATE_PAGECACHE
1464 # 3.12 truncate_pagecache without oldsize parameter
1466 AC_DEFUN([LC_OLDSIZE_TRUNCATE_PAGECACHE], [
1467 LB_CHECK_COMPILE([if 'truncate_pagecache' with 'old_size' parameter],
1468 truncate_pagecache_old_size, [
1469 #include <linux/mm.h>
1471 truncate_pagecache(NULL, 0, 0);
1473 AC_DEFINE(HAVE_OLDSIZE_TRUNCATE_PAGECACHE, 1,
1476 ]) # LC_OLDSIZE_TRUNCATE_PAGECACHE
1479 # LC_HAVE_DENTRY_D_U_D_ALIAS
1481 # 3.11 kernel moved d_alias to the union d_u in struct dentry
1483 # Some distros move d_alias to d_u but it is still a struct list
1485 AC_DEFUN([LC_HAVE_DENTRY_D_U_D_ALIAS], [
1486 AS_IF([test "x$lb_cv_compile_i_dentry_d_alias_list" = xyes], [
1487 LB_CHECK_COMPILE([if list 'dentry.d_u.d_alias' exist],
1489 #include <linux/list.h>
1490 #include <linux/dcache.h>
1493 INIT_LIST_HEAD(&de.d_u.d_alias);
1495 AC_DEFINE(HAVE_DENTRY_D_U_D_ALIAS, 1,
1496 [list dentry.d_u.d_alias exist])
1499 LB_CHECK_COMPILE([if hlist 'dentry.d_u.d_alias' exist],
1501 #include <linux/list.h>
1502 #include <linux/dcache.h>
1505 INIT_HLIST_NODE(&de.d_u.d_alias);
1507 AC_DEFINE(HAVE_DENTRY_D_U_D_ALIAS, 1,
1508 [hlist dentry.d_u.d_alias exist])
1511 ]) # LC_HAVE_DENTRY_D_U_D_ALIAS
1514 # LC_HAVE_DENTRY_D_CHILD
1516 # 3.11 kernel d_child has been moved out of the union d_u
1519 AC_DEFUN([LC_HAVE_DENTRY_D_CHILD], [
1520 LB_CHECK_COMPILE([if 'dentry.d_child' exist],
1522 #include <linux/list.h>
1523 #include <linux/dcache.h>
1526 INIT_LIST_HEAD(&de.d_child);
1528 AC_DEFINE(HAVE_DENTRY_D_CHILD, 1,
1529 [dentry.d_child exist])
1531 ]) # LC_HAVE_DENTRY_D_CHILD
1536 # 3.12 ki_left removed from struct kiocb
1538 AC_DEFUN([LC_KIOCB_KI_LEFT], [
1539 LB_CHECK_COMPILE([if 'struct kiocb' with 'ki_left' member],
1541 #include <linux/aio.h>
1543 ((struct kiocb*)0)->ki_left = 0;
1545 AC_DEFINE(HAVE_KIOCB_KI_LEFT, 1,
1548 ]) # LC_KIOCB_KI_LEFT
1551 # LC_VFS_RENAME_5ARGS
1553 # 3.13 has vfs_rename with 5 args
1555 AC_DEFUN([LC_VFS_RENAME_5ARGS], [
1556 LB_CHECK_COMPILE([if Linux kernel has 'vfs_rename' with 5 args],
1558 #include <linux/fs.h>
1560 vfs_rename(NULL, NULL, NULL, NULL, NULL);
1562 AC_DEFINE(HAVE_VFS_RENAME_5ARGS, 1,
1563 [kernel has vfs_rename with 5 args])
1565 ]) # LC_VFS_RENAME_5ARGS
1568 # LC_VFS_UNLINK_3ARGS
1570 # 3.13 has vfs_unlink with 3 args
1572 AC_DEFUN([LC_VFS_UNLINK_3ARGS], [
1573 LB_CHECK_COMPILE([if Linux kernel has 'vfs_unlink' with 3 args],
1575 #include <linux/fs.h>
1577 vfs_unlink(NULL, NULL, NULL);
1579 AC_DEFINE(HAVE_VFS_UNLINK_3ARGS, 1,
1580 [kernel has vfs_unlink with 3 args])
1582 ]) # LC_VFS_UNLINK_3ARGS
1587 # 3.14 move some of its data in struct bio into the new
1590 AC_DEFUN([LC_HAVE_BVEC_ITER], [
1591 LB_CHECK_COMPILE([if Linux kernel has struct bvec_iter],
1593 #include <linux/bio.h>
1595 struct bvec_iter iter;
1596 iter.bi_bvec_done = 0;
1598 AC_DEFINE(HAVE_BVEC_ITER, 1,
1599 [kernel has struct bvec_iter])
1601 ]) # LC_HAVE_BVEC_ITER
1604 # LC_HAVE_TRUNCATE_IPAGE_FINAL
1606 # 3.14 bring truncate_inode_pages_final for evict_inode
1608 AC_DEFUN([LC_HAVE_TRUNCATE_IPAGES_FINAL], [
1609 LB_CHECK_COMPILE([if Linux kernel has truncate_inode_pages_final],
1610 truncate_ipages_final, [
1611 #include <linux/mm.h>
1613 truncate_inode_pages_final(NULL);
1615 AC_DEFINE(HAVE_TRUNCATE_INODE_PAGES_FINAL, 1,
1616 [kernel has truncate_inode_pages_final])
1618 ]) # LC_HAVE_TRUNCATE_IPAGES_FINAL
1621 # LC_VFS_RENAME_6ARGS
1623 # 3.15 has vfs_rename with 6 args
1625 AC_DEFUN([LC_VFS_RENAME_6ARGS], [
1626 LB_CHECK_COMPILE([if Linux kernel has 'vfs_rename' with 6 args],
1628 #include <linux/fs.h>
1630 vfs_rename(NULL, NULL, NULL, NULL, NULL, NULL);
1632 AC_DEFINE(HAVE_VFS_RENAME_6ARGS, 1,
1633 [kernel has vfs_rename with 6 args])
1635 ]) # LC_VFS_RENAME_6ARGS
1638 # LC_DIRECTIO_USE_ITER
1640 # 3.16 kernel changes direct IO to use iov_iter
1642 AC_DEFUN([LC_DIRECTIO_USE_ITER], [
1643 LB_CHECK_COMPILE([if direct IO uses iov_iter],
1645 #include <linux/fs.h>
1647 struct address_space_operations ops;
1648 struct iov_iter *iter = NULL;
1651 ops.direct_IO(0, NULL, iter, offset);
1653 AC_DEFINE(HAVE_DIRECTIO_ITER, 1,
1654 [direct IO uses iov_iter])
1656 ]) # LC_DIRECTIO_USE_ITER
1659 # LC_HAVE_IOV_ITER_INIT_DIRECTION
1662 # 3.16 linux commit 71d8e532b1549a478e6a6a8a44f309d050294d00
1663 # changed iov_iter_init api to start accepting a tag
1664 # that defines if its a read or write operation
1666 AC_DEFUN([LC_HAVE_IOV_ITER_INIT_DIRECTION], [
1667 tmp_flags="$EXTRA_KCFLAGS"
1668 EXTRA_KCFLAGS="-Werror"
1669 LB_CHECK_COMPILE([if 'iov_iter_init' takes a tag],
1671 #include <linux/uio.h>
1672 #include <linux/fs.h>
1674 const struct iovec *iov = NULL;
1676 iov_iter_init(NULL, READ, iov, 1, 0);
1678 AC_DEFINE(HAVE_IOV_ITER_INIT_DIRECTION, 1,
1679 [iov_iter_init handles directional tag])
1681 EXTRA_KCFLAGS="$tmp_flags"
1682 ]) # LC_HAVE_IOV_ITER_INIT_DIRECTION
1685 # LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
1687 # 3.16 introduces [read|write]_iter to struct file_operations
1689 AC_DEFUN([LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER], [
1690 LB_CHECK_COMPILE([if 'file_operations.[read|write]_iter' exist],
1691 file_function_iter, [
1692 #include <linux/fs.h>
1694 ((struct file_operations *)NULL)->read_iter(NULL, NULL);
1695 ((struct file_operations *)NULL)->write_iter(NULL, NULL);
1697 AC_DEFINE(HAVE_FILE_OPERATIONS_READ_WRITE_ITER, 1,
1698 [file_operations.[read|write]_iter functions exist])
1700 ]) # LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
1703 # LC_NFS_FILLDIR_USE_CTX
1705 # 3.18 kernel moved from void cookie to struct dir_context
1707 AC_DEFUN([LC_NFS_FILLDIR_USE_CTX], [
1708 tmp_flags="$EXTRA_KCFLAGS"
1709 EXTRA_KCFLAGS="-Werror"
1710 LB_CHECK_COMPILE([if filldir_t uses struct dir_context],
1712 #include <linux/fs.h>
1714 int filldir(struct dir_context *ctx, const char* name,
1715 int i, loff_t off, u64 tmp, unsigned temp)
1720 struct dir_context ctx = {
1724 ctx.actor(NULL, "test", 0, (loff_t) 0, 0, 0);
1726 AC_DEFINE(HAVE_FILLDIR_USE_CTX, 1,
1727 [filldir_t needs struct dir_context as argument])
1729 EXTRA_KCFLAGS="$tmp_flags"
1730 ]) # LC_NFS_FILLDIR_USE_CTX
1733 # LC_KIOCB_HAS_NBYTES
1735 # 3.19 kernel removed ki_nbytes from struct kiocb
1737 AC_DEFUN([LC_KIOCB_HAS_NBYTES], [
1738 LB_CHECK_COMPILE([if struct kiocb has ki_nbytes field],
1740 #include <linux/fs.h>
1746 AC_DEFINE(HAVE_KI_NBYTES, 1, [ki_nbytes field exist])
1748 ]) # LC_KIOCB_HAS_NBYTES
1751 # LC_CANCEL_DIRTY_PAGE
1753 # 4.0.0 kernel removed cancle_dirty_page
1755 AC_DEFUN([LC_CANCEL_DIRTY_PAGE], [
1756 LB_CHECK_COMPILE([if cancel_dirty_page still exist],
1757 cancel_dirty_page, [
1758 #include <linux/mm.h>
1760 cancel_dirty_page(NULL, PAGE_SIZE);
1762 AC_DEFINE(HAVE_CANCEL_DIRTY_PAGE, 1,
1763 [cancel_dirty_page is still available])
1765 ]) # LC_CANCEL_DIRTY_PAGE
1770 # 4.1 kernel has iov_iter_rw
1772 AC_DEFUN([LC_IOV_ITER_RW], [
1773 LB_CHECK_COMPILE([if iov_iter_rw exist],
1775 #include <linux/fs.h>
1776 #include <linux/uio.h>
1778 struct iov_iter *iter = NULL;
1782 AC_DEFINE(HAVE_IOV_ITER_RW, 1,
1783 [iov_iter_rw exist])
1790 # Lustre linux kernel checks
1792 AC_DEFUN([LC_PROG_LINUX], [
1793 AC_MSG_NOTICE([Lustre kernel checks
1794 ==============================================================================])
1798 LC_CONFIG_HEALTH_CHECK_WRITE
1799 LC_CONFIG_LRU_RESIZE
1800 LC_LLITE_LLOOP_MODULE
1802 LC_GLIBC_SUPPORT_FHANDLES
1807 LC_BLK_QUEUE_MAX_SEGMENTS
1810 LC_HAVE_DQUOT_FS_DISK_QUOTA
1811 LC_HAVE_DQUOT_SUSPEND
1812 LC_HAVE_ADD_WAIT_QUEUE_EXCLUSIVE
1816 LC_EXPORT_SIMPLE_SETATTR
1817 LC_EXPORT_TRUNCATE_COMPLETE_PAGE
1821 LC_SBOPS_EVICT_INODE
1827 LC_BLKDEV_GET_BY_DEV
1828 LC_GENERIC_PERMISSION
1835 LC_REQUEST_QUEUE_UNPLUG_FN
1836 LC_HAVE_FHANDLE_SYSCALLS
1837 LC_HAVE_FSTYPE_MOUNT
1839 LC_HAVE_INODE_OWNER_OR_CAPABLE
1840 LC_HAVE_SECURITY_IINITSEC
1843 LC_DIRTY_INODE_WITH_FLAG
1846 LC_LM_XXX_LOCK_MANAGER_OPS
1850 LC_INODE_PERMISION_2ARGS
1851 LC_RADIX_EXCEPTION_ENTRY
1854 LC_HAVE_VOID_MAKE_REQUEST_FN
1855 LC_HAVE_PROTECT_I_NLINK
1858 LC_HAVE_MIGRATE_HEADER
1859 LC_MIGRATEPAGE_4ARGS
1860 LC_SUPEROPS_USE_DENTRY
1861 LC_INODEOPS_USE_UMODE_T
1862 LC_HAVE_CACHE_REGISTER
1866 LC_KMAP_ATOMIC_HAS_1ARG
1870 LC_HAVE_ENCODE_FH_PARENT
1871 LC_FILE_LLSEEK_SIZE_5ARG
1874 LC_DATA_FOR_LLITE_IS_LIST
1875 LC_DENTRY_OPEN_USE_PATH
1876 LC_HAVE_IOP_ATOMIC_OPEN
1879 LC_HAVE_POSIXACL_USER_NS
1882 LC_HAVE_FILE_F_INODE
1883 LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS
1886 LC_HAVE_HLIST_FOR_EACH_3ARG
1887 LC_HAVE_BIO_END_SECTOR
1890 LC_BLKDEV_RELEASE_RETURN_INT
1891 LC_HAVE_REMOVE_PROC_SUBTREE
1899 LC_HAVE_DENTRY_D_U_D_ALIAS
1900 LC_HAVE_DENTRY_D_CHILD
1903 LC_OLDSIZE_TRUNCATE_PAGECACHE
1912 LC_HAVE_TRUNCATE_IPAGES_FINAL
1918 LC_DIRECTIO_USE_ITER
1919 LC_HAVE_IOV_ITER_INIT_DIRECTION
1920 LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
1923 LC_NFS_FILLDIR_USE_CTX
1929 LC_CANCEL_DIRTY_PAGE
1935 AS_IF([test "x$enable_server" != xno], [
1936 LC_FUNC_DEV_SET_RDONLY
1946 # Check whether to build the client side of Lustre
1948 AC_DEFUN([LC_CONFIG_CLIENT], [
1949 AC_MSG_CHECKING([whether to build Lustre client support])
1950 AC_ARG_ENABLE([client],
1951 AC_HELP_STRING([--disable-client],
1952 [disable Lustre client support]),
1953 [], [enable_client="yes"])
1954 AC_MSG_RESULT([$enable_client])
1955 ]) # LC_CONFIG_CLIENT
1960 AC_DEFUN([LB_CONFIG_MPITESTS], [
1961 AC_ARG_ENABLE([mpitests],
1962 AC_HELP_STRING([--enable-mpitests=<yes|no|mpicc wrapper>],
1963 [include mpi tests]), [
1964 enable_mpitests="yes"
1967 MPICC_WRAPPER="mpicc"
1970 enable_mpitests="no"
1973 MPICC_WRAPPER=$enableval
1977 enable_mpitests="yes"
1978 MPICC_WRAPPER="mpicc"
1981 if test "x$enable_mpitests" != "xno"; then
1984 AC_CACHE_CHECK([whether mpitests can be built],
1985 lb_cv_mpi_tests, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([
1989 MPI_Initialized(&flag);
1992 ])], [lb_cv_mpi_tests="yes"], [lb_cv_mpi_tests="no"])
1994 enable_mpitests=$lb_cv_mpi_tests
1997 AC_SUBST(MPICC_WRAPPER)
1998 ]) # LB_CONFIG_MPITESTS
2003 # whether to enable quota support global control
2005 AC_DEFUN([LC_CONFIG_QUOTA], [
2006 AC_MSG_CHECKING([whether to enable quota support global control])
2007 AC_ARG_ENABLE([quota],
2008 AC_HELP_STRING([--enable-quota],
2009 [enable quota support]),
2010 [], [enable_quota="yes"])
2011 AS_IF([test "x$enable_quota" = xyes],
2012 [AC_MSG_RESULT([yes])],
2013 [AC_MSG_RESULT([no])])
2014 ]) # LC_CONFIG_QUOTA
2019 AC_DEFUN([LC_QUOTA], [
2023 AS_IF([test "x$enable_quota" != xno -a "x$enable_utils" != xno], [
2024 AC_CHECK_HEADER([sys/quota.h],
2025 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1,
2026 [Define to 1 if you have <sys/quota.h>.])],
2027 [AC_MSG_ERROR([don't find <sys/quota.h> in your system])])
2032 # LC_CONFIG_NODEMAP_PROC_DEBUG
2034 # enable nodemap proc file debugging
2036 AC_DEFUN([LC_NODEMAP_PROC_DEBUG], [
2037 AC_MSG_CHECKING([whether to enable nodemap proc debug])
2038 AC_ARG_ENABLE([nodemap_proc_debug],
2039 AC_HELP_STRING([--enable-nodemap-proc-debug],
2040 [enable nodemap proc debug]),
2041 [], [enable_nodemap_proc_debug="no"])
2042 AC_MSG_RESULT([$enable_nodemap_proc_debug])
2043 AS_IF([test "x$enable_nodemap_proc_debug" != xno],
2044 [AC_DEFINE(NODEMAP_PROC_DEBUG, 1,
2045 [enable nodemap proc debug support])])
2046 ]) # LC_NODEMAP_PROC_DEBUG
2049 # LC_LLITE_LLOOP_MODULE
2051 # lloop_llite.ko does not currently work with page sizes
2054 AC_DEFUN([LC_LLITE_LLOOP_MODULE], [
2055 LB_CHECK_COMPILE([whether to enable 'llite_lloop' module],
2056 enable_llite_lloop_module, [
2057 #include <asm/page.h>
2059 #if PAGE_SIZE >= 65536
2060 #error "PAGE_SIZE >= 65536"
2063 [enable_llite_lloop_module="yes"],
2064 [enable_llite_lloop_module="no"])
2065 ]) # LC_LLITE_LLOOP_MODULE
2070 # configure support for optional OSD implementation
2072 AC_DEFUN([LC_OSD_ADDON], [
2073 AC_MSG_CHECKING([whether to use OSD addon])
2075 AC_HELP_STRING([--with-osd=path],
2076 [set path to optional osd]),
2083 OSDADDON="$with_osd"
2090 AS_IF([test $ENABLEOSDADDON -eq 0], [
2094 OSDMODNAME=$(basename $OSDADDON)
2095 AS_IF([test -e $LUSTRE/$OSDMODNAME], [
2096 AC_MSG_RESULT([can't link])
2098 ], [ln -s $OSDADDON $LUSTRE/$OSDMODNAME], [
2099 AC_MSG_RESULT([$OSDMODNAME])
2100 OSDADDON="subdir-m += $OSDMODNAME"
2102 AC_MSG_RESULT([can't link])
2112 # other configure checks
2114 AC_DEFUN([LC_CONFIGURE], [
2115 AC_MSG_NOTICE([Lustre core checks
2116 ==============================================================================])
2118 LC_CONFIG_OBD_BUFFER_SIZE
2120 AS_IF([test $target_cpu == "i686" -o $target_cpu == "x86_64"],
2121 [CFLAGS="$CFLAGS -Wall -Werror"])
2123 # maximum MDS thread count
2126 # lustre/utils/gss/gss_util.c
2127 # lustre/utils/gss/gssd_proc.c
2128 # lustre/utils/gss/krb5_util.c
2129 # lustre/utils/llog_reader.c
2130 # lustre/utils/create_iam.c
2131 # lustre/utils/libiam.c
2132 AC_CHECK_HEADERS([netdb.h endian.h])
2133 AC_CHECK_FUNCS([gethostbyname])
2135 # lustre/utils/llverdev.c
2136 AC_CHECK_HEADERS([blkid/blkid.h])
2138 # lustre/utils/llverfs.c
2139 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
2142 AC_CHECK_LIB([selinux], [is_selinux_enabled],
2143 [AC_CHECK_HEADERS([selinux/selinux.h],
2144 [SELINUX="-lselinux"
2145 AC_DEFINE([HAVE_SELINUX], 1,
2146 [support for selinux ])],
2149 No libselinux-devel package found, unable to build selinux enabled tools
2154 No selinux package found, unable to build selinux enabled tools
2160 AC_MSG_CHECKING([whether to report minimum OST free space])
2161 AC_ARG_ENABLE([mindf],
2162 AC_HELP_STRING([--enable-mindf],
2163 [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
2164 [], [enable_mindf="no"])
2165 AC_MSG_RESULT([$enable_mindf])
2166 AS_IF([test "$enable_mindf" = "yes"],
2167 [AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])])
2169 AC_MSG_CHECKING([whether to randomly failing memory alloc])
2170 AC_ARG_ENABLE([fail_alloc],
2171 AC_HELP_STRING([--disable-fail-alloc],
2172 [disable randomly alloc failure]),
2173 [], [enable_fail_alloc="yes"])
2174 AC_MSG_RESULT([$enable_fail_alloc])
2175 AS_IF([test "x$enable_fail_alloc" != xno],
2176 [AC_DEFINE([RANDOM_FAIL_ALLOC], 1,
2177 [enable randomly alloc failure])])
2179 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
2180 AC_ARG_ENABLE([invariants],
2181 AC_HELP_STRING([--enable-invariants],
2182 [enable invariant checking (cpu intensive)]),
2183 [], [enable_invariants="no"])
2184 AC_MSG_RESULT([$enable_invariants])
2185 AS_IF([test "x$enable_invariants" = xyes],
2186 [AC_DEFINE([CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK], 1,
2187 [enable invariant checking])])
2189 AC_MSG_CHECKING([whether to track references with lu_ref])
2190 AC_ARG_ENABLE([lu_ref],
2191 AC_HELP_STRING([--enable-lu_ref],
2192 [enable lu_ref reference tracking code]),
2193 [], [enable_lu_ref="no"])
2194 AC_MSG_RESULT([$enable_lu_ref])
2195 AS_IF([test "x$enable_lu_ref" = xyes],
2196 [AC_DEFINE([USE_LU_REF], 1,
2197 [enable lu_ref reference tracking code])])
2199 AC_MSG_CHECKING([whether to enable page state tracking])
2200 AC_ARG_ENABLE([pgstate-track],
2201 AC_HELP_STRING([--enable-pgstate-track],
2202 [enable page state tracking]),
2203 [], [enable_pgstat_track="no"])
2204 AC_MSG_RESULT([$enable_pgstat_track])
2205 AS_IF([test "x$enable_pgstat_track" = xyes],
2206 [AC_DEFINE([CONFIG_DEBUG_PAGESTATE_TRACKING], 1,
2207 [enable page state tracking code])])
2213 # AM_CONDITIONALS for lustre
2215 AC_DEFUN([LC_CONDITIONALS], [
2216 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
2217 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
2218 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
2219 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
2220 AM_CONDITIONAL(BLKID, test x$ac_cv_header_blkid_blkid_h = xyes)
2221 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
2222 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
2223 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
2224 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
2225 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
2226 AM_CONDITIONAL(LLITE_LLOOP, test x$enable_llite_lloop_module = xyes)
2227 ]) # LC_CONDITIONALS
2232 # files that should be generated with AC_OUTPUT
2234 AC_DEFUN([LC_CONFIG_FILES],
2238 lustre/autoconf/Makefile
2239 lustre/conf/Makefile
2240 lustre/contrib/Makefile
2242 lustre/include/Makefile
2243 lustre/include/lustre_ver.h
2244 lustre/include/lustre/Makefile
2245 lustre/kernel_patches/targets/3.10-rhel7.target
2246 lustre/kernel_patches/targets/2.6-rhel6.6.target
2247 lustre/kernel_patches/targets/2.6-rhel6.target
2248 lustre/kernel_patches/targets/2.6-rhel5.target
2249 lustre/kernel_patches/targets/2.6-sles11.target
2250 lustre/kernel_patches/targets/3.0-sles11.target
2251 lustre/kernel_patches/targets/3.0-sles11sp3.target
2252 lustre/kernel_patches/targets/3.12-sles12.target
2253 lustre/kernel_patches/targets/2.6-fc11.target
2254 lustre/kernel_patches/targets/2.6-fc12.target
2255 lustre/kernel_patches/targets/2.6-fc15.target
2256 lustre/kernel_patches/targets/3.x-fc18.target
2257 lustre/ldlm/Makefile
2259 lustre/fid/autoMakefile
2260 lustre/llite/Makefile
2261 lustre/llite/autoMakefile
2263 lustre/lov/autoMakefile
2265 lustre/mdc/autoMakefile
2267 lustre/lmv/autoMakefile
2268 lustre/lfsck/Makefile
2269 lustre/lfsck/autoMakefile
2271 lustre/mdt/autoMakefile
2273 lustre/mdd/autoMakefile
2275 lustre/fld/autoMakefile
2276 lustre/obdclass/Makefile
2277 lustre/obdclass/autoMakefile
2278 lustre/obdclass/linux/Makefile
2279 lustre/obdecho/Makefile
2280 lustre/obdecho/autoMakefile
2282 lustre/ofd/autoMakefile
2284 lustre/osc/autoMakefile
2286 lustre/ost/autoMakefile
2287 lustre/osd-ldiskfs/Makefile
2288 lustre/osd-ldiskfs/autoMakefile
2289 lustre/osd-zfs/Makefile
2290 lustre/osd-zfs/autoMakefile
2292 lustre/mgc/autoMakefile
2294 lustre/mgs/autoMakefile
2295 lustre/target/Makefile
2296 lustre/ptlrpc/Makefile
2297 lustre/ptlrpc/autoMakefile
2298 lustre/ptlrpc/gss/Makefile
2299 lustre/ptlrpc/gss/autoMakefile
2300 lustre/quota/Makefile
2301 lustre/quota/autoMakefile
2302 lustre/scripts/Makefile
2303 lustre/tests/Makefile
2304 lustre/tests/mpi/Makefile
2305 lustre/utils/Makefile
2306 lustre/utils/gss/Makefile
2308 lustre/osp/autoMakefile
2310 lustre/lod/autoMakefile
2312 ]) # LC_CONFIG_FILES