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
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_GLIBC_SUPPORT_FHANDLES
52 AC_DEFUN([LC_GLIBC_SUPPORT_FHANDLES], [
53 AC_CHECK_FUNCS([name_to_handle_at],
54 [AC_DEFINE(HAVE_FHANDLE_GLIBC_SUPPORT, 1,
55 [file handle and related syscalls are supported])],
56 [AC_MSG_WARN([file handle and related syscalls are not supported])])
57 ]) # LC_GLIBC_SUPPORT_FHANDLES
62 # Ensure the stack size is at least 8k in Lustre server (all kernels)
64 AC_DEFUN([LC_STACK_SIZE], [
65 LB_CHECK_COMPILE([if stack size is at least 8k],
67 #include <linux/thread_info.h>
69 #if THREAD_SIZE < 8192
70 #error "stack size < 8192"
72 ], [], [AC_MSG_ERROR([
74 Lustre requires that Linux is configured with at least a 8KB stack.
81 # Allow the user to set the MDS thread upper limit
83 AC_DEFUN([LC_MDS_MAX_THREADS], [
84 AC_MSG_CHECKING([for maximum number of MDS threads])
85 AC_ARG_WITH([mds_max_threads],
86 AC_HELP_STRING([--with-mds-max-threads=count],
87 [maximum threads available on the MDS: (default=512)]),
88 [AC_DEFINE_UNQUOTED(MDS_MAX_THREADS, $with_mds_max_threads,
89 [maximum number of MDS threads])])
90 AC_MSG_RESULT([$with_mds_max_threads])
91 ]) # LC_MDS_MAX_THREADS
96 # the pinger is temporary, until we have the recovery node in place
98 AC_DEFUN([LC_CONFIG_PINGER], [
99 AC_MSG_CHECKING([whether to enable Lustre pinger support])
100 AC_ARG_ENABLE([pinger],
101 AC_HELP_STRING([--disable-pinger],
102 [disable recovery pinger support]),
103 [], [enable_pinger="yes"])
104 AC_MSG_RESULT([$enable_pinger])
105 AS_IF([test "x$enable_pinger" != xno],
106 [AC_DEFINE(ENABLE_PINGER, 1,[Use the Pinger])])
107 ]) # LC_CONFIG_PINGER
112 # do checksum of bulk data between client and OST
114 AC_DEFUN([LC_CONFIG_CHECKSUM], [
115 AC_MSG_CHECKING([whether to enable data checksum support])
116 AC_ARG_ENABLE([checksum],
117 AC_HELP_STRING([--disable-checksum],
118 [disable data checksum support]),
119 [], [enable_checksum="yes"])
120 AC_MSG_RESULT([$enable_checksum])
121 AS_IF([test "x$enable_checksum" != xno],
122 [AC_DEFINE(ENABLE_CHECKSUM, 1, [do data checksums])])
123 ]) # LC_CONFIG_CHECKSUM
126 # LC_CONFIG_HEALTH_CHECK_WRITE
128 # Turn off the actual write to the disk
130 AC_DEFUN([LC_CONFIG_HEALTH_CHECK_WRITE], [
131 AC_MSG_CHECKING([whether to enable a write with the health check])
132 AC_ARG_ENABLE([health_write],
133 AC_HELP_STRING([--enable-health_write],
134 [enable disk writes when doing health check]),
135 [], [enable_health_write="no"])
136 AC_MSG_RESULT([$enable_health_write])
137 AS_IF([test "x$enable_health_write" != xno],
138 [AC_DEFINE(USE_HEALTH_CHECK_WRITE, 1, [Write when Checking Health])])
139 ]) # LC_CONFIG_HEALTH_CHECK_WRITE
142 # LC_CONFIG_LRU_RESIZE
144 AC_DEFUN([LC_CONFIG_LRU_RESIZE], [
145 AC_MSG_CHECKING([whether to enable lru self-adjusting])
146 AC_ARG_ENABLE([lru_resize],
147 AC_HELP_STRING([--enable-lru-resize],
148 [enable lru resize support]),
149 [], [enable_lru_resize="yes"])
150 AC_MSG_RESULT([$enable_lru_resize])
151 AS_IF([test "x$enable_lru_resize" != xno],
152 [AC_DEFINE(HAVE_LRU_RESIZE_SUPPORT, 1, [Enable lru resize support])])
153 ]) # LC_CONFIG_LRU_RESIZE
158 # Quota support. The kernel must support CONFIG_QUOTA.
160 AC_DEFUN([LC_QUOTA_CONFIG], [
161 LB_CHECK_CONFIG_IM([QUOTA], [],
164 Lustre quota requires that CONFIG_QUOTA is enabled in your kernel.
169 # LC_EXPORT_TRUNCATE_COMPLETE_PAGE
171 # truncate_complete_page() has never been exported from an upstream kernel
172 # remove_from_page_cache() was exported between 2.6.35 and 2.6.38
173 # delete_from_page_cache() is exported from 2.6.39
175 AC_DEFUN([LC_EXPORT_TRUNCATE_COMPLETE_PAGE], [
176 LB_CHECK_EXPORT([truncate_complete_page], [mm/truncate.c],
177 [AC_DEFINE(HAVE_TRUNCATE_COMPLETE_PAGE, 1,
178 [kernel export truncate_complete_page])])
179 LB_CHECK_EXPORT([remove_from_page_cache], [mm/filemap.c],
180 [AC_DEFINE(HAVE_REMOVE_FROM_PAGE_CACHE, 1,
181 [kernel export remove_from_page_cache])])
182 LB_CHECK_EXPORT([delete_from_page_cache], [mm/filemap.c],
183 [AC_DEFINE(HAVE_DELETE_FROM_PAGE_CACHE, 1,
184 [kernel export delete_from_page_cache])])
185 ]) # LC_EXPORT_TRUNCATE_COMPLETE_PAGE
188 # LC_CONFIG_GSS_KEYRING
190 # default 'auto', tests for dependencies, if found, enables;
191 # only called if gss is enabled
193 AC_DEFUN([LC_CONFIG_GSS_KEYRING], [
194 AC_MSG_CHECKING([whether to enable gss keyring backend])
195 AC_ARG_ENABLE([gss_keyring],
196 [AC_HELP_STRING([--disable-gss-keyring],
197 [disable gss keyring backend])],
198 [], [enable_gss_keyring="auto"])
199 AC_MSG_RESULT([$enable_gss_keyring])
200 AS_IF([test "x$enable_gss_keyring" != xno], [
201 LB_CHECK_CONFIG_IM([KEYS], [], [
202 gss_keyring_conf_test="fail"
203 AC_MSG_WARN([GSS keyring backend requires that CONFIG_KEYS be enabled in your kernel.])])
205 AC_CHECK_LIB([keyutils], [keyctl_search], [], [
206 gss_keyring_conf_test="fail"
207 AC_MSG_WARN([GSS keyring backend requires libkeyutils])])
209 AS_IF([test "x$gss_keyring_conf_test" != xfail], [
210 AC_DEFINE([HAVE_GSS_KEYRING], [1],
211 [Define this if you enable gss keyring backend])
212 enable_gss_keyring="yes"
214 AS_IF([test "x$enable_gss_keyring" = xyes], [
215 AC_MSG_ERROR([Cannot enable gss_keyring. See above for details.])
219 ]) # LC_CONFIG_GSS_KEYRING
222 # LC_HAVE_CRED_TGCRED
224 # rhel7 struct cred has no member tgcred
226 AC_DEFUN([LC_HAVE_CRED_TGCRED], [
227 LB_CHECK_COMPILE([if 'struct cred' has member 'tgcred'],
229 #include <linux/cred.h>
231 ((struct cred *)0)->tgcred = NULL;
233 AC_DEFINE(HAVE_CRED_TGCRED, 1,
234 [struct cred has member tgcred])
236 ]) # LC_HAVE_CRED_TGCRED
239 # LC_KEY_TYPE_INSTANTIATE_2ARGS
241 # rhel7 key_type->instantiate takes 2 args (struct key, struct key_preparsed_payload)
243 AC_DEFUN([LC_KEY_TYPE_INSTANTIATE_2ARGS], [
244 LB_CHECK_COMPILE([if 'key_type->instantiate' has two args],
245 key_type_instantiate_2args, [
246 #include <linux/key-type.h>
248 ((struct key_type *)0)->instantiate(0, NULL);
250 AC_DEFINE(HAVE_KEY_TYPE_INSTANTIATE_2ARGS, 1,
251 [key_type->instantiate has two args])
253 ]) # LC_KEY_TYPE_INSTANTIATE_2ARGS
258 AC_DEFUN([LC_CONFIG_SUNRPC], [
259 LB_CHECK_CONFIG_IM([SUNRPC], [], [
260 AS_IF([test "x$sunrpc_required" = xyes], [
263 kernel SUNRPC support is required by using GSS.
266 ]) # LC_CONFIG_SUNRPC
269 # LC_HAVE_CRYPTO_HASH
271 # 4.6 kernel commit 896545098777564212b9e91af4c973f094649aa7
272 # removed crypto_hash support. Since GSS only works with
273 # crypto_hash it has to be disabled for newer distros.
275 AC_DEFUN([LC_HAVE_CRYPTO_HASH], [
276 LB_CHECK_COMPILE([if crypto_hash API is supported],
278 #include <linux/crypto.h>
280 crypto_hash_digestsize(NULL);
281 ], [], [enable_gss="no"])
283 ]) # LC_HAVE_CRYPTO_HASH
286 # LC_CONFIG_GSS (default 'auto' (tests for dependencies, if found, enables))
288 # Build gss and related tools of Lustre. Currently both kernel and user space
289 # parts are depend on linux platform.
291 AC_DEFUN([LC_CONFIG_GSS], [
292 AC_MSG_CHECKING([whether to enable gss support])
294 [AC_HELP_STRING([--enable-gss], [enable gss support])],
295 [], [enable_gss="auto"])
296 AC_MSG_RESULT([$enable_gss])
298 AS_IF([test "x$enable_gss" != xno], [
299 LC_CONFIG_GSS_KEYRING
302 LC_KEY_TYPE_INSTANTIATE_2ARGS
303 sunrpc_required=$enable_gss
307 LB_CHECK_CONFIG_IM([CRYPTO_MD5], [],
308 [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
309 LB_CHECK_CONFIG_IM([CRYPTO_SHA1], [],
310 [AC_MSG_WARN([kernel SHA1 support is recommended by using GSS.])])
311 LB_CHECK_CONFIG_IM([CRYPTO_SHA256], [],
312 [AC_MSG_WARN([kernel SHA256 support is recommended by using GSS.])])
313 LB_CHECK_CONFIG_IM([CRYPTO_SHA512], [],
314 [AC_MSG_WARN([kernel SHA512 support is recommended by using GSS.])])
316 require_krb5=$enable_gss
320 AS_IF([test -n "$KRBDIR"], [
321 gss_conf_test="success"
323 gss_conf_test="failure"
326 AS_IF([test "x$gss_conf_test" = xsuccess && test "x$enable_gss" != xno], [
327 AC_DEFINE([HAVE_GSS], [1], [Define this is if you enable gss])
333 enable_ssk=$enable_gss
339 # OpenSSL 1.0+ return int for HMAC functions but older SLES11 versions do not
340 AC_DEFUN([LC_OPENSSL_SSK], [
341 AC_MSG_CHECKING([whether OpenSSL has functions needed for SSK])
342 AS_IF([test "x$enable_ssk" != xno], [
343 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
344 #include <openssl/hmac.h>
345 #include <openssl/evp.h>
351 rc = HMAC_Init_ex(&ctx, "test", 4, EVP_md_null(), NULL);
353 ])],[AC_DEFINE(HAVE_OPENSSL_SSK, 1,
354 [OpenSSL HMAC functions needed for SSK])],
357 AC_MSG_RESULT([$enable_ssk])
360 # LC_INODE_PERMISION_2ARGS
362 # up to v2.6.27 had a 3 arg version (inode, mask, nameidata)
363 # v2.6.27->v2.6.37 had a 2 arg version (inode, mask)
364 # v2.6.37->v3.0 had a 3 arg version (inode, mask, nameidata)
365 # v3.1 onward have a 2 arg version (inode, mask)
367 AC_DEFUN([LC_INODE_PERMISION_2ARGS], [
368 LB_CHECK_COMPILE([if 'inode_operations->permission' has two args],
369 inode_ops_permission_2args, [
370 #include <linux/fs.h>
372 struct inode *inode __attribute__ ((unused));
375 inode->i_op->permission(NULL, 0);
377 AC_DEFINE(HAVE_INODE_PERMISION_2ARGS, 1,
378 [inode_operations->permission has two args])
380 ]) # LC_INODE_PERMISION_2ARGS
383 # LC_BLK_QUEUE_MAX_SEGMENTS
385 # 2.6.32 replaces 2 functions blk_queue_max_phys_segments and blk_queue_max_hw_segments by blk_queue_max_segments
387 AC_DEFUN([LC_BLK_QUEUE_MAX_SEGMENTS], [
388 LB_CHECK_COMPILE([if 'blk_queue_max_segments' is defined],
389 blk_queue_max_segments, [
390 #include <linux/blkdev.h>
392 blk_queue_max_segments(NULL, 0);
394 AC_DEFINE(HAVE_BLK_QUEUE_MAX_SEGMENTS, 1,
395 [blk_queue_max_segments is defined])
397 ]) # LC_BLK_QUEUE_MAX_SEGMENTS
400 # LC_HAVE_XATTR_HANDLER_FLAGS
402 # 2.6.33 added a private flag to xattr_handler
404 AC_DEFUN([LC_HAVE_XATTR_HANDLER_FLAGS], [
405 LB_CHECK_COMPILE([if 'struct xattr_handler' has flags field],
406 xattr_handler_flags, [
407 #include <linux/xattr.h>
409 struct xattr_handler handler;
413 AC_DEFINE(HAVE_XATTR_HANDLER_FLAGS, 1, [flags field exist])
415 ]) # LC_HAVE_XATTR_HANDLER_FLAGS
418 # LC_HAVE_DQUOT_FS_DISK_QUOTA
420 # 2.6.34 has quotactl_ops->[sg]et_dqblk that take struct fs_disk_quota
422 AC_DEFUN([LC_HAVE_DQUOT_FS_DISK_QUOTA], [
423 tmp_flags="$EXTRA_KCFLAGS"
424 EXTRA_KCFLAGS="-Werror"
425 LB_CHECK_COMPILE([if 'quotactl_ops.set_dqblk' takes struct fs_disk_quota],
427 #include <linux/fs.h>
428 #include <linux/quota.h>
430 ((struct quotactl_ops *)0)->set_dqblk(NULL, 0, 0, (struct fs_disk_quota*)0);
432 AC_DEFINE(HAVE_DQUOT_FS_DISK_QUOTA, 1,
433 [quotactl_ops.set_dqblk takes struct fs_disk_quota])
435 LB_CHECK_COMPILE([if 'quotactl_ops.set_dqblk' takes struct kqid & fs_disk_quota],
436 kqid_fs_disk_quota, [
437 #include <linux/fs.h>
438 #include <linux/quota.h>
440 ((struct quotactl_ops *)0)->set_dqblk((struct super_block*)0, *((struct kqid*)0), (struct fs_disk_quota*)0);
442 AC_DEFINE(HAVE_DQUOT_FS_DISK_QUOTA, 1,
443 [quotactl_ops.set_dqblk takes struct fs_disk_quota])
444 AC_DEFINE(HAVE_DQUOT_KQID, 1,
445 [quotactl_ops.set_dqblk takes struct kqid])
448 EXTRA_KCFLAGS="$tmp_flags"
449 ]) # LC_HAVE_DQUOT_FS_DISK_QUOTA
452 # LC_HAVE_DQUOT_SUSPEND
454 # 2.6.34 has renamed dquot options to dquot_*, check for dquot_suspend
456 AC_DEFUN([LC_HAVE_DQUOT_SUSPEND], [
457 LB_CHECK_COMPILE([if 'dquot_suspend' is defined],
459 #include <linux/quotaops.h>
461 dquot_suspend(NULL, -1);
463 AC_DEFINE(HAVE_DQUOT_SUSPEND, 1, [dquot_suspend is defined])
465 ]) # LC_HAVE_DQUOT_SUSPEND
470 # Check if kernel has been patched for 64-bit quota limits support.
471 # The upstream version of this patch in RHEL6 2.6.32 kernels introduces
472 # the constant QFMT_VFS_V1 in include/linux/quota.h, so we can check for
473 # that in the absence of quotaio_v1.h in the kernel headers.
475 AC_DEFUN([LC_QUOTA64], [
476 tmp_flags="$EXTRA_KCFLAGS"
477 EXTRA_KCFLAGS="-I$LINUX/fs"
478 LB_CHECK_COMPILE([if kernel has 64-bit quota limits support],
480 #include <linux/kernel.h>
481 #include <linux/fs.h>
482 #if defined(HAVE_FS_QUOTA_QUOTAIO_H)
483 #include <quota/quotaio_v2.h>
484 struct v2r1_disk_dqblk dqblk_r1;
486 #include <linux/quota.h>
487 int ver = QFMT_VFS_V1;
490 AC_DEFINE(HAVE_QUOTA64, 1, [have quota64])
492 LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],
493 [AC_MSG_ERROR([You have got no 64-bit kernel quota support.])])
495 EXTRA_KCFLAGS=$tmp_flags
499 # LC_HAVE_ADD_WAIT_QUEUE_EXCLUSIVE
501 # 2.6.34 adds __add_wait_queue_exclusive
503 AC_DEFUN([LC_HAVE_ADD_WAIT_QUEUE_EXCLUSIVE], [
504 LB_CHECK_COMPILE([if '__add_wait_queue_exclusive' exists],
505 __add_wait_queue_exclusive, [
506 #include <linux/wait.h>
508 wait_queue_head_t queue;
511 __add_wait_queue_exclusive(&queue, &wait);
513 AC_DEFINE(HAVE___ADD_WAIT_QUEUE_EXCLUSIVE, 1,
514 [__add_wait_queue_exclusive exists])
516 ]) # LC_HAVE_ADD_WAIT_QUEUE_EXCLUSIVE
519 # LC_FS_STRUCT_RWLOCK
521 # 2.6.36 fs_struct.lock use spinlock instead of rwlock.
523 AC_DEFUN([LC_FS_STRUCT_RWLOCK], [
524 LB_CHECK_COMPILE([if 'fs_struct.lock' use rwlock],
526 #include <asm/atomic.h>
527 #include <linux/spinlock.h>
528 #include <linux/fs_struct.h>
530 ((struct fs_struct *)0)->lock = (rwlock_t){ 0 };
532 AC_DEFINE(HAVE_FS_STRUCT_RWLOCK, 1, [fs_struct.lock use rwlock])
534 ]) # LC_FS_STRUCT_RWLOCK
537 # LC_SBOPS_EVICT_INODE
539 # 2.6.36 super_operations add evict_inode method. it hybird of
540 # delete_inode & clear_inode.
542 AC_DEFUN([LC_SBOPS_EVICT_INODE], [
543 LB_CHECK_COMPILE([if 'super_operations.evict_inode' exist],
544 super_ops_evict_inode, [
545 #include <linux/fs.h>
547 ((struct super_operations *)0)->evict_inode(NULL);
549 AC_DEFINE(HAVE_SBOPS_EVICT_INODE, 1,
550 [super_operations.evict_inode() is exist in kernel])
552 ]) # LC_SBOPS_EVICT_INODE
557 # 2.6.35 file_operations.fsync taken 2 arguments.
558 # 3.0.0 file_operations.fsync takes 4 arguments.
560 AC_DEFUN([LC_FILE_FSYNC], [
561 LB_CHECK_COMPILE([if 'file_operations.fsync' takes 4 arguments],
562 file_ops_fsync_4args, [
563 #include <linux/fs.h>
565 ((struct file_operations *)0)->fsync(NULL, 0, 0, 0);
567 AC_DEFINE(HAVE_FILE_FSYNC_4ARGS, 1,
568 [file_operations.fsync takes 4 arguments])
570 LB_CHECK_COMPILE([if 'file_operations.fsync' takes 2 arguments],
571 file_ops_fsync_2args, [
572 #include <linux/fs.h>
574 ((struct file_operations *)0)->fsync(NULL, 0);
576 AC_DEFINE(HAVE_FILE_FSYNC_2ARGS, 1,
577 [file_operations.fsync takes 2 arguments])
585 # 2.6.37 remove kernel_locked
587 AC_DEFUN([LC_KERNEL_LOCKED], [
588 LB_CHECK_COMPILE([if 'kernel_locked' is defined],
590 #include <linux/smp_lock.h>
594 AC_DEFINE(HAVE_KERNEL_LOCKED, 1, [kernel_locked is defined])
596 ]) # LC_KERNEL_LOCKED
599 # LC_FS_STRUCT_SEQCOUNT
601 # 2.6.37 uses seqlock in fs_struct
603 AC_DEFUN([LC_FS_STRUCT_SEQCOUNT], [
604 LB_CHECK_COMPILE([if fs_struct use seqcount],
605 fs_struct_seqcount, [
606 #include <linux/fs_struct.h>
608 ((struct fs_struct *)0)->seq = (struct seqcount){ 0 };
610 AC_DEFINE(HAVE_FS_STRUCT_SEQCOUNT, 1, [fs_struct use seqcount])
612 ]) # LC_FS_STRUCT_SEQCOUNT
617 # 2.6.38 dentry_operations.d_compare() taken 7 arguments.
619 AC_DEFUN([LC_D_COMPARE_7ARGS], [
620 LB_CHECK_COMPILE([if 'dentry_operations.d_compare()' taken 7 arguments],
621 dentry_ops_d_compare_7arg, [
622 #include <linux/dcache.h>
624 ((struct dentry_operations*)0)->d_compare(NULL,NULL,NULL,NULL,0,NULL,NULL);
626 AC_DEFINE(HAVE_D_COMPARE_7ARGS, 1, [d_compare need 7 arguments])
628 ]) # LC_D_COMPARE_7ARGS
633 # 2.6.38 dentry_operations.d_delete() defined 'const' for 1st parameter.
635 AC_DEFUN([LC_D_DELETE_CONST], [
636 tmp_flags="$EXTRA_KCFLAGS"
637 EXTRA_KCFLAGS="-Werror"
638 LB_CHECK_COMPILE([if 'dentry_operations.d_delete()' has const declare on first parameter],
639 dentry_ops_d_delete_1st_const, [
640 #include <linux/dcache.h>
642 const struct dentry *d = NULL;
643 ((struct dentry_operations*)0)->d_delete(d);
645 AC_DEFINE(HAVE_D_DELETE_CONST, const,
646 [d_delete first parameter declared const])
648 AC_DEFINE(HAVE_D_DELETE_CONST, [],
649 [d_delete first parameter declared is not const])
651 EXTRA_KCFLAGS="$tmp_flags"
652 ]) # LC_D_DELETE_CONST
657 # 2.6.38 dcache_lock removed. rcu-walk committed.
659 AC_DEFUN([LC_DCACHE_LOCK], [
660 LB_CHECK_COMPILE([if 'dcache_lock' is exist],
662 #include <linux/dcache.h>
664 spin_lock(&dcache_lock);
666 AC_DEFINE(HAVE_DCACHE_LOCK, 1,
667 [dcache_lock is exist])
674 # 2.6.38 inode.i_rcu added.
676 AC_DEFUN([LC_INODE_I_RCU], [
677 LB_CHECK_COMPILE([if 'inode.i_rcu' exists],
679 #include <linux/fs.h>
682 struct rcu_head rcu = {};
685 AC_DEFINE(HAVE_INODE_I_RCU, 1,
686 [inode.i_rcu exists])
691 # LC_BLKDEV_GET_BY_DEV
693 # 2.6.38 export blkdev_get_by_dev
695 AC_DEFUN([LC_BLKDEV_GET_BY_DEV], [
696 LB_CHECK_EXPORT([blkdev_get_by_dev], [fs/block_dev.c],
697 [AC_DEFINE(HAVE_BLKDEV_GET_BY_DEV, 1,
698 [blkdev_get_by_dev is exported by the kernel])])
699 ]) # LC_BLKDEV_GET_BY_DEV
702 # LC_EXPORT_SIMPLE_SETATTR
704 # 2.6.38 export simple_setattr
706 AC_DEFUN([LC_EXPORT_SIMPLE_SETATTR], [
707 LB_CHECK_EXPORT([simple_setattr], [fs/libfs.c],
708 [AC_DEFINE(HAVE_SIMPLE_SETATTR, 1,
709 [simple_setattr is exported by the kernel])])
710 ]) # LC_EXPORT_SIMPLE_SETATTR
715 # 2.6.38 add struct blk_plug
717 AC_DEFUN([LC_HAVE_BLK_PLUG], [
718 LB_CHECK_COMPILE([if 'struct blk_plug' exists],
720 #include <linux/blkdev.h>
722 struct blk_plug plug;
724 blk_start_plug(&plug);
725 blk_finish_plug(&plug);
727 AC_DEFINE(HAVE_BLK_PLUG, 1,
728 [blk_plug struct exists])
730 ]) # LC_HAVE_BLK_PLUG
735 # truncate callback removed since 2.6.39
737 AC_DEFUN([LC_IOP_TRUNCATE], [
738 LB_CHECK_COMPILE([if 'inode_operations' has '.truncate' member function],
739 inode_ops_truncate, [
740 #include <linux/fs.h>
742 ((struct inode_operations *)0)->truncate(NULL);
744 AC_DEFINE(HAVE_INODEOPS_TRUNCATE, 1,
745 [inode_operations has .truncate member function])
750 # LC_HAVE_FSTYPE_MOUNT
752 # 2.6.39 replace get_sb with mount in struct file_system_type
754 AC_DEFUN([LC_HAVE_FSTYPE_MOUNT], [
755 LB_CHECK_COMPILE([if 'file_system_type' has 'mount' field],
756 file_system_type_mount, [
757 #include <linux/fs.h>
759 struct file_system_type fst;
760 void *i = (void *) fst.mount;
762 AC_DEFINE(HAVE_FSTYPE_MOUNT, 1,
763 [struct file_system_type has mount field])
765 ]) # LC_HAVE_FSTYPE_MOUNT
768 # LC_HAVE_FHANDLE_SYSCALLS
770 # 2.6.39 The open_by_handle_at() and name_to_handle_at() system calls were
771 # added to Linux kernel 2.6.39.
772 # Check if client supports these functions
774 AC_DEFUN([LC_HAVE_FHANDLE_SYSCALLS], [
775 LB_CHECK_CONFIG_IM([FHANDLE],[
776 AC_DEFINE(HAVE_FHANDLE_SYSCALLS, 1,
777 [kernel supports fhandles and related syscalls])
779 ]) # LC_HAVE_FHANDLE_SYSCALLS
782 # LC_HAVE_INODE_OWNER_OR_CAPABLE
784 # 2.6.39 renames is_owner_or_cap to inode_owner_or_capable
786 AC_DEFUN([LC_HAVE_INODE_OWNER_OR_CAPABLE], [
787 LB_CHECK_COMPILE([if 'inode_owner_or_capable' exist],
788 inode_owner_or_capable, [
789 #include <linux/fs.h>
791 inode_owner_or_capable(NULL);
793 AC_DEFINE(HAVE_INODE_OWNER_OR_CAPABLE, 1,
794 [inode_owner_or_capable exist])
796 ]) # LC_HAVE_INODE_OWNER_OR_CAPABLE
799 # LC_DIRTY_INODE_WITH_FLAG
801 # 3.0 dirty_inode() has a flag parameter
802 # see kernel commit aa38572954ade525817fe88c54faebf85e5a61c0
804 AC_DEFUN([LC_DIRTY_INODE_WITH_FLAG], [
805 LB_CHECK_COMPILE([if 'dirty_inode' super_operation takes flag],
806 dirty_inode_super_operation_flag, [
807 #include <linux/fs.h>
810 inode->i_sb->s_op->dirty_inode(NULL, 0);
812 AC_DEFINE(HAVE_DIRTY_INODE_HAS_FLAG, 1,
813 [dirty_inode super_operation takes flag])
815 ]) # LC_DIRTY_INODE_WITH_FLAG
820 # 3.0 introduced setns
822 AC_DEFUN([LC_SETNS], [
823 AC_CHECK_HEADERS([sched.h], [], [],
826 AC_CHECK_FUNCS([setns])
830 # LC_GENERIC_PERMISSION
832 # 2.6.38 generic_permission taken 4 parameters.
833 # in fact, it means rcu-walk aware permission bring.
835 # 3.1 generic_permission taken 2 parameters.
836 # see kernel commit 2830ba7f34ebb27c4e5b8b6ef408cd6d74860890
838 AC_DEFUN([LC_GENERIC_PERMISSION], [
839 LB_CHECK_COMPILE([if 'generic_permission' take 2 arguments],
840 generic_permission_2args, [
841 #include <linux/fs.h>
843 generic_permission(NULL, 0);
845 AC_DEFINE(HAVE_GENERIC_PERMISSION_2ARGS, 1,
846 [generic_permission taken 2 arguments])
848 LB_CHECK_COMPILE([if 'generic_permission' take 4 arguments],
849 generic_permission_4args, [
850 #include <linux/fs.h>
852 generic_permission(NULL, 0, 0, NULL);
854 AC_DEFINE(HAVE_GENERIC_PERMISSION_4ARGS, 1,
855 [generic_permission taken 4 arguments])
858 ]) # LC_GENERIC_PERMISSION
861 # LC_LM_XXX_LOCK_MANAGER_OPS
863 # 3.1 renames lock-manager ops(lock_manager_operations) from fl_xxx to lm_xxx
864 # see kernel commit 8fb47a4fbf858a164e973b8ea8ef5e83e61f2e50
866 AC_DEFUN([LC_LM_XXX_LOCK_MANAGER_OPS], [
867 LB_CHECK_COMPILE([if 'lock-manager' ops renamed to 'lm_xxx'],
868 lock_manager_ops_lm_xxx, [
869 #include <linux/fs.h>
871 struct lock_manager_operations lm_ops;
872 lm_ops.lm_compare_owner = NULL;
874 AC_DEFINE(HAVE_LM_XXX_LOCK_MANAGER_OPS, 1,
875 [lock-manager ops renamed to lm_xxx])
877 ]) # LC_LM_XXX_LOCK_MANAGER_OPS
882 # 3.1 kills inode->i_alloc_sem, use i_dio_count and inode_dio_wait
884 # see kernel commit bd5fe6c5eb9c548d7f07fe8f89a150bb6705e8e3
886 AC_DEFUN([LC_INODE_DIO_WAIT], [
887 LB_CHECK_COMPILE([if 'inode->i_alloc_sem' is killed and use inode_dio_wait],
889 #include <linux/fs.h>
891 inode_dio_wait((struct inode *)0);
893 AC_DEFINE(HAVE_INODE_DIO_WAIT, 1,
894 [inode->i_alloc_sem is killed and use inode_dio_wait])
896 ]) # LC_INODE_DIO_WAIT
901 # 3.1 adds get_acl method to inode_operations to read ACL from disk.
902 # see kernel commit 4e34e719e457f2e031297175410fc0bd4016a085
904 AC_DEFUN([LC_IOP_GET_ACL], [
905 LB_CHECK_COMPILE([if 'inode_operations' has '.get_acl' member function],
907 #include <linux/fs.h>
909 struct inode_operations iop;
912 AC_DEFINE(HAVE_IOP_GET_ACL, 1,
913 [inode_operations has .get_acl member function])
918 # LC_FILE_LLSEEK_SIZE
920 # 3.1 introduced generic_file_llseek_size()
922 AC_DEFUN([LC_FILE_LLSEEK_SIZE], [
923 LB_CHECK_EXPORT([generic_file_llseek_size], [fs/read_write.c],
924 [AC_DEFINE(HAVE_FILE_LLSEEK_SIZE, 1,
925 [generic_file_llseek_size is exported by the kernel])])
926 ]) # LC_FILE_LLSEEK_SIZE
929 # LC_RADIX_EXCEPTION_ENTRY
930 # 3.1 adds radix_tree_exception_entry.
932 AC_DEFUN([LC_RADIX_EXCEPTION_ENTRY], [
933 LB_CHECK_COMPILE([radix_tree_exceptional_entry exist],
934 radix_tree_exceptional_entry, [
935 #include <linux/radix-tree.h>
937 radix_tree_exceptional_entry(NULL);
939 AC_DEFINE(HAVE_RADIX_EXCEPTION_ENTRY, 1,
940 [radix_tree_exceptional_entry exist])
942 ]) # LC_RADIX_EXCEPTION_ENTRY
945 # LC_HAVE_PROTECT_I_NLINK
947 # 3.2 protects inode->i_nlink from direct modification
948 # see kernel commit a78ef704a8dd430225955f0709b22d4a6ba21deb
949 # at the same time adds set_nlink(), so checks set_nlink() for it.
951 AC_DEFUN([LC_HAVE_PROTECT_I_NLINK], [
952 LB_CHECK_COMPILE([if 'inode->i_nlink' is protected from direct modification],
953 inode_i_nlink_protected, [
954 #include <linux/fs.h>
959 AC_DEFINE(HAVE_PROTECT_I_NLINK, 1,
960 [inode->i_nlink is protected from direct modification])
962 ]) # LC_HAVE_PROTECT_I_NLINK
965 # 2.6.39 security_inode_init_security takes a 'struct qstr' parameter
967 # 3.2 security_inode_init_security takes a callback to set xattrs
969 AC_DEFUN([LC_HAVE_SECURITY_IINITSEC], [
970 LB_CHECK_COMPILE([if security_inode_init_security takes a callback],
971 security_inode_init_security_callback, [
972 #include <linux/security.h>
974 security_inode_init_security(NULL, NULL, NULL, (const initxattrs)NULL, NULL);
976 AC_DEFINE(HAVE_SECURITY_IINITSEC_CALLBACK, 1,
977 [security_inode_init_security takes a callback to set xattrs])
979 LB_CHECK_COMPILE([if security_inode_init_security takes a 'struct qstr' parameter],
980 security_inode_init_security_qstr, [
981 #include <linux/security.h>
983 security_inode_init_security(NULL, NULL, (struct qstr *)NULL, NULL, NULL, NULL);
985 AC_DEFINE(HAVE_SECURITY_IINITSEC_QSTR, 1,
986 [security_inode_init_security takes a 'struct qstr' parameter])
989 ]) # LC_HAVE_SECURITY_IINITSEC
992 # LC_HAVE_MIGRATE_HEADER
994 # 3.3 introduces migrate_mode.h and migratepage has 4 args
996 AC_DEFUN([LC_HAVE_MIGRATE_HEADER], [
997 LB_CHECK_FILE([$LINUX/include/linux/migrate.h], [
998 AC_DEFINE(HAVE_MIGRATE_H, 1,
999 [kernel has include/linux/migrate.h])
1001 LB_CHECK_FILE([$LINUX/include/linux/migrate_mode.h], [
1002 AC_DEFINE(HAVE_MIGRATE_MODE_H, 1,
1003 [kernel has include/linux/migrate_mode.h])
1006 ]) # LC_HAVE_MIGRATE_HEADER
1009 # LC_MIGRATEPAGE_4ARGS
1011 AC_DEFUN([LC_MIGRATEPAGE_4ARGS], [
1012 LB_CHECK_COMPILE([if 'address_space_operations.migratepage' has 4 args],
1013 address_space_ops_migratepage_4args, [
1014 #include <linux/fs.h>
1015 #ifdef HAVE_MIGRATE_H
1016 #include <linux/migrate.h>
1017 #elif defined(HAVE_MIGRATE_MODE_H)
1018 #include <linux/migrate_mode.h>
1021 struct address_space_operations aops;
1022 aops.migratepage(NULL, NULL, NULL, MIGRATE_ASYNC);
1024 AC_DEFINE(HAVE_MIGRATEPAGE_4ARGS, 1,
1025 [address_space_operations.migratepage has 4 args])
1027 ]) # LC_MIGRATEPAGE_4ARGS
1030 # LC_SUPEROPS_USE_DENTRY
1032 # 3.3 switchs super_operations to use dentry as parameter (but not vfsmount)
1033 # see kernel commit 34c80b1d93e6e20ca9dea0baf583a5b5510d92d4
1035 AC_DEFUN([LC_SUPEROPS_USE_DENTRY], [
1036 tmp_flags="$EXTRA_KCFLAGS"
1037 EXTRA_KCFLAGS="-Werror"
1038 LB_CHECK_COMPILE([if 'super_operations' use 'dentry' as parameter],
1040 #include <linux/fs.h>
1041 int show_options(struct seq_file *seq, struct dentry *root) {
1045 struct super_operations ops;
1046 ops.show_options = show_options;
1048 AC_DEFINE(HAVE_SUPEROPS_USE_DENTRY, 1,
1049 [super_operations use dentry as parameter])
1051 EXTRA_KCFLAGS="$tmp_flags"
1052 ]) # LC_SUPEROPS_USE_DENTRY
1055 # LC_INODEOPS_USE_UMODE_T
1057 # 3.3 switchs inode_operations to use umode_t as parameter (but not int)
1058 # see kernel commit 1a67aafb5f72a436ca044293309fa7e6351d6a35
1060 AC_DEFUN([LC_INODEOPS_USE_UMODE_T], [
1061 tmp_flags="$EXTRA_KCFLAGS"
1062 EXTRA_KCFLAGS="-Werror"
1063 LB_CHECK_COMPILE([if 'inode_operations' use 'umode_t' as parameter],
1064 inode_ops_umode_t, [
1065 #include <linux/fs.h>
1066 #include <linux/types.h>
1067 int my_mknod(struct inode *dir, struct dentry *dchild,
1068 umode_t mode, dev_t dev)
1073 struct inode_operations ops;
1074 ops.mknod = my_mknod;
1076 AC_DEFINE(HAVE_INODEOPS_USE_UMODE_T, 1,
1077 [inode_operations use umode_t as parameter])
1079 EXTRA_KCFLAGS="$tmp_flags"
1080 ]) # LC_INODEOPS_USE_UMODE_T
1083 # LC_KMAP_ATOMIC_HAS_1ARG
1085 # 3.4 kmap_atomic removes second argument
1086 # see kernel commit 1ec9c5ddc17aa398f05646abfcbaf315b544e62f
1088 AC_DEFUN([LC_KMAP_ATOMIC_HAS_1ARG], [
1089 LB_CHECK_COMPILE([if 'kmap_atomic' has only 1 argument],
1091 #include <linux/highmem.h>
1095 AC_DEFINE(HAVE_KMAP_ATOMIC_HAS_1ARG, 1,
1096 [have kmap_atomic has only 1 argument])
1098 ]) # LC_KMAP_ATOMIC_HAS_1ARG
1101 # LC_HAVE_D_MAKE_ROOT
1103 # 3.4 converts d_alloc_root to d_make_root
1104 # see kernel commit 32991ab305ace7017c62f8eecbe5eb36dc32e13b
1106 AC_DEFUN([LC_HAVE_D_MAKE_ROOT], [
1107 LB_CHECK_COMPILE([if have 'd_make_root'],
1109 #include <linux/fs.h>
1111 d_make_root((struct inode *)NULL);
1113 AC_DEFINE(HAVE_D_MAKE_ROOT, 1,
1116 ]) # LC_HAVE_D_MAKE_ROOT
1119 # LC_HAVE_CACHE_REGISTER
1121 # 3.4 cache_register/cache_unregister are removed
1122 # see kernel commit 2c5f846747526e2b83c5f1b8e69016be0e2e87c0
1123 # Note, since 2.6.37 cache_register_net/cache_unregister_net
1124 # are defined, but not exported.
1125 # 3.3 cache_register_net/cache_unregister_net are
1126 # exported and replacing cache_register/cache_unregister in 3.4
1128 AC_DEFUN([LC_HAVE_CACHE_REGISTER], [
1129 LB_CHECK_COMPILE([if have 'cache_register'],
1131 #include <linux/sunrpc/cache.h>
1133 cache_register(NULL);
1135 AC_DEFINE(HAVE_CACHE_REGISTER, 1,
1136 [have cache_register])
1138 ]) # LC_HAVE_CACHE_REGISTER
1141 # LC_HAVE_CLEAR_INODE
1143 # 3.5 renames end_writeback() back to clear_inode()...
1144 # see kernel commit dbd5768f87ff6fb0a4fe09c4d7b6c4a24de99430
1146 AC_DEFUN([LC_HAVE_CLEAR_INODE], [
1147 LB_CHECK_COMPILE([if have 'clear_inode'],
1149 #include <linux/fs.h>
1151 clear_inode((struct inode *)NULL);
1153 AC_DEFINE(HAVE_CLEAR_INODE, 1,
1156 ]) # LC_HAVE_CLEAR_INODE
1159 # LC_HAVE_ENCODE_FH_PARENT
1161 # 3.5 encode_fh has parent inode passed in directly
1162 # see kernel commit b0b0382b
1164 AC_DEFUN([LC_HAVE_ENCODE_FH_PARENT], [
1165 tmp_flags="$EXTRA_KCFLAGS"
1166 EXTRA_KCFLAGS="-Werror"
1167 LB_CHECK_COMPILE([if 'encode_fh' have parent inode as parameter],
1168 encode_fh_parent_inode, [
1169 #include <linux/exportfs.h>
1170 #include <linux/fs.h>
1171 #include <linux/types.h>
1172 int ll_encode_fh(struct inode *i, __u32 *a, int *b, struct inode *p)
1177 struct export_operations exp_op;
1178 exp_op.encode_fh = ll_encode_fh;
1180 AC_DEFINE(HAVE_ENCODE_FH_PARENT, 1,
1181 [have parent inode as parameter])
1183 EXTRA_KCFLAGS="$tmp_flags"
1184 ]) # LC_HAVE_ENCODE_FH_PARENT
1187 # LC_FILE_LLSEEK_SIZE_5ARG
1189 # 3.5 has generic_file_llseek_size with 5 args
1191 AC_DEFUN([LC_FILE_LLSEEK_SIZE_5ARG], [
1192 LB_CHECK_COMPILE([if Linux kernel has 'generic_file_llseek_size' with 5 args],
1193 generic_file_llseek_size_5args, [
1194 #include <linux/fs.h>
1196 generic_file_llseek_size(NULL, 0, 0, 0, 0);
1198 AC_DEFINE(HAVE_FILE_LLSEEK_SIZE_5ARGS, 1,
1199 [kernel has generic_file_llseek_size with 5 args])
1201 ]) # LC_FILE_LLSEEK_SIZE_5ARG
1204 # LC_LLITE_DATA_IS_LIST
1206 # 3.6 switch i_dentry/d_alias from list to hlist
1208 # In the upstream kernels d_alias first changes
1209 # to a hlist and then in later version, 3.11, gets
1210 # moved to the union d_u. Due to some distros having
1211 # d_alias in the d_u union as a struct list, which
1212 # has never existed upstream stream, we can't test
1213 # if d_alias is a list or hlist directly. If ever
1214 # i_dentry and d_alias even up different combos then
1215 # the build will fail. In that case then we will need
1216 # to separate out the i_dentry and d_alias test below.
1218 AC_DEFUN([LC_DATA_FOR_LLITE_IS_LIST], [
1219 tmp_flags="$EXTRA_KCFLAGS"
1220 EXTRA_KCFLAGS="-Werror"
1221 LB_CHECK_COMPILE([if 'i_dentry/d_alias' uses 'list'],
1222 i_dentry_d_alias_list, [
1223 #include <linux/fs.h>
1226 INIT_LIST_HEAD(&inode.i_dentry);
1228 AC_DEFINE(DATA_FOR_LLITE_IS_LIST, 1,
1229 [both i_dentry/d_alias uses list])
1231 EXTRA_KCFLAGS="$tmp_flags"
1232 ]) # LC_DATA_FOR_LLITE_IS_LIST
1235 # LC_DENTRY_OPEN_USE_PATH
1237 # 3.6 dentry_open uses struct path as first argument
1238 # see kernel commit 765927b2
1240 AC_DEFUN([LC_DENTRY_OPEN_USE_PATH], [
1241 tmp_flags="$EXTRA_KCFLAGS"
1242 EXTRA_KCFLAGS="-Werror"
1243 LB_CHECK_COMPILE([if 'dentry_open' uses 'struct path' as first argument],
1245 #include <linux/fs.h>
1246 #include <linux/path.h>
1249 dentry_open(&path, 0, NULL);
1251 AC_DEFINE(HAVE_DENTRY_OPEN_USE_PATH, 1,
1252 [dentry_open uses struct path as first argument])
1254 EXTRA_KCFLAGS="$tmp_flags"
1255 ]) # LC_DENTRY_OPEN_USE_PATH
1258 # LC_HAVE_IOP_ATOMIC_OPEN
1260 # 3.6 vfs adds iop->atomic_open
1262 AC_DEFUN([LC_HAVE_IOP_ATOMIC_OPEN], [
1263 LB_CHECK_COMPILE([if 'iop' has 'atomic_open'],
1264 inode_ops_atomic_open, [
1265 #include <linux/fs.h>
1267 struct inode_operations iop;
1268 iop.atomic_open = NULL;
1270 AC_DEFINE(HAVE_IOP_ATOMIC_OPEN, 1,
1271 [have iop atomic_open])
1273 ]) # LC_HAVE_IOP_ATOMIC_OPEN
1276 # LC_HAVE_SB_START_WRITE
1278 # RHEL6 2.6.32, 3.6 or newer support wrapped FS freeze functions
1280 AC_DEFUN([LC_HAVE_SB_START_WRITE], [
1281 LB_CHECK_COMPILE([if kernel supports wrapped FS freeze functions],
1283 #include <linux/fs.h>
1285 sb_start_write(NULL);
1287 AC_DEFINE(HAVE_SB_START_WRITE, 1,
1288 [kernel supports wrapped FS freeze functions])
1290 ]) # LC_HAVE_SB_START_WRITE
1293 # LC_HAVE_POSIXACL_USER_NS
1295 # 3.7 posix_acl_{to,from}_xattr take struct user_namespace
1297 AC_DEFUN([LC_HAVE_POSIXACL_USER_NS], [
1298 LB_CHECK_COMPILE([if 'posix_acl_to_xattr' takes 'struct user_namespace'],
1299 posix_acl_to_xattr_user_namespace, [
1300 #include <linux/fs.h>
1301 #include <linux/posix_acl_xattr.h>
1303 posix_acl_to_xattr((struct user_namespace *)NULL, NULL, NULL, 0);
1305 AC_DEFINE(HAVE_POSIXACL_USER_NS, 1,
1306 [posix_acl_to_xattr takes struct user_namespace])
1308 ]) # LC_HAVE_POSIXACL_USER_NS
1311 # LC_HAVE_FILE_F_INODE
1313 # 3.8 struct file has new member f_inode
1315 AC_DEFUN([LC_HAVE_FILE_F_INODE], [
1316 LB_CHECK_COMPILE([if 'struct file' has member 'f_inode'],
1318 #include <linux/fs.h>
1320 ((struct file *)0)->f_inode = NULL;
1322 AC_DEFINE(HAVE_FILE_F_INODE, 1,
1323 [struct file has member f_inode])
1325 ]) # LC_HAVE_FILE_F_INODE
1328 # LC_HAVE_FILE_INODE
1330 # 3.8 has introduced inline function file_inode
1332 AC_DEFUN([LC_HAVE_FILE_INODE], [
1333 LB_CHECK_COMPILE([if file_inode() exists],
1335 #include <linux/fs.h>
1339 AC_DEFINE(HAVE_FILE_INODE, 1,
1340 [file_inode() has been defined])
1342 ]) # LC_HAVE_FILE_INODE
1345 # LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS
1347 AC_DEFUN([LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS], [
1348 LB_CHECK_COMPILE([if 'sunrpc_cache_pipe_upcall' takes 3 args],
1349 sunrpc_cache_pipe_upcall_3args, [
1350 #include <linux/sunrpc/cache.h>
1352 sunrpc_cache_pipe_upcall(NULL, NULL, NULL);
1354 AC_DEFINE(HAVE_SUNRPC_UPCALL_HAS_3ARGS, 1,
1355 [sunrpc_cache_pipe_upcall takes 3 args])
1357 ]) # LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS
1360 # LC_HAVE_HLIST_FOR_EACH_3ARG
1362 # 3.9 uses hlist_for_each_entry with 3 args
1363 # b67bfe0d42cac56c512dd5da4b1b347a23f4b70a
1365 AC_DEFUN([LC_HAVE_HLIST_FOR_EACH_3ARG], [
1366 LB_CHECK_COMPILE([if 'hlist_for_each_entry' has 3 args],
1367 hlist_for_each_entry_3args, [
1368 #include <linux/list.h>
1369 #include <linux/fs.h>
1371 struct hlist_head *head = NULL;
1372 struct inode *inode;
1374 hlist_for_each_entry(inode, head, i_hash) {
1378 AC_DEFINE(HAVE_HLIST_FOR_EACH_3ARG, 1,
1379 [hlist_for_each_entry has 3 args])
1381 ]) # LC_HAVE_HLIST_FOR_EACH_3ARG
1384 # LC_HAVE_BIO_END_SECTOR
1386 # 3.9 introduces bio_end_sector macro
1387 # f73a1c7d117d07a96d89475066188a2b79e53c48
1389 AC_DEFUN([LC_HAVE_BIO_END_SECTOR], [
1390 LB_CHECK_COMPILE([if 'bio_end_sector' is defined],
1392 #include <linux/bio.h>
1396 bio_end_sector(&bio);
1398 AC_DEFINE(HAVE_BIO_END_SECTOR, 1,
1399 [bio_end_sector is defined])
1401 ]) # LC_HAVE_BIO_END_SECTOR
1404 # 3.9 created is_sxid
1406 AC_DEFUN([LC_HAVE_IS_SXID], [
1407 LB_CHECK_COMPILE([if 'is_sxid' is defined],
1409 #include <linux/fs.h>
1413 is_sxid(inode.i_mode);
1415 AC_DEFINE(HAVE_IS_SXID, 1, [is_sxid is defined])
1417 ]) # LC_HAVE_IS_SXID
1420 # LC_HAVE_REMOVE_PROC_SUBTREE
1422 # 3.10 introduced remove_proc_subtree
1424 AC_DEFUN([LC_HAVE_REMOVE_PROC_SUBTREE], [
1425 LB_CHECK_COMPILE([if 'remove_proc_subtree' is defined],
1426 remove_proc_subtree, [
1427 #include <linux/proc_fs.h>
1429 remove_proc_subtree(NULL, NULL);
1431 AC_DEFINE(HAVE_REMOVE_PROC_SUBTREE, 1,
1432 [remove_proc_subtree is defined])
1434 ]) # LC_HAVE_REMOVE_PROC_SUBTREE
1437 # LC_HAVE_PROC_REMOVE
1439 # 3.10 introduced proc_remove
1441 AC_DEFUN([LC_HAVE_PROC_REMOVE], [
1442 LB_CHECK_COMPILE([if 'proc_remove' is defined],
1444 #include <linux/proc_fs.h>
1448 AC_DEFINE(HAVE_PROC_REMOVE, 1,
1449 [proc_remove is defined])
1451 ]) # LC_HAVE_PROC_REMOVE
1453 AC_DEFUN([LC_HAVE_PROJECT_QUOTA], [
1454 LB_CHECK_COMPILE([if get_projid exists],
1456 #include <linux/quota.h>
1458 struct dquot_operations ops;
1460 ops.get_projid(NULL, NULL);
1462 AC_DEFINE(HAVE_PROJECT_QUOTA, 1,
1463 [get_projid function exists])
1465 ]) # LC_HAVE_PROJECT_QUOTA
1469 # LC_HAVE_SECURITY_DENTRY_INIT_SECURITY
1471 # 3.10 introduced security_dentry_init_security()
1473 AC_DEFUN([LC_HAVE_SECURITY_DENTRY_INIT_SECURITY], [
1474 LB_CHECK_COMPILE([if 'security_dentry_init_security' is defined],
1475 security_dentry_init_security, [
1476 #include <linux/security.h>
1478 security_dentry_init_security(NULL, 0, NULL, NULL, NULL);
1480 AC_DEFINE(HAVE_SECURITY_DENTRY_INIT_SECURITY, 1,
1481 [security_dentry_init_security' is defined])
1483 ]) # LC_HAVE_SECURITY_DENTRY_INIT_SECURITY
1486 # LC_INVALIDATE_RANGE
1488 # 3.11 invalidatepage requires the length of the range to invalidate
1490 AC_DEFUN([LC_INVALIDATE_RANGE], [
1491 LB_CHECK_COMPILE([if 'address_space_operations.invalidatepage' requires 3 arguments],
1492 address_space_ops_invalidatepage_3args, [
1493 #include <linux/fs.h>
1495 struct address_space_operations a_ops;
1496 a_ops.invalidatepage(NULL, 0, 0);
1498 AC_DEFINE(HAVE_INVALIDATE_RANGE, 1,
1499 [address_space_operations.invalidatepage needs 3 arguments])
1501 ]) # LC_INVALIDATE_RANGE
1504 # LC_HAVE_DIR_CONTEXT
1506 # 3.11 readdir now takes the new struct dir_context
1508 AC_DEFUN([LC_HAVE_DIR_CONTEXT], [
1509 LB_CHECK_COMPILE([if 'dir_context' exist],
1511 #include <linux/fs.h>
1513 #ifdef FMODE_KABI_ITERATE
1514 #error "back to use readdir in kabi_extand mode"
1516 struct dir_context ctx;
1520 AC_DEFINE(HAVE_DIR_CONTEXT, 1,
1521 [dir_context exist])
1523 ]) # LC_HAVE_DIR_CONTEXT
1526 # LC_D_COMPARE_5ARGS
1528 # 3.11 dentry_operations.d_compare() taken 5 arguments.
1530 AC_DEFUN([LC_D_COMPARE_5ARGS], [
1531 LB_CHECK_COMPILE([if 'd_compare' taken 5 arguments],
1533 #include <linux/dcache.h>
1535 ((struct dentry_operations*)0)->d_compare(NULL,NULL,0,NULL,NULL);
1537 AC_DEFINE(HAVE_D_COMPARE_5ARGS, 1,
1538 [d_compare need 5 arguments])
1540 ]) # LC_D_COMPARE_5ARGS
1545 # 3.11 need to access d_count to get dentry reference count
1547 AC_DEFUN([LC_HAVE_DCOUNT], [
1548 LB_CHECK_COMPILE([if 'd_count' exist],
1550 #include <linux/dcache.h>
1555 AC_DEFINE(HAVE_D_COUNT, 1,
1561 # LC_PID_NS_FOR_CHILDREN
1563 # 3.11 replaces pid_ns by pid_ns_for_children in struct nsproxy
1565 AC_DEFUN([LC_PID_NS_FOR_CHILDREN], [
1566 LB_CHECK_COMPILE([if 'struct nsproxy' has 'pid_ns_for_children'],
1567 pid_ns_for_children, [
1568 #include <linux/nsproxy.h>
1571 ns.pid_ns_for_children = NULL;
1573 AC_DEFINE(HAVE_PID_NS_FOR_CHILDREN, 1,
1574 ['struct nsproxy' has 'pid_ns_for_children'])
1576 ]) # LC_PID_NS_FOR_CHILDREN
1579 # LC_OLDSIZE_TRUNCATE_PAGECACHE
1581 # 3.12 truncate_pagecache without oldsize parameter
1583 AC_DEFUN([LC_OLDSIZE_TRUNCATE_PAGECACHE], [
1584 LB_CHECK_COMPILE([if 'truncate_pagecache' with 'old_size' parameter],
1585 truncate_pagecache_old_size, [
1586 #include <linux/mm.h>
1588 truncate_pagecache(NULL, 0, 0);
1590 AC_DEFINE(HAVE_OLDSIZE_TRUNCATE_PAGECACHE, 1,
1593 ]) # LC_OLDSIZE_TRUNCATE_PAGECACHE
1596 # LC_HAVE_DENTRY_D_U_D_ALIAS
1598 # 3.11 kernel moved d_alias to the union d_u in struct dentry
1600 # Some distros move d_alias to d_u but it is still a struct list
1602 AC_DEFUN([LC_HAVE_DENTRY_D_U_D_ALIAS], [
1603 AS_IF([test "x$lb_cv_compile_i_dentry_d_alias_list" = xyes], [
1604 LB_CHECK_COMPILE([if list 'dentry.d_u.d_alias' exist],
1606 #include <linux/list.h>
1607 #include <linux/dcache.h>
1610 INIT_LIST_HEAD(&de.d_u.d_alias);
1612 AC_DEFINE(HAVE_DENTRY_D_U_D_ALIAS, 1,
1613 [list dentry.d_u.d_alias exist])
1616 LB_CHECK_COMPILE([if hlist 'dentry.d_u.d_alias' exist],
1618 #include <linux/list.h>
1619 #include <linux/dcache.h>
1622 INIT_HLIST_NODE(&de.d_u.d_alias);
1624 AC_DEFINE(HAVE_DENTRY_D_U_D_ALIAS, 1,
1625 [hlist dentry.d_u.d_alias exist])
1628 ]) # LC_HAVE_DENTRY_D_U_D_ALIAS
1631 # LC_HAVE_DENTRY_D_CHILD
1633 # 3.11 kernel d_child has been moved out of the union d_u
1636 AC_DEFUN([LC_HAVE_DENTRY_D_CHILD], [
1637 LB_CHECK_COMPILE([if 'dentry.d_child' exist],
1639 #include <linux/list.h>
1640 #include <linux/dcache.h>
1643 INIT_LIST_HEAD(&de.d_child);
1645 AC_DEFINE(HAVE_DENTRY_D_CHILD, 1,
1646 [dentry.d_child exist])
1648 ]) # LC_HAVE_DENTRY_D_CHILD
1653 # 3.12 ki_left removed from struct kiocb
1655 AC_DEFUN([LC_KIOCB_KI_LEFT], [
1656 LB_CHECK_COMPILE([if 'struct kiocb' with 'ki_left' member],
1658 #include <linux/aio.h>
1660 ((struct kiocb*)0)->ki_left = 0;
1662 AC_DEFINE(HAVE_KIOCB_KI_LEFT, 1,
1665 ]) # LC_KIOCB_KI_LEFT
1668 # LC_VFS_RENAME_5ARGS
1670 # 3.13 has vfs_rename with 5 args
1672 AC_DEFUN([LC_VFS_RENAME_5ARGS], [
1673 LB_CHECK_COMPILE([if Linux kernel has 'vfs_rename' with 5 args],
1675 #include <linux/fs.h>
1677 vfs_rename(NULL, NULL, NULL, NULL, NULL);
1679 AC_DEFINE(HAVE_VFS_RENAME_5ARGS, 1,
1680 [kernel has vfs_rename with 5 args])
1682 ]) # LC_VFS_RENAME_5ARGS
1685 # LC_VFS_UNLINK_3ARGS
1687 # 3.13 has vfs_unlink with 3 args
1689 AC_DEFUN([LC_VFS_UNLINK_3ARGS], [
1690 LB_CHECK_COMPILE([if Linux kernel has 'vfs_unlink' with 3 args],
1692 #include <linux/fs.h>
1694 vfs_unlink(NULL, NULL, NULL);
1696 AC_DEFINE(HAVE_VFS_UNLINK_3ARGS, 1,
1697 [kernel has vfs_unlink with 3 args])
1699 ]) # LC_VFS_UNLINK_3ARGS
1704 # 3.14 move some of its data in struct bio into the new
1707 AC_DEFUN([LC_HAVE_BVEC_ITER], [
1708 LB_CHECK_COMPILE([if Linux kernel has struct bvec_iter],
1710 #include <linux/bio.h>
1712 struct bvec_iter iter;
1713 iter.bi_bvec_done = 0;
1715 AC_DEFINE(HAVE_BVEC_ITER, 1,
1716 [kernel has struct bvec_iter])
1718 ]) # LC_HAVE_BVEC_ITER
1723 # 3.14 adds set_acl method to inode_operations
1724 # see kernel commit 893d46e443346370cd4ea81d9d35f72952c62a37
1726 AC_DEFUN([LC_IOP_SET_ACL], [
1727 LB_CHECK_COMPILE([if 'inode_operations' has '.set_acl' member function],
1728 inode_ops_set_acl, [
1729 #include <linux/fs.h>
1731 struct inode_operations iop;
1734 AC_DEFINE(HAVE_IOP_SET_ACL, 1,
1735 [inode_operations has .set_acl member function])
1742 # 4.4 redefined bi_cnt as __bi_cnt
1744 AC_DEFUN([LC_HAVE_BI_CNT], [
1745 LB_CHECK_COMPILE([if Linux kernel has bi_cnt in struct bio],
1747 #include <asm/atomic.h>
1748 #include <linux/bio.h>
1752 cnt = atomic_read(&bio.bi_cnt);
1754 AC_DEFINE(HAVE_BI_CNT, 1,
1755 [struct bio has bi_cnt])
1762 # 4.4 redefined bi_rw as bi_opf
1764 AC_DEFUN([LC_HAVE_BI_RW], [
1765 LB_CHECK_COMPILE([if Linux kernel has bi_rw in struct bio],
1767 #include <linux/bio.h>
1772 AC_DEFINE(HAVE_BI_RW, 1,
1773 [struct bio has bi_rw])
1778 # LC_HAVE_SUBMIT_BIO_2ARGS
1780 # 4.4 removed an argument from submit_bio
1782 AC_DEFUN([LC_HAVE_SUBMIT_BIO_2ARGS], [
1783 LB_CHECK_COMPILE([if submit_bio takes two arguments],
1784 have_submit_bio_2args, [
1785 #include <linux/bio.h>
1788 submit_bio(READ, &bio);
1790 AC_DEFINE(HAVE_SUBMIT_BIO_2ARGS, 1,
1791 [submit_bio takes two arguments])
1793 ]) # LC_HAVE_SUBMIT_BIO_2_ARGS
1796 # LC_HAVE_CLEAN_BDEV_ALIASES
1798 # 4.4 unmap_underlying_metadata was replaced by clean_bdev_aliases
1800 AC_DEFUN([LC_HAVE_CLEAN_BDEV_ALIASES], [
1801 LB_CHECK_COMPILE([if kernel has clean_bdev_aliases],
1802 have_clean_bdev_aliases, [
1803 #include <linux/buffer_head.h>
1805 struct block_device bdev;
1806 clean_bdev_aliases(&bdev,1,1);
1808 AC_DEFINE(HAVE_CLEAN_BDEV_ALIASES, 1,
1809 [kernel has clean_bdev_aliases])
1811 ]) # LC_HAVE_CLEAN_BDEV_ALIASES
1814 # LC_HAVE_TRUNCATE_IPAGE_FINAL
1816 # 3.14 bring truncate_inode_pages_final for evict_inode
1818 AC_DEFUN([LC_HAVE_TRUNCATE_IPAGES_FINAL], [
1819 LB_CHECK_COMPILE([if Linux kernel has truncate_inode_pages_final],
1820 truncate_ipages_final, [
1821 #include <linux/mm.h>
1823 truncate_inode_pages_final(NULL);
1825 AC_DEFINE(HAVE_TRUNCATE_INODE_PAGES_FINAL, 1,
1826 [kernel has truncate_inode_pages_final])
1828 ]) # LC_HAVE_TRUNCATE_IPAGES_FINAL
1831 # LC_IOPS_RENAME_WITH_FLAGS
1833 # 3.14 has inode_operations->rename with 5 args
1834 # commit 520c8b16505236fc82daa352e6c5e73cd9870cff
1836 AC_DEFUN([LC_IOPS_RENAME_WITH_FLAGS], [
1837 LB_CHECK_COMPILE([if 'inode_operations->rename' taken flags as argument],
1838 iops_rename_with_flags, [
1839 #include <linux/fs.h>
1841 struct inode *i1 = NULL, *i2 = NULL;
1842 struct dentry *d1 = NULL, *d2 = NULL;
1844 rc = ((struct inode_operations *)0)->rename(i1, d1, i2, d2, 0);
1846 AC_DEFINE(HAVE_IOPS_RENAME_WITH_FLAGS, 1,
1847 [inode_operations->rename need flags as argument])
1849 ]) # LC_IOPS_RENAME_WITH_FLAGS
1852 # LC_VFS_RENAME_6ARGS
1854 # 3.15 has vfs_rename with 6 args
1856 AC_DEFUN([LC_VFS_RENAME_6ARGS], [
1857 LB_CHECK_COMPILE([if Linux kernel has 'vfs_rename' with 6 args],
1859 #include <linux/fs.h>
1861 vfs_rename(NULL, NULL, NULL, NULL, NULL, NULL);
1863 AC_DEFINE(HAVE_VFS_RENAME_6ARGS, 1,
1864 [kernel has vfs_rename with 6 args])
1866 ]) # LC_VFS_RENAME_6ARGS
1869 # LC_DIRECTIO_USE_ITER
1871 # 3.16 kernel changes direct IO to use iov_iter
1873 AC_DEFUN([LC_DIRECTIO_USE_ITER], [
1874 LB_CHECK_COMPILE([if direct IO uses iov_iter],
1876 #include <linux/fs.h>
1878 struct address_space_operations ops;
1879 struct iov_iter *iter = NULL;
1882 ops.direct_IO(0, NULL, iter, offset);
1884 AC_DEFINE(HAVE_DIRECTIO_ITER, 1,
1885 [direct IO uses iov_iter])
1887 ]) # LC_DIRECTIO_USE_ITER
1890 # LC_HAVE_IOV_ITER_INIT_DIRECTION
1893 # 3.16 linux commit 71d8e532b1549a478e6a6a8a44f309d050294d00
1894 # changed iov_iter_init api to start accepting a tag
1895 # that defines if its a read or write operation
1897 AC_DEFUN([LC_HAVE_IOV_ITER_INIT_DIRECTION], [
1898 tmp_flags="$EXTRA_KCFLAGS"
1899 EXTRA_KCFLAGS="-Werror"
1900 LB_CHECK_COMPILE([if 'iov_iter_init' takes a tag],
1902 #include <linux/uio.h>
1903 #include <linux/fs.h>
1905 const struct iovec *iov = NULL;
1907 iov_iter_init(NULL, READ, iov, 1, 0);
1909 AC_DEFINE(HAVE_IOV_ITER_INIT_DIRECTION, 1,
1910 [iov_iter_init handles directional tag])
1912 EXTRA_KCFLAGS="$tmp_flags"
1913 ]) # LC_HAVE_IOV_ITER_INIT_DIRECTION
1916 # LC_HAVE_IOV_ITER_TRUNCATE
1919 # 3.16 introduces a new API iov_iter_truncate()
1921 AC_DEFUN([LC_HAVE_IOV_ITER_TRUNCATE], [
1922 tmp_flags="$EXTRA_KCFLAGS"
1923 EXTRA_KCFLAGS="-Werror"
1924 LB_CHECK_COMPILE([if 'iov_iter_truncate' exists ],
1926 #include <linux/uio.h>
1927 #include <linux/fs.h>
1929 struct iov_iter *i = NULL;
1931 iov_iter_truncate(i, 0);
1933 AC_DEFINE(HAVE_IOV_ITER_TRUNCATE, 1, [iov_iter_truncate exists])
1935 EXTRA_KCFLAGS="$tmp_flags"
1936 ]) # LC_HAVE_IOV_ITER_TRUNCATE
1939 # LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
1941 # 3.16 introduces [read|write]_iter to struct file_operations
1943 AC_DEFUN([LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER], [
1944 LB_CHECK_COMPILE([if 'file_operations.[read|write]_iter' exist],
1945 file_function_iter, [
1946 #include <linux/fs.h>
1948 ((struct file_operations *)NULL)->read_iter(NULL, NULL);
1949 ((struct file_operations *)NULL)->write_iter(NULL, NULL);
1951 AC_DEFINE(HAVE_FILE_OPERATIONS_READ_WRITE_ITER, 1,
1952 [file_operations.[read|write]_iter functions exist])
1954 ]) # LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
1959 # 3.17 replaces key_type::match with match_preparse
1960 # and has new struct key_match_data
1962 AC_DEFUN([LC_KEY_MATCH_DATA], [
1963 LB_CHECK_COMPILE([if struct key_match field exist],
1965 #include <linux/key-type.h>
1967 struct key_match_data data;
1969 AC_DEFINE(HAVE_KEY_MATCH_DATA, 1,
1970 [struct key_match_data exist])
1972 ]) # LC_KEY_MATCH_DATA
1975 # LC_NFS_FILLDIR_USE_CTX
1977 # 3.18 kernel moved from void cookie to struct dir_context
1979 AC_DEFUN([LC_NFS_FILLDIR_USE_CTX], [
1980 tmp_flags="$EXTRA_KCFLAGS"
1981 EXTRA_KCFLAGS="-Werror"
1982 LB_CHECK_COMPILE([if filldir_t uses struct dir_context],
1984 #include <linux/fs.h>
1986 int filldir(struct dir_context *ctx, const char* name,
1987 int i, loff_t off, u64 tmp, unsigned temp)
1992 struct dir_context ctx = {
1996 ctx.actor(NULL, "test", 0, (loff_t) 0, 0, 0);
1998 AC_DEFINE(HAVE_FILLDIR_USE_CTX, 1,
1999 [filldir_t needs struct dir_context as argument])
2001 EXTRA_KCFLAGS="$tmp_flags"
2002 ]) # LC_NFS_FILLDIR_USE_CTX
2005 # LC_PERCPU_COUNTER_INIT
2007 # 3.18 For kernels 3.18 and after percpu_counter_init starts
2008 # to pass a GFP_* memory allocation flag for internal
2009 # memory allocation purposes.
2011 AC_DEFUN([LC_PERCPU_COUNTER_INIT], [
2012 LB_CHECK_COMPILE([if percpu_counter_init uses GFP_* flag as argument],
2013 percpu_counter_init, [
2014 #include <linux/percpu_counter.h>
2016 percpu_counter_init(NULL, 0, GFP_KERNEL);
2018 AC_DEFINE(HAVE_PERCPU_COUNTER_INIT_GFP_FLAG, 1,
2019 [percpu_counter_init uses GFP_* flag])
2021 ]) # LC_PERCPU_COUNTER_INIT
2024 # LC_KIOCB_HAS_NBYTES
2026 # 3.19 kernel removed ki_nbytes from struct kiocb
2028 AC_DEFUN([LC_KIOCB_HAS_NBYTES], [
2029 LB_CHECK_COMPILE([if struct kiocb has ki_nbytes field],
2031 #include <linux/fs.h>
2037 AC_DEFINE(HAVE_KI_NBYTES, 1, [ki_nbytes field exist])
2039 ]) # LC_KIOCB_HAS_NBYTES
2042 # LC_HAVE_DQUOT_QC_DQBLK
2044 # 3.19 has quotactl_ops->[sg]et_dqblk that take struct kqid and qc_dqblk
2045 # Added in commit 14bf61ffe
2047 AC_DEFUN([LC_HAVE_DQUOT_QC_DQBLK], [
2048 tmp_flags="$EXTRA_KCFLAGS"
2049 EXTRA_KCFLAGS="-Werror"
2050 LB_CHECK_COMPILE([if 'quotactl_ops.set_dqblk' takes struct qc_dqblk],
2052 #include <linux/fs.h>
2053 #include <linux/quota.h>
2055 ((struct quotactl_ops *)0)->set_dqblk(NULL, *((struct kqid*)0), (struct qc_dqblk*)0);
2057 AC_DEFINE(HAVE_DQUOT_QC_DQBLK, 1,
2058 [quotactl_ops.set_dqblk takes struct qc_dqblk])
2059 AC_DEFINE(HAVE_DQUOT_KQID, 1,
2060 [quotactl_ops.set_dqblk takes struct kqid])
2062 EXTRA_KCFLAGS="$tmp_flags"
2063 ]) # LC_HAVE_DQUOT_QC_DQBLK
2066 # LC_BACKING_DEV_INFO_REMOVAL
2068 # 3.20 kernel removed backing_dev_info from address_space
2070 AC_DEFUN([LC_BACKING_DEV_INFO_REMOVAL], [
2071 LB_CHECK_COMPILE([if struct address_space has backing_dev_info],
2073 #include <linux/fs.h>
2075 struct address_space mapping;
2077 mapping.backing_dev_info = NULL;
2079 AC_DEFINE(HAVE_BACKING_DEV_INFO, 1, [backing_dev_info exist])
2081 ]) # LC_BACKING_DEV_INFO_REMOVAL
2084 # LC_HAVE_BDI_CAP_MAP_COPY
2086 # 3.20 removed mmap handling for backing devices since
2087 # it breaks on non-MMU systems. See kernel commit
2088 # b4caecd48005fbed3949dde6c1cb233142fd69e9
2090 AC_DEFUN([LC_HAVE_BDI_CAP_MAP_COPY], [
2091 LB_CHECK_COMPILE([if have 'BDI_CAP_MAP_COPY'],
2093 #include <linux/backing-dev.h>
2095 struct backing_dev_info info;
2097 info.capabilities = BDI_CAP_MAP_COPY;
2099 AC_DEFINE(HAVE_BDI_CAP_MAP_COPY, 1,
2100 [BDI_CAP_MAP_COPY exist])
2102 ]) # LC_HAVE_BDI_CAP_MAP_COPY
2105 # LC_CANCEL_DIRTY_PAGE
2107 # 4.0.0 kernel removed cancel_dirty_page
2109 AC_DEFUN([LC_CANCEL_DIRTY_PAGE], [
2110 LB_CHECK_COMPILE([if cancel_dirty_page still exist],
2111 cancel_dirty_page, [
2112 #include <linux/mm.h>
2114 cancel_dirty_page(NULL, PAGE_SIZE);
2116 AC_DEFINE(HAVE_CANCEL_DIRTY_PAGE, 1,
2117 [cancel_dirty_page is still available])
2119 ]) # LC_CANCEL_DIRTY_PAGE
2124 # 4.1 kernel has iov_iter_rw
2126 AC_DEFUN([LC_IOV_ITER_RW], [
2127 LB_CHECK_COMPILE([if iov_iter_rw exist],
2129 #include <linux/fs.h>
2130 #include <linux/uio.h>
2132 struct iov_iter *iter = NULL;
2136 AC_DEFINE(HAVE_IOV_ITER_RW, 1,
2137 [iov_iter_rw exist])
2142 # LC_HAVE_SYNC_READ_WRITE
2144 # 4.1 new_sync_[read|write] no longer exported
2146 AC_DEFUN([LC_HAVE_SYNC_READ_WRITE], [
2147 LB_CHECK_EXPORT([new_sync_read], [fs/read_write.c],
2148 [AC_DEFINE(HAVE_SYNC_READ_WRITE, 1,
2149 [new_sync_[read|write] is exported by the kernel])])
2150 ]) # LC_HAVE_SYNC_READ_WRITE
2153 # LC_NEW_CANCEL_DIRTY_PAGE
2155 # 4.2 kernel has new cancel_dirty_page
2157 AC_DEFUN([LC_NEW_CANCEL_DIRTY_PAGE], [
2158 LB_CHECK_COMPILE([if cancel_dirty_page with one argument exist],
2159 new_cancel_dirty_page, [
2160 #include <linux/mm.h>
2162 cancel_dirty_page(NULL);
2164 AC_DEFINE(HAVE_NEW_CANCEL_DIRTY_PAGE, 1,
2165 [cancel_dirty_page with one arguement is available])
2167 ]) # LC_NEW_CANCEL_DIRTY_PAGE
2170 # LC_SYMLINK_OPS_USE_NAMEIDATA
2172 # For the 4.2+ kernels the file system internal symlink api no
2173 # longer uses struct nameidata as a argument
2175 AC_DEFUN([LC_SYMLINK_OPS_USE_NAMEIDATA], [
2176 LB_CHECK_COMPILE([if symlink inode operations have struct nameidata argument],
2177 symlink_use_nameidata, [
2178 #include <linux/namei.h>
2179 #include <linux/fs.h>
2181 struct nameidata *nd = NULL;
2183 ((struct inode_operations *)0)->follow_link(NULL, nd);
2184 ((struct inode_operations *)0)->put_link(NULL, nd, NULL);
2186 AC_DEFINE(HAVE_SYMLINK_OPS_USE_NAMEIDATA, 1,
2187 [symlink inode operations need struct nameidata argument])
2189 ]) # LC_SYMLINK_OPS_USE_NAMEIDATA
2192 # LC_BIO_ENDIO_USES_ONE_ARG
2194 # 4.2 kernel bio_endio now only takes one argument
2196 AC_DEFUN([LC_BIO_ENDIO_USES_ONE_ARG], [
2197 LB_CHECK_COMPILE([if 'bio_endio' with one argument exist],
2199 #include <linux/bio.h>
2203 AC_DEFINE(HAVE_BIO_ENDIO_USES_ONE_ARG, 1,
2204 [bio_endio takes only one argument])
2206 ]) # LC_BIO_ENDIO_USES_ONE_ARG
2209 # LC_HAVE_LOOP_CTL_GET_FREE
2211 # 4.x kernel have moved userspace APIs to
2212 # the separate directory and all of them
2213 # support LOOP_CTL_GET_FREE
2215 AC_DEFUN([LC_HAVE_LOOP_CTL_GET_FREE], [
2216 LB_CHECK_FILE([$LINUX/include/linux/loop.h], [
2217 LB_CHECK_COMPILE([if have 'HAVE_LOOP_CTL_GET_FREE'],
2218 LOOP_CTL_GET_FREE, [
2219 #include <linux/loop.h>
2223 i = LOOP_CTL_GET_FREE;
2225 AC_DEFINE(HAVE_LOOP_CTL_GET_FREE, 1,
2226 [LOOP_CTL_GET_FREE exist])
2229 AC_DEFINE(HAVE_LOOP_CTL_GET_FREE, 1,
2230 [kernel has LOOP_CTL_GET_FREE])
2232 ]) # LC_HAVE_LOOP_CTL_GET_FREE
2235 # LC_HAVE_CACHE_HEAD_HLIST
2237 # 4.3 kernel swiched to hlist for cache_head
2239 AC_DEFUN([LC_HAVE_CACHE_HEAD_HLIST], [
2240 LB_CHECK_COMPILE([if 'struct cache_head' has 'cache_list' field],
2241 cache_head_has_hlist, [
2242 #include <linux/sunrpc/cache.h>
2244 do {} while(sizeof(((struct cache_head *)0)->cache_list));
2246 AC_DEFINE(HAVE_CACHE_HEAD_HLIST, 1,
2247 [cache_head has hlist cache_list])
2249 ]) # LC_HAVE_CACHE_HEAD_HLIST
2252 # LC_HAVE_XATTR_HANDLER_SIMPLIFIED
2254 # Kernel version 4.3 commit e409de992e3ea3674393465f07cc71c948edd87a
2255 # simplified xattr_handler handling by passing in the handler pointer
2257 AC_DEFUN([LC_HAVE_XATTR_HANDLER_SIMPLIFIED], [
2258 tmp_flags="$EXTRA_KCFLAGS"
2259 EXTRA_KCFLAGS="-Werror"
2260 LB_CHECK_COMPILE([if 'struct xattr_handler' functions pass in handler pointer],
2261 xattr_handler_simplified, [
2262 #include <linux/xattr.h>
2264 struct xattr_handler handler;
2266 ((struct xattr_handler *)0)->get(&handler, NULL, NULL, NULL, 0);
2267 ((struct xattr_handler *)0)->set(&handler, NULL, NULL, NULL, 0, 0);
2269 AC_DEFINE(HAVE_XATTR_HANDLER_SIMPLIFIED, 1, [handler pointer is parameter])
2271 EXTRA_KCFLAGS="$tmp_flags"
2272 ]) # LC_HAVE_XATTR_HANDLER_SIMPLIFIED
2275 # LC_HAVE_LOCKS_LOCK_FILE_WAIT
2277 # 4.4 kernel have moved locks API users to
2278 # locks_lock_inode_wait()
2280 AC_DEFUN([LC_HAVE_LOCKS_LOCK_FILE_WAIT], [
2281 LB_CHECK_COMPILE([if 'locks_lock_file_wait' exists],
2282 locks_lock_file_wait, [
2283 #include <linux/fs.h>
2285 locks_lock_file_wait(NULL, NULL);
2287 AC_DEFINE(HAVE_LOCKS_LOCK_FILE_WAIT, 1,
2288 [kernel has locks_lock_file_wait])
2290 ]) # LC_HAVE_LOCKS_LOCK_FILE_WAIT
2293 # LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
2295 # 4.4 kernel merged type-specific data with the payload data for keys
2297 AC_DEFUN([LC_HAVE_KEY_PAYLOAD_DATA_ARRAY], [
2298 LB_CHECK_COMPILE([if 'struct key' has 'payload.data' as an array],
2299 key_payload_data_array, [
2300 #include <linux/key.h>
2302 ((struct key *)0)->payload.data[0] = NULL;
2304 AC_DEFINE(HAVE_KEY_PAYLOAD_DATA_ARRAY, 1, [payload.data is an array])
2306 ]) #LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
2309 # LC_HAVE_FILE_DENTRY
2311 # 4.5 adds wrapper file_dentry
2313 AC_DEFUN([LC_HAVE_FILE_DENTRY], [
2314 LB_CHECK_COMPILE([if Linux kernel has 'file_dentry'],
2316 #include <linux/fs.h>
2320 AC_DEFINE(HAVE_FILE_DENTRY, 1,
2321 [kernel has file_dentry])
2323 ]) # LC_HAVE_FILE_DENTRY
2326 # LC_HAVE_INODE_LOCK
2328 # 4.5 introduced inode_lock
2330 AC_DEFUN([LC_HAVE_INODE_LOCK], [
2331 LB_CHECK_COMPILE([if 'inode_lock' is defined],
2333 #include <linux/fs.h>
2337 AC_DEFINE(HAVE_INODE_LOCK, 1,
2338 [inode_lock is defined])
2340 ]) # LC_HAVE_INODE_LOCK
2343 # LC_HAVE_IOP_GET_LINK
2345 # 4.5 vfs replaced iop->follow_link with
2348 AC_DEFUN([LC_HAVE_IOP_GET_LINK], [
2349 LB_CHECK_COMPILE([if 'iop' has 'get_link'],
2350 inode_ops_get_link, [
2351 #include <linux/fs.h>
2353 struct inode_operations iop;
2354 iop.get_link = NULL;
2356 AC_DEFINE(HAVE_IOP_GET_LINK, 1,
2357 [have iop get_link])
2359 ]) # LC_HAVE_IOP_GET_LINK
2362 # LC_HAVE_IN_COMPAT_SYSCALL
2364 # 4.6 renamed is_compat_task to in_compat_syscall
2366 AC_DEFUN([LC_HAVE_IN_COMPAT_SYSCALL], [
2367 LB_CHECK_COMPILE([if 'in_compat_syscall' is defined],
2368 in_compat_syscall, [
2369 #include <linux/compat.h>
2371 in_compat_syscall();
2373 AC_DEFINE(HAVE_IN_COMPAT_SYSCALL, 1,
2374 [have in_compat_syscall])
2376 ]) # LC_HAVE_IN_COMPAT_SYSCALL
2379 # LC_HAVE_XATTR_HANDLER_INODE_PARAM
2381 # Kernel version 4.6 commit b296821a7c42fa58baa17513b2b7b30ae66f3336
2382 # and commit 5930122683dff58f0846b0f0405b4bd598a3ba6a added inode parameter
2383 # to xattr_handler functions
2385 AC_DEFUN([LC_HAVE_XATTR_HANDLER_INODE_PARAM], [
2386 tmp_flags="$EXTRA_KCFLAGS"
2387 EXTRA_KCFLAGS="-Werror"
2388 LB_CHECK_COMPILE([if 'struct xattr_handler' functions have inode parameter],
2389 xattr_handler_inode_param, [
2390 #include <linux/xattr.h>
2392 const struct xattr_handler handler;
2394 ((struct xattr_handler *)0)->get(&handler, NULL, NULL, NULL, NULL, 0);
2395 ((struct xattr_handler *)0)->set(&handler, NULL, NULL, NULL, NULL, 0, 0);
2397 AC_DEFINE(HAVE_XATTR_HANDLER_INODE_PARAM, 1, [needs inode parameter])
2399 EXTRA_KCFLAGS="$tmp_flags"
2400 ]) # LC_HAVE_XATTR_HANDLER_INODE_PARAM
2405 # Kernel version 4.7 commit c8b8e32d700fe943a935e435ae251364d016c497
2406 # direct-io: eliminate the offset argument to ->direct_IO
2408 AC_DEFUN([LC_DIRECTIO_2ARGS], [
2409 LB_CHECK_COMPILE([if '->direct_IO()' taken 2 arguments],
2411 #include <linux/fs.h>
2413 struct address_space_operations ops;
2414 struct iov_iter *iter = NULL;
2415 struct kiocb *iocb = NULL;
2417 rc = ops.direct_IO(iocb, iter);
2419 AC_DEFINE(HAVE_DIRECTIO_2ARGS, 1,
2420 [direct_IO need 2 arguments])
2422 ]) # LC_DIRECTIO_2ARGS
2425 # LC_GENERIC_WRITE_SYNC_2ARGS
2427 # Kernel version 4.7 commit c8b8e32d700fe943a935e435ae251364d016c497
2428 # direct-io: eliminate the offset argument to ->direct_IO
2430 AC_DEFUN([LC_GENERIC_WRITE_SYNC_2ARGS], [
2431 LB_CHECK_COMPILE([if 'generic_write_sync()' taken 2 arguments],
2432 generic_write_sync_2args, [
2433 #include <linux/fs.h>
2435 struct kiocb *iocb = NULL;
2437 rc = generic_write_sync(iocb, 0);
2439 AC_DEFINE(HAVE_GENERIC_WRITE_SYNC_2ARGS, 1,
2440 [generic_write_sync need 2 arguments])
2442 ]) # LC_GENERIC_WRITE_SYNC_2ARGS
2445 # LC_HAVE_POSIX_ACL_VALID_USER_NS
2447 # 4.8 posix_acl_valid takes struct user_namespace
2449 AC_DEFUN([LC_HAVE_POSIX_ACL_VALID_USER_NS], [
2450 LB_CHECK_COMPILE([if 'posix_acl_valid' takes 'struct user_namespace'],
2452 #include <linux/fs.h>
2453 #include <linux/posix_acl.h>
2455 posix_acl_valid((struct user_namespace*)NULL, (const struct posix_acl*)NULL);
2457 AC_DEFINE(HAVE_POSIX_ACL_VALID_USER_NS, 1,
2458 [posix_acl_valid takes struct user_namespace])
2460 ]) # LC_HAVE_POSIX_ACL_VALID_USER_NS
2463 # LC_D_COMPARE_4ARGS
2465 # Kernel version 4.8 commit 6fa67e707559303e086303aeecc9e8b91ef497d5
2466 # get rid of 'parent' argument of ->d_compare()
2468 AC_DEFUN([LC_D_COMPARE_4ARGS], [
2469 LB_CHECK_COMPILE([if 'd_compare' taken 4 arguments],
2471 #include <linux/dcache.h>
2473 ((struct dentry_operations*)0)->d_compare(NULL,0,NULL,NULL);
2475 AC_DEFINE(HAVE_D_COMPARE_4ARGS, 1,
2476 [d_compare need 4 arguments])
2478 ]) # LC_D_COMPARE_4ARGS
2481 # LC_FULL_NAME_HASH_3ARGS
2483 # Kernel version 4.8 commit 8387ff2577eb9ed245df9a39947f66976c6bcd02
2484 # vfs: make the string hashes salt the hash
2486 AC_DEFUN([LC_FULL_NAME_HASH_3ARGS], [
2487 LB_CHECK_COMPILE([if 'full_name_hash' taken 3 arguments],
2488 full_name_hash_3args, [
2489 #include <linux/stringhash.h>
2492 hash = full_name_hash(NULL,NULL,0);
2494 AC_DEFINE(HAVE_FULL_NAME_HASH_3ARGS, 1,
2495 [full_name_hash need 3 arguments])
2497 ]) # LC_FULL_NAME_HASH_3ARGS
2500 # LC_STRUCT_POSIX_ACL_XATTR
2502 # Kernel version 4.8 commit 2211d5ba5c6c4e972ba6dbc912b2897425ea6621
2503 # posix_acl: xattr representation cleanups
2505 AC_DEFUN([LC_STRUCT_POSIX_ACL_XATTR], [
2506 LB_CHECK_COMPILE([if 'struct posix_acl_xattr_{header,entry}' defined],
2507 struct_posix_acl_xattr, [
2508 #include <linux/fs.h>
2509 #include <linux/posix_acl_xattr.h>
2511 struct posix_acl_xattr_header *h = NULL;
2512 struct posix_acl_xattr_entry *e;
2513 e = (void *)(h + 1);
2515 AC_DEFINE(HAVE_STRUCT_POSIX_ACL_XATTR, 1,
2516 [struct posix_acl_xattr_{header,entry} defined])
2518 ]) # LC_STRUCT_POSIX_ACL_XATTR
2523 # Kernel version 4.8 commit fd50ecaddf8372a1d96e0daeaac0f93cf04e4d42
2524 # removed {get,set,remove}xattr inode operations
2526 AC_DEFUN([LC_IOP_XATTR], [
2527 LB_CHECK_COMPILE([if 'inode_operations' has {get,set,remove}xattr members],
2529 #include <linux/fs.h>
2531 struct inode_operations iop;
2532 iop.setxattr = NULL;
2533 iop.getxattr = NULL;
2534 iop.removexattr = NULL;
2536 AC_DEFINE(HAVE_IOP_XATTR, 1,
2537 [inode_operations has {get,set,remove}xattr members])
2544 # Kernel version 4.9 commit 81243eacfa400f5f7b89f4c2323d0de9982bb0fb
2545 # cred: simpler, 1D supplementary groups
2547 AC_DEFUN([LC_GROUP_INFO_GID], [
2548 LB_CHECK_COMPILE([if 'struct group_info' has member 'gid'],
2550 #include <linux/cred.h>
2553 p = ((struct group_info *)0)->gid;
2555 AC_DEFINE(HAVE_GROUP_INFO_GID, 1,
2556 [struct group_info has member gid])
2558 ]) # LC_GROUP_INFO_GID
2563 # Kernel version 4.9 commit 5d6c31910bc0713e37628dc0ce677dcb13c8ccf4
2564 # added __vfs_{get,set,remove}xattr helpers
2566 AC_DEFUN([LC_VFS_SETXATTR], [
2567 LB_CHECK_COMPILE([if '__vfs_setxattr' helper is available],
2569 #include <linux/xattr.h>
2571 __vfs_setxattr(NULL, NULL, NULL, NULL, 0, 0);
2573 AC_DEFINE(HAVE_VFS_SETXATTR, 1,
2574 ['__vfs_setxattr is available])
2576 ]) # LC_VFS_SETXATTR
2579 # LC_POSIX_ACL_UPDATE_MODE
2581 # Kernel version 4.9 commit 073931017b49d9458aa351605b43a7e34598caef
2582 # posix_acl: Clear SGID bit when setting file permissions
2584 AC_DEFUN([LC_POSIX_ACL_UPDATE_MODE], [
2585 LB_CHECK_COMPILE([if 'posix_acl_update_mode' exists],
2586 posix_acl_update_mode, [
2587 #include <linux/fs.h>
2588 #include <linux/posix_acl.h>
2590 posix_acl_update_mode(NULL, NULL, NULL);
2592 AC_DEFINE(HAVE_POSIX_ACL_UPDATE_MODE, 1,
2593 ['posix_acl_update_mode' is available])
2595 ]) # LC_POSIX_ACL_UPDATE_MODE
2598 # LC_IOP_GENERIC_READLINK
2600 # Kernel version 4.10 commit dfeef68862edd7d4bafe68ef7aeb5f658ef24bb5
2601 # removed generic_readlink from individual file systems
2603 AC_DEFUN([LC_IOP_GENERIC_READLINK], [
2604 LB_CHECK_COMPILE([if 'generic_readlink' still exist],
2605 inode_ops_readlink, [
2606 #include <linux/fs.h>
2608 struct inode_operations iop;
2609 iop.readlink = generic_readlink;
2611 AC_DEFINE(HAVE_IOP_GENERIC_READLINK, 1,
2612 [generic_readlink has been removed])
2614 ]) # LC_IOP_GENERIC_READLINK
2617 # LC_HAVE_VM_FAULT_ADDRESS
2619 # Kernel version 4.10 commit 1a29d85eb0f19b7d8271923d8917d7b4f5540b3e
2620 # removed virtual_address field. Need to use address field instead
2622 AC_DEFUN([LC_HAVE_VM_FAULT_ADDRESS], [
2623 LB_CHECK_COMPILE([if 'struct vm_fault' replaced virtual_address with address field],
2625 #include <linux/mm.h>
2627 struct vm_fault vmf;
2630 AC_DEFINE(HAVE_VM_FAULT_ADDRESS, 1,
2631 [virtual_address has been replaced by address field])
2633 ]) # LC_HAVE_VM_FAULT_ADDRESS
2636 # LC_INODEOPS_ENHANCED_GETATTR
2638 # Kernel version 4.11 commit a528d35e8bfcc521d7cb70aaf03e1bd296c8493f
2639 # expanded getattr to be able to get more stat information.
2641 AC_DEFUN([LC_INODEOPS_ENHANCED_GETATTR], [
2642 LB_CHECK_COMPILE([if 'inode_operations' getattr member can gather advance stats],
2644 #include <linux/fs.h>
2648 ((struct inode_operations *)1)->getattr(&path, NULL, 0, 0);
2650 AC_DEFINE(HAVE_INODEOPS_ENHANCED_GETATTR, 1,
2651 [inode_operations .getattr member function can gather advance stats])
2653 ]) # LC_INODEOPS_ENHANCED_GETATTR
2656 # LC_VM_OPERATIONS_REMOVE_VMF_ARG
2658 # Kernel version 4.11 commit 11bac80004499ea59f361ef2a5516c84b6eab675
2659 # removed struct vm_area_struct as an argument for vm_operations since
2660 # in the same kernel version struct vma_area_struct was folded into
2663 AC_DEFUN([LC_VM_OPERATIONS_REMOVE_VMF_ARG], [
2664 LB_CHECK_COMPILE([if 'struct vm_operations' removed struct vm_area_struct],
2665 vm_operations_no_vm_area_struct, [
2666 #include <linux/mm.h>
2668 struct vm_fault vmf;
2670 ((struct vm_operations_struct *)0)->fault(&vmf);
2671 ((struct vm_operations_struct *)0)->page_mkwrite(&vmf);
2673 AC_DEFINE(HAVE_VM_OPS_USE_VM_FAULT_ONLY, 1,
2674 ['struct vm_operations' remove struct vm_area_struct argument])
2676 ]) # LC_VM_OPERATIONS_REMOVE_VMF_ARG
2679 # Kernel version 4.12 commit 47f38c539e9a42344ff5a664942075bd4df93876
2680 # CURRENT_TIME is not 64 bit time safe so it was replaced with
2683 AC_DEFUN([LC_CURRENT_TIME], [
2684 LB_CHECK_COMPILE([if CURRENT_TIME has been replaced with current_time],
2686 #include <linux/fs.h>
2688 struct timespec ts = current_time(NULL);
2690 AC_DEFINE(HAVE_CURRENT_TIME, 1,
2691 [current_time() has replaced CURRENT_TIME])
2693 ]) # LIBCFS_CURRENT_TIME
2696 # LC_SUPER_SETUP_BDI_NAME
2698 # Kernel version 4.12 commit 9594caf216dc0fe3e318b34af0127276db661241
2699 # unified bdi handling
2701 AC_DEFUN([LC_SUPER_SETUP_BDI_NAME], [
2702 LB_CHECK_COMPILE([if 'super_setup_bdi_name' exist],
2703 super_setup_bdi_name, [
2704 #include <linux/fs.h>
2706 super_setup_bdi_name(NULL, "lustre");
2708 AC_DEFINE(HAVE_SUPER_SETUP_BDI_NAME, 1,
2709 ['super_setup_bdi_name' is available])
2711 ]) # LC_SUPER_SETUP_BDI_NAME
2716 # Lustre linux kernel checks
2718 AC_DEFUN([LC_PROG_LINUX], [
2719 AC_MSG_NOTICE([Lustre kernel checks
2720 ==============================================================================])
2724 LC_CONFIG_HEALTH_CHECK_WRITE
2725 LC_CONFIG_LRU_RESIZE
2727 LC_GLIBC_SUPPORT_FHANDLES
2732 LC_BLK_QUEUE_MAX_SEGMENTS
2735 LC_HAVE_XATTR_HANDLER_FLAGS
2738 LC_HAVE_DQUOT_FS_DISK_QUOTA
2739 LC_HAVE_DQUOT_SUSPEND
2740 LC_HAVE_ADD_WAIT_QUEUE_EXCLUSIVE
2744 LC_EXPORT_SIMPLE_SETATTR
2745 LC_EXPORT_TRUNCATE_COMPLETE_PAGE
2749 LC_SBOPS_EVICT_INODE
2753 LC_FS_STRUCT_SEQCOUNT
2756 LC_BLKDEV_GET_BY_DEV
2757 LC_GENERIC_PERMISSION
2765 LC_HAVE_FHANDLE_SYSCALLS
2766 LC_HAVE_FSTYPE_MOUNT
2768 LC_HAVE_INODE_OWNER_OR_CAPABLE
2769 LC_HAVE_SECURITY_IINITSEC
2772 LC_DIRTY_INODE_WITH_FLAG
2776 LC_LM_XXX_LOCK_MANAGER_OPS
2780 LC_INODE_PERMISION_2ARGS
2781 LC_RADIX_EXCEPTION_ENTRY
2782 LC_HAVE_LOOP_CTL_GET_FREE
2785 LC_HAVE_PROTECT_I_NLINK
2788 LC_HAVE_MIGRATE_HEADER
2789 LC_MIGRATEPAGE_4ARGS
2790 LC_SUPEROPS_USE_DENTRY
2791 LC_INODEOPS_USE_UMODE_T
2792 LC_HAVE_CACHE_REGISTER
2796 LC_KMAP_ATOMIC_HAS_1ARG
2800 LC_HAVE_ENCODE_FH_PARENT
2801 LC_FILE_LLSEEK_SIZE_5ARG
2804 LC_DATA_FOR_LLITE_IS_LIST
2805 LC_DENTRY_OPEN_USE_PATH
2806 LC_HAVE_IOP_ATOMIC_OPEN
2807 LC_HAVE_SB_START_WRITE
2810 LC_HAVE_POSIXACL_USER_NS
2813 LC_HAVE_FILE_F_INODE
2815 LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS
2818 LC_HAVE_HLIST_FOR_EACH_3ARG
2819 LC_HAVE_BIO_END_SECTOR
2823 LC_HAVE_REMOVE_PROC_SUBTREE
2825 LC_HAVE_PROJECT_QUOTA
2826 LC_HAVE_SECURITY_DENTRY_INIT_SECURITY
2833 LC_HAVE_DENTRY_D_U_D_ALIAS
2834 LC_HAVE_DENTRY_D_CHILD
2835 LC_PID_NS_FOR_CHILDREN
2838 LC_OLDSIZE_TRUNCATE_PAGECACHE
2847 LC_HAVE_TRUNCATE_IPAGES_FINAL
2848 LC_IOPS_RENAME_WITH_FLAGS
2855 LC_DIRECTIO_USE_ITER
2856 LC_HAVE_IOV_ITER_INIT_DIRECTION
2857 LC_HAVE_IOV_ITER_TRUNCATE
2858 LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
2864 LC_PERCPU_COUNTER_INIT
2865 LC_NFS_FILLDIR_USE_CTX
2869 LC_HAVE_DQUOT_QC_DQBLK
2872 LC_BACKING_DEV_INFO_REMOVAL
2873 LC_HAVE_BDI_CAP_MAP_COPY
2876 LC_CANCEL_DIRTY_PAGE
2880 LC_HAVE_SYNC_READ_WRITE
2883 LC_NEW_CANCEL_DIRTY_PAGE
2884 LC_BIO_ENDIO_USES_ONE_ARG
2885 LC_SYMLINK_OPS_USE_NAMEIDATA
2888 LC_HAVE_CACHE_HEAD_HLIST
2889 LC_HAVE_XATTR_HANDLER_SIMPLIFIED
2892 LC_HAVE_LOCKS_LOCK_FILE_WAIT
2893 LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
2896 LC_HAVE_SUBMIT_BIO_2ARGS
2897 LC_HAVE_CLEAN_BDEV_ALIASES
2904 LC_HAVE_IOP_GET_LINK
2907 LC_HAVE_IN_COMPAT_SYSCALL
2908 LC_HAVE_XATTR_HANDLER_INODE_PARAM
2912 LC_GENERIC_WRITE_SYNC_2ARGS
2915 LC_HAVE_POSIX_ACL_VALID_USER_NS
2917 LC_FULL_NAME_HASH_3ARGS
2918 LC_STRUCT_POSIX_ACL_XATTR
2924 LC_POSIX_ACL_UPDATE_MODE
2927 LC_IOP_GENERIC_READLINK
2928 LC_HAVE_VM_FAULT_ADDRESS
2931 LC_INODEOPS_ENHANCED_GETATTR
2932 LC_VM_OPERATIONS_REMOVE_VMF_ARG
2936 LC_SUPER_SETUP_BDI_NAME
2939 AS_IF([test "x$enable_server" != xno], [
2949 # Check whether to build the client side of Lustre
2951 AC_DEFUN([LC_CONFIG_CLIENT], [
2952 AC_MSG_CHECKING([whether to build Lustre client support])
2953 AC_ARG_ENABLE([client],
2954 AC_HELP_STRING([--disable-client],
2955 [disable Lustre client support]),
2956 [], [enable_client="yes"])
2957 AC_MSG_RESULT([$enable_client])
2958 ]) # LC_CONFIG_CLIENT
2963 AC_DEFUN([LB_CONFIG_MPITESTS], [
2964 AC_ARG_ENABLE([mpitests],
2965 AC_HELP_STRING([--enable-mpitests=<yes|no|mpicc wrapper>],
2966 [include mpi tests]), [
2967 enable_mpitests="yes"
2970 MPICC_WRAPPER="mpicc"
2973 enable_mpitests="no"
2976 MPICC_WRAPPER=$enableval
2980 enable_mpitests="yes"
2981 MPICC_WRAPPER="mpicc"
2984 if test "x$enable_mpitests" != "xno"; then
2987 AC_CACHE_CHECK([whether mpitests can be built],
2988 lb_cv_mpi_tests, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([
2992 MPI_Initialized(&flag);
2995 ])], [lb_cv_mpi_tests="yes"], [lb_cv_mpi_tests="no"])
2997 enable_mpitests=$lb_cv_mpi_tests
3000 AC_SUBST(MPICC_WRAPPER)
3001 ]) # LB_CONFIG_MPITESTS
3006 # whether to enable quota support global control
3008 AC_DEFUN([LC_CONFIG_QUOTA], [
3009 AC_MSG_CHECKING([whether to enable quota support global control])
3010 AC_ARG_ENABLE([quota],
3011 AC_HELP_STRING([--enable-quota],
3012 [enable quota support]),
3013 [], [enable_quota="yes"])
3014 AS_IF([test "x$enable_quota" = xyes],
3015 [AC_MSG_RESULT([yes])],
3016 [AC_MSG_RESULT([no])])
3017 ]) # LC_CONFIG_QUOTA
3022 AC_DEFUN([LC_QUOTA], [
3026 AS_IF([test "x$enable_quota" != xno -a "x$enable_utils" != xno], [
3027 AC_CHECK_HEADER([sys/quota.h],
3028 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1,
3029 [Define to 1 if you have <sys/quota.h>.])],
3030 [AC_MSG_ERROR([don't find <sys/quota.h> in your system])])
3035 # LC_CONFIG_NODEMAP_PROC_DEBUG
3037 # enable nodemap proc file debugging
3039 AC_DEFUN([LC_NODEMAP_PROC_DEBUG], [
3040 AC_MSG_CHECKING([whether to enable nodemap proc debug])
3041 AC_ARG_ENABLE([nodemap_proc_debug],
3042 AC_HELP_STRING([--enable-nodemap-proc-debug],
3043 [enable nodemap proc debug]),
3044 [], [enable_nodemap_proc_debug="no"])
3045 AC_MSG_RESULT([$enable_nodemap_proc_debug])
3046 AS_IF([test "x$enable_nodemap_proc_debug" != xno],
3047 [AC_DEFINE(NODEMAP_PROC_DEBUG, 1,
3048 [enable nodemap proc debug support])])
3049 ]) # LC_NODEMAP_PROC_DEBUG
3054 # configure support for optional OSD implementation
3056 AC_DEFUN([LC_OSD_ADDON], [
3057 AC_MSG_CHECKING([whether to use OSD addon])
3059 AC_HELP_STRING([--with-osd=path],
3060 [set path to optional osd]),
3067 OSDADDON="$with_osd"
3074 AS_IF([test $ENABLEOSDADDON -eq 0], [
3078 OSDMODNAME=$(basename $OSDADDON)
3079 AS_IF([test -e $LUSTRE/$OSDMODNAME], [
3080 AC_MSG_RESULT([can't link])
3082 ], [ln -s $OSDADDON $LUSTRE/$OSDMODNAME], [
3083 AC_MSG_RESULT([$OSDMODNAME])
3084 OSDADDON="subdir-m += $OSDMODNAME"
3086 AC_MSG_RESULT([can't link])
3096 # other configure checks
3098 AC_DEFUN([LC_CONFIGURE], [
3099 AC_MSG_NOTICE([Lustre core checks
3100 ==============================================================================])
3102 AS_IF([test $target_cpu == "i686" -o $target_cpu == "x86_64"],
3103 [CFLAGS="$CFLAGS -Wall -Werror"])
3105 # maximum MDS thread count
3108 # lustre/utils/gss/gss_util.c
3109 # lustre/utils/gss/gssd_proc.c
3110 # lustre/utils/gss/krb5_util.c
3111 # lustre/utils/llog_reader.c
3112 # lustre/utils/create_iam.c
3113 # lustre/utils/libiam.c
3114 AC_CHECK_HEADERS([netdb.h endian.h])
3115 AC_CHECK_FUNCS([gethostbyname])
3117 # lustre/utils/llverdev.c
3118 AC_CHECK_HEADERS([blkid/blkid.h])
3120 # lustre/utils/llverfs.c
3121 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
3123 # lustre/utils/lfs.c
3124 AC_CHECK_LIB([z], [crc32], [
3125 AC_CHECK_HEADER([zlib.h], [], [
3126 AC_MSG_ERROR([zlib.h not found.])])
3129 zlib library not found. Please install zlib development package.])
3133 AC_CHECK_LIB([selinux], [is_selinux_enabled],
3134 [AC_CHECK_HEADERS([selinux/selinux.h],
3135 [SELINUX="-lselinux"
3136 AC_DEFINE([HAVE_SELINUX], 1,
3137 [support for selinux ])],
3140 No libselinux-devel package found, unable to build selinux enabled tools
3145 No selinux package found, unable to build selinux enabled tools
3151 AC_MSG_CHECKING([whether to report minimum OST free space])
3152 AC_ARG_ENABLE([mindf],
3153 AC_HELP_STRING([--enable-mindf],
3154 [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
3155 [], [enable_mindf="no"])
3156 AC_MSG_RESULT([$enable_mindf])
3157 AS_IF([test "$enable_mindf" = "yes"],
3158 [AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])])
3160 AC_MSG_CHECKING([whether to randomly failing memory alloc])
3161 AC_ARG_ENABLE([fail_alloc],
3162 AC_HELP_STRING([--disable-fail-alloc],
3163 [disable randomly alloc failure]),
3164 [], [enable_fail_alloc="yes"])
3165 AC_MSG_RESULT([$enable_fail_alloc])
3166 AS_IF([test "x$enable_fail_alloc" != xno],
3167 [AC_DEFINE([RANDOM_FAIL_ALLOC], 1,
3168 [enable randomly alloc failure])])
3170 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
3171 AC_ARG_ENABLE([invariants],
3172 AC_HELP_STRING([--enable-invariants],
3173 [enable invariant checking (cpu intensive)]),
3174 [], [enable_invariants="no"])
3175 AC_MSG_RESULT([$enable_invariants])
3176 AS_IF([test "x$enable_invariants" = xyes],
3177 [AC_DEFINE([CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK], 1,
3178 [enable invariant checking])])
3180 AC_MSG_CHECKING([whether to track references with lu_ref])
3181 AC_ARG_ENABLE([lu_ref],
3182 AC_HELP_STRING([--enable-lu_ref],
3183 [enable lu_ref reference tracking code]),
3184 [], [enable_lu_ref="no"])
3185 AC_MSG_RESULT([$enable_lu_ref])
3186 AS_IF([test "x$enable_lu_ref" = xyes],
3187 [AC_DEFINE([USE_LU_REF], 1,
3188 [enable lu_ref reference tracking code])])
3190 AC_MSG_CHECKING([whether to enable page state tracking])
3191 AC_ARG_ENABLE([pgstate-track],
3192 AC_HELP_STRING([--enable-pgstate-track],
3193 [enable page state tracking]),
3194 [], [enable_pgstat_track="no"])
3195 AC_MSG_RESULT([$enable_pgstat_track])
3196 AS_IF([test "x$enable_pgstat_track" = xyes],
3197 [AC_DEFINE([CONFIG_DEBUG_PAGESTATE_TRACKING], 1,
3198 [enable page state tracking code])])
3201 AC_MSG_CHECKING([systemd unit file directory])
3202 AC_ARG_WITH([systemdsystemunitdir],
3203 [AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
3204 [Directory for systemd service files])],
3205 [], [with_systemdsystemunitdir=auto])
3206 AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"],
3207 [def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
3208 AS_IF([test "x$def_systemdsystemunitdir" = "x"],
3209 [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
3210 [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
3211 with_systemdsystemunitdir=no],
3212 [with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
3213 AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
3214 [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
3215 AC_MSG_RESULT([$with_systemdsystemunitdir])
3221 # AM_CONDITIONALS for lustre
3223 AC_DEFUN([LC_CONDITIONALS], [
3224 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
3225 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
3226 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
3227 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
3228 AM_CONDITIONAL(BLKID, test x$ac_cv_header_blkid_blkid_h = xyes)
3229 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
3230 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
3231 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
3232 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
3233 AM_CONDITIONAL(GSS_SSK, test x$enable_ssk = xyes)
3234 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
3235 AM_CONDITIONAL(HAVE_SYSTEMD, test "x$with_systemdsystemunitdir" != "xno")
3236 AM_CONDITIONAL(XATTR_HANDLER, test "x$lb_cv_compile_xattr_handler_flags" = xyes)
3237 ]) # LC_CONDITIONALS
3242 # files that should be generated with AC_OUTPUT
3244 AC_DEFUN([LC_CONFIG_FILES],
3248 lustre/autoconf/Makefile
3249 lustre/conf/Makefile
3250 lustre/contrib/Makefile
3252 lustre/include/Makefile
3253 lustre/include/lustre/Makefile
3254 lustre/include/uapi/linux/lustre/Makefile
3255 lustre/kernel_patches/targets/3.10-rhel7.target
3256 lustre/kernel_patches/targets/2.6-rhel6.9.target
3257 lustre/kernel_patches/targets/2.6-rhel6.8.target
3258 lustre/kernel_patches/targets/2.6-rhel6.7.target
3259 lustre/kernel_patches/targets/2.6-rhel6.6.target
3260 lustre/kernel_patches/targets/2.6-rhel6.target
3261 lustre/kernel_patches/targets/2.6-rhel5.target
3262 lustre/kernel_patches/targets/2.6-sles11.target
3263 lustre/kernel_patches/targets/3.0-sles11.target
3264 lustre/kernel_patches/targets/3.0-sles11sp3.target
3265 lustre/kernel_patches/targets/3.0-sles11sp4.target
3266 lustre/kernel_patches/targets/3.12-sles12.target
3267 lustre/kernel_patches/targets/4.4-sles12.target
3268 lustre/kernel_patches/targets/4.4-sles12sp3.target
3269 lustre/kernel_patches/targets/2.6-fc11.target
3270 lustre/kernel_patches/targets/2.6-fc12.target
3271 lustre/kernel_patches/targets/2.6-fc15.target
3272 lustre/kernel_patches/targets/3.x-fc18.target
3273 lustre/ldlm/Makefile
3275 lustre/fid/autoMakefile
3276 lustre/llite/Makefile
3277 lustre/llite/autoMakefile
3279 lustre/lov/autoMakefile
3281 lustre/mdc/autoMakefile
3283 lustre/lmv/autoMakefile
3284 lustre/lfsck/Makefile
3285 lustre/lfsck/autoMakefile
3287 lustre/mdt/autoMakefile
3289 lustre/mdd/autoMakefile
3291 lustre/fld/autoMakefile
3292 lustre/obdclass/Makefile
3293 lustre/obdclass/autoMakefile
3294 lustre/obdclass/linux/Makefile
3295 lustre/obdecho/Makefile
3296 lustre/obdecho/autoMakefile
3298 lustre/ofd/autoMakefile
3300 lustre/osc/autoMakefile
3302 lustre/ost/autoMakefile
3303 lustre/osd-ldiskfs/Makefile
3304 lustre/osd-ldiskfs/autoMakefile
3305 lustre/osd-zfs/Makefile
3306 lustre/osd-zfs/autoMakefile
3308 lustre/mgc/autoMakefile
3310 lustre/mgs/autoMakefile
3311 lustre/target/Makefile
3312 lustre/ptlrpc/Makefile
3313 lustre/ptlrpc/autoMakefile
3314 lustre/ptlrpc/gss/Makefile
3315 lustre/ptlrpc/gss/autoMakefile
3316 lustre/quota/Makefile
3317 lustre/quota/autoMakefile
3318 lustre/scripts/Makefile
3319 lustre/scripts/systemd/Makefile
3320 lustre/tests/Makefile
3321 lustre/tests/mpi/Makefile
3322 lustre/tests/kernel/Makefile
3323 lustre/tests/kernel/autoMakefile
3324 lustre/utils/Makefile
3325 lustre/utils/gss/Makefile
3327 lustre/osp/autoMakefile
3329 lustre/lod/autoMakefile
3331 ]) # LC_CONFIG_FILES