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
128 # enable distributed flock by default
130 AC_DEFUN([LC_CONFIG_FLOCK], [
131 AC_MSG_CHECKING([whether to enable flock by default])
132 AC_ARG_ENABLE([flock],
133 AC_HELP_STRING([--disable-flock],
134 [disable flock by default]),
135 [], [enable_flock="yes"])
136 AC_MSG_RESULT([$enable_flock])
137 AS_IF([test "x$enable_flock" != xno],
138 [AC_DEFINE(ENABLE_FLOCK, 1, [enable flock by default])])
142 # LC_CONFIG_HEALTH_CHECK_WRITE
144 # Turn off the actual write to the disk
146 AC_DEFUN([LC_CONFIG_HEALTH_CHECK_WRITE], [
147 AC_MSG_CHECKING([whether to enable a write with the health check])
148 AC_ARG_ENABLE([health_write],
149 AC_HELP_STRING([--enable-health_write],
150 [enable disk writes when doing health check]),
151 [], [enable_health_write="no"])
152 AC_MSG_RESULT([$enable_health_write])
153 AS_IF([test "x$enable_health_write" != xno],
154 [AC_DEFINE(USE_HEALTH_CHECK_WRITE, 1, [Write when Checking Health])])
155 ]) # LC_CONFIG_HEALTH_CHECK_WRITE
158 # LC_CONFIG_LRU_RESIZE
160 AC_DEFUN([LC_CONFIG_LRU_RESIZE], [
161 AC_MSG_CHECKING([whether to enable lru self-adjusting])
162 AC_ARG_ENABLE([lru_resize],
163 AC_HELP_STRING([--enable-lru-resize],
164 [enable lru resize support]),
165 [], [enable_lru_resize="yes"])
166 AC_MSG_RESULT([$enable_lru_resize])
167 AS_IF([test "x$enable_lru_resize" != xno],
168 [AC_DEFINE(HAVE_LRU_RESIZE_SUPPORT, 1, [Enable lru resize support])])
169 ]) # LC_CONFIG_LRU_RESIZE
174 # Quota support. The kernel must support CONFIG_QUOTA.
176 AC_DEFUN([LC_QUOTA_CONFIG], [
177 LB_CHECK_CONFIG_IM([QUOTA], [],
180 Lustre quota requires that CONFIG_QUOTA is enabled in your kernel.
187 # fhandle kernel support for open_by_handle_at() and name_to_handle_at()
188 # system calls. The kernel must support CONFIG_FHANDLE.
190 AC_DEFUN([LC_CONFIG_FHANDLE], [
191 LB_CHECK_CONFIG_IM([FHANDLE], [],
194 Lustre fid handling requires that CONFIG_FHANDLE is enabled in your kernel.
196 ]) # LC_CONFIG_FHANDLE
199 # LC_POSIX_ACL_CONFIG
203 AC_DEFUN([LC_POSIX_ACL_CONFIG], [
204 LB_CHECK_CONFIG_IM([FS_POSIX_ACL],
205 [AC_DEFINE(CONFIG_LUSTRE_FS_POSIX_ACL, 1, [Enable POSIX acl])
207 ]) # LC_POSIX_ACL_CONFIG
209 LB_CHECK_CONFIG_IM([CRYPTO_MD5], [],
210 [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
213 # LC_CONFIG_GSS_KEYRING
215 # default 'auto', tests for dependencies, if found, enables;
216 # only called if gss is enabled
218 AC_DEFUN([LC_CONFIG_GSS_KEYRING], [
219 AC_MSG_CHECKING([whether to enable gss keyring backend])
220 AC_ARG_ENABLE([gss_keyring],
221 [AC_HELP_STRING([--disable-gss-keyring],
222 [disable gss keyring backend])],
223 [], [enable_gss_keyring="auto"])
224 AC_MSG_RESULT([$enable_gss_keyring])
225 AS_IF([test "x$enable_gss_keyring" != xno], [
226 LB_CHECK_CONFIG_IM([KEYS], [], [
227 gss_keyring_conf_test="fail"
228 AC_MSG_WARN([GSS keyring backend requires that CONFIG_KEYS be enabled in your kernel.])])
230 AC_CHECK_LIB([keyutils], [keyctl_search], [], [
231 gss_keyring_conf_test="fail"
232 AC_MSG_WARN([GSS keyring backend requires libkeyutils])])
234 AS_IF([test "x$gss_keyring_conf_test" != xfail], [
235 AC_DEFINE([HAVE_GSS_KEYRING], [1],
236 [Define this if you enable gss keyring backend])
237 enable_gss_keyring="yes"
239 AS_IF([test "x$enable_gss_keyring" = xyes], [
240 AC_MSG_ERROR([Cannot enable gss_keyring. See above for details.])
244 ]) # LC_CONFIG_GSS_KEYRING
247 # LC_KEY_TYPE_INSTANTIATE_2ARGS
249 # rhel7 key_type->instantiate takes 2 args (struct key, struct key_preparsed_payload)
251 AC_DEFUN([LC_KEY_TYPE_INSTANTIATE_2ARGS], [
252 LB_CHECK_COMPILE([if 'key_type->instantiate' has two args],
253 key_type_instantiate_2args, [
254 #include <linux/key-type.h>
256 ((struct key_type *)0)->instantiate(0, NULL);
258 AC_DEFINE(HAVE_KEY_TYPE_INSTANTIATE_2ARGS, 1,
259 [key_type->instantiate has two args])
261 ]) # LC_KEY_TYPE_INSTANTIATE_2ARGS
266 AC_DEFUN([LC_CONFIG_SUNRPC], [
267 LB_CHECK_CONFIG_IM([SUNRPC], [], [
268 AS_IF([test "x$sunrpc_required" = xyes], [
271 kernel SUNRPC support is required by using GSS.
274 ]) # LC_CONFIG_SUNRPC
277 # LC_CONFIG_GSS (default 'auto' (tests for dependencies, if found, enables))
279 # Build gss and related tools of Lustre. Currently both kernel and user space
280 # parts are depend on linux platform.
282 AC_DEFUN([LC_CONFIG_GSS], [
283 AC_MSG_CHECKING([whether to enable gss support])
285 [AC_HELP_STRING([--enable-gss], [enable gss support])],
286 [], [enable_gss="auto"])
287 AC_MSG_RESULT([$enable_gss])
289 AS_IF([test "x$enable_gss" != xno], [
290 LC_CONFIG_GSS_KEYRING
291 LC_KEY_TYPE_INSTANTIATE_2ARGS
292 sunrpc_required=$enable_gss
296 LB_CHECK_CONFIG_IM([CRYPTO_MD5], [],
297 [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
298 LB_CHECK_CONFIG_IM([CRYPTO_SHA1], [],
299 [AC_MSG_WARN([kernel SHA1 support is recommended by using GSS.])])
300 LB_CHECK_CONFIG_IM([CRYPTO_SHA256], [],
301 [AC_MSG_WARN([kernel SHA256 support is recommended by using GSS.])])
302 LB_CHECK_CONFIG_IM([CRYPTO_SHA512], [],
303 [AC_MSG_WARN([kernel SHA512 support is recommended by using GSS.])])
305 require_krb5=$enable_gss
309 AS_IF([test -n "$KRBDIR"], [
310 gss_conf_test="success"
312 gss_conf_test="failure"
315 AS_IF([test "x$gss_conf_test" = xsuccess && test "x$enable_gss" != xno], [
316 AC_DEFINE([HAVE_GSS], [1], [Define this is if you enable gss])
319 enable_gss_keyring="no"
323 enable_ssk=$enable_gss
325 enable_gss_keyring="no"
331 # OpenSSL 1.0+ return int for HMAC functions but older SLES11 versions do not
332 AC_DEFUN([LC_OPENSSL_SSK], [
333 AC_MSG_CHECKING([whether OpenSSL has functions needed for SSK])
334 AS_IF([test "x$enable_ssk" != xno], [
335 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
336 #include <openssl/hmac.h>
337 #include <openssl/evp.h>
341 rc = HMAC_Init_ex(NULL, "test", 4, EVP_md_null(), NULL);
343 ])],[AC_DEFINE(HAVE_OPENSSL_SSK, 1,
344 [OpenSSL HMAC functions needed for SSK])],
347 AC_MSG_RESULT([$enable_ssk])
350 # LC_OPENSSL_GETSEPOL
352 # OpenSSL is needed for l_getsepol
353 AC_DEFUN([LC_OPENSSL_GETSEPOL], [
354 AC_MSG_CHECKING([whether openssl-devel is present])
355 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
356 #include <openssl/evp.h>
359 EVP_MD_CTX *mdctx = EVP_MD_CTX_create();
362 AC_DEFINE(HAVE_OPENSSL_GETSEPOL, 1, [openssl-devel is present])
363 enable_getsepol="yes"
369 No openssk-devel headers found, unable to build l_getsepol and SELinux status checking
372 AC_MSG_RESULT([$enable_getsepol])
373 ]) # LC_OPENSSL_GETSEPOL
375 AC_DEFUN([LC_HAVE_PROJECT_QUOTA], [
376 LB_CHECK_COMPILE([if get_projid exists],
379 #include <linux/quota.h>
381 struct dquot_operations ops = { };
383 ops.get_projid(NULL, NULL);
385 AC_DEFINE(HAVE_PROJECT_QUOTA, 1,
386 [get_projid function exists])
388 ]) # LC_HAVE_PROJECT_QUOTA
391 # LC_INVALIDATE_RANGE
393 # 3.11 invalidatepage requires the length of the range to invalidate
395 AC_DEFUN([LC_INVALIDATE_RANGE], [
396 LB_CHECK_COMPILE([if 'address_space_operations.invalidatepage' requires 3 arguments],
397 address_space_ops_invalidatepage_3args, [
398 #include <linux/fs.h>
400 struct address_space_operations a_ops;
401 a_ops.invalidatepage(NULL, 0, 0);
403 AC_DEFINE(HAVE_INVALIDATE_RANGE, 1,
404 [address_space_operations.invalidatepage needs 3 arguments])
406 ]) # LC_INVALIDATE_RANGE
409 # LC_HAVE_DIR_CONTEXT
411 # 3.11 readdir now takes the new struct dir_context
413 AC_DEFUN([LC_HAVE_DIR_CONTEXT], [
414 LB_CHECK_COMPILE([if 'dir_context' exist],
416 #include <linux/fs.h>
418 #ifdef FMODE_KABI_ITERATE
419 #error "back to use readdir in kabi_extand mode"
421 struct dir_context ctx;
426 AC_DEFINE(HAVE_DIR_CONTEXT, 1,
429 ]) # LC_HAVE_DIR_CONTEXT
434 # 3.11 dentry_operations.d_compare() taken 5 arguments.
436 AC_DEFUN([LC_D_COMPARE_5ARGS], [
437 LB_CHECK_COMPILE([if 'd_compare' taken 5 arguments],
439 #include <linux/dcache.h>
441 ((struct dentry_operations*)0)->d_compare(NULL,NULL,0,NULL,NULL);
443 AC_DEFINE(HAVE_D_COMPARE_5ARGS, 1,
444 [d_compare need 5 arguments])
446 ]) # LC_D_COMPARE_5ARGS
451 # 3.11 need to access d_count to get dentry reference count
453 AC_DEFUN([LC_HAVE_DCOUNT], [
454 LB_CHECK_COMPILE([if 'd_count' exists],
456 #include <linux/dcache.h>
458 struct dentry de = { };
461 count = d_count(&de);
463 AC_DEFINE(HAVE_D_COUNT, 1,
469 # LC_PID_NS_FOR_CHILDREN
471 # 3.11 replaces pid_ns by pid_ns_for_children in struct nsproxy
473 AC_DEFUN([LC_PID_NS_FOR_CHILDREN], [
474 LB_CHECK_COMPILE([if 'struct nsproxy' has 'pid_ns_for_children'],
475 pid_ns_for_children, [
476 #include <linux/nsproxy.h>
479 ns.pid_ns_for_children = NULL;
481 AC_DEFINE(HAVE_PID_NS_FOR_CHILDREN, 1,
482 ['struct nsproxy' has 'pid_ns_for_children'])
484 ]) # LC_PID_NS_FOR_CHILDREN
487 # LC_OLDSIZE_TRUNCATE_PAGECACHE
489 # 3.12 truncate_pagecache without oldsize parameter
491 AC_DEFUN([LC_OLDSIZE_TRUNCATE_PAGECACHE], [
492 LB_CHECK_COMPILE([if 'truncate_pagecache' with 'old_size' parameter],
493 truncate_pagecache_old_size, [
494 #include <linux/mm.h>
496 truncate_pagecache(NULL, 0, 0);
498 AC_DEFINE(HAVE_OLDSIZE_TRUNCATE_PAGECACHE, 1,
501 ]) # LC_OLDSIZE_TRUNCATE_PAGECACHE
506 # For some reason SLES11SP4 is missing the PTR_ERR_OR_ZERO macro
507 # It was added to linux kernel 3.12
509 AC_DEFUN([LC_PTR_ERR_OR_ZERO_MISSING], [
510 LB_CHECK_COMPILE([if 'PTR_ERR_OR_ZERO' is missing],
512 #include <linux/err.h>
514 if (PTR_ERR_OR_ZERO(NULL)) return 0;
516 AC_DEFINE(HAVE_PTR_ERR_OR_ZERO, 1,
517 ['PTR_ERR_OR_ZERO' exist])
519 ]) # LC_PTR_ERR_OR_ZERO_MISSING
522 # LC_HAVE_DENTRY_D_U_D_ALIAS
524 # 3.11 kernel moved d_alias to the union d_u in struct dentry
526 # Some distros move d_alias to d_u but it is still a struct list
528 AC_DEFUN([LC_HAVE_DENTRY_D_U_D_ALIAS], [
529 AS_IF([test "x$lb_cv_compile_i_dentry_d_alias_list" = xyes], [
530 LB_CHECK_COMPILE([if list 'dentry.d_u.d_alias' exist],
532 #include <linux/list.h>
533 #include <linux/dcache.h>
536 INIT_LIST_HEAD(&de.d_u.d_alias);
538 AC_DEFINE(HAVE_DENTRY_D_U_D_ALIAS, 1,
539 [list dentry.d_u.d_alias exist])
542 LB_CHECK_COMPILE([if hlist 'dentry.d_u.d_alias' exist],
544 #include <linux/list.h>
545 #include <linux/dcache.h>
548 INIT_HLIST_NODE(&de.d_u.d_alias);
550 AC_DEFINE(HAVE_DENTRY_D_U_D_ALIAS, 1,
551 [hlist dentry.d_u.d_alias exist])
554 ]) # LC_HAVE_DENTRY_D_U_D_ALIAS
557 # LC_HAVE_DENTRY_D_CHILD
559 # 3.11 kernel d_child has been moved out of the union d_u
562 AC_DEFUN([LC_HAVE_DENTRY_D_CHILD], [
563 LB_CHECK_COMPILE([if 'dentry.d_child' exist],
565 #include <linux/list.h>
566 #include <linux/dcache.h>
569 INIT_LIST_HEAD(&de.d_child);
571 AC_DEFINE(HAVE_DENTRY_D_CHILD, 1,
572 [dentry.d_child exist])
574 ]) # LC_HAVE_DENTRY_D_CHILD
579 # 3.12 ki_left removed from struct kiocb
581 AC_DEFUN([LC_KIOCB_KI_LEFT], [
582 LB_CHECK_COMPILE([if 'struct kiocb' with 'ki_left' member],
584 #include <linux/aio.h>
586 ((struct kiocb*)0)->ki_left = 0;
588 AC_DEFINE(HAVE_KIOCB_KI_LEFT, 1,
591 ]) # LC_KIOCB_KI_LEFT
594 # LC_INIT_LIST_HEAD_RCU
596 # 3.12 added INIT_LIST_HEAD_RCU in commit 2a855b644c310d5db5
597 # which is unfortunately an inline function and not a macro
598 # that can be tested directly, so it needs a configure check.
600 AC_DEFUN([LC_INIT_LIST_HEAD_RCU], [
601 LB_CHECK_COMPILE([if 'INIT_LIST_HEAD_RCU' exists],
602 init_list_head_rcu, [
603 #include <linux/list.h>
604 #include <linux/rculist.h>
606 struct list_head list;
607 INIT_LIST_HEAD_RCU(&list);
609 AC_DEFINE(HAVE_INIT_LIST_HEAD_RCU, 1,
610 [INIT_LIST_HEAD_RCU exists])
612 ]) # LC_INIT_LIST_HEAD_RCU
615 # LC_VFS_RENAME_5ARGS
617 # 3.13 has vfs_rename with 5 args
619 AC_DEFUN([LC_VFS_RENAME_5ARGS], [
620 LB_CHECK_COMPILE([if Linux kernel has 'vfs_rename' with 5 args],
622 #include <linux/fs.h>
624 vfs_rename(NULL, NULL, NULL, NULL, NULL);
626 AC_DEFINE(HAVE_VFS_RENAME_5ARGS, 1,
627 [kernel has vfs_rename with 5 args])
629 ]) # LC_VFS_RENAME_5ARGS
632 # LC_VFS_UNLINK_3ARGS
634 # 3.13 has vfs_unlink with 3 args
636 AC_DEFUN([LC_VFS_UNLINK_3ARGS], [
637 LB_CHECK_COMPILE([if Linux kernel has 'vfs_unlink' with 3 args],
639 #include <linux/fs.h>
641 vfs_unlink(NULL, NULL, NULL);
643 AC_DEFINE(HAVE_VFS_UNLINK_3ARGS, 1,
644 [kernel has vfs_unlink with 3 args])
646 ]) # LC_VFS_UNLINK_3ARGS
648 # LC_HAVE_D_IS_POSITIVE
650 # Kernel version 3.13 b18825a7c8e37a7cf6abb97a12a6ad71af160de7
651 # d_is_positive is added
653 AC_DEFUN([LC_HAVE_D_IS_POSITIVE], [
654 LB_CHECK_COMPILE([if 'd_is_positive' exist],
656 #include <linux/dcache.h>
660 AC_DEFINE(HAVE_D_IS_POSITIVE, 1,
661 ['d_is_positive' is available])
663 ]) # LC_HAVE_D_IS_POSITIVE
668 # 3.14 move some of its data in struct bio into the new
671 AC_DEFUN([LC_HAVE_BVEC_ITER], [
672 LB_CHECK_COMPILE([if Linux kernel has struct bvec_iter],
674 #include <linux/bio.h>
676 struct bvec_iter iter;
678 iter.bi_bvec_done = 0;
680 AC_DEFINE(HAVE_BVEC_ITER, 1,
681 [kernel has struct bvec_iter])
683 ]) # LC_HAVE_BVEC_ITER
688 # 3.14 adds set_acl method to inode_operations
689 # see kernel commit 893d46e443346370cd4ea81d9d35f72952c62a37
691 AC_DEFUN([LC_IOP_SET_ACL], [
692 LB_CHECK_COMPILE([if 'inode_operations' has '.set_acl' member function],
694 #include <linux/fs.h>
696 struct inode_operations iop;
699 AC_DEFINE(HAVE_IOP_SET_ACL, 1,
700 [inode_operations has .set_acl member function])
705 # LC_HAVE_TRUNCATE_IPAGE_FINAL
707 # 3.14 bring truncate_inode_pages_final for evict_inode
709 AC_DEFUN([LC_HAVE_TRUNCATE_IPAGES_FINAL], [
710 LB_CHECK_COMPILE([if Linux kernel has truncate_inode_pages_final],
711 truncate_ipages_final, [
712 #include <linux/mm.h>
714 truncate_inode_pages_final(NULL);
716 AC_DEFINE(HAVE_TRUNCATE_INODE_PAGES_FINAL, 1,
717 [kernel has truncate_inode_pages_final])
719 ]) # LC_HAVE_TRUNCATE_IPAGES_FINAL
722 # LC_IOPS_RENAME_WITH_FLAGS
724 # 3.14 has inode_operations->rename with 5 args
725 # commit 520c8b16505236fc82daa352e6c5e73cd9870cff
727 AC_DEFUN([LC_IOPS_RENAME_WITH_FLAGS], [
728 LB_CHECK_COMPILE([if 'inode_operations->rename' taken flags as argument],
729 iops_rename_with_flags, [
730 #include <linux/fs.h>
732 struct inode *i1 = NULL, *i2 = NULL;
733 struct dentry *d1 = NULL, *d2 = NULL;
735 rc = ((struct inode_operations *)0)->rename(i1, d1, i2, d2, 0);
737 AC_DEFINE(HAVE_IOPS_RENAME_WITH_FLAGS, 1,
738 [inode_operations->rename need flags as argument])
740 ]) # LC_IOPS_RENAME_WITH_FLAGS
743 # LC_VFS_RENAME_6ARGS
745 # 3.15 has vfs_rename with 6 args
747 AC_DEFUN([LC_VFS_RENAME_6ARGS], [
748 LB_CHECK_COMPILE([if Linux kernel has 'vfs_rename' with 6 args],
750 #include <linux/fs.h>
752 vfs_rename(NULL, NULL, NULL, NULL, NULL, NULL);
754 AC_DEFINE(HAVE_VFS_RENAME_6ARGS, 1,
755 [kernel has vfs_rename with 6 args])
757 ]) # LC_VFS_RENAME_6ARGS
760 # LC_DIRECTIO_USE_ITER
762 # 3.16 kernel changes direct IO to use iov_iter
764 AC_DEFUN([LC_DIRECTIO_USE_ITER], [
765 LB_CHECK_COMPILE([if direct IO uses iov_iter],
767 #include <linux/fs.h>
769 struct address_space_operations ops = { };
770 struct iov_iter *iter = NULL;
773 ops.direct_IO(0, NULL, iter, offset);
775 AC_DEFINE(HAVE_DIRECTIO_ITER, 1,
776 [direct IO uses iov_iter])
778 ]) # LC_DIRECTIO_USE_ITER
781 # LC_HAVE_IOV_ITER_INIT_DIRECTION
784 # 3.16 linux commit 71d8e532b1549a478e6a6a8a44f309d050294d00
785 # changed iov_iter_init api to start accepting a tag
786 # that defines if its a read or write operation
788 AC_DEFUN([LC_HAVE_IOV_ITER_INIT_DIRECTION], [
789 tmp_flags="$EXTRA_KCFLAGS"
790 EXTRA_KCFLAGS="-Werror"
791 LB_CHECK_COMPILE([if 'iov_iter_init' takes a tag],
793 #include <linux/uio.h>
794 #include <linux/fs.h>
796 const struct iovec *iov = NULL;
798 iov_iter_init(NULL, READ, iov, 1, 0);
800 AC_DEFINE(HAVE_IOV_ITER_INIT_DIRECTION, 1,
801 [iov_iter_init handles directional tag])
803 EXTRA_KCFLAGS="$tmp_flags"
804 ]) # LC_HAVE_IOV_ITER_INIT_DIRECTION
807 # LC_HAVE_IOV_ITER_TRUNCATE
810 # 3.16 introduces a new API iov_iter_truncate()
812 AC_DEFUN([LC_HAVE_IOV_ITER_TRUNCATE], [
813 tmp_flags="$EXTRA_KCFLAGS"
814 EXTRA_KCFLAGS="-Werror"
815 LB_CHECK_COMPILE([if 'iov_iter_truncate' exists ],
817 #include <linux/uio.h>
818 #include <linux/fs.h>
820 struct iov_iter *i = NULL;
822 iov_iter_truncate(i, 0);
824 AC_DEFINE(HAVE_IOV_ITER_TRUNCATE, 1, [iov_iter_truncate exists])
826 EXTRA_KCFLAGS="$tmp_flags"
827 ]) # LC_HAVE_IOV_ITER_TRUNCATE
830 # LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
832 # 3.16 introduces [read|write]_iter to struct file_operations
834 AC_DEFUN([LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER], [
835 LB_CHECK_COMPILE([if 'file_operations.[read|write]_iter' exist],
836 file_function_iter, [
837 #include <linux/fs.h>
839 ((struct file_operations *)NULL)->read_iter(NULL, NULL);
840 ((struct file_operations *)NULL)->write_iter(NULL, NULL);
842 AC_DEFINE(HAVE_FILE_OPERATIONS_READ_WRITE_ITER, 1,
843 [file_operations.[read|write]_iter functions exist])
845 ]) # LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
848 # LC_HAVE_INTERVAL_BLK_INTEGRITY
850 # 3.17 replace sector_size with interval in struct blk_integrity
852 AC_DEFUN([LC_HAVE_INTERVAL_BLK_INTEGRITY], [
853 LB_CHECK_COMPILE([if 'blk_integrity.interval' exist],
854 interval_blk_integrity, [
855 #include <linux/blkdev.h>
857 ((struct blk_integrity *)0)->interval = 0;
859 AC_DEFINE(HAVE_INTERVAL_BLK_INTEGRITY, 1,
860 [blk_integrity.interval exist])
862 ]) # LC_HAVE_INTERVAL_BLK_INTEGRITY
867 # 3.17 replaces key_type::match with match_preparse
868 # and has new struct key_match_data
870 AC_DEFUN([LC_KEY_MATCH_DATA], [
871 LB_CHECK_COMPILE([if struct key_match field exist],
873 #include <linux/key-type.h>
875 struct key_match_data data;
877 data.raw_data = NULL;
879 AC_DEFINE(HAVE_KEY_MATCH_DATA, 1,
880 [struct key_match_data exist])
882 ]) # LC_KEY_MATCH_DATA
885 # LC_NFS_FILLDIR_USE_CTX
887 # 3.18 kernel moved from void cookie to struct dir_context
889 AC_DEFUN([LC_NFS_FILLDIR_USE_CTX], [
890 tmp_flags="$EXTRA_KCFLAGS"
891 EXTRA_KCFLAGS="-Werror"
892 LB_CHECK_COMPILE([if filldir_t uses struct dir_context],
894 #include <linux/fs.h>
896 int filldir(struct dir_context *ctx, const char* name,
897 int i, loff_t off, u64 tmp, unsigned temp)
902 struct dir_context ctx = {
906 ctx.actor(NULL, "test", 0, (loff_t) 0, 0, 0);
908 AC_DEFINE(HAVE_FILLDIR_USE_CTX, 1,
909 [filldir_t needs struct dir_context as argument])
911 EXTRA_KCFLAGS="$tmp_flags"
912 ]) # LC_NFS_FILLDIR_USE_CTX
915 # LC_PERCPU_COUNTER_INIT
917 # 3.18 For kernels 3.18 and after percpu_counter_init starts
918 # to pass a GFP_* memory allocation flag for internal
919 # memory allocation purposes.
921 AC_DEFUN([LC_PERCPU_COUNTER_INIT], [
922 LB_CHECK_COMPILE([if percpu_counter_init uses GFP_* flag as argument],
923 percpu_counter_init, [
924 #include <linux/percpu_counter.h>
926 percpu_counter_init(NULL, 0, GFP_KERNEL);
928 AC_DEFINE(HAVE_PERCPU_COUNTER_INIT_GFP_FLAG, 1,
929 [percpu_counter_init uses GFP_* flag])
931 ]) # LC_PERCPU_COUNTER_INIT
934 # LC_KIOCB_HAS_NBYTES
936 # 3.19 kernel removed ki_nbytes from struct kiocb
938 AC_DEFUN([LC_KIOCB_HAS_NBYTES], [
939 LB_CHECK_COMPILE([if struct kiocb has ki_nbytes field],
941 #include <linux/fs.h>
943 struct kiocb iocb = { };
947 AC_DEFINE(HAVE_KI_NBYTES, 1, [ki_nbytes field exist])
949 ]) # LC_KIOCB_HAS_NBYTES
952 # LC_HAVE_DQUOT_QC_DQBLK
954 # 3.19 has quotactl_ops->[sg]et_dqblk that take struct kqid and qc_dqblk
955 # Added in commit 14bf61ffe
957 AC_DEFUN([LC_HAVE_DQUOT_QC_DQBLK], [
958 tmp_flags="$EXTRA_KCFLAGS"
959 EXTRA_KCFLAGS="-Werror"
960 LB_CHECK_COMPILE([if 'quotactl_ops.set_dqblk' takes struct qc_dqblk],
962 #include <linux/fs.h>
963 #include <linux/quota.h>
965 ((struct quotactl_ops *)0)->set_dqblk(NULL, *((struct kqid*)0), (struct qc_dqblk*)0);
967 AC_DEFINE(HAVE_DQUOT_QC_DQBLK, 1,
968 [quotactl_ops.set_dqblk takes struct qc_dqblk])
969 AC_DEFINE(HAVE_DQUOT_KQID, 1,
970 [quotactl_ops.set_dqblk takes struct kqid])
972 EXTRA_KCFLAGS="$tmp_flags"
973 ]) # LC_HAVE_DQUOT_QC_DQBLK
976 # LC_HAVE_AIO_COMPLETE
978 # 3.19 kernel makes aio_complete() static
980 AC_DEFUN([LC_HAVE_AIO_COMPLETE], [
981 LB_CHECK_COMPILE([if kernel has exported aio_complete() ],
983 #include <linux/aio.h>
985 aio_complete(NULL, 0, 0);
987 AC_DEFINE(HAVE_AIO_COMPLETE, 1, [aio_complete defined])
989 ]) # LC_HAVE_AIO_COMPLETE
992 # LC_BACKING_DEV_INFO_REMOVAL
994 # 3.20 kernel removed backing_dev_info from address_space
996 AC_DEFUN([LC_BACKING_DEV_INFO_REMOVAL], [
997 LB_CHECK_COMPILE([if struct address_space has backing_dev_info],
999 #include <linux/fs.h>
1001 struct address_space mapping;
1003 mapping.backing_dev_info = NULL;
1005 AC_DEFINE(HAVE_BACKING_DEV_INFO, 1, [backing_dev_info exist])
1007 ]) # LC_BACKING_DEV_INFO_REMOVAL
1010 # LC_HAVE_BDI_CAP_MAP_COPY
1012 # 3.20 removed mmap handling for backing devices since
1013 # it breaks on non-MMU systems. See kernel commit
1014 # b4caecd48005fbed3949dde6c1cb233142fd69e9
1016 AC_DEFUN([LC_HAVE_BDI_CAP_MAP_COPY], [
1017 LB_CHECK_COMPILE([if have 'BDI_CAP_MAP_COPY'],
1019 #include <linux/backing-dev.h>
1021 struct backing_dev_info info;
1023 info.capabilities = BDI_CAP_MAP_COPY;
1025 AC_DEFINE(HAVE_BDI_CAP_MAP_COPY, 1,
1026 [BDI_CAP_MAP_COPY exist])
1028 ]) # LC_HAVE_BDI_CAP_MAP_COPY
1033 # 4.1 kernel has iov_iter_rw
1035 AC_DEFUN([LC_IOV_ITER_RW], [
1036 LB_CHECK_COMPILE([if iov_iter_rw exist],
1038 #include <linux/fs.h>
1039 #include <linux/uio.h>
1041 struct iov_iter *iter = NULL;
1045 AC_DEFINE(HAVE_IOV_ITER_RW, 1,
1046 [iov_iter_rw exist])
1051 # LC_HAVE_SYNC_READ_WRITE
1053 # 4.1 new_sync_[read|write] no longer exported
1055 AC_DEFUN([LC_HAVE_SYNC_READ_WRITE], [
1056 LB_CHECK_EXPORT([new_sync_read], [fs/read_write.c],
1057 [AC_DEFINE(HAVE_SYNC_READ_WRITE, 1,
1058 [new_sync_[read|write] is exported by the kernel])])
1059 ]) # LC_HAVE_SYNC_READ_WRITE
1064 # 4.1 redefined bi_cnt as __bi_cnt in commit dac56212e8127dbc0
1066 AC_DEFUN([LC_HAVE___BI_CNT], [
1067 LB_CHECK_COMPILE([if Linux kernel has __bi_cnt in struct bio],
1069 #include <asm/atomic.h>
1070 #include <linux/bio.h>
1071 #include <linux/blk_types.h>
1073 struct bio bio = { };
1075 cnt = atomic_read(&bio.__bi_cnt);
1077 AC_DEFINE(HAVE___BI_CNT, 1,
1078 [struct bio has __bi_cnt])
1080 ]) # LC_HAVE___BI_CNT
1083 # LC_SYMLINK_OPS_USE_NAMEIDATA
1085 # For the 4.2+ kernels the file system internal symlink api no
1086 # longer uses struct nameidata as a argument
1088 AC_DEFUN([LC_SYMLINK_OPS_USE_NAMEIDATA], [
1089 LB_CHECK_COMPILE([if symlink inode operations have struct nameidata argument],
1090 symlink_use_nameidata, [
1091 #include <linux/namei.h>
1092 #include <linux/fs.h>
1094 struct nameidata *nd = NULL;
1096 ((struct inode_operations *)0)->follow_link(NULL, nd);
1097 ((struct inode_operations *)0)->put_link(NULL, nd, NULL);
1099 AC_DEFINE(HAVE_SYMLINK_OPS_USE_NAMEIDATA, 1,
1100 [symlink inode operations need struct nameidata argument])
1102 ]) # LC_SYMLINK_OPS_USE_NAMEIDATA
1105 # LC_BIO_ENDIO_USES_ONE_ARG
1107 # 4.2 kernel bio_endio now only takes one argument
1109 AC_DEFUN([LC_BIO_ENDIO_USES_ONE_ARG], [
1110 LB_CHECK_COMPILE([if 'bio_endio' with one argument exist],
1112 #include <linux/bio.h>
1116 AC_DEFINE(HAVE_BIO_ENDIO_USES_ONE_ARG, 1,
1117 [bio_endio takes only one argument])
1119 ]) # LC_BIO_ENDIO_USES_ONE_ARG
1122 # LC_ACCOUNT_PAGE_DIRTIED_3ARGS
1124 # 4.2 [to 4.5] kernel page dirtied takes 3 arguments
1126 AC_DEFUN([LC_ACCOUNT_PAGE_DIRTIED_3ARGS], [
1127 LB_CHECK_COMPILE([if 'account_page_dirtied' with 3 args exists],
1128 account_page_dirtied, [
1129 #include <linux/mm.h>
1131 account_page_dirtied(NULL, NULL, NULL);
1133 AC_DEFINE(HAVE_ACCOUNT_PAGE_DIRTIED_3ARGS, 1,
1134 [account_page_dirtied takes three arguments])
1136 ]) # LC_ACCOUNT_PAGE_DIRTIED_3ARGS
1139 # LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
1141 # 4.3 replace interval with interval_exp in 'struct blk_integrity'
1142 # 'struct blk_integrity_profile' is also added in this version,
1143 # thus use this to determine whether 'struct blk_integrity' has profile
1145 AC_DEFUN([LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY], [
1146 LB_CHECK_COMPILE([if 'blk_integrity.interval_exp' exist],
1147 blk_integrity_interval_exp, [
1148 #include <linux/blkdev.h>
1150 ((struct blk_integrity *)0)->interval_exp = 0;
1152 AC_DEFINE(HAVE_INTERVAL_EXP_BLK_INTEGRITY, 1,
1153 [blk_integrity.interval_exp exist])
1155 ]) # LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
1158 # LC_HAVE_CACHE_HEAD_HLIST
1160 # 4.3 kernel swiched to hlist for cache_head
1162 AC_DEFUN([LC_HAVE_CACHE_HEAD_HLIST], [
1163 LB_CHECK_COMPILE([if 'struct cache_head' has 'cache_list' field],
1164 cache_head_has_hlist, [
1165 #include <linux/sunrpc/cache.h>
1167 do {} while(sizeof(((struct cache_head *)0)->cache_list));
1169 AC_DEFINE(HAVE_CACHE_HEAD_HLIST, 1,
1170 [cache_head has hlist cache_list])
1172 ]) # LC_HAVE_CACHE_HEAD_HLIST
1175 # LC_HAVE_XATTR_HANDLER_SIMPLIFIED
1177 # Kernel version 4.3 commit e409de992e3ea3674393465f07cc71c948edd87a
1178 # simplified xattr_handler handling by passing in the handler pointer
1180 AC_DEFUN([LC_HAVE_XATTR_HANDLER_SIMPLIFIED], [
1181 tmp_flags="$EXTRA_KCFLAGS"
1182 EXTRA_KCFLAGS="-Werror"
1183 LB_CHECK_COMPILE([if 'struct xattr_handler' functions pass in handler pointer],
1184 xattr_handler_simplified, [
1185 #include <linux/xattr.h>
1187 struct xattr_handler handler;
1189 ((struct xattr_handler *)0)->get(&handler, NULL, NULL, NULL, 0);
1190 ((struct xattr_handler *)0)->set(&handler, NULL, NULL, NULL, 0, 0);
1192 AC_DEFINE(HAVE_XATTR_HANDLER_SIMPLIFIED, 1, [handler pointer is parameter])
1194 EXTRA_KCFLAGS="$tmp_flags"
1195 ]) # LC_HAVE_XATTR_HANDLER_SIMPLIFIED
1198 # LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
1200 # 4.3 replace interval with interval_exp in 'struct blk_integrity'.
1202 AC_DEFUN([LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD], [
1203 LB_CHECK_COMPILE([if 'bio_integrity_payload.bip_iter' exist],
1204 bio_integrity_payload_bip_iter, [
1205 #include <linux/bio.h>
1207 ((struct bio_integrity_payload *)0)->bip_iter.bi_size = 0;
1209 AC_DEFINE(HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD, 1,
1210 [bio_integrity_payload.bip_iter exist])
1212 ]) # LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
1215 # LC_BIO_INTEGRITY_PREP_FN
1217 # Lustre kernel patch extents bio_integrity_prep to accept optional
1218 # generate/verify_fn as extra args.
1220 AC_DEFUN([LC_BIO_INTEGRITY_PREP_FN], [
1221 LB_CHECK_COMPILE([if 'bio_integrity_prep_fn' exists],
1222 bio_integrity_prep_fn, [
1223 #include <linux/bio.h>
1225 bio_integrity_prep_fn(NULL, NULL, NULL);
1227 AC_DEFINE(HAVE_BIO_INTEGRITY_PREP_FN, 1,
1228 [kernel has bio_integrity_prep_fn])
1229 AC_SUBST(PATCHED_INTEGRITY_INTF)
1231 AC_SUBST(PATCHED_INTEGRITY_INTF, [#])
1233 ]) # LC_BIO_INTEGRITY_PREP_FN
1238 # 4.4/4.8 redefined bi_rw as bi_opf (SLES12/kernel commit 4382e33ad37486)
1240 AC_DEFUN([LC_HAVE_BI_OPF], [
1241 LB_CHECK_COMPILE([if Linux kernel has bi_opf in struct bio],
1243 #include <linux/bio.h>
1249 AC_DEFINE(HAVE_BI_OPF, 1,
1250 [struct bio has bi_opf])
1255 # LC_HAVE_SUBMIT_BIO_2ARGS
1257 # 4.4 removed an argument from submit_bio
1259 AC_DEFUN([LC_HAVE_SUBMIT_BIO_2ARGS], [
1260 LB_CHECK_COMPILE([if submit_bio takes two arguments],
1261 have_submit_bio_2args, [
1262 #include <linux/bio.h>
1265 submit_bio(READ, &bio);
1267 AC_DEFINE(HAVE_SUBMIT_BIO_2ARGS, 1,
1268 [submit_bio takes two arguments])
1270 ]) # LC_HAVE_SUBMIT_BIO_2_ARGS
1273 # LC_HAVE_CLEAN_BDEV_ALIASES
1275 # 4.4/4.9 unmap_underlying_metadata was replaced by clean_bdev_aliases
1276 # (SLES12/kernel commit 29f3ad7d8380364c)
1278 AC_DEFUN([LC_HAVE_CLEAN_BDEV_ALIASES], [
1279 LB_CHECK_COMPILE([if kernel has clean_bdev_aliases],
1280 have_clean_bdev_aliases, [
1281 #include <linux/buffer_head.h>
1283 struct block_device bdev;
1284 clean_bdev_aliases(&bdev,1,1);
1286 AC_DEFINE(HAVE_CLEAN_BDEV_ALIASES, 1,
1287 [kernel has clean_bdev_aliases])
1289 ]) # LC_HAVE_CLEAN_BDEV_ALIASES
1292 # LC_HAVE_LOCKS_LOCK_FILE_WAIT
1294 # 4.4 kernel have moved locks API users to
1295 # locks_lock_inode_wait()
1297 AC_DEFUN([LC_HAVE_LOCKS_LOCK_FILE_WAIT], [
1298 LB_CHECK_COMPILE([if 'locks_lock_file_wait' exists],
1299 locks_lock_file_wait, [
1300 #include <linux/fs.h>
1302 locks_lock_file_wait(NULL, NULL);
1304 AC_DEFINE(HAVE_LOCKS_LOCK_FILE_WAIT, 1,
1305 [kernel has locks_lock_file_wait])
1307 ]) # LC_HAVE_LOCKS_LOCK_FILE_WAIT
1310 # LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
1312 # 4.4 kernel merged type-specific data with the payload data for keys
1314 AC_DEFUN([LC_HAVE_KEY_PAYLOAD_DATA_ARRAY], [
1315 LB_CHECK_COMPILE([if 'struct key' has 'payload.data' as an array],
1316 key_payload_data_array, [
1317 #include <linux/key.h>
1319 struct key key = { };
1321 key.payload.data[0] = NULL;
1323 AC_DEFINE(HAVE_KEY_PAYLOAD_DATA_ARRAY, 1, [payload.data is an array])
1325 ]) #LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
1328 # LC_HAVE_XATTR_HANDLER_NAME
1330 # Kernel version 4.4 commit 98e9cb5711c68223f0e4d5201b9a6add255ec550
1331 # add a name member to struct xattr_handler
1333 AC_DEFUN([LC_HAVE_XATTR_HANDLER_NAME], [
1334 tmp_flags="$EXTRA_KCFLAGS"
1335 EXTRA_KCFLAGS="-Werror"
1336 LB_CHECK_COMPILE([if 'struct xattr_handler' has a name member],
1337 xattr_handler_name, [
1338 #include <linux/xattr.h>
1340 ((struct xattr_handler *)NULL)->name = NULL;
1342 AC_DEFINE(HAVE_XATTR_HANDLER_NAME, 1, [xattr_handler has a name member])
1344 EXTRA_KCFLAGS="$tmp_flags"
1345 ]) # LC_HAVE_XATTR_HANDLER_NAME
1348 # LC_HAVE_FILE_DENTRY
1350 # 4.5 adds wrapper file_dentry
1352 AC_DEFUN([LC_HAVE_FILE_DENTRY], [
1353 LB_CHECK_COMPILE([if Linux kernel has 'file_dentry'],
1355 #include <linux/fs.h>
1359 AC_DEFINE(HAVE_FILE_DENTRY, 1,
1360 [kernel has file_dentry])
1362 ]) # LC_HAVE_FILE_DENTRY
1365 # LC_HAVE_INODE_LOCK
1367 # 4.5 introduced inode_lock
1369 AC_DEFUN([LC_HAVE_INODE_LOCK], [
1370 LB_CHECK_COMPILE([if 'inode_lock' is defined],
1372 #include <linux/fs.h>
1376 AC_DEFINE(HAVE_INODE_LOCK, 1,
1377 [inode_lock is defined])
1379 ]) # LC_HAVE_INODE_LOCK
1382 # LC_HAVE_IOP_GET_LINK
1384 # 4.5 vfs replaced iop->follow_link with
1387 AC_DEFUN([LC_HAVE_IOP_GET_LINK], [
1388 LB_CHECK_COMPILE([if 'iop' has 'get_link'],
1389 inode_ops_get_link, [
1390 #include <linux/fs.h>
1392 struct inode_operations iop;
1393 iop.get_link = NULL;
1395 AC_DEFINE(HAVE_IOP_GET_LINK, 1,
1396 [have iop get_link])
1398 ]) # LC_HAVE_IOP_GET_LINK
1401 # LC_HAVE_IN_COMPAT_SYSCALL
1403 # 4.6 renamed is_compat_task to in_compat_syscall
1405 AC_DEFUN([LC_HAVE_IN_COMPAT_SYSCALL], [
1406 LB_CHECK_COMPILE([if 'in_compat_syscall' is defined],
1407 in_compat_syscall, [
1408 #include <linux/compat.h>
1410 in_compat_syscall();
1412 AC_DEFINE(HAVE_IN_COMPAT_SYSCALL, 1,
1413 [have in_compat_syscall])
1415 ]) # LC_HAVE_IN_COMPAT_SYSCALL
1418 # LC_HAVE_XATTR_HANDLER_INODE_PARAM
1420 # Kernel version 4.6 commit b296821a7c42fa58baa17513b2b7b30ae66f3336
1421 # and commit 5930122683dff58f0846b0f0405b4bd598a3ba6a added inode parameter
1422 # to xattr_handler functions
1424 AC_DEFUN([LC_HAVE_XATTR_HANDLER_INODE_PARAM], [
1425 tmp_flags="$EXTRA_KCFLAGS"
1426 EXTRA_KCFLAGS="-Werror"
1427 LB_CHECK_COMPILE([if 'struct xattr_handler' functions have inode parameter],
1428 xattr_handler_inode_param, [
1429 #include <linux/xattr.h>
1431 const struct xattr_handler handler;
1433 ((struct xattr_handler *)0)->get(&handler, NULL, NULL, NULL, NULL, 0);
1434 ((struct xattr_handler *)0)->set(&handler, NULL, NULL, NULL, NULL, 0, 0);
1436 AC_DEFINE(HAVE_XATTR_HANDLER_INODE_PARAM, 1, [needs inode parameter])
1438 EXTRA_KCFLAGS="$tmp_flags"
1439 ]) # LC_HAVE_XATTR_HANDLER_INODE_PARAM
1444 # Kernel version 4.6 commit 85c7f81041d57cfe9dc97f4680d5586b54534a39
1445 # introduced parallel lookups in the VFS layer. The inline function
1446 # d_in_lookup was added to notify when the same item was being queried
1449 AC_DEFUN([LC_D_IN_LOOKUP], [
1450 tmp_flags="$EXTRA_KCFLAGS"
1451 EXTRA_KCFLAGS="-Werror"
1452 LB_CHECK_COMPILE([if 'd_in_lookup' is defined],
1454 #include <linux/dcache.h>
1458 AC_DEFINE(HAVE_D_IN_LOOKUP, 1, [d_in_lookup is defined])
1460 EXTRA_KCFLAGS="$tmp_flags"
1464 # LC_LOCK_PAGE_MEMCG
1466 # Kernel version 4.6 adds lock_page_memcg
1468 AC_DEFUN([LC_LOCK_PAGE_MEMCG], [
1469 LB_CHECK_COMPILE([if 'lock_page_memcg' is defined],
1471 #include <linux/memcontrol.h>
1473 lock_page_memcg(NULL);
1475 AC_DEFINE(HAVE_LOCK_PAGE_MEMCG, 1,
1476 [lock_page_memcg is defined])
1478 ]) # LC_LOCK_PAGE_MEMCG
1483 # Kernel version 4.7 commit c8b8e32d700fe943a935e435ae251364d016c497
1484 # direct-io: eliminate the offset argument to ->direct_IO
1486 AC_DEFUN([LC_DIRECTIO_2ARGS], [
1487 LB_CHECK_COMPILE([if '->direct_IO()' taken 2 arguments],
1489 #include <linux/fs.h>
1491 struct address_space_operations ops = { };
1492 struct iov_iter *iter = NULL;
1493 struct kiocb *iocb = NULL;
1496 rc = ops.direct_IO(iocb, iter);
1498 AC_DEFINE(HAVE_DIRECTIO_2ARGS, 1,
1499 [direct_IO need 2 arguments])
1501 ]) # LC_DIRECTIO_2ARGS
1504 # LC_GENERIC_WRITE_SYNC_2ARGS
1506 # Kernel version 4.7 commit dde0c2e79848298cc25621ad080d47f94dbd7cce
1507 # fs: add IOCB_SYNC and IOCB_DSYNC
1509 AC_DEFUN([LC_GENERIC_WRITE_SYNC_2ARGS], [
1510 LB_CHECK_COMPILE([if 'generic_write_sync()' taken 2 arguments],
1511 generic_write_sync_2args, [
1512 #include <linux/fs.h>
1514 struct kiocb *iocb = NULL;
1517 rc = generic_write_sync(iocb, 0);
1519 AC_DEFINE(HAVE_GENERIC_WRITE_SYNC_2ARGS, 1,
1520 [generic_write_sync need 2 arguments])
1522 ]) # LC_GENERIC_WRITE_SYNC_2ARGS
1525 # LC_FOP_ITERATE_SHARED
1527 # Kernel v4.6-rc3-29-g6192269 adds iterate_shared method to file_operations
1529 AC_DEFUN([LC_FOP_ITERATE_SHARED], [
1530 LB_CHECK_COMPILE([if 'file_operations' has 'iterate_shared'],
1531 fop_iterate_shared, [
1532 #include <linux/fs.h>
1534 struct file_operations fop;
1535 fop.iterate_shared = NULL;
1537 AC_DEFINE(HAVE_FOP_ITERATE_SHARED, 1,
1538 [file_operations has iterate_shared])
1540 ]) # LC_FOP_ITERATE_SHARED
1543 # LC_HAVE_POSIX_ACL_VALID_USER_NS
1545 # 4.8 posix_acl_valid takes struct user_namespace
1547 AC_DEFUN([LC_HAVE_POSIX_ACL_VALID_USER_NS], [
1548 LB_CHECK_COMPILE([if 'posix_acl_valid' takes 'struct user_namespace'],
1550 #include <linux/fs.h>
1551 #include <linux/posix_acl.h>
1553 posix_acl_valid((struct user_namespace*)NULL, (const struct posix_acl*)NULL);
1555 AC_DEFINE(HAVE_POSIX_ACL_VALID_USER_NS, 1,
1556 [posix_acl_valid takes struct user_namespace])
1558 ]) # LC_HAVE_POSIX_ACL_VALID_USER_NS
1561 # LC_D_COMPARE_4ARGS
1563 # Kernel version 4.8 commit 6fa67e707559303e086303aeecc9e8b91ef497d5
1564 # get rid of 'parent' argument of ->d_compare()
1566 AC_DEFUN([LC_D_COMPARE_4ARGS], [
1567 LB_CHECK_COMPILE([if 'd_compare' taken 4 arguments],
1569 #include <linux/dcache.h>
1571 ((struct dentry_operations*)0)->d_compare(NULL,0,NULL,NULL);
1573 AC_DEFINE(HAVE_D_COMPARE_4ARGS, 1,
1574 [d_compare need 4 arguments])
1576 ]) # LC_D_COMPARE_4ARGS
1579 # LC_FULL_NAME_HASH_3ARGS
1581 # Kernel version 4.8 commit 8387ff2577eb9ed245df9a39947f66976c6bcd02
1582 # vfs: make the string hashes salt the hash
1584 AC_DEFUN([LC_FULL_NAME_HASH_3ARGS], [
1585 LB_CHECK_COMPILE([if 'full_name_hash' taken 3 arguments],
1586 full_name_hash_3args, [
1587 #include <linux/stringhash.h>
1590 hash = full_name_hash(NULL,NULL,0);
1592 AC_DEFINE(HAVE_FULL_NAME_HASH_3ARGS, 1,
1593 [full_name_hash need 3 arguments])
1595 ]) # LC_FULL_NAME_HASH_3ARGS
1598 # LC_STRUCT_POSIX_ACL_XATTR
1600 # Kernel version 4.8 commit 2211d5ba5c6c4e972ba6dbc912b2897425ea6621
1601 # posix_acl: xattr representation cleanups
1603 AC_DEFUN([LC_STRUCT_POSIX_ACL_XATTR], [
1604 LB_CHECK_COMPILE([if 'struct posix_acl_xattr_{header,entry}' defined],
1605 struct_posix_acl_xattr, [
1606 #include <linux/fs.h>
1607 #include <linux/posix_acl_xattr.h>
1609 struct posix_acl_xattr_header *h = NULL;
1610 struct posix_acl_xattr_entry *e;
1611 e = (void *)(h + 1);
1613 AC_DEFINE(HAVE_STRUCT_POSIX_ACL_XATTR, 1,
1614 [struct posix_acl_xattr_{header,entry} defined])
1616 ]) # LC_STRUCT_POSIX_ACL_XATTR
1621 # Kernel version 4.8 commit fd50ecaddf8372a1d96e0daeaac0f93cf04e4d42
1622 # removed {get,set,remove}xattr inode operations
1624 AC_DEFUN([LC_IOP_XATTR], [
1625 LB_CHECK_COMPILE([if 'inode_operations' has {get,set,remove}xattr members],
1627 #include <linux/fs.h>
1629 struct inode_operations iop;
1630 iop.setxattr = NULL;
1631 iop.getxattr = NULL;
1632 iop.removexattr = NULL;
1634 AC_DEFINE(HAVE_IOP_XATTR, 1,
1635 [inode_operations has {get,set,remove}xattr members])
1642 # Kernel version 4.9 commit 81243eacfa400f5f7b89f4c2323d0de9982bb0fb
1643 # cred: simpler, 1D supplementary groups
1645 AC_DEFUN([LC_GROUP_INFO_GID], [
1646 LB_CHECK_COMPILE([if 'struct group_info' has member 'gid'],
1648 #include <linux/cred.h>
1651 p = ((struct group_info *)0)->gid;
1653 AC_DEFINE(HAVE_GROUP_INFO_GID, 1,
1654 [struct group_info has member gid])
1656 ]) # LC_GROUP_INFO_GID
1661 # Kernel version 4.9 commit 5d6c31910bc0713e37628dc0ce677dcb13c8ccf4
1662 # added __vfs_{get,set,remove}xattr helpers
1664 AC_DEFUN([LC_VFS_SETXATTR], [
1665 LB_CHECK_COMPILE([if '__vfs_setxattr' helper is available],
1667 #include <linux/xattr.h>
1669 __vfs_setxattr(NULL, NULL, NULL, NULL, 0, 0);
1671 AC_DEFINE(HAVE_VFS_SETXATTR, 1,
1672 ['__vfs_setxattr is available])
1674 ]) # LC_VFS_SETXATTR
1677 # LC_POSIX_ACL_UPDATE_MODE
1679 # Kernel version 4.9 commit 073931017b49d9458aa351605b43a7e34598caef
1680 # posix_acl: Clear SGID bit when setting file permissions
1682 AC_DEFUN([LC_POSIX_ACL_UPDATE_MODE], [
1683 LB_CHECK_COMPILE([if 'posix_acl_update_mode' exists],
1684 posix_acl_update_mode, [
1685 #include <linux/fs.h>
1686 #include <linux/posix_acl.h>
1688 posix_acl_update_mode(NULL, NULL, NULL);
1690 AC_DEFINE(HAVE_POSIX_ACL_UPDATE_MODE, 1,
1691 ['posix_acl_update_mode' is available])
1693 ]) # LC_POSIX_ACL_UPDATE_MODE
1696 # LC_IOP_GENERIC_READLINK
1698 # Kernel version 4.10 commit dfeef68862edd7d4bafe68ef7aeb5f658ef24bb5
1699 # removed generic_readlink from individual file systems
1701 AC_DEFUN([LC_IOP_GENERIC_READLINK], [
1702 LB_CHECK_COMPILE([if 'generic_readlink' still exist],
1703 inode_ops_readlink, [
1704 #include <linux/fs.h>
1706 struct inode_operations iop;
1707 iop.readlink = generic_readlink;
1709 AC_DEFINE(HAVE_IOP_GENERIC_READLINK, 1,
1710 [generic_readlink has been removed])
1712 ]) # LC_IOP_GENERIC_READLINK
1715 # LC_HAVE_VM_FAULT_ADDRESS
1717 # Kernel version 4.10 commit 1a29d85eb0f19b7d8271923d8917d7b4f5540b3e
1718 # removed virtual_address field. Need to use address field instead
1720 AC_DEFUN([LC_HAVE_VM_FAULT_ADDRESS], [
1721 LB_CHECK_COMPILE([if 'struct vm_fault' replaced virtual_address with address field],
1723 #include <linux/mm.h>
1725 struct vm_fault vmf;
1728 AC_DEFINE(HAVE_VM_FAULT_ADDRESS, 1,
1729 [virtual_address has been replaced by address field])
1731 ]) # LC_HAVE_VM_FAULT_ADDRESS
1734 # LC_INODEOPS_ENHANCED_GETATTR
1736 # Kernel version 4.11 commit a528d35e8bfcc521d7cb70aaf03e1bd296c8493f
1737 # expanded getattr to be able to get more stat information.
1739 AC_DEFUN([LC_INODEOPS_ENHANCED_GETATTR], [
1740 LB_CHECK_COMPILE([if 'inode_operations' getattr member can gather advance stats],
1742 #include <linux/fs.h>
1746 ((struct inode_operations *)1)->getattr(&path, NULL, 0, 0);
1748 AC_DEFINE(HAVE_INODEOPS_ENHANCED_GETATTR, 1,
1749 [inode_operations .getattr member function can gather advance stats])
1751 ]) # LC_INODEOPS_ENHANCED_GETATTR
1754 # LC_VM_OPERATIONS_REMOVE_VMF_ARG
1756 # Kernel version 4.11 commit 11bac80004499ea59f361ef2a5516c84b6eab675
1757 # removed struct vm_area_struct as an argument for vm_operations since
1758 # in the same kernel version struct vma_area_struct was folded into
1761 AC_DEFUN([LC_VM_OPERATIONS_REMOVE_VMF_ARG], [
1762 LB_CHECK_COMPILE([if 'struct vm_operations' removed struct vm_area_struct],
1763 vm_operations_no_vm_area_struct, [
1764 #include <linux/mm.h>
1766 struct vm_fault vmf;
1768 ((struct vm_operations_struct *)0)->fault(&vmf);
1769 ((struct vm_operations_struct *)0)->page_mkwrite(&vmf);
1771 AC_DEFINE(HAVE_VM_OPS_USE_VM_FAULT_ONLY, 1,
1772 ['struct vm_operations' remove struct vm_area_struct argument])
1774 ]) # LC_VM_OPERATIONS_REMOVE_VMF_ARG
1777 # LC_HAVE_KEY_USAGE_REFCOUNT
1779 # Kernel version 4.11 commit fff292914d3a2f1efd05ca71c2ba72a3c663201e
1780 # converted key.usage from atomic_t to refcount_t.
1782 AC_DEFUN([LC_HAVE_KEY_USAGE_REFCOUNT], [
1783 LB_CHECK_COMPILE([if 'key.usage' is refcount_t],
1784 key_usage_refcount, [
1785 #include <linux/key.h>
1787 struct key key = { };
1789 refcount_read(&key.usage);
1791 AC_DEFINE(HAVE_KEY_USAGE_REFCOUNT, 1, [key.usage is of type refcount_t])
1793 ]) #LC_HAVE_KEY_USAGE_REFCOUNT
1796 # LC_HAVE_CRYPTO_MAX_ALG_NAME_128
1798 # Kernel version 4.11 commit f437a3f477cce402dbec6537b29e9e33962c9f73
1799 # switched CRYPTO_MAX_ALG_NAME from 64 to 128.
1801 AC_DEFUN([LC_HAVE_CRYPTO_MAX_ALG_NAME_128], [
1802 LB_CHECK_COMPILE([if 'CRYPTO_MAX_ALG_NAME' is 128],
1803 crypto_max_alg_name, [
1804 #include <linux/crypto.h>
1806 #if CRYPTO_MAX_ALG_NAME != 128
1810 AC_DEFINE(HAVE_CRYPTO_MAX_ALG_NAME_128, 1,
1811 ['CRYPTO_MAX_ALG_NAME' is 128])
1813 ]) # LC_HAVE_CRYPTO_MAX_ALG_NAME_128
1816 # Kernel version 4.12 commit 47f38c539e9a42344ff5a664942075bd4df93876
1817 # CURRENT_TIME is not 64 bit time safe so it was replaced with
1820 AC_DEFUN([LC_CURRENT_TIME], [
1821 LB_CHECK_COMPILE([if CURRENT_TIME has been replaced with current_time],
1823 #include <linux/fs.h>
1827 attr.ia_atime = current_time(NULL);
1829 AC_DEFINE(HAVE_CURRENT_TIME, 1,
1830 [current_time() has replaced CURRENT_TIME])
1832 ]) # LIBCFS_CURRENT_TIME
1835 # Kernel version 4.12-rc3 85787090a21eb749d8b347eaf9ff1a455637473c
1836 # changed struct super_block s_uuid into a proper uuid_t
1838 AC_DEFUN([LC_SUPER_BLOCK_S_UUID], [
1839 LB_CHECK_COMPILE([if 'struct super_block' s_uuid is uuid_t],
1840 super_block_s_uuid, [
1841 #include <linux/fs.h>
1843 struct super_block sb;
1845 uuid_parse(NULL, &sb.s_uuid);
1847 AC_DEFINE(HAVE_S_UUID_AS_UUID_T, 1, ['s_uuid' is an uuid_t])
1849 ]) # LC_SUPER_BLOCK_S_UUID
1852 # LC_SUPER_SETUP_BDI_NAME
1854 # Kernel version 4.12 commit 9594caf216dc0fe3e318b34af0127276db661241
1855 # unified bdi handling
1857 AC_DEFUN([LC_SUPER_SETUP_BDI_NAME], [
1858 LB_CHECK_COMPILE([if 'super_setup_bdi_name' exist],
1859 super_setup_bdi_name, [
1860 #include <linux/fs.h>
1862 super_setup_bdi_name(NULL, "lustre");
1864 AC_DEFINE(HAVE_SUPER_SETUP_BDI_NAME, 1,
1865 ['super_setup_bdi_name' is available])
1867 ]) # LC_SUPER_SETUP_BDI_NAME
1872 # 4.12 replace bi_error to bi_status
1874 AC_DEFUN([LC_BI_STATUS], [
1875 LB_CHECK_COMPILE([if 'bi_status' exist],
1877 #include <linux/blk_types.h>
1879 ((struct bio *)0)->bi_status = 0;
1881 AC_DEFINE(HAVE_BI_STATUS, 1,
1882 ['bi_status' is available])
1887 # LC_BIO_INTEGRITY_ENABLED
1889 # 4.13 removed bio_integrity_enabled
1891 AC_DEFUN([LC_BIO_INTEGRITY_ENABLED], [
1892 LB_CHECK_COMPILE([if 'bio_integrity_enabled' exist],
1893 bio_integrity_enabled, [
1894 #include <linux/bio.h>
1896 bio_integrity_enabled(NULL);
1898 AC_DEFINE(HAVE_BIO_INTEGRITY_ENABLED, 1,
1899 ['bio_integrity_enabled' is available])
1901 ]) # LC_BIO_INTEGRITY_ENABLED
1904 # LC_PAGEVEC_INIT_ONE_PARAM
1906 # 4.14 pagevec_init takes one parameter
1908 AC_DEFUN([LC_PAGEVEC_INIT_ONE_PARAM], [
1909 LB_CHECK_COMPILE([if 'pagevec_init' takes one parameter],
1911 #include <linux/pagevec.h>
1915 AC_DEFINE(HAVE_PAGEVEC_INIT_ONE_PARAM, 1,
1916 ['pagevec_init' takes one parameter])
1918 ]) # LC_PAGEVEC_INIT_ONE_PARAM
1923 # 4.14 replaced bi_bdev to bi_disk
1925 AC_DEFUN([LC_BI_BDEV], [
1926 LB_CHECK_COMPILE([if 'bi_bdev' exist],
1928 #include <linux/bio.h>
1930 ((struct bio *)0)->bi_bdev = NULL;
1932 AC_DEFINE(HAVE_BI_BDEV, 1,
1933 ['bi_bdev' is available])
1940 # kernel 4.17 commit b93b016313b3ba8003c3b8bb71f569af91f19fc7
1942 AC_DEFUN([LC_I_PAGES], [
1943 LB_CHECK_COMPILE([if struct address_space has i_pages],
1945 #include <linux/fs.h>
1947 struct address_space mapping = {};
1950 i_pages = &mapping.i_pages;
1952 AC_DEFINE(HAVE_I_PAGES, 1,
1953 [struct address_space has i_pages])
1960 # kernel 4.17 commit 3d3539018d2cbd12e5af4a132636ee7fd8d43ef0
1961 # mm: create the new vm_fault_t type
1963 AC_DEFUN([LC_VM_FAULT_T], [
1964 LB_CHECK_COMPILE([if vm_fault_t type exists],
1966 #include <linux/mm_types.h>
1968 vm_fault_t x = VM_FAULT_SIGBUS;
1971 AC_DEFINE(HAVE_VM_FAULT_T, 1,
1972 [if vm_fault_t type exists])
1977 # LC_INODE_TIMESPEC64
1979 # kernel 4.17-rc7 commit 8efd6894ff089adeeac7cb9f32125b85d963d1bc
1980 # fs: add timespec64_truncate()
1981 # kernel 4.18 commit 95582b00838837fc07e042979320caf917ce3fe6
1982 # inode timestamps switched to timespec64
1983 # kernel 4.19-rc2 commit 976516404ff3fab2a8caa8bd6f5efc1437fed0b8
1984 # y2038: remove unused time interfaces
1988 # When inode times are timespec64 stop using the deprecated
1991 AC_DEFUN([LC_INODE_TIMESPEC64], [
1992 tmp_flags="$EXTRA_KCFLAGS"
1993 EXTRA_KCFLAGS="-Werror"
1994 LB_CHECK_COMPILE([if inode timestamps are struct timespec64],
1996 #include <linux/fs.h>
1998 struct inode *inode = NULL;
1999 struct timespec64 ts = {};
2001 inode->i_atime = timespec64_trunc(ts, 1);
2004 AC_DEFINE(HAVE_INODE_TIMESPEC64, 1,
2005 [inode times are using timespec64])
2007 EXTRA_KCFLAGS="$tmp_flags"
2008 ]) # LC_INODE_TIMESPEC64
2012 # kernel 4.19-rc6 commit 3159f943aafdbacb2f94c38fdaadabf2bbde2a14
2013 # xarray: Replace exceptional entries
2016 AC_DEFUN([LC_XA_IS_VALUE], [
2017 LB_CHECK_COMPILE([xa_is_value exist],
2019 #include <linux/xarray.h>
2023 AC_DEFINE(HAVE_XA_IS_VALUE, 1, [xa_is_value exist])
2030 # kernel 4.20 commit v4.19-rc5-248-g9b89a0355144
2031 # xarray: Add XArray marks
2033 AC_DEFUN([LC___XA_SET_MARK], [
2034 LB_CHECK_COMPILE([if '__xa_set_mark' exists],
2036 #include <linux/xarray.h>
2037 #include <linux/fs.h>
2039 struct xarray *xa = NULL;
2041 __xa_set_mark(xa, 0, PAGECACHE_TAG_DIRTY);
2043 AC_DEFINE(HAVE___XA_SET_MARK, 1,
2044 [__xa_set_mark exists])
2046 ]) # LC___XA_SET_MARK
2049 # LC_UAPI_LINUX_MOUNT_H
2051 # kernel 4.20 commit e262e32d6bde0f77fb0c95d977482fc872c51996
2052 # vfs: Suppress MS_* flag defs within the kernel ...
2054 AC_DEFUN([LC_UAPI_LINUX_MOUNT_H], [
2055 tmp_flags="$EXTRA_KCFLAGS"
2056 EXTRA_KCFLAGS="-Werror"
2057 LB_CHECK_COMPILE([if MS_RDONLY was moved to uapi/linux/mount.h],
2059 #include <uapi/linux/mount.h>
2064 AC_DEFINE(HAVE_UAPI_LINUX_MOUNT_H, 1,
2065 [if MS_RDONLY was moved to uapi/linux/mount.h])
2067 EXTRA_KCFLAGS="$tmp_flags"
2068 ]) # LC_UAPI_LINUX_MOUNT_H
2071 # LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
2073 # kernel 4.20 commit 1863d77f15da0addcd293a1719fa5d3ef8cde3ca
2074 # SUNRPC: Replace the cache_detail->hash_lock with a regular spinlock
2076 # Now that the reader functions are all RCU protected, use a regular
2077 # spinlock rather than a reader/writer lock.
2079 AC_DEFUN([LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK], [
2080 tmp_flags="$EXTRA_KCFLAGS"
2081 EXTRA_KCFLAGS="-Werror"
2082 LB_CHECK_COMPILE([if cache_detail->hash_lock is a spinlock],
2083 hash_lock_isa_spinlock_t, [
2084 #include <linux/sunrpc/cache.h>
2086 spinlock_t *lock = &(((struct cache_detail *)0)->hash_lock);
2089 AC_DEFINE(HAVE_CACHE_HASH_SPINLOCK, 1,
2090 [if cache_detail->hash_lock is a spinlock])
2092 EXTRA_KCFLAGS="$tmp_flags"
2093 ]) # LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
2096 # LC_HAS_LINUX_SELINUX_ENABLED
2098 # kernel 5.1 commit 3d252529480c68bfd6a6774652df7c8968b28e41
2099 # SELinux: Remove unused selinux_is_enabled
2101 AC_DEFUN([LC_HAS_LINUX_SELINUX_ENABLED], [
2102 tmp_flags="$EXTRA_KCFLAGS"
2103 EXTRA_KCFLAGS="-Werror"
2104 LB_CHECK_COMPILE([if linux/selinux.h exists],
2105 selinux_is_enabled, [
2106 #include <linux/selinux.h>
2108 bool has_selinux = selinux_is_enabled();
2111 AC_DEFINE(HAVE_LINUX_SELINUX_IS_ENABLED, 1,
2112 [if linux/selinux.h exists])
2114 EXTRA_KCFLAGS="$tmp_flags"
2115 ]) # LC_HAS_LINUX_SELINUX_ENABLED
2118 # LC_ACCOUNT_PAGE_DIRTIED
2120 # After 5.2 kernel page dirtied is not exported
2122 AC_DEFUN([LC_ACCOUNT_PAGE_DIRTIED], [
2123 LB_CHECK_EXPORT([account_page_dirtied], [mm/page-writeback.c],
2124 [AC_DEFINE(HAVE_ACCOUNT_PAGE_DIRTIED_EXPORT, 1,
2125 [account_page_dirtied is exported])])
2126 ]) # LC_ACCOUNT_PAGE_DIRTIED
2129 # LC_BIO_BI_PHYS_SEGMENTS
2131 # kernel 5.3-rc1 commit 14ccb66b3f585b2bc21e7256c96090abed5a512c
2132 # block: remove the bi_phys_segments field in struct bio
2134 AC_DEFUN([LC_BIO_BI_PHYS_SEGMENTS], [
2135 tmp_flags="$EXTRA_KCFLAGS"
2136 EXTRA_KCFLAGS="-Werror"
2137 LB_CHECK_COMPILE([if struct bio has bi_phys_segments member],
2138 bye_bio_bi_phys_segments, [
2139 #include <linux/bio.h>
2141 struct bio *bio = NULL;
2142 bio->bi_phys_segments++;
2144 AC_DEFINE(HAVE_BIO_BI_PHYS_SEGMENTS, 1,
2145 [struct bio has bi_phys_segments member])
2147 EXTRA_KCFLAGS="$tmp_flags"
2148 ]) # LC_BIO_BI_PHYS_SEGMENTS
2151 # LC_LM_COMPARE_OWNER_EXISTS
2153 # kernel 5.3-rc3 commit f85d93385e9fe6886a751f647f6812a89bf6bee3
2154 # locks: Cleanup lm_compare_owner and lm_owner_key
2155 # removed lm_compare_owner
2157 AC_DEFUN([LC_LM_COMPARE_OWNER_EXISTS], [
2158 tmp_flags="$EXTRA_KCFLAGS"
2159 EXTRA_KCFLAGS="-Werror"
2160 LB_CHECK_COMPILE([if lock_manager_operations has lm_compare_owner],
2161 lock_manager_ops_lm_compare_owner, [
2162 #include <linux/fs.h>
2164 struct lock_manager_operations lm_ops;
2165 lm_ops.lm_compare_owner = NULL;
2167 AC_DEFINE(HAVE_LM_COMPARE_OWNER, 1,
2168 [lock_manager_operations has lm_compare_owner])
2170 EXTRA_KCFLAGS="$tmp_flags"
2171 ]) # LC_LM_COMPARE_OWNER_EXISTS
2176 # Lustre linux kernel checks
2178 AC_DEFUN([LC_PROG_LINUX], [
2179 AC_MSG_NOTICE([Lustre kernel checks
2180 ==============================================================================])
2185 LC_CONFIG_HEALTH_CHECK_WRITE
2186 LC_CONFIG_LRU_RESIZE
2190 LC_GLIBC_SUPPORT_FHANDLES
2195 LC_HAVE_PROJECT_QUOTA
2202 LC_HAVE_DENTRY_D_U_D_ALIAS
2203 LC_HAVE_DENTRY_D_CHILD
2204 LC_PID_NS_FOR_CHILDREN
2207 LC_OLDSIZE_TRUNCATE_PAGECACHE
2208 LC_PTR_ERR_OR_ZERO_MISSING
2210 LC_INIT_LIST_HEAD_RCU
2215 LC_HAVE_D_IS_POSITIVE
2219 LC_HAVE_TRUNCATE_IPAGES_FINAL
2220 LC_IOPS_RENAME_WITH_FLAGS
2227 LC_DIRECTIO_USE_ITER
2228 LC_HAVE_IOV_ITER_INIT_DIRECTION
2229 LC_HAVE_IOV_ITER_TRUNCATE
2230 LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
2233 LC_HAVE_INTERVAL_BLK_INTEGRITY
2237 LC_PERCPU_COUNTER_INIT
2238 LC_NFS_FILLDIR_USE_CTX
2242 LC_HAVE_DQUOT_QC_DQBLK
2243 LC_HAVE_AIO_COMPLETE
2246 LC_BACKING_DEV_INFO_REMOVAL
2247 LC_HAVE_BDI_CAP_MAP_COPY
2251 LC_HAVE_SYNC_READ_WRITE
2255 LC_BIO_ENDIO_USES_ONE_ARG
2256 LC_SYMLINK_OPS_USE_NAMEIDATA
2257 LC_ACCOUNT_PAGE_DIRTIED_3ARGS
2260 LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
2261 LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
2262 LC_HAVE_CACHE_HEAD_HLIST
2263 LC_HAVE_XATTR_HANDLER_SIMPLIFIED
2266 LC_HAVE_LOCKS_LOCK_FILE_WAIT
2267 LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
2268 LC_HAVE_XATTR_HANDLER_NAME
2270 LC_HAVE_SUBMIT_BIO_2ARGS
2271 LC_HAVE_CLEAN_BDEV_ALIASES
2278 LC_HAVE_IOP_GET_LINK
2281 LC_HAVE_IN_COMPAT_SYSCALL
2282 LC_HAVE_XATTR_HANDLER_INODE_PARAM
2288 LC_GENERIC_WRITE_SYNC_2ARGS
2289 LC_FOP_ITERATE_SHARED
2292 LC_HAVE_POSIX_ACL_VALID_USER_NS
2294 LC_FULL_NAME_HASH_3ARGS
2295 LC_STRUCT_POSIX_ACL_XATTR
2301 LC_POSIX_ACL_UPDATE_MODE
2304 LC_IOP_GENERIC_READLINK
2305 LC_HAVE_VM_FAULT_ADDRESS
2308 LC_INODEOPS_ENHANCED_GETATTR
2309 LC_VM_OPERATIONS_REMOVE_VMF_ARG
2310 LC_HAVE_KEY_USAGE_REFCOUNT
2311 LC_HAVE_CRYPTO_MAX_ALG_NAME_128
2315 LC_SUPER_BLOCK_S_UUID
2316 LC_SUPER_SETUP_BDI_NAME
2320 LC_BIO_INTEGRITY_ENABLED
2323 LC_PAGEVEC_INIT_ONE_PARAM
2336 LC_UAPI_LINUX_MOUNT_H
2337 LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
2338 LC_REPLACE_EXCEPTIONAL_ENTRIES
2341 LC_HAS_LINUX_SELINUX_ENABLED
2344 LC_ACCOUNT_PAGE_DIRTIED
2347 LC_BIO_BI_PHYS_SEGMENTS
2348 LC_LM_COMPARE_OWNER_EXISTS
2350 # kernel patch to extend integrity interface
2351 LC_BIO_INTEGRITY_PREP_FN
2354 AS_IF([test "x$enable_server" != xno], [
2364 # Check whether to build the client side of Lustre
2366 AC_DEFUN([LC_CONFIG_CLIENT], [
2367 AC_MSG_CHECKING([whether to build Lustre client support])
2368 AC_ARG_ENABLE([client],
2369 AC_HELP_STRING([--disable-client],
2370 [disable Lustre client support]),
2371 [], [enable_client="yes"])
2372 AC_MSG_RESULT([$enable_client])
2373 ]) # LC_CONFIG_CLIENT
2378 AC_DEFUN([LB_CONFIG_MPITESTS], [
2379 AC_ARG_ENABLE([mpitests],
2380 AC_HELP_STRING([--enable-mpitests=<yes|no|mpicc wrapper>],
2381 [include mpi tests]), [
2382 enable_mpitests="yes"
2385 MPICC_WRAPPER="mpicc"
2386 MPI_BIN=$(eval which $MPICC_WRAPPER | xargs dirname)
2389 enable_mpitests="no"
2393 MPICC_WRAPPER=$enableval
2394 MPI_BIN=$(eval echo $MPICC_WRAPPER | xargs dirname)
2398 enable_mpitests="yes"
2399 MPICC_WRAPPER="mpicc"
2400 MPI_BIN=$(eval which $MPICC_WRAPPER | xargs dirname)
2403 if test "x$enable_mpitests" != "xno"; then
2406 AC_CACHE_CHECK([whether mpitests can be built],
2407 lb_cv_mpi_tests, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([
2411 MPI_Initialized(&flag);
2414 ])], [lb_cv_mpi_tests="yes"], [lb_cv_mpi_tests="no"])
2416 enable_mpitests=$lb_cv_mpi_tests
2420 AC_SUBST(MPICC_WRAPPER)
2421 ]) # LB_CONFIG_MPITESTS
2426 # whether to enable quota support global control
2428 AC_DEFUN([LC_CONFIG_QUOTA], [
2429 AC_MSG_CHECKING([whether to enable quota support global control])
2430 AC_ARG_ENABLE([quota],
2431 AC_HELP_STRING([--enable-quota],
2432 [enable quota support]),
2433 [], [enable_quota="yes"])
2434 AS_IF([test "x$enable_quota" = xyes],
2435 [AC_MSG_RESULT([yes])],
2436 [AC_MSG_RESULT([no])])
2437 ]) # LC_CONFIG_QUOTA
2442 AC_DEFUN([LC_QUOTA], [
2446 AS_IF([test "x$enable_quota" != xno -a "x$enable_utils" != xno], [
2447 AC_CHECK_HEADER([sys/quota.h],
2448 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1,
2449 [Define to 1 if you have <sys/quota.h>.])],
2450 [AC_MSG_ERROR([don't find <sys/quota.h> in your system])])
2457 # configure support for optional OSD implementation
2459 AC_DEFUN([LC_OSD_ADDON], [
2460 AC_MSG_CHECKING([whether to use OSD addon])
2462 AC_HELP_STRING([--with-osd=path],
2463 [set path to optional osd]),
2470 OSDADDON="$with_osd"
2477 AS_IF([test $ENABLEOSDADDON -eq 0], [
2481 OSDMODNAME=$(basename $OSDADDON)
2482 AS_IF([test -e $LUSTRE/$OSDMODNAME], [
2483 AC_MSG_RESULT([can't link])
2485 ], [ln -s $OSDADDON $LUSTRE/$OSDMODNAME], [
2486 AC_MSG_RESULT([$OSDMODNAME])
2487 OSDADDON="obj-m += $OSDMODNAME/"
2489 AC_MSG_RESULT([can't link])
2499 # other configure checks
2501 AC_DEFUN([LC_CONFIGURE], [
2502 AC_MSG_NOTICE([Lustre core checks
2503 ==============================================================================])
2505 AS_IF([test $target_cpu == "i686" -o $target_cpu == "x86_64"],
2506 [CFLAGS="$CFLAGS -Wall -Werror"])
2508 # maximum MDS thread count
2511 # lustre/utils/gss/gss_util.c
2512 # lustre/utils/gss/gssd_proc.c
2513 # lustre/utils/gss/krb5_util.c
2514 # lustre/utils/llog_reader.c
2515 # lustre/utils/create_iam.c
2516 # lustre/utils/libiam.c
2517 AC_CHECK_HEADERS([netdb.h endian.h])
2518 AC_CHECK_FUNCS([gethostbyname])
2520 # lustre/utils/llverfs.c
2521 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
2523 # lustre/utils/lfs.c
2524 AS_IF([test "$enable_dist" = "no"], [
2525 AC_CHECK_LIB([z], [crc32], [
2526 AC_CHECK_HEADER([zlib.h], [], [
2527 AC_MSG_ERROR([zlib.h not found.])])
2530 zlib library not found. Please install zlib development package.])
2536 AC_CHECK_LIB([selinux], [is_selinux_enabled],
2537 [AC_CHECK_HEADERS([selinux/selinux.h],
2538 [SELINUX="-lselinux"
2539 AC_DEFINE([HAVE_SELINUX], 1,
2540 [support for selinux ])],
2543 No libselinux-devel package found, unable to build selinux enabled tools
2548 No selinux package found, unable to build selinux enabled tools
2554 AC_MSG_CHECKING([whether to report minimum OST free space])
2555 AC_ARG_ENABLE([mindf],
2556 AC_HELP_STRING([--enable-mindf],
2557 [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
2558 [], [enable_mindf="no"])
2559 AC_MSG_RESULT([$enable_mindf])
2560 AS_IF([test "$enable_mindf" = "yes"],
2561 [AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])])
2563 AC_MSG_CHECKING([whether to randomly failing memory alloc])
2564 AC_ARG_ENABLE([fail_alloc],
2565 AC_HELP_STRING([--disable-fail-alloc],
2566 [disable randomly alloc failure]),
2567 [], [enable_fail_alloc="yes"])
2568 AC_MSG_RESULT([$enable_fail_alloc])
2569 AS_IF([test "x$enable_fail_alloc" != xno],
2570 [AC_DEFINE([RANDOM_FAIL_ALLOC], 1,
2571 [enable randomly alloc failure])])
2573 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
2574 AC_ARG_ENABLE([invariants],
2575 AC_HELP_STRING([--enable-invariants],
2576 [enable invariant checking (cpu intensive)]),
2577 [], [enable_invariants="no"])
2578 AC_MSG_RESULT([$enable_invariants])
2579 AS_IF([test "x$enable_invariants" = xyes],
2580 [AC_DEFINE([CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK], 1,
2581 [enable invariant checking])])
2583 AC_MSG_CHECKING([whether to track references with lu_ref])
2584 AC_ARG_ENABLE([lu_ref],
2585 AC_HELP_STRING([--enable-lu_ref],
2586 [enable lu_ref reference tracking code]),
2587 [], [enable_lu_ref="no"])
2588 AC_MSG_RESULT([$enable_lu_ref])
2589 AS_IF([test "x$enable_lu_ref" = xyes],
2590 [AC_DEFINE([USE_LU_REF], 1,
2591 [enable lu_ref reference tracking code])])
2593 AC_MSG_CHECKING([whether to enable page state tracking])
2594 AC_ARG_ENABLE([pgstate-track],
2595 AC_HELP_STRING([--enable-pgstate-track],
2596 [enable page state tracking]),
2597 [], [enable_pgstat_track="no"])
2598 AC_MSG_RESULT([$enable_pgstat_track])
2599 AS_IF([test "x$enable_pgstat_track" = xyes],
2600 [AC_DEFINE([CONFIG_DEBUG_PAGESTATE_TRACKING], 1,
2601 [enable page state tracking code])])
2604 AC_MSG_CHECKING([systemd unit file directory])
2605 AC_ARG_WITH([systemdsystemunitdir],
2606 [AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
2607 [Directory for systemd service files])],
2608 [], [with_systemdsystemunitdir=auto])
2609 AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"],
2610 [def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
2611 AS_IF([test "x$def_systemdsystemunitdir" = "x"],
2612 [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
2613 [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
2614 with_systemdsystemunitdir=no],
2615 [with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
2616 AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
2617 [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
2618 AC_MSG_RESULT([$with_systemdsystemunitdir])
2620 AC_MSG_CHECKING([bash-completion directory])
2621 AC_ARG_WITH([bash-completion-dir],
2622 AS_HELP_STRING([--with-bash-completion-dir[=PATH]],
2623 [Install the bash auto-completion script in this directory.]),
2625 [with_bash_completion_dir=yes])
2626 AS_IF([test "x$with_bash_completion_dir" = "xyes"], [
2627 BASH_COMPLETION_DIR="`pkg-config --variable=completionsdir bash-completion`"
2628 AS_IF([test "x$BASH_COMPLETION_DIR" = "x"], [
2629 [BASH_COMPLETION_DIR="$datadir/bash-completion/completions"]
2632 BASH_COMPLETION_DIR="$with_bash_completion_dir"
2634 AC_SUBST([BASH_COMPLETION_DIR])
2635 AC_MSG_RESULT([$BASH_COMPLETION_DIR])
2641 # AM_CONDITIONALS for lustre
2643 AC_DEFUN([LC_CONDITIONALS], [
2644 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
2645 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
2646 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
2647 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
2648 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
2649 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
2650 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
2651 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
2652 AM_CONDITIONAL(GSS_SSK, test x$enable_ssk = xyes)
2653 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
2654 AM_CONDITIONAL(HAVE_SYSTEMD, test "x$with_systemdsystemunitdir" != "xno")
2655 AM_CONDITIONAL(ENABLE_BASH_COMPLETION, test "x$with_bash_completion_dir" != "xno")
2656 AM_CONDITIONAL(XATTR_HANDLER, test "x$lb_cv_compile_xattr_handler_flags" = xyes)
2657 AM_CONDITIONAL(SELINUX, test "$SELINUX" = "-lselinux")
2658 AM_CONDITIONAL(GETSEPOL, test x$enable_getsepol = xyes)
2659 ]) # LC_CONDITIONALS
2664 # files that should be generated with AC_OUTPUT
2666 AC_DEFUN([LC_CONFIG_FILES],
2670 lustre/autoconf/Makefile
2671 lustre/conf/Makefile
2672 lustre/conf/resource/Makefile
2673 lustre/contrib/Makefile
2675 lustre/include/Makefile
2676 lustre/include/lustre/Makefile
2677 lustre/include/uapi/linux/lustre/Makefile
2678 lustre/kernel_patches/targets/4.18-rhel8.1.target
2679 lustre/kernel_patches/targets/4.18-rhel8.target
2680 lustre/kernel_patches/targets/3.10-rhel7.7.target
2681 lustre/kernel_patches/targets/3.10-rhel7.6.target
2682 lustre/kernel_patches/targets/3.10-rhel7.5.target
2683 lustre/kernel_patches/targets/4.14-rhel7.5.target
2684 lustre/kernel_patches/targets/4.14-rhel7.6.target
2685 lustre/kernel_patches/targets/3.0-sles11.target
2686 lustre/kernel_patches/targets/3.0-sles11sp3.target
2687 lustre/kernel_patches/targets/3.0-sles11sp4.target
2688 lustre/kernel_patches/targets/3.12-sles12.target
2689 lustre/kernel_patches/targets/4.4-sles12.target
2690 lustre/kernel_patches/targets/4.4-sles12sp3.target
2691 lustre/kernel_patches/targets/4.12-sles12sp4.target
2692 lustre/kernel_patches/targets/3.x-fc18.target
2693 lustre/ldlm/Makefile
2695 lustre/fid/autoMakefile
2696 lustre/llite/Makefile
2697 lustre/llite/autoMakefile
2699 lustre/lov/autoMakefile
2701 lustre/mdc/autoMakefile
2703 lustre/lmv/autoMakefile
2704 lustre/lfsck/Makefile
2705 lustre/lfsck/autoMakefile
2707 lustre/mdt/autoMakefile
2709 lustre/mdd/autoMakefile
2711 lustre/fld/autoMakefile
2712 lustre/obdclass/Makefile
2713 lustre/obdclass/autoMakefile
2714 lustre/obdecho/Makefile
2715 lustre/obdecho/autoMakefile
2717 lustre/ofd/autoMakefile
2719 lustre/osc/autoMakefile
2721 lustre/ost/autoMakefile
2722 lustre/osd-ldiskfs/Makefile
2723 lustre/osd-ldiskfs/autoMakefile
2724 lustre/osd-zfs/Makefile
2725 lustre/osd-zfs/autoMakefile
2727 lustre/mgc/autoMakefile
2729 lustre/mgs/autoMakefile
2730 lustre/target/Makefile
2731 lustre/ptlrpc/Makefile
2732 lustre/ptlrpc/autoMakefile
2733 lustre/ptlrpc/gss/Makefile
2734 lustre/ptlrpc/gss/autoMakefile
2735 lustre/quota/Makefile
2736 lustre/quota/autoMakefile
2737 lustre/scripts/Makefile
2738 lustre/scripts/systemd/Makefile
2739 lustre/tests/Makefile
2740 lustre/tests/mpi/Makefile
2741 lustre/tests/kernel/Makefile
2742 lustre/tests/kernel/autoMakefile
2743 lustre/utils/Makefile
2744 lustre/utils/gss/Makefile
2746 lustre/osp/autoMakefile
2748 lustre/lod/autoMakefile
2750 ]) # LC_CONFIG_FILES