4 # Wrapper for AC_CONFIG_SUBDIR
6 AC_DEFUN([LC_CONFIG_SRCDIR], [
7 AC_CONFIG_SRCDIR([lustre/obdclass/obdo.c])
14 # lustre specific paths
16 AC_DEFUN([LC_PATH_DEFAULTS], [
17 # ptlrpc kernel build requires this
25 demodir='$(docdir)/demo'
28 pkgexampledir='${pkgdatadir}/examples'
29 AC_SUBST(pkgexampledir)
35 # is the target os supported?
37 AC_DEFUN([LC_TARGET_SUPPORTED], [
46 ]) # LC_TARGET_SUPPORTED
49 # LC_GLIBC_SUPPORT_FHANDLES
51 AC_DEFUN([LC_GLIBC_SUPPORT_FHANDLES], [
52 AC_CHECK_FUNCS([name_to_handle_at],
53 [AC_DEFINE(HAVE_FHANDLE_GLIBC_SUPPORT, 1,
54 [file handle and related syscalls are supported])],
55 [AC_MSG_WARN([file handle and related syscalls are not supported])])
56 ]) # LC_GLIBC_SUPPORT_FHANDLES
59 # LC_GLIBC_SUPPORT_COPY_FILE_RANGE
61 AC_DEFUN([LC_GLIBC_SUPPORT_COPY_FILE_RANGE], [
62 AC_CHECK_FUNCS([copy_file_range],
63 [AC_DEFINE(HAVE_COPY_FILE_RANGE, 1,
64 [copy_file_range() is supported])],
65 [AC_MSG_WARN([copy_file_range() is not supported])])
66 ]) # LC_GLIBC_SUPPORT_COPY_FILE_RANGE
71 AC_DEFUN([LC_FID2PATH_ANON_UNION], [
72 AC_MSG_CHECKING([if 'struct getinfo_fid2path' has anony•mous union])
73 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
74 #include <linux/lustre/lustre_idl.h>
77 struct getinfo_fid2path gf;
78 struct lu_fid root_fid;
80 *gf.gf_root_fid = root_fid;
84 AC_DEFINE(HAVE_FID2PATH_ANON_UNIONS, 1, [union is unnamed])
87 ]) # LC_FID2PATH_ANON_UNION
92 AC_DEFUN([LC_IOC_REMOVE_ENTRY], [
93 AC_MSG_CHECKING([if ioctl IOC_REMOVE_ENTRY' is supported])
94 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
95 #include <sys/ioctl.h>
96 #include <linux/lustre/lustre_ioctl.h>
99 return ioctl(0, LL_IOC_REMOVE_ENTRY, NULL);
102 AC_DEFINE(HAVE_IOC_REMOVE_ENTRY, 1,
103 [IOC_REMOVE_ENTRY ioctl exists])
105 ]) # LC_IOC_REMOVE_ENTRY
110 # Ensure the stack size is at least 8k in Lustre server (all kernels)
112 AC_DEFUN([LC_STACK_SIZE], [
113 LB_CHECK_COMPILE([if stack size is at least 8k],
115 #include <linux/thread_info.h>
117 #if THREAD_SIZE < 8192
118 #error "stack size < 8192"
120 ], [], [AC_MSG_ERROR([
122 Lustre requires that Linux is configured with at least a 8KB stack.
129 # Allow the user to set the MDS thread upper limit
131 AC_DEFUN([LC_MDS_MAX_THREADS], [
132 AC_MSG_CHECKING([for maximum number of MDS threads])
133 AC_ARG_WITH([mds_max_threads],
134 AC_HELP_STRING([--with-mds-max-threads=count],
135 [maximum threads available on the MDS: (default=512)]),
136 [AC_DEFINE_UNQUOTED(MDS_MAX_THREADS, $with_mds_max_threads,
137 [maximum number of MDS threads])])
138 AC_MSG_RESULT([$with_mds_max_threads])
139 ]) # LC_MDS_MAX_THREADS
144 # the pinger is temporary, until we have the recovery node in place
146 AC_DEFUN([LC_CONFIG_PINGER], [
147 AC_MSG_CHECKING([whether to enable Lustre pinger support])
148 AC_ARG_ENABLE([pinger],
149 AC_HELP_STRING([--disable-pinger],
150 [disable recovery pinger support]),
151 [], [enable_pinger="yes"])
152 AC_MSG_RESULT([$enable_pinger])
153 AS_IF([test "x$enable_pinger" != xno],
154 [AC_DEFINE(CONFIG_LUSTRE_FS_PINGER, 1,[Use the Pinger])])
155 ]) # LC_CONFIG_PINGER
160 # do checksum of bulk data between client and OST
162 AC_DEFUN([LC_CONFIG_CHECKSUM], [
163 AC_MSG_CHECKING([whether to enable data checksum support])
164 AC_ARG_ENABLE([checksum],
165 AC_HELP_STRING([--disable-checksum],
166 [disable data checksum support]),
167 [], [enable_checksum="yes"])
168 AC_MSG_RESULT([$enable_checksum])
169 AS_IF([test "x$enable_checksum" != xno],
170 [AC_DEFINE(ENABLE_CHECKSUM, 1, [do data checksums])])
171 ]) # LC_CONFIG_CHECKSUM
176 # enable distributed flock by default
178 AC_DEFUN([LC_CONFIG_FLOCK], [
179 AC_MSG_CHECKING([whether to enable flock by default])
180 AC_ARG_ENABLE([flock],
181 AC_HELP_STRING([--disable-flock],
182 [disable flock by default]),
183 [], [enable_flock="yes"])
184 AC_MSG_RESULT([$enable_flock])
185 AS_IF([test "x$enable_flock" != xno],
186 [AC_DEFINE(ENABLE_FLOCK, 1, [enable flock by default])])
190 # LC_CONFIG_HEALTH_CHECK_WRITE
192 # Turn off the actual write to the disk
194 AC_DEFUN([LC_CONFIG_HEALTH_CHECK_WRITE], [
195 AC_MSG_CHECKING([whether to enable a write with the health check])
196 AC_ARG_ENABLE([health_write],
197 AC_HELP_STRING([--enable-health_write],
198 [enable disk writes when doing health check]),
199 [], [enable_health_write="no"])
200 AC_MSG_RESULT([$enable_health_write])
201 AS_IF([test "x$enable_health_write" != xno],
202 [AC_DEFINE(USE_HEALTH_CHECK_WRITE, 1, [Write when Checking Health])])
203 ]) # LC_CONFIG_HEALTH_CHECK_WRITE
206 # LC_CONFIG_LRU_RESIZE
208 AC_DEFUN([LC_CONFIG_LRU_RESIZE], [
209 AC_MSG_CHECKING([whether to enable lru self-adjusting])
210 AC_ARG_ENABLE([lru_resize],
211 AC_HELP_STRING([--enable-lru-resize],
212 [enable lru resize support]),
213 [], [enable_lru_resize="yes"])
214 AC_MSG_RESULT([$enable_lru_resize])
215 AS_IF([test "x$enable_lru_resize" != xno],
216 [AC_DEFINE(HAVE_LRU_RESIZE_SUPPORT, 1, [Enable lru resize support])])
217 ]) # LC_CONFIG_LRU_RESIZE
222 # Quota support. The kernel must support CONFIG_QUOTA.
224 AC_DEFUN([LC_QUOTA_CONFIG], [
225 LB_CHECK_CONFIG_IM([QUOTA], [],
228 Lustre quota requires that CONFIG_QUOTA is enabled in your kernel.
235 # fhandle kernel support for open_by_handle_at() and name_to_handle_at()
236 # system calls. The kernel must support CONFIG_FHANDLE.
238 AC_DEFUN([LC_CONFIG_FHANDLE], [
239 LB_CHECK_CONFIG_IM([FHANDLE], [],
242 Lustre fid handling requires that CONFIG_FHANDLE is enabled in your kernel.
244 ]) # LC_CONFIG_FHANDLE
247 # LC_POSIX_ACL_CONFIG
251 AC_DEFUN([LC_POSIX_ACL_CONFIG], [
252 LB_CHECK_CONFIG_IM([FS_POSIX_ACL],
253 [AC_DEFINE(CONFIG_LUSTRE_FS_POSIX_ACL, 1, [Enable POSIX acl])
255 ]) # LC_POSIX_ACL_CONFIG
257 LB_CHECK_CONFIG_IM([CRYPTO_MD5], [],
258 [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
261 # LC_CONFIG_GSS_KEYRING
263 # default 'auto', tests for dependencies, if found, enables;
264 # only called if gss is enabled
266 AC_DEFUN([LC_CONFIG_GSS_KEYRING], [
267 AC_MSG_CHECKING([whether to enable gss keyring backend])
268 AC_ARG_ENABLE([gss_keyring],
269 [AC_HELP_STRING([--disable-gss-keyring],
270 [disable gss keyring backend])],
271 [], [AS_IF([test "x$enable_gss" != xno], [
272 enable_gss_keyring="yes"], [
273 enable_gss_keyring="auto"])])
274 AC_MSG_RESULT([$enable_gss_keyring])
275 AS_IF([test "x$enable_gss_keyring" != xno], [
276 LB_CHECK_CONFIG_IM([KEYS], [], [
277 gss_keyring_conf_test="fail"
278 AC_MSG_WARN([GSS keyring backend requires that CONFIG_KEYS be enabled in your kernel.])])
280 AC_CHECK_LIB([keyutils], [keyctl_search], [], [
281 gss_keyring_conf_test="fail"
282 AC_MSG_WARN([GSS keyring backend requires libkeyutils])])
284 AS_IF([test "x$gss_keyring_conf_test" != xfail], [
285 AC_DEFINE([HAVE_GSS_KEYRING], [1],
286 [Define this if you enable gss keyring backend])
287 enable_gss_keyring="yes"
289 AS_IF([test "x$enable_gss_keyring" = xyes], [
290 AC_MSG_ERROR([Cannot enable gss_keyring. See above for details.])
297 ]) # LC_CONFIG_GSS_KEYRING
300 # LC_KEY_TYPE_INSTANTIATE_2ARGS
302 # rhel7 key_type->instantiate takes 2 args (struct key, struct key_preparsed_payload)
304 AC_DEFUN([LC_KEY_TYPE_INSTANTIATE_2ARGS], [
305 LB_CHECK_COMPILE([if 'key_type->instantiate' has two args],
306 key_type_instantiate_2args, [
307 #include <linux/key-type.h>
309 ((struct key_type *)0)->instantiate(0, NULL);
311 AC_DEFINE(HAVE_KEY_TYPE_INSTANTIATE_2ARGS, 1,
312 [key_type->instantiate has two args])
314 ]) # LC_KEY_TYPE_INSTANTIATE_2ARGS
319 AC_DEFUN([LC_CONFIG_SUNRPC], [
320 LB_CHECK_CONFIG_IM([SUNRPC], [], [
321 AS_IF([test "x$sunrpc_required" = xyes], [
324 kernel SUNRPC support is required by using GSS.
327 ]) # LC_CONFIG_SUNRPC
330 # LC_CONFIG_GSS (default 'auto' (tests for dependencies, if found, enables))
332 # Build gss and related tools of Lustre. Currently both kernel and user space
333 # parts are depend on linux platform.
335 AC_DEFUN([LC_CONFIG_GSS], [
336 AC_MSG_CHECKING([whether to enable gss support])
338 [AC_HELP_STRING([--enable-gss], [enable gss support])],
339 [], [enable_gss="auto"])
340 AC_MSG_RESULT([$enable_gss])
342 AC_ARG_VAR([TEST_JOBS],
343 [simultaneous jobs during configure (defaults to $(nproc))])
344 if test "x$ac_cv_env_TEST_JOBS_set" != "xset"; then
345 TEST_JOBS=${TEST_JOBS:-$(nproc)}
349 AC_ARG_VAR([TEST_DIR],
350 [location of temporary parallel configure tests (defaults to $PWD/lb2)])
351 TEST_DIR=${TEST_DIR:-$PWD/_lpb}
354 AS_IF([test "x$enable_gss" != xno], [
355 LC_CONFIG_GSS_KEYRING
356 LC_KEY_TYPE_INSTANTIATE_2ARGS
357 sunrpc_required=$enable_gss
361 LB_CHECK_CONFIG_IM([CRYPTO_MD5], [],
362 [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
363 LB_CHECK_CONFIG_IM([CRYPTO_SHA1], [],
364 [AC_MSG_WARN([kernel SHA1 support is recommended by using GSS.])])
365 LB_CHECK_CONFIG_IM([CRYPTO_SHA256], [],
366 [AC_MSG_WARN([kernel SHA256 support is recommended by using GSS.])])
367 LB_CHECK_CONFIG_IM([CRYPTO_SHA512], [],
368 [AC_MSG_WARN([kernel SHA512 support is recommended by using GSS.])])
370 require_krb5=$enable_gss
374 AS_IF([test -n "$KRBDIR"], [
375 gss_conf_test="success"
377 gss_conf_test="failure"
380 AS_IF([test "x$gss_conf_test" = xsuccess && test "x$enable_gss" != xno], [
381 AC_DEFINE([HAVE_GSS], [1], [Define this is if you enable gss])
384 enable_gss_keyring="no"
388 AS_IF([test "x$enable_ssk" != xno], [
389 enable_ssk=$enable_gss
392 enable_gss_keyring="no"
398 # OpenSSL 1.0+ return int for HMAC functions but older SLES11 versions do not
399 AC_DEFUN([LC_OPENSSL_SSK], [
400 AC_MSG_CHECKING([whether OpenSSL has functions needed for SSK])
401 AS_IF([test "x$enable_ssk" != xno], [
402 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
403 #include <openssl/hmac.h>
404 #include <openssl/evp.h>
408 rc = HMAC_Init_ex(NULL, "test", 4, EVP_md_null(), NULL);
410 ])],[AC_DEFINE(HAVE_OPENSSL_SSK, 1,
411 [OpenSSL HMAC functions needed for SSK])],
414 AC_MSG_RESULT([$enable_ssk])
417 # LC_OPENSSL_GETSEPOL
419 # OpenSSL is needed for l_getsepol
420 AC_DEFUN([LC_OPENSSL_GETSEPOL], [
421 AC_MSG_CHECKING([whether openssl-devel is present])
422 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
423 #include <openssl/evp.h>
426 EVP_MD_CTX *mdctx = EVP_MD_CTX_create();
429 AC_DEFINE(HAVE_OPENSSL_GETSEPOL, 1, [openssl-devel is present])
430 enable_getsepol="yes"
436 No openssl-devel headers found, unable to build l_getsepol and SELinux status checking
439 AC_MSG_RESULT([$enable_getsepol])
440 ]) # LC_OPENSSL_GETSEPOL
443 AC_DEFUN([LC_HAVE_LIBAIO], [
444 AC_CHECK_HEADER([libaio.h],
446 AC_MSG_WARN([libaio is not installed in the system]))
449 AC_DEFUN([LC_HAVE_PROJECT_QUOTA], [
450 LB_CHECK_COMPILE([if get_projid exists],
453 #include <linux/quota.h>
455 struct dquot_operations ops = { };
457 ops.get_projid(NULL, NULL);
459 AC_DEFINE(HAVE_PROJECT_QUOTA, 1,
460 [get_projid function exists])
462 ]) # LC_HAVE_PROJECT_QUOTA
464 AC_DEFUN([LC_HAVE_GET_INODE_USAGE], [
465 LB_CHECK_COMPILE([if get_inode_usage exists],
468 #include <linux/quota.h>
470 struct dquot_operations ops = { };
472 ops.get_inode_usage(NULL, NULL);
474 AC_DEFINE(HAVE_GET_INODE_USAGE, 1,
475 [get_inode_usage function exists])
477 ]) # LC_HAVE_GET_INODE_USAGE
480 # LC_INVALIDATE_RANGE
482 # 3.11 invalidatepage requires the length of the range to invalidate
484 AC_DEFUN([LC_INVALIDATE_RANGE], [
485 LB_CHECK_COMPILE([if 'address_space_operations.invalidatepage' requires 3 arguments],
486 address_space_ops_invalidatepage_3args, [
487 #include <linux/fs.h>
489 struct address_space_operations a_ops;
490 a_ops.invalidatepage(NULL, 0, 0);
492 AC_DEFINE(HAVE_INVALIDATE_RANGE, 1,
493 [address_space_operations.invalidatepage needs 3 arguments])
495 ]) # LC_INVALIDATE_RANGE
498 # LC_HAVE_DIR_CONTEXT
500 # 3.11 readdir now takes the new struct dir_context
502 AC_DEFUN([LC_HAVE_DIR_CONTEXT], [
503 LB_CHECK_COMPILE([if 'dir_context' exist],
505 #include <linux/fs.h>
507 #ifdef FMODE_KABI_ITERATE
508 #error "back to use readdir in kabi_extand mode"
510 struct dir_context ctx;
515 AC_DEFINE(HAVE_DIR_CONTEXT, 1,
518 ]) # LC_HAVE_DIR_CONTEXT
523 # 3.11 dentry_operations.d_compare() taken 5 arguments.
525 AC_DEFUN([LC_D_COMPARE_5ARGS], [
526 LB_CHECK_COMPILE([if 'd_compare' taken 5 arguments],
528 #include <linux/dcache.h>
530 ((struct dentry_operations*)0)->d_compare(NULL,NULL,0,NULL,NULL);
532 AC_DEFINE(HAVE_D_COMPARE_5ARGS, 1,
533 [d_compare need 5 arguments])
535 ]) # LC_D_COMPARE_5ARGS
540 # 3.11 need to access d_count to get dentry reference count
542 AC_DEFUN([LC_HAVE_DCOUNT], [
543 LB_CHECK_COMPILE([if 'd_count' exists],
545 #include <linux/dcache.h>
547 struct dentry de = { };
550 count = d_count(&de);
552 AC_DEFINE(HAVE_D_COUNT, 1,
558 # LC_PID_NS_FOR_CHILDREN
560 # 3.11 replaces pid_ns by pid_ns_for_children in struct nsproxy
562 AC_DEFUN([LC_PID_NS_FOR_CHILDREN], [
563 LB_CHECK_COMPILE([if 'struct nsproxy' has 'pid_ns_for_children'],
564 pid_ns_for_children, [
565 #include <linux/nsproxy.h>
568 ns.pid_ns_for_children = NULL;
570 AC_DEFINE(HAVE_PID_NS_FOR_CHILDREN, 1,
571 ['struct nsproxy' has 'pid_ns_for_children'])
573 ]) # LC_PID_NS_FOR_CHILDREN
576 # LC_OLDSIZE_TRUNCATE_PAGECACHE
578 # 3.12 truncate_pagecache without oldsize parameter
580 AC_DEFUN([LC_OLDSIZE_TRUNCATE_PAGECACHE], [
581 LB_CHECK_COMPILE([if 'truncate_pagecache' with 'old_size' parameter],
582 truncate_pagecache_old_size, [
583 #include <linux/mm.h>
585 truncate_pagecache(NULL, 0, 0);
587 AC_DEFINE(HAVE_OLDSIZE_TRUNCATE_PAGECACHE, 1,
590 ]) # LC_OLDSIZE_TRUNCATE_PAGECACHE
595 # For some reason SLES11SP4 is missing the PTR_ERR_OR_ZERO macro
596 # It was added to linux kernel 3.12
598 AC_DEFUN([LC_PTR_ERR_OR_ZERO_MISSING], [
599 LB_CHECK_COMPILE([if 'PTR_ERR_OR_ZERO' is missing],
601 #include <linux/err.h>
603 if (PTR_ERR_OR_ZERO(NULL)) return 0;
605 AC_DEFINE(HAVE_PTR_ERR_OR_ZERO, 1,
606 ['PTR_ERR_OR_ZERO' exist])
608 ]) # LC_PTR_ERR_OR_ZERO_MISSING
611 # LC_HAVE_DENTRY_D_U_D_ALIAS
613 # 3.11 kernel moved d_alias to the union d_u in struct dentry
615 # Some distros move d_alias to d_u but it is still a struct list
617 AC_DEFUN([LC_HAVE_DENTRY_D_U_D_ALIAS], [
618 AS_IF([test "x$lb_cv_compile_i_dentry_d_alias_list" = xyes], [
619 LB_CHECK_COMPILE([if list 'dentry.d_u.d_alias' exist],
621 #include <linux/list.h>
622 #include <linux/dcache.h>
625 INIT_LIST_HEAD(&de.d_u.d_alias);
627 AC_DEFINE(HAVE_DENTRY_D_U_D_ALIAS, 1,
628 [list dentry.d_u.d_alias exist])
631 LB_CHECK_COMPILE([if hlist 'dentry.d_u.d_alias' exist],
633 #include <linux/list.h>
634 #include <linux/dcache.h>
637 INIT_HLIST_NODE(&de.d_u.d_alias);
639 AC_DEFINE(HAVE_DENTRY_D_U_D_ALIAS, 1,
640 [hlist dentry.d_u.d_alias exist])
643 ]) # LC_HAVE_DENTRY_D_U_D_ALIAS
646 # LC_HAVE_DENTRY_D_CHILD
648 # 3.11 kernel d_child has been moved out of the union d_u
651 AC_DEFUN([LC_HAVE_DENTRY_D_CHILD], [
652 LB_CHECK_COMPILE([if 'dentry.d_child' exist],
654 #include <linux/list.h>
655 #include <linux/dcache.h>
658 INIT_LIST_HEAD(&de.d_child);
660 AC_DEFINE(HAVE_DENTRY_D_CHILD, 1,
661 [dentry.d_child exist])
663 ]) # LC_HAVE_DENTRY_D_CHILD
668 # 3.12 ki_left removed from struct kiocb
670 AC_DEFUN([LC_KIOCB_KI_LEFT], [
671 LB_CHECK_COMPILE([if 'struct kiocb' with 'ki_left' member],
673 #include <linux/aio.h>
675 ((struct kiocb*)0)->ki_left = 0;
677 AC_DEFINE(HAVE_KIOCB_KI_LEFT, 1,
680 ]) # LC_KIOCB_KI_LEFT
683 # LC_REGISTER_SHRINKER_RET
685 # v3.11-8748-g1d3d4437eae1 register_shrinker returns a status
687 AC_DEFUN([LC_REGISTER_SHRINKER_RET], [
688 LB_CHECK_COMPILE([if register_shrinker() returns status],
689 register_shrinker_ret, [
690 #include <linux/mm.h>
692 if (register_shrinker(NULL))
693 unregister_shrinker(NULL);
695 AC_DEFINE(HAVE_REGISTER_SHRINKER_RET, 1,
696 [register_shrinker() returns status])
698 ]) # LC_REGISTER_SHRINKER_RET
701 # LC_VFS_RENAME_5ARGS
703 # 3.13 has vfs_rename with 5 args
705 AC_DEFUN([LC_VFS_RENAME_5ARGS], [
706 LB_CHECK_COMPILE([if Linux kernel has 'vfs_rename' with 5 args],
708 #include <linux/fs.h>
710 vfs_rename(NULL, NULL, NULL, NULL, NULL);
712 AC_DEFINE(HAVE_VFS_RENAME_5ARGS, 1,
713 [kernel has vfs_rename with 5 args])
715 ]) # LC_VFS_RENAME_5ARGS
718 # LC_VFS_UNLINK_3ARGS
720 # 3.13 has vfs_unlink with 3 args
722 AC_DEFUN([LC_VFS_UNLINK_3ARGS], [
723 LB_CHECK_COMPILE([if Linux kernel has 'vfs_unlink' with 3 args],
725 #include <linux/fs.h>
727 vfs_unlink(NULL, NULL, NULL);
729 AC_DEFINE(HAVE_VFS_UNLINK_3ARGS, 1,
730 [kernel has vfs_unlink with 3 args])
732 ]) # LC_VFS_UNLINK_3ARGS
734 # LC_HAVE_D_IS_POSITIVE
736 # Kernel version 3.13 b18825a7c8e37a7cf6abb97a12a6ad71af160de7
737 # d_is_positive is added
739 AC_DEFUN([LC_HAVE_D_IS_POSITIVE], [
740 LB_CHECK_COMPILE([if 'd_is_positive' exist],
742 #include <linux/dcache.h>
746 AC_DEFINE(HAVE_D_IS_POSITIVE, 1,
747 ['d_is_positive' is available])
749 ]) # LC_HAVE_D_IS_POSITIVE
754 # 3.14 move some of its data in struct bio into the new
757 AC_DEFUN([LC_HAVE_BVEC_ITER], [
758 LB_CHECK_COMPILE([if Linux kernel has struct bvec_iter],
760 #include <linux/bio.h>
762 struct bvec_iter iter;
764 iter.bi_bvec_done = 0;
766 AC_DEFINE(HAVE_BVEC_ITER, 1,
767 [kernel has struct bvec_iter])
769 ]) # LC_HAVE_BVEC_ITER
774 # 3.14 adds set_acl method to inode_operations
775 # see kernel commit 893d46e443346370cd4ea81d9d35f72952c62a37
777 AC_DEFUN([LC_IOP_SET_ACL], [
778 LB_CHECK_COMPILE([if 'inode_operations' has '.set_acl' member function],
780 #include <linux/fs.h>
782 struct inode_operations iop;
785 AC_DEFINE(HAVE_IOP_SET_ACL, 1,
786 [inode_operations has .set_acl member function])
791 # LC_HAVE_TRUNCATE_IPAGE_FINAL
793 # 3.14 bring truncate_inode_pages_final for evict_inode
795 AC_DEFUN([LC_HAVE_TRUNCATE_IPAGES_FINAL], [
796 LB_CHECK_COMPILE([if Linux kernel has truncate_inode_pages_final],
797 truncate_ipages_final, [
798 #include <linux/mm.h>
800 truncate_inode_pages_final(NULL);
802 AC_DEFINE(HAVE_TRUNCATE_INODE_PAGES_FINAL, 1,
803 [kernel has truncate_inode_pages_final])
805 ]) # LC_HAVE_TRUNCATE_IPAGES_FINAL
808 # LC_IOPS_RENAME_WITH_FLAGS
810 # 3.14 has inode_operations->rename with 5 args
811 # commit 520c8b16505236fc82daa352e6c5e73cd9870cff
813 AC_DEFUN([LC_IOPS_RENAME_WITH_FLAGS], [
814 LB_CHECK_COMPILE([if 'inode_operations->rename' taken flags as argument],
815 iops_rename_with_flags, [
816 #include <linux/fs.h>
818 struct inode *i1 = NULL, *i2 = NULL;
819 struct dentry *d1 = NULL, *d2 = NULL;
821 rc = ((struct inode_operations *)0)->rename(i1, d1, i2, d2, 0);
823 AC_DEFINE(HAVE_IOPS_RENAME_WITH_FLAGS, 1,
824 [inode_operations->rename need flags as argument])
826 ]) # LC_IOPS_RENAME_WITH_FLAGS
829 # LC_VFS_RENAME_6ARGS
831 # 3.15 has vfs_rename with 6 args
833 AC_DEFUN([LC_VFS_RENAME_6ARGS], [
834 LB_CHECK_COMPILE([if Linux kernel has 'vfs_rename' with 6 args],
836 #include <linux/fs.h>
838 vfs_rename(NULL, NULL, NULL, NULL, NULL, NULL);
840 AC_DEFINE(HAVE_VFS_RENAME_6ARGS, 1,
841 [kernel has vfs_rename with 6 args])
843 ]) # LC_VFS_RENAME_6ARGS
846 # LC_DIRECTIO_USE_ITER
848 # 3.16 kernel changes direct IO to use iov_iter
850 AC_DEFUN([LC_DIRECTIO_USE_ITER], [
851 LB_CHECK_COMPILE([if direct IO uses iov_iter],
853 #include <linux/fs.h>
855 struct address_space_operations ops = { };
856 struct iov_iter *iter = NULL;
859 ops.direct_IO(0, NULL, iter, offset);
861 AC_DEFINE(HAVE_DIRECTIO_ITER, 1,
862 [direct IO uses iov_iter])
864 ]) # LC_DIRECTIO_USE_ITER
867 # LC_HAVE_IOV_ITER_INIT_DIRECTION
870 # 3.16 linux commit 71d8e532b1549a478e6a6a8a44f309d050294d00
871 # changed iov_iter_init api to start accepting a tag
872 # that defines if its a read or write operation
874 AC_DEFUN([LC_HAVE_IOV_ITER_INIT_DIRECTION], [
875 tmp_flags="$EXTRA_KCFLAGS"
876 EXTRA_KCFLAGS="-Werror"
877 LB_CHECK_COMPILE([if 'iov_iter_init' takes a tag],
879 #include <linux/uio.h>
880 #include <linux/fs.h>
882 const struct iovec *iov = NULL;
884 iov_iter_init(NULL, READ, iov, 1, 0);
886 AC_DEFINE(HAVE_IOV_ITER_INIT_DIRECTION, 1,
887 [iov_iter_init handles directional tag])
889 EXTRA_KCFLAGS="$tmp_flags"
890 ]) # LC_HAVE_IOV_ITER_INIT_DIRECTION
893 # LC_HAVE_IOV_ITER_TRUNCATE
896 # 3.16 introduces a new API iov_iter_truncate()
898 AC_DEFUN([LC_HAVE_IOV_ITER_TRUNCATE], [
899 tmp_flags="$EXTRA_KCFLAGS"
900 EXTRA_KCFLAGS="-Werror"
901 LB_CHECK_COMPILE([if 'iov_iter_truncate' exists ],
903 #include <linux/uio.h>
904 #include <linux/fs.h>
906 struct iov_iter *i = NULL;
908 iov_iter_truncate(i, 0);
910 AC_DEFINE(HAVE_IOV_ITER_TRUNCATE, 1, [iov_iter_truncate exists])
912 EXTRA_KCFLAGS="$tmp_flags"
913 ]) # LC_HAVE_IOV_ITER_TRUNCATE
916 # LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
918 # 3.16 introduces [read|write]_iter to struct file_operations
920 AC_DEFUN([LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER], [
921 LB_CHECK_COMPILE([if 'file_operations.[read|write]_iter' exist],
922 file_function_iter, [
923 #include <linux/fs.h>
925 ((struct file_operations *)NULL)->read_iter(NULL, NULL);
926 ((struct file_operations *)NULL)->write_iter(NULL, NULL);
928 AC_DEFINE(HAVE_FILE_OPERATIONS_READ_WRITE_ITER, 1,
929 [file_operations.[read|write]_iter functions exist])
931 ]) # LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
934 # LC_HAVE_INTERVAL_BLK_INTEGRITY
936 # 3.17 replace sector_size with interval in struct blk_integrity
938 AC_DEFUN([LC_HAVE_INTERVAL_BLK_INTEGRITY], [
939 LB_CHECK_COMPILE([if 'blk_integrity.interval' exist],
940 interval_blk_integrity, [
941 #include <linux/blkdev.h>
943 ((struct blk_integrity *)0)->interval = 0;
945 AC_DEFINE(HAVE_INTERVAL_BLK_INTEGRITY, 1,
946 [blk_integrity.interval exist])
948 ]) # LC_HAVE_INTERVAL_BLK_INTEGRITY
953 # 3.17 replaces key_type::match with match_preparse
954 # and has new struct key_match_data
956 AC_DEFUN([LC_KEY_MATCH_DATA], [
957 LB_CHECK_COMPILE([if struct key_match field exist],
959 #include <linux/key-type.h>
961 struct key_match_data data;
963 data.raw_data = NULL;
965 AC_DEFINE(HAVE_KEY_MATCH_DATA, 1,
966 [struct key_match_data exist])
968 ]) # LC_KEY_MATCH_DATA
971 # LC_NFS_FILLDIR_USE_CTX
973 # 3.18 kernel moved from void cookie to struct dir_context
975 AC_DEFUN([LC_NFS_FILLDIR_USE_CTX], [
976 tmp_flags="$EXTRA_KCFLAGS"
977 EXTRA_KCFLAGS="-Werror"
978 LB_CHECK_COMPILE([if filldir_t uses struct dir_context],
980 #include <linux/fs.h>
982 int filldir(struct dir_context *ctx, const char* name,
983 int i, loff_t off, u64 tmp, unsigned temp)
988 struct dir_context ctx = {
992 ctx.actor(NULL, "test", 0, (loff_t) 0, 0, 0);
994 AC_DEFINE(HAVE_FILLDIR_USE_CTX, 1,
995 [filldir_t needs struct dir_context as argument])
997 EXTRA_KCFLAGS="$tmp_flags"
998 ]) # LC_NFS_FILLDIR_USE_CTX
1001 # LC_PERCPU_COUNTER_INIT
1003 # 3.18 For kernels 3.18 and after percpu_counter_init starts
1004 # to pass a GFP_* memory allocation flag for internal
1005 # memory allocation purposes.
1007 AC_DEFUN([LC_PERCPU_COUNTER_INIT], [
1008 LB_CHECK_COMPILE([if percpu_counter_init uses GFP_* flag as argument],
1009 percpu_counter_init, [
1010 #include <linux/percpu_counter.h>
1012 percpu_counter_init(NULL, 0, GFP_KERNEL);
1014 AC_DEFINE(HAVE_PERCPU_COUNTER_INIT_GFP_FLAG, 1,
1015 [percpu_counter_init uses GFP_* flag])
1017 ]) # LC_PERCPU_COUNTER_INIT
1020 # LC_KIOCB_HAS_NBYTES
1022 # 3.19 kernel removed ki_nbytes from struct kiocb
1024 AC_DEFUN([LC_KIOCB_HAS_NBYTES], [
1025 LB_CHECK_COMPILE([if struct kiocb has ki_nbytes field],
1027 #include <linux/fs.h>
1029 struct kiocb iocb = { };
1033 AC_DEFINE(HAVE_KI_NBYTES, 1, [ki_nbytes field exist])
1035 ]) # LC_KIOCB_HAS_NBYTES
1038 # LC_HAVE_DQUOT_QC_DQBLK
1040 # 3.19 has quotactl_ops->[sg]et_dqblk that take struct kqid and qc_dqblk
1041 # Added in commit 14bf61ffe
1043 AC_DEFUN([LC_HAVE_DQUOT_QC_DQBLK], [
1044 tmp_flags="$EXTRA_KCFLAGS"
1045 EXTRA_KCFLAGS="-Werror"
1046 LB_CHECK_COMPILE([if 'quotactl_ops.set_dqblk' takes struct qc_dqblk],
1048 #include <linux/fs.h>
1049 #include <linux/quota.h>
1051 ((struct quotactl_ops *)0)->set_dqblk(NULL, *((struct kqid*)0), (struct qc_dqblk*)0);
1053 AC_DEFINE(HAVE_DQUOT_QC_DQBLK, 1,
1054 [quotactl_ops.set_dqblk takes struct qc_dqblk])
1055 AC_DEFINE(HAVE_DQUOT_KQID, 1,
1056 [quotactl_ops.set_dqblk takes struct kqid])
1058 EXTRA_KCFLAGS="$tmp_flags"
1059 ]) # LC_HAVE_DQUOT_QC_DQBLK
1062 # LC_HAVE_AIO_COMPLETE
1064 # 3.19 kernel makes aio_complete() static
1066 AC_DEFUN([LC_HAVE_AIO_COMPLETE], [
1067 LB_CHECK_COMPILE([if kernel has exported aio_complete() ],
1069 #include <linux/aio.h>
1071 aio_complete(NULL, 0, 0);
1073 AC_DEFINE(HAVE_AIO_COMPLETE, 1, [aio_complete defined])
1075 ]) # LC_HAVE_AIO_COMPLETE
1078 # LC_HAVE_IS_ROOT_INODE
1080 # 3.19 kernel adds is_root_inode()
1081 # Commit a7400222e3eb ("new helper: is_root_inode()")
1083 AC_DEFUN([LC_HAVE_IS_ROOT_INODE], [
1084 LB_CHECK_COMPILE([if kernel has is_root_inode() ],
1086 #include <linux/fs.h>
1088 is_root_inode(NULL);
1090 AC_DEFINE(HAVE_IS_ROOT_INODE, 1, [is_root_inode defined])
1092 ]) # LC_HAVE_IS_ROOT_INODE
1095 # LC_BACKING_DEV_INFO_REMOVAL
1097 # 3.20 kernel removed backing_dev_info from address_space
1099 AC_DEFUN([LC_BACKING_DEV_INFO_REMOVAL], [
1100 LB_CHECK_COMPILE([if struct address_space has backing_dev_info],
1102 #include <linux/fs.h>
1104 struct address_space mapping;
1106 mapping.backing_dev_info = NULL;
1108 AC_DEFINE(HAVE_BACKING_DEV_INFO, 1, [backing_dev_info exist])
1110 ]) # LC_BACKING_DEV_INFO_REMOVAL
1113 # LC_HAVE_BDI_CAP_MAP_COPY
1115 # 3.20 removed mmap handling for backing devices since
1116 # it breaks on non-MMU systems. See kernel commit
1117 # b4caecd48005fbed3949dde6c1cb233142fd69e9
1119 AC_DEFUN([LC_HAVE_BDI_CAP_MAP_COPY], [
1120 LB_CHECK_COMPILE([if have 'BDI_CAP_MAP_COPY'],
1122 #include <linux/backing-dev.h>
1124 struct backing_dev_info info;
1126 info.capabilities = BDI_CAP_MAP_COPY;
1128 AC_DEFINE(HAVE_BDI_CAP_MAP_COPY, 1,
1129 [BDI_CAP_MAP_COPY exist])
1131 ]) # LC_HAVE_BDI_CAP_MAP_COPY
1136 # 4.1 kernel has iov_iter_rw
1138 AC_DEFUN([LC_IOV_ITER_RW], [
1139 LB_CHECK_COMPILE([if iov_iter_rw exist],
1141 #include <linux/fs.h>
1142 #include <linux/uio.h>
1144 struct iov_iter *iter = NULL;
1148 AC_DEFINE(HAVE_IOV_ITER_RW, 1,
1149 [iov_iter_rw exist])
1154 # LC_HAVE_SYNC_READ_WRITE
1156 # 4.1 new_sync_[read|write] no longer exported
1158 AC_DEFUN([LC_HAVE_SYNC_READ_WRITE], [
1159 LB_CHECK_EXPORT([new_sync_read], [fs/read_write.c],
1160 [AC_DEFINE(HAVE_SYNC_READ_WRITE, 1,
1161 [new_sync_[read|write] is exported by the kernel])])
1162 ]) # LC_HAVE_SYNC_READ_WRITE
1167 # 4.1 redefined bi_cnt as __bi_cnt in commit dac56212e8127dbc0
1169 AC_DEFUN([LC_HAVE___BI_CNT], [
1170 LB_CHECK_COMPILE([if Linux kernel has __bi_cnt in struct bio],
1172 #include <asm/atomic.h>
1173 #include <linux/bio.h>
1174 #include <linux/blk_types.h>
1176 struct bio bio = { };
1178 cnt = atomic_read(&bio.__bi_cnt);
1180 AC_DEFINE(HAVE___BI_CNT, 1,
1181 [struct bio has __bi_cnt])
1183 ]) # LC_HAVE___BI_CNT
1186 # LC_SYMLINK_OPS_USE_NAMEIDATA
1188 # For the 4.2+ kernels the file system internal symlink api no
1189 # longer uses struct nameidata as a argument
1191 AC_DEFUN([LC_SYMLINK_OPS_USE_NAMEIDATA], [
1192 LB_CHECK_COMPILE([if symlink inode operations have struct nameidata argument],
1193 symlink_use_nameidata, [
1194 #include <linux/namei.h>
1195 #include <linux/fs.h>
1197 struct nameidata *nd = NULL;
1199 ((struct inode_operations *)0)->follow_link(NULL, nd);
1200 ((struct inode_operations *)0)->put_link(NULL, nd, NULL);
1202 AC_DEFINE(HAVE_SYMLINK_OPS_USE_NAMEIDATA, 1,
1203 [symlink inode operations need struct nameidata argument])
1205 ]) # LC_SYMLINK_OPS_USE_NAMEIDATA
1208 # LC_BIO_ENDIO_USES_ONE_ARG
1210 # 4.2 kernel bio_endio now only takes one argument
1212 AC_DEFUN([LC_BIO_ENDIO_USES_ONE_ARG], [
1213 LB_CHECK_COMPILE([if 'bio_endio' with one argument exist],
1215 #include <linux/bio.h>
1219 AC_DEFINE(HAVE_BIO_ENDIO_USES_ONE_ARG, 1,
1220 [bio_endio takes only one argument])
1222 ]) # LC_BIO_ENDIO_USES_ONE_ARG
1225 # LC_ACCOUNT_PAGE_DIRTIED_3ARGS
1227 # 4.2 [to 4.5] kernel page dirtied takes 3 arguments
1229 AC_DEFUN([LC_ACCOUNT_PAGE_DIRTIED_3ARGS], [
1230 LB_CHECK_COMPILE([if 'account_page_dirtied' with 3 args exists],
1231 account_page_dirtied, [
1232 #include <linux/mm.h>
1234 account_page_dirtied(NULL, NULL, NULL);
1236 AC_DEFINE(HAVE_ACCOUNT_PAGE_DIRTIED_3ARGS, 1,
1237 [account_page_dirtied takes three arguments])
1239 ]) # LC_ACCOUNT_PAGE_DIRTIED_3ARGS
1242 # LC_HAVE_CRYPTO_ALLOC_SKCIPHER
1244 # Kernel version 4.12 commit 7a7ffe65c8c5
1245 # introduced crypto_alloc_skcipher().
1247 AC_DEFUN([LC_HAVE_CRYPTO_ALLOC_SKCIPHER], [
1248 LB_CHECK_COMPILE([if crypto_alloc_skcipher is defined],
1249 crypto_alloc_skcipher, [
1250 #include <crypto/skcipher.h>
1252 crypto_alloc_skcipher(NULL, 0, 0);
1254 AC_DEFINE(HAVE_CRYPTO_ALLOC_SKCIPHER, 1,
1255 [crypto_alloc_skcipher is defined])
1257 ]) # LC_HAVE_CRYPTO_ALLOC_SKCIPHER
1260 # LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
1262 # 4.3 replace interval with interval_exp in 'struct blk_integrity'
1263 # 'struct blk_integrity_profile' is also added in this version,
1264 # thus use this to determine whether 'struct blk_integrity' has profile
1266 AC_DEFUN([LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY], [
1267 LB_CHECK_COMPILE([if 'blk_integrity.interval_exp' exist],
1268 blk_integrity_interval_exp, [
1269 #include <linux/blkdev.h>
1271 ((struct blk_integrity *)0)->interval_exp = 0;
1273 AC_DEFINE(HAVE_INTERVAL_EXP_BLK_INTEGRITY, 1,
1274 [blk_integrity.interval_exp exist])
1276 ]) # LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
1279 # LC_HAVE_CACHE_HEAD_HLIST
1281 # 4.3 kernel swiched to hlist for cache_head
1283 AC_DEFUN([LC_HAVE_CACHE_HEAD_HLIST], [
1284 LB_CHECK_COMPILE([if 'struct cache_head' has 'cache_list' field],
1285 cache_head_has_hlist, [
1286 #include <linux/sunrpc/cache.h>
1288 do {} while(sizeof(((struct cache_head *)0)->cache_list));
1290 AC_DEFINE(HAVE_CACHE_HEAD_HLIST, 1,
1291 [cache_head has hlist cache_list])
1293 ]) # LC_HAVE_CACHE_HEAD_HLIST
1296 # LC_HAVE_XATTR_HANDLER_SIMPLIFIED
1298 # Kernel version 4.3 commit e409de992e3ea3674393465f07cc71c948edd87a
1299 # simplified xattr_handler handling by passing in the handler pointer
1301 AC_DEFUN([LC_HAVE_XATTR_HANDLER_SIMPLIFIED], [
1302 tmp_flags="$EXTRA_KCFLAGS"
1303 EXTRA_KCFLAGS="-Werror"
1304 LB_CHECK_COMPILE([if 'struct xattr_handler' functions pass in handler pointer],
1305 xattr_handler_simplified, [
1306 #include <linux/xattr.h>
1308 struct xattr_handler handler;
1310 ((struct xattr_handler *)0)->get(&handler, NULL, NULL, NULL, 0);
1311 ((struct xattr_handler *)0)->set(&handler, NULL, NULL, NULL, 0, 0);
1313 AC_DEFINE(HAVE_XATTR_HANDLER_SIMPLIFIED, 1, [handler pointer is parameter])
1315 EXTRA_KCFLAGS="$tmp_flags"
1316 ]) # LC_HAVE_XATTR_HANDLER_SIMPLIFIED
1319 # LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
1321 # 4.3 replace interval with interval_exp in 'struct blk_integrity'.
1323 AC_DEFUN([LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD], [
1324 LB_CHECK_COMPILE([if 'bio_integrity_payload.bip_iter' exist],
1325 bio_integrity_payload_bip_iter, [
1326 #include <linux/bio.h>
1328 ((struct bio_integrity_payload *)0)->bip_iter.bi_size = 0;
1330 AC_DEFINE(HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD, 1,
1331 [bio_integrity_payload.bip_iter exist])
1333 ]) # LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
1336 # LC_BIO_INTEGRITY_PREP_FN
1338 # Lustre kernel patch extents bio_integrity_prep to accept optional
1339 # generate/verify_fn as extra args.
1341 AC_DEFUN([LC_BIO_INTEGRITY_PREP_FN], [
1342 LB_CHECK_COMPILE([if 'bio_integrity_prep_fn' exists],
1343 bio_integrity_prep_fn, [
1344 #include <linux/bio.h>
1346 bio_integrity_prep_fn(NULL, NULL, NULL);
1348 AC_DEFINE(HAVE_BIO_INTEGRITY_PREP_FN, 1,
1349 [kernel has bio_integrity_prep_fn])
1350 AC_SUBST(PATCHED_INTEGRITY_INTF)
1352 AC_SUBST(PATCHED_INTEGRITY_INTF, [#])
1354 ]) # LC_BIO_INTEGRITY_PREP_FN
1356 # LC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL
1358 # 13 kernel integrity API has changed and in 4.13+
1359 # (as well as in rhel 8.4) bio_integrity_prep() returns boolean true
1362 AC_DEFUN([LC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL], [
1363 LB_CHECK_COMPILE([if 'bio_integrity_prep_fn' returns bool],
1364 bio_integrity_prep, [
1365 #include <linux/bio.h>
1366 #include <linux/typecheck.h>
1368 #pragma GCC diagnostic warning "-Werror"
1369 typedef bool (*bio_integrity_prep_type)(struct bio *bio) ;
1371 typecheck_fn(bio_integrity_prep_type, bio_integrity_prep);
1373 AC_DEFINE(HAVE_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL, 1,
1374 [bio_integrity_prep_fn returns bool])
1376 ]) # LC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL
1381 # 4.4/4.8 redefined bi_rw as bi_opf (SLES12/kernel commit 4382e33ad37486)
1383 AC_DEFUN([LC_HAVE_BI_OPF], [
1384 LB_CHECK_COMPILE([if Linux kernel has bi_opf in struct bio],
1386 #include <linux/bio.h>
1392 AC_DEFINE(HAVE_BI_OPF, 1,
1393 [struct bio has bi_opf])
1398 # LC_HAVE_SUBMIT_BIO_2ARGS
1400 # 4.4 removed an argument from submit_bio
1402 AC_DEFUN([LC_HAVE_SUBMIT_BIO_2ARGS], [
1403 LB_CHECK_COMPILE([if submit_bio takes two arguments],
1404 have_submit_bio_2args, [
1405 #include <linux/bio.h>
1408 submit_bio(READ, &bio);
1410 AC_DEFINE(HAVE_SUBMIT_BIO_2ARGS, 1,
1411 [submit_bio takes two arguments])
1413 ]) # LC_HAVE_SUBMIT_BIO_2_ARGS
1416 # LC_HAVE_CLEAN_BDEV_ALIASES
1418 # 4.4/4.9 unmap_underlying_metadata was replaced by clean_bdev_aliases
1419 # (SLES12/kernel commit 29f3ad7d8380364c)
1421 AC_DEFUN([LC_HAVE_CLEAN_BDEV_ALIASES], [
1422 LB_CHECK_COMPILE([if kernel has clean_bdev_aliases],
1423 have_clean_bdev_aliases, [
1424 #include <linux/buffer_head.h>
1426 clean_bdev_aliases(NULL,1,1);
1428 AC_DEFINE(HAVE_CLEAN_BDEV_ALIASES, 1,
1429 [kernel has clean_bdev_aliases])
1431 ]) # LC_HAVE_CLEAN_BDEV_ALIASES
1434 # LC_HAVE_LOCKS_LOCK_FILE_WAIT
1436 # 4.4 kernel have moved locks API users to
1437 # locks_lock_inode_wait()
1439 AC_DEFUN([LC_HAVE_LOCKS_LOCK_FILE_WAIT], [
1440 LB_CHECK_COMPILE([if 'locks_lock_file_wait' exists],
1441 locks_lock_file_wait, [
1442 #include <linux/fs.h>
1444 locks_lock_file_wait(NULL, NULL);
1446 AC_DEFINE(HAVE_LOCKS_LOCK_FILE_WAIT, 1,
1447 [kernel has locks_lock_file_wait])
1449 ]) # LC_HAVE_LOCKS_LOCK_FILE_WAIT
1452 # LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
1454 # 4.4 kernel merged type-specific data with the payload data for keys
1456 AC_DEFUN([LC_HAVE_KEY_PAYLOAD_DATA_ARRAY], [
1457 LB_CHECK_COMPILE([if 'struct key' has 'payload.data' as an array],
1458 key_payload_data_array, [
1459 #include <linux/key.h>
1461 struct key key = { };
1463 key.payload.data[0] = NULL;
1465 AC_DEFINE(HAVE_KEY_PAYLOAD_DATA_ARRAY, 1, [payload.data is an array])
1467 ]) #LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
1470 # LC_HAVE_XATTR_HANDLER_NAME
1472 # Kernel version 4.4 commit 98e9cb5711c68223f0e4d5201b9a6add255ec550
1473 # add a name member to struct xattr_handler
1475 AC_DEFUN([LC_HAVE_XATTR_HANDLER_NAME], [
1476 tmp_flags="$EXTRA_KCFLAGS"
1477 EXTRA_KCFLAGS="-Werror"
1478 LB_CHECK_COMPILE([if 'struct xattr_handler' has a name member],
1479 xattr_handler_name, [
1480 #include <linux/xattr.h>
1482 ((struct xattr_handler *)NULL)->name = NULL;
1484 AC_DEFINE(HAVE_XATTR_HANDLER_NAME, 1, [xattr_handler has a name member])
1486 EXTRA_KCFLAGS="$tmp_flags"
1487 ]) # LC_HAVE_XATTR_HANDLER_NAME
1490 # LC_HAVE_FILE_DENTRY
1492 # 4.5 adds wrapper file_dentry
1494 AC_DEFUN([LC_HAVE_FILE_DENTRY], [
1495 LB_CHECK_COMPILE([if Linux kernel has 'file_dentry'],
1497 #include <linux/fs.h>
1501 AC_DEFINE(HAVE_FILE_DENTRY, 1,
1502 [kernel has file_dentry])
1504 ]) # LC_HAVE_FILE_DENTRY
1507 # LC_HAVE_INODE_LOCK
1509 # 4.5 introduced inode_lock
1511 AC_DEFUN([LC_HAVE_INODE_LOCK], [
1512 LB_CHECK_COMPILE([if 'inode_lock' is defined],
1514 #include <linux/fs.h>
1518 AC_DEFINE(HAVE_INODE_LOCK, 1,
1519 [inode_lock is defined])
1521 ]) # LC_HAVE_INODE_LOCK
1524 # LC_HAVE_IOP_GET_LINK
1526 # 4.5 vfs replaced iop->follow_link with
1529 AC_DEFUN([LC_HAVE_IOP_GET_LINK], [
1530 LB_CHECK_COMPILE([if 'iop' has 'get_link'],
1531 inode_ops_get_link, [
1532 #include <linux/fs.h>
1534 struct inode_operations iop;
1535 iop.get_link = NULL;
1537 AC_DEFINE(HAVE_IOP_GET_LINK, 1,
1538 [have iop get_link])
1540 ]) # LC_HAVE_IOP_GET_LINK
1543 # LC_HAVE_IN_COMPAT_SYSCALL
1545 # 4.6 renamed is_compat_task to in_compat_syscall
1547 AC_DEFUN([LC_HAVE_IN_COMPAT_SYSCALL], [
1548 LB_CHECK_COMPILE([if 'in_compat_syscall' is defined],
1549 in_compat_syscall, [
1550 #include <linux/compat.h>
1552 in_compat_syscall();
1554 AC_DEFINE(HAVE_IN_COMPAT_SYSCALL, 1,
1555 [have in_compat_syscall])
1557 ]) # LC_HAVE_IN_COMPAT_SYSCALL
1560 # LC_HAVE_XATTR_HANDLER_INODE_PARAM
1562 # Kernel version 4.6 commit b296821a7c42fa58baa17513b2b7b30ae66f3336
1563 # and commit 5930122683dff58f0846b0f0405b4bd598a3ba6a added inode parameter
1564 # to xattr_handler functions
1566 AC_DEFUN([LC_HAVE_XATTR_HANDLER_INODE_PARAM], [
1567 tmp_flags="$EXTRA_KCFLAGS"
1568 EXTRA_KCFLAGS="-Werror"
1569 LB_CHECK_COMPILE([if 'struct xattr_handler' functions have inode parameter],
1570 xattr_handler_inode_param, [
1571 #include <linux/xattr.h>
1573 const struct xattr_handler handler;
1575 ((struct xattr_handler *)0)->get(&handler, NULL, NULL, NULL, NULL, 0);
1576 ((struct xattr_handler *)0)->set(&handler, NULL, NULL, NULL, NULL, 0, 0);
1578 AC_DEFINE(HAVE_XATTR_HANDLER_INODE_PARAM, 1, [needs inode parameter])
1580 EXTRA_KCFLAGS="$tmp_flags"
1581 ]) # LC_HAVE_XATTR_HANDLER_INODE_PARAM
1586 # Kernel version 4.6 commit 85c7f81041d57cfe9dc97f4680d5586b54534a39
1587 # introduced parallel lookups in the VFS layer. The inline function
1588 # d_in_lookup was added to notify when the same item was being queried
1591 AC_DEFUN([LC_D_IN_LOOKUP], [
1592 tmp_flags="$EXTRA_KCFLAGS"
1593 EXTRA_KCFLAGS="-Werror"
1594 LB_CHECK_COMPILE([if 'd_in_lookup' is defined],
1596 #include <linux/dcache.h>
1600 AC_DEFINE(HAVE_D_IN_LOOKUP, 1, [d_in_lookup is defined])
1602 EXTRA_KCFLAGS="$tmp_flags"
1606 # LC_LOCK_PAGE_MEMCG
1608 # Kernel version 4.6 adds lock_page_memcg
1610 AC_DEFUN([LC_LOCK_PAGE_MEMCG], [
1611 LB_CHECK_COMPILE([if 'lock_page_memcg' is defined],
1613 #include <linux/memcontrol.h>
1615 lock_page_memcg(NULL);
1617 AC_DEFINE(HAVE_LOCK_PAGE_MEMCG, 1,
1618 [lock_page_memcg is defined])
1620 ]) # LC_LOCK_PAGE_MEMCG
1625 # Kernel version 4.7-rc5 commit 285b102d3b745f3c2c110c9c327741d87e64aacc
1626 # add new d_init to initialize dentry at allocation time
1628 AC_DEFUN([LC_D_INIT], [
1629 LB_CHECK_COMPILE([if dentry operations supports 'd_init'],
1631 #include <linux/dcache.h>
1633 struct dentry_operations ops = { };
1636 rc = ops.d_init(NULL);
1638 AC_DEFINE(HAVE_D_INIT, 1, ['d_init' exists])
1645 # Kernel version 4.7 commit c8b8e32d700fe943a935e435ae251364d016c497
1646 # direct-io: eliminate the offset argument to ->direct_IO
1648 AC_DEFUN([LC_DIRECTIO_2ARGS], [
1649 LB_CHECK_COMPILE([if '->direct_IO()' taken 2 arguments],
1651 #include <linux/fs.h>
1653 struct address_space_operations ops = { };
1654 struct iov_iter *iter = NULL;
1655 struct kiocb *iocb = NULL;
1658 rc = ops.direct_IO(iocb, iter);
1660 AC_DEFINE(HAVE_DIRECTIO_2ARGS, 1,
1661 [direct_IO need 2 arguments])
1663 ]) # LC_DIRECTIO_2ARGS
1666 # LC_GENERIC_WRITE_SYNC_2ARGS
1668 # Kernel version 4.7 commit dde0c2e79848298cc25621ad080d47f94dbd7cce
1669 # fs: add IOCB_SYNC and IOCB_DSYNC
1671 AC_DEFUN([LC_GENERIC_WRITE_SYNC_2ARGS], [
1672 LB_CHECK_COMPILE([if 'generic_write_sync()' taken 2 arguments],
1673 generic_write_sync_2args, [
1674 #include <linux/fs.h>
1676 struct kiocb *iocb = NULL;
1679 rc = generic_write_sync(iocb, 0);
1681 AC_DEFINE(HAVE_GENERIC_WRITE_SYNC_2ARGS, 1,
1682 [generic_write_sync need 2 arguments])
1684 ]) # LC_GENERIC_WRITE_SYNC_2ARGS
1687 # LC_FOP_ITERATE_SHARED
1689 # Kernel v4.6-rc3-29-g6192269 adds iterate_shared method to file_operations
1691 AC_DEFUN([LC_FOP_ITERATE_SHARED], [
1692 LB_CHECK_COMPILE([if 'file_operations' has 'iterate_shared'],
1693 fop_iterate_shared, [
1694 #include <linux/fs.h>
1696 struct file_operations fop;
1697 fop.iterate_shared = NULL;
1699 AC_DEFINE(HAVE_FOP_ITERATE_SHARED, 1,
1700 [file_operations has iterate_shared])
1702 ]) # LC_FOP_ITERATE_SHARED
1705 # LC_EXPORT_DEFAULT_FILE_SPLICE_READ
1707 # 4.8-rc8 commit 82c156f853840645604acd7c2cebcb75ed1b6652 switched
1708 # generic_file_splice_read() to using ->read_iter. We can test this
1709 # change since default_file_splice_read() is no longer exported.
1711 AC_DEFUN([LC_EXPORT_DEFAULT_FILE_SPLICE_READ], [
1712 LB_CHECK_EXPORT([default_file_splice_read], [fs/splice.c],
1713 [AC_DEFINE(HAVE_DEFAULT_FILE_SPLICE_READ_EXPORT, 1,
1714 [default_file_splice_read is exported])])
1715 ]) # LC_EXPORT_DEFAULT_FILE_SPLCE_READ
1718 # LC_HAVE_POSIX_ACL_VALID_USER_NS
1720 # 4.8 posix_acl_valid takes struct user_namespace
1722 AC_DEFUN([LC_HAVE_POSIX_ACL_VALID_USER_NS], [
1723 LB_CHECK_COMPILE([if 'posix_acl_valid' takes 'struct user_namespace'],
1725 #include <linux/fs.h>
1726 #include <linux/posix_acl.h>
1728 posix_acl_valid((struct user_namespace*)NULL, (const struct posix_acl*)NULL);
1730 AC_DEFINE(HAVE_POSIX_ACL_VALID_USER_NS, 1,
1731 [posix_acl_valid takes struct user_namespace])
1733 ]) # LC_HAVE_POSIX_ACL_VALID_USER_NS
1736 # LC_D_COMPARE_4ARGS
1738 # Kernel version 4.8 commit 6fa67e707559303e086303aeecc9e8b91ef497d5
1739 # get rid of 'parent' argument of ->d_compare()
1741 AC_DEFUN([LC_D_COMPARE_4ARGS], [
1742 LB_CHECK_COMPILE([if 'd_compare' taken 4 arguments],
1744 #include <linux/dcache.h>
1746 ((struct dentry_operations*)0)->d_compare(NULL,0,NULL,NULL);
1748 AC_DEFINE(HAVE_D_COMPARE_4ARGS, 1,
1749 [d_compare need 4 arguments])
1751 ]) # LC_D_COMPARE_4ARGS
1754 # LC_FULL_NAME_HASH_3ARGS
1756 # Kernel version 4.8 commit 8387ff2577eb9ed245df9a39947f66976c6bcd02
1757 # vfs: make the string hashes salt the hash
1759 AC_DEFUN([LC_FULL_NAME_HASH_3ARGS], [
1760 LB_CHECK_COMPILE([if 'full_name_hash' taken 3 arguments],
1761 full_name_hash_3args, [
1762 #include <linux/stringhash.h>
1765 hash = full_name_hash(NULL,NULL,0);
1767 AC_DEFINE(HAVE_FULL_NAME_HASH_3ARGS, 1,
1768 [full_name_hash need 3 arguments])
1770 ]) # LC_FULL_NAME_HASH_3ARGS
1773 # LC_STRUCT_POSIX_ACL_XATTR
1775 # Kernel version 4.8 commit 2211d5ba5c6c4e972ba6dbc912b2897425ea6621
1776 # posix_acl: xattr representation cleanups
1778 AC_DEFUN([LC_STRUCT_POSIX_ACL_XATTR], [
1779 LB_CHECK_COMPILE([if 'struct posix_acl_xattr_{header,entry}' defined],
1780 struct_posix_acl_xattr, [
1781 #include <linux/fs.h>
1782 #include <linux/posix_acl_xattr.h>
1784 struct posix_acl_xattr_header *h = NULL;
1785 struct posix_acl_xattr_entry *e;
1786 e = (void *)(h + 1);
1788 AC_DEFINE(HAVE_STRUCT_POSIX_ACL_XATTR, 1,
1789 [struct posix_acl_xattr_{header,entry} defined])
1791 ]) # LC_STRUCT_POSIX_ACL_XATTR
1796 # Kernel version 4.8 commit fd50ecaddf8372a1d96e0daeaac0f93cf04e4d42
1797 # removed {get,set,remove}xattr inode operations
1799 AC_DEFUN([LC_IOP_XATTR], [
1800 LB_CHECK_COMPILE([if 'inode_operations' has {get,set,remove}xattr members],
1802 #include <linux/fs.h>
1804 struct inode_operations iop;
1805 iop.setxattr = NULL;
1806 iop.getxattr = NULL;
1807 iop.removexattr = NULL;
1809 AC_DEFINE(HAVE_IOP_XATTR, 1,
1810 [inode_operations has {get,set,remove}xattr members])
1817 # Kernel version 4.9 commit 81243eacfa400f5f7b89f4c2323d0de9982bb0fb
1818 # cred: simpler, 1D supplementary groups
1820 AC_DEFUN([LC_GROUP_INFO_GID], [
1821 LB_CHECK_COMPILE([if 'struct group_info' has member 'gid'],
1823 #include <linux/cred.h>
1826 p = ((struct group_info *)0)->gid;
1828 AC_DEFINE(HAVE_GROUP_INFO_GID, 1,
1829 [struct group_info has member gid])
1831 ]) # LC_GROUP_INFO_GID
1836 # Kernel version 4.9 commit 5d6c31910bc0713e37628dc0ce677dcb13c8ccf4
1837 # added __vfs_{get,set,remove}xattr helpers
1839 AC_DEFUN([LC_VFS_SETXATTR], [
1840 LB_CHECK_COMPILE([if '__vfs_setxattr' helper is available],
1842 #include <linux/xattr.h>
1844 __vfs_setxattr(NULL, NULL, NULL, NULL, 0, 0);
1846 AC_DEFINE(HAVE_VFS_SETXATTR, 1,
1847 ['__vfs_setxattr is available])
1849 ]) # LC_VFS_SETXATTR
1852 # LC_POSIX_ACL_UPDATE_MODE
1854 # Kernel version 4.9 commit 073931017b49d9458aa351605b43a7e34598caef
1855 # posix_acl: Clear SGID bit when setting file permissions
1857 AC_DEFUN([LC_POSIX_ACL_UPDATE_MODE], [
1858 LB_CHECK_COMPILE([if 'posix_acl_update_mode' exists],
1859 posix_acl_update_mode, [
1860 #include <linux/fs.h>
1861 #include <linux/posix_acl.h>
1863 posix_acl_update_mode(NULL, NULL, NULL);
1865 AC_DEFINE(HAVE_POSIX_ACL_UPDATE_MODE, 1,
1866 ['posix_acl_update_mode' is available])
1868 ]) # LC_POSIX_ACL_UPDATE_MODE
1871 # LC_IOP_GENERIC_READLINK
1873 # Kernel version 4.10 commit dfeef68862edd7d4bafe68ef7aeb5f658ef24bb5
1874 # removed generic_readlink from individual file systems
1876 AC_DEFUN([LC_IOP_GENERIC_READLINK], [
1877 LB_CHECK_COMPILE([if 'generic_readlink' still exist],
1878 inode_ops_readlink, [
1879 #include <linux/fs.h>
1881 struct inode_operations iop;
1882 iop.readlink = generic_readlink;
1884 AC_DEFINE(HAVE_IOP_GENERIC_READLINK, 1,
1885 [generic_readlink has been removed])
1887 ]) # LC_IOP_GENERIC_READLINK
1890 # LC_HAVE_VM_FAULT_ADDRESS
1892 # Kernel version 4.10 commit 1a29d85eb0f19b7d8271923d8917d7b4f5540b3e
1893 # removed virtual_address field. Need to use address field instead
1895 AC_DEFUN([LC_HAVE_VM_FAULT_ADDRESS], [
1896 LB_CHECK_COMPILE([if 'struct vm_fault' replaced virtual_address with address field],
1898 #include <linux/mm.h>
1900 struct vm_fault vmf;
1903 AC_DEFINE(HAVE_VM_FAULT_ADDRESS, 1,
1904 [virtual_address has been replaced by address field])
1906 ]) # LC_HAVE_VM_FAULT_ADDRESS
1909 # LC_INODEOPS_ENHANCED_GETATTR
1911 # Kernel version 4.11 commit a528d35e8bfcc521d7cb70aaf03e1bd296c8493f
1912 # expanded getattr to be able to get more stat information.
1914 AC_DEFUN([LC_INODEOPS_ENHANCED_GETATTR], [
1915 LB_CHECK_COMPILE([if 'inode_operations' getattr member can gather advance stats],
1917 #include <linux/fs.h>
1921 ((struct inode_operations *)1)->getattr(&path, NULL, 0, 0);
1923 AC_DEFINE(HAVE_INODEOPS_ENHANCED_GETATTR, 1,
1924 [inode_operations .getattr member function can gather advance stats])
1926 ]) # LC_INODEOPS_ENHANCED_GETATTR
1929 # LC_VM_OPERATIONS_REMOVE_VMF_ARG
1931 # Kernel version 4.11 commit 11bac80004499ea59f361ef2a5516c84b6eab675
1932 # removed struct vm_area_struct as an argument for vm_operations since
1933 # in the same kernel version struct vma_area_struct was folded into
1936 AC_DEFUN([LC_VM_OPERATIONS_REMOVE_VMF_ARG], [
1937 LB_CHECK_COMPILE([if 'struct vm_operations' removed struct vm_area_struct],
1938 vm_operations_no_vm_area_struct, [
1939 #include <linux/mm.h>
1941 struct vm_fault vmf;
1943 ((struct vm_operations_struct *)0)->fault(&vmf);
1944 ((struct vm_operations_struct *)0)->page_mkwrite(&vmf);
1946 AC_DEFINE(HAVE_VM_OPS_USE_VM_FAULT_ONLY, 1,
1947 ['struct vm_operations' remove struct vm_area_struct argument])
1949 ]) # LC_VM_OPERATIONS_REMOVE_VMF_ARG
1952 # LC_HAVE_KEY_USAGE_REFCOUNT
1954 # Kernel version 4.11 commit fff292914d3a2f1efd05ca71c2ba72a3c663201e
1955 # converted key.usage from atomic_t to refcount_t.
1957 AC_DEFUN([LC_HAVE_KEY_USAGE_REFCOUNT], [
1958 LB_CHECK_COMPILE([if 'key.usage' is refcount_t],
1959 key_usage_refcount, [
1960 #include <linux/key.h>
1962 struct key key = { };
1964 refcount_read(&key.usage);
1966 AC_DEFINE(HAVE_KEY_USAGE_REFCOUNT, 1, [key.usage is of type refcount_t])
1968 ]) #LC_HAVE_KEY_USAGE_REFCOUNT
1971 # LC_HAVE_CRYPTO_MAX_ALG_NAME_128
1973 # Kernel version 4.11 commit f437a3f477cce402dbec6537b29e9e33962c9f73
1974 # switched CRYPTO_MAX_ALG_NAME from 64 to 128.
1976 AC_DEFUN([LC_HAVE_CRYPTO_MAX_ALG_NAME_128], [
1977 LB_CHECK_COMPILE([if 'CRYPTO_MAX_ALG_NAME' is 128],
1978 crypto_max_alg_name, [
1979 #include <linux/crypto.h>
1981 #if CRYPTO_MAX_ALG_NAME != 128
1985 AC_DEFINE(HAVE_CRYPTO_MAX_ALG_NAME_128, 1,
1986 ['CRYPTO_MAX_ALG_NAME' is 128])
1988 ]) # LC_HAVE_CRYPTO_MAX_ALG_NAME_128
1991 # Kernel version 4.12 commit 47f38c539e9a42344ff5a664942075bd4df93876
1992 # CURRENT_TIME is not 64 bit time safe so it was replaced with
1995 AC_DEFUN([LC_CURRENT_TIME], [
1996 LB_CHECK_COMPILE([if CURRENT_TIME has been replaced with current_time],
1998 #include <linux/fs.h>
2002 attr.ia_atime = current_time(NULL);
2004 AC_DEFINE(HAVE_CURRENT_TIME, 1,
2005 [current_time() has replaced CURRENT_TIME])
2007 ]) # LIBCFS_CURRENT_TIME
2010 # Kernel version 4.12-rc3 85787090a21eb749d8b347eaf9ff1a455637473c
2011 # changed struct super_block s_uuid into a proper uuid_t
2013 AC_DEFUN([LC_SUPER_BLOCK_S_UUID], [
2014 LB_CHECK_COMPILE([if 'struct super_block' s_uuid is uuid_t],
2015 super_block_s_uuid, [
2016 #include <linux/fs.h>
2018 struct super_block sb;
2020 uuid_parse(NULL, &sb.s_uuid);
2022 AC_DEFINE(HAVE_S_UUID_AS_UUID_T, 1, ['s_uuid' is an uuid_t])
2024 ]) # LC_SUPER_BLOCK_S_UUID
2027 # LC_SUPER_SETUP_BDI_NAME
2029 # Kernel version 4.12 commit 9594caf216dc0fe3e318b34af0127276db661241
2030 # unified bdi handling
2032 AC_DEFUN([LC_SUPER_SETUP_BDI_NAME], [
2033 LB_CHECK_COMPILE([if 'super_setup_bdi_name' exist],
2034 super_setup_bdi_name, [
2035 #include <linux/fs.h>
2037 super_setup_bdi_name(NULL, "lustre");
2039 AC_DEFINE(HAVE_SUPER_SETUP_BDI_NAME, 1,
2040 ['super_setup_bdi_name' is available])
2042 ]) # LC_SUPER_SETUP_BDI_NAME
2047 # 4.12 replace bi_error to bi_status
2049 AC_DEFUN([LC_BI_STATUS], [
2050 LB_CHECK_COMPILE([if 'bi_status' exist],
2052 #include <linux/blk_types.h>
2054 ((struct bio *)0)->bi_status = 0;
2056 AC_DEFINE(HAVE_BI_STATUS, 1,
2057 ['bi_status' is available])
2062 # LC_BIO_INTEGRITY_ENABLED
2064 # 4.13 removed bio_integrity_enabled
2066 AC_DEFUN([LC_BIO_INTEGRITY_ENABLED], [
2067 LB_CHECK_COMPILE([if 'bio_integrity_enabled' exist],
2068 bio_integrity_enabled, [
2069 #include <linux/bio.h>
2071 bio_integrity_enabled(NULL);
2073 AC_DEFINE(HAVE_BIO_INTEGRITY_ENABLED, 1,
2074 ['bio_integrity_enabled' is available])
2076 ]) # LC_BIO_INTEGRITY_ENABLED
2079 # LC_PAGEVEC_INIT_ONE_PARAM
2081 # 4.14 pagevec_init takes one parameter
2083 AC_DEFUN([LC_PAGEVEC_INIT_ONE_PARAM], [
2084 LB_CHECK_COMPILE([if 'pagevec_init' takes one parameter],
2086 #include <linux/pagevec.h>
2090 AC_DEFINE(HAVE_PAGEVEC_INIT_ONE_PARAM, 1,
2091 ['pagevec_init' takes one parameter])
2093 ]) # LC_PAGEVEC_INIT_ONE_PARAM
2098 # 4.14 replaced bi_bdev to bi_disk
2100 AC_DEFUN([LC_BI_BDEV], [
2101 LB_CHECK_COMPILE([if 'bi_bdev' exist],
2103 #include <linux/bio.h>
2105 ((struct bio *)0)->bi_bdev = NULL;
2107 AC_DEFINE(HAVE_BI_BDEV, 1,
2108 ['bi_bdev' is available])
2113 # LC_INTERVAL_TREE_CACHED
2115 # 4.14 f808c13fd3738948e10196496959871130612b61
2116 # switched INTERVAL_TREE_DEFINE to use cached RB_Trees.
2118 AC_DEFUN([LC_INTERVAL_TREE_CACHED], [
2119 tmp_flags="$EXTRA_KCFLAGS"
2120 EXTRA_KCFLAGS="-Werror"
2121 LB_CHECK_COMPILE([if interval_trees use rb_tree_cached],
2123 #include <linux/interval_tree_generic.h>
2124 struct foo { struct rb_node rb; int last; int a,b;};
2125 #define START(n) ((n)->a)
2126 #define LAST(n) ((n)->b)
2127 struct rb_root_cached tree;
2128 INTERVAL_TREE_DEFINE(struct foo, rb, int, last,
2129 START, LAST, , foo);
2131 foo_insert(NULL, &tree);
2133 AC_DEFINE(HAVE_INTERVAL_TREE_CACHED, 1,
2134 [interval trees use rb_tree_cached])
2136 EXTRA_KCFLAGS="$tmp_flags"
2137 ]) # LC_INTERVAL_TREE_CACHED
2142 # 4.14 introduced IS_ENCRYPTED and S_ENCRYPTED
2144 AC_DEFUN([LC_IS_ENCRYPTED], [
2145 LB_CHECK_COMPILE([if IS_ENCRYPTED is defined],
2147 #include <linux/fs.h>
2149 IS_ENCRYPTED((struct inode *)0);
2151 has_is_encrypted="yes"
2153 ]) # LC_IS_ENCRYPTED
2158 # kernel 4.17 commit b93b016313b3ba8003c3b8bb71f569af91f19fc7
2160 AC_DEFUN([LC_I_PAGES], [
2161 LB_CHECK_COMPILE([if struct address_space has i_pages],
2163 #include <linux/fs.h>
2165 struct address_space mapping = {};
2168 i_pages = &mapping.i_pages;
2170 AC_DEFINE(HAVE_I_PAGES, 1,
2171 [struct address_space has i_pages])
2178 # kernel 4.17 commit 3d3539018d2cbd12e5af4a132636ee7fd8d43ef0
2179 # mm: create the new vm_fault_t type
2181 AC_DEFUN([LC_VM_FAULT_T], [
2182 LB_CHECK_COMPILE([if vm_fault_t type exists],
2184 #include <linux/mm_types.h>
2186 vm_fault_t x = VM_FAULT_SIGBUS;
2189 AC_DEFINE(HAVE_VM_FAULT_T, 1,
2190 [if vm_fault_t type exists])
2197 # kernel 4.17 commit 3d3539018d2cbd12e5af4a132636ee7fd8d43ef0
2198 # mm: VM_FAULT_RETRY is defined in enum vm_fault_reason
2200 AC_DEFUN([LC_VM_FAULT_RETRY], [
2201 LB_CHECK_COMPILE([if VM_FAULT_RETRY is defined],
2203 #include <linux/mm.h>
2205 #ifndef VM_FAULT_RETRY
2210 AC_DEFINE(HAVE_VM_FAULT_RETRY, 1,
2211 [if VM_FAULT_RETRY is defined])
2213 ]) # LC_VM_FAULT_RETRY
2216 # LC_ALLOC_FILE_PSEUDO
2218 # kernel 4.18-rc1 commit d93aa9d82aea80b80f225dbf9c7986df444d8106
2219 # new wrapper: alloc_file_pseudo()
2221 AC_DEFUN([LC_ALLOC_FILE_PSEUDO], [
2222 LB_CHECK_COMPILE([if 'alloc_file_pseudo' is defined],
2223 alloc_file_pseudo, [
2224 #include <linux/file.h>
2227 file = alloc_file_pseudo(NULL, NULL, "[test]",
2230 AC_DEFINE(HAVE_ALLOC_FILE_PSEUDO, 1,
2231 ['alloc_file_pseudo' exist])
2233 ]) # LC_ALLOC_FILE_PSEUDO
2236 # LC_INODE_TIMESPEC64
2238 # kernel 4.17-rc7 commit 8efd6894ff089adeeac7cb9f32125b85d963d1bc
2239 # fs: add timespec64_truncate()
2240 # kernel 4.18 commit 95582b00838837fc07e042979320caf917ce3fe6
2241 # inode timestamps switched to timespec64
2242 # kernel 4.19-rc2 commit 976516404ff3fab2a8caa8bd6f5efc1437fed0b8
2243 # y2038: remove unused time interfaces
2247 # When inode times are timespec64 stop using the deprecated
2250 # kernel v5.5-rc1-6-gba70609d5ec6 ba70609d5ec664a8f36ba1c857fcd97a478adf79
2251 # fs: Delete timespec64_trunc()
2253 AC_DEFUN([LC_INODE_TIMESPEC64], [
2254 tmp_flags="$EXTRA_KCFLAGS"
2255 EXTRA_KCFLAGS="-Werror"
2256 LB_CHECK_COMPILE([if inode timestamps are struct timespec64],
2258 #include <linux/fs.h>
2260 struct inode *inode = NULL;
2261 struct timespec64 ts = {0, 1};
2263 inode->i_atime = ts;
2266 AC_DEFINE(HAVE_INODE_TIMESPEC64, 1,
2267 [inode times are using timespec64])
2269 EXTRA_KCFLAGS="$tmp_flags"
2270 ]) # LC_INODE_TIMESPEC64
2273 # LC_RADIX_TREE_TAG_SET
2275 # kernel 4.20 commit v4.19-rc5-248-g9b89a0355144
2276 # xarray: Add XArray marks - replaced radix_tree_tag_set
2278 AC_DEFUN([LC_RADIX_TREE_TAG_SET], [
2279 tmp_flags="$EXTRA_KCFLAGS"
2280 EXTRA_KCFLAGS="-Werror"
2281 LB_CHECK_COMPILE([if 'radix_tree_tag_set' exists],
2282 radix_tree_tag_set, [
2283 #include <linux/fs.h>
2284 #include <linux/radix-tree.h>
2286 radix_tree_tag_set(NULL, 0, PAGECACHE_TAG_DIRTY);
2288 AC_DEFINE(HAVE_RADIX_TREE_TAG_SET, 1,
2289 [radix_tree_tag_set exists])
2291 EXTRA_KCFLAGS="$tmp_flags"
2292 ]) # LC_RADIX_TREE_TAG_SET
2295 # LC_UAPI_LINUX_MOUNT_H
2297 # kernel 4.20 commit e262e32d6bde0f77fb0c95d977482fc872c51996
2298 # vfs: Suppress MS_* flag defs within the kernel ...
2300 AC_DEFUN([LC_UAPI_LINUX_MOUNT_H], [
2301 tmp_flags="$EXTRA_KCFLAGS"
2302 EXTRA_KCFLAGS="-Werror"
2303 LB_CHECK_COMPILE([if MS_RDONLY was moved to uapi/linux/mount.h],
2305 #include <uapi/linux/mount.h>
2310 AC_DEFINE(HAVE_UAPI_LINUX_MOUNT_H, 1,
2311 [if MS_RDONLY was moved to uapi/linux/mount.h])
2313 EXTRA_KCFLAGS="$tmp_flags"
2314 ]) # LC_UAPI_LINUX_MOUNT_H
2317 # LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
2319 # kernel 4.20 commit 1863d77f15da0addcd293a1719fa5d3ef8cde3ca
2320 # SUNRPC: Replace the cache_detail->hash_lock with a regular spinlock
2322 # Now that the reader functions are all RCU protected, use a regular
2323 # spinlock rather than a reader/writer lock.
2325 AC_DEFUN([LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK], [
2326 tmp_flags="$EXTRA_KCFLAGS"
2327 EXTRA_KCFLAGS="-Werror"
2328 LB_CHECK_COMPILE([if cache_detail->hash_lock is a spinlock],
2329 hash_lock_isa_spinlock_t, [
2330 #include <linux/sunrpc/cache.h>
2332 spinlock_t *lock = &(((struct cache_detail *)0)->hash_lock);
2335 AC_DEFINE(HAVE_CACHE_HASH_SPINLOCK, 1,
2336 [if cache_detail->hash_lock is a spinlock])
2338 EXTRA_KCFLAGS="$tmp_flags"
2339 ]) # LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
2342 # LC_HAS_LINUX_SELINUX_ENABLED
2344 # kernel 5.1 commit 3d252529480c68bfd6a6774652df7c8968b28e41
2345 # SELinux: Remove unused selinux_is_enabled
2347 AC_DEFUN([LC_HAS_LINUX_SELINUX_ENABLED], [
2348 tmp_flags="$EXTRA_KCFLAGS"
2349 EXTRA_KCFLAGS="-Werror"
2350 LB_CHECK_COMPILE([if linux/selinux.h exists],
2351 selinux_is_enabled, [
2352 #include <linux/selinux.h>
2354 bool has_selinux = selinux_is_enabled();
2357 AC_DEFINE(HAVE_LINUX_SELINUX_IS_ENABLED, 1,
2358 [if linux/selinux.h exists])
2360 EXTRA_KCFLAGS="$tmp_flags"
2361 ]) # LC_HAS_LINUX_SELINUX_ENABLED
2364 # LB_HAVE_BVEC_ITER_ALL
2366 # kernel 5.1 commit 6dc4f100c175dd0511ae8674786e7c9006cdfbfa
2367 # block: allow bio_for_each_segment_all() to iterate over multi-page bvec
2369 AC_DEFUN([LB_HAVE_BVEC_ITER_ALL], [
2370 tmp_flags="$EXTRA_KCFLAGS"
2371 EXTRA_KCFLAGS="-Werror"
2372 LB_CHECK_COMPILE([if bvec_iter_all exists for multi-page bvec iternation],
2374 #include <linux/bvec.h>
2376 struct bvec_iter_all iter;
2379 AC_DEFINE(HAVE_BVEC_ITER_ALL, 1,
2380 [if bvec_iter_all exists for multi-page bvec iternation])
2382 EXTRA_KCFLAGS="$tmp_flags"
2383 ]) # LB_HAVE_BVEC_ITER_ALL
2386 # LC_ACCOUNT_PAGE_DIRTIED
2388 # After 5.2 kernel page dirtied is not exported
2390 AC_DEFUN([LC_ACCOUNT_PAGE_DIRTIED], [
2391 LB_CHECK_EXPORT([account_page_dirtied], [mm/page-writeback.c],
2392 [AC_DEFINE(HAVE_ACCOUNT_PAGE_DIRTIED_EXPORT, 1,
2393 [account_page_dirtied is exported])])
2394 ]) # LC_ACCOUNT_PAGE_DIRTIED
2397 # LC_KEYRING_SEARCH_4ARGS
2399 # Kernel 5.2 commit dcf49dbc8077
2400 # keys: Add a 'recurse' flag for keyring searches
2402 AC_DEFUN([LC_KEYRING_SEARCH_4ARGS], [
2403 LB_CHECK_COMPILE([if 'keyring_search' has 4 args],
2404 keyring_search_4args, [
2405 #include <linux/key.h>
2408 keyring_search(keyring, NULL, NULL, false);
2410 AC_DEFINE(HAVE_KEYRING_SEARCH_4ARGS, 1,
2411 [keyring_search has 4 args])
2413 ]) # LC_KEYRING_SEARCH_4ARGS
2416 # LC_BIO_BI_PHYS_SEGMENTS
2418 # kernel 5.3-rc1 commit 14ccb66b3f585b2bc21e7256c96090abed5a512c
2419 # block: remove the bi_phys_segments field in struct bio
2421 AC_DEFUN([LC_BIO_BI_PHYS_SEGMENTS], [
2422 tmp_flags="$EXTRA_KCFLAGS"
2423 EXTRA_KCFLAGS="-Werror"
2424 LB_CHECK_COMPILE([if struct bio has bi_phys_segments member],
2425 bye_bio_bi_phys_segments, [
2426 #include <linux/bio.h>
2428 struct bio *bio = NULL;
2429 bio->bi_phys_segments++;
2431 AC_DEFINE(HAVE_BIO_BI_PHYS_SEGMENTS, 1,
2432 [struct bio has bi_phys_segments member])
2434 EXTRA_KCFLAGS="$tmp_flags"
2435 ]) # LC_BIO_BI_PHYS_SEGMENTS
2438 # LC_LM_COMPARE_OWNER_EXISTS
2440 # kernel 5.3-rc3 commit f85d93385e9fe6886a751f647f6812a89bf6bee3
2441 # locks: Cleanup lm_compare_owner and lm_owner_key
2442 # removed lm_compare_owner
2444 AC_DEFUN([LC_LM_COMPARE_OWNER_EXISTS], [
2445 tmp_flags="$EXTRA_KCFLAGS"
2446 EXTRA_KCFLAGS="-Werror"
2447 LB_CHECK_COMPILE([if lock_manager_operations has lm_compare_owner],
2448 lock_manager_ops_lm_compare_owner, [
2449 #include <linux/fs.h>
2451 struct lock_manager_operations lm_ops;
2452 lm_ops.lm_compare_owner = NULL;
2454 AC_DEFINE(HAVE_LM_COMPARE_OWNER, 1,
2455 [lock_manager_operations has lm_compare_owner])
2457 EXTRA_KCFLAGS="$tmp_flags"
2458 ]) # LC_LM_COMPARE_OWNER_EXISTS
2460 AC_DEFUN([LC_PROG_LINUX_SRC], [])
2461 AC_DEFUN([LC_PROG_LINUX_RESULTS], [])
2464 # LC_FSCRYPT_SUPPORT
2466 # 5.4 introduced fscrypt encryption policies v2
2468 AC_DEFUN([LC_FSCRYPT_SUPPORT], [
2469 LB_CHECK_COMPILE([for fscrypt in-kernel support],
2471 #define __FS_HAS_ENCRYPTION 0
2472 #include <linux/fscrypt.h>
2474 fscrypt_ioctl_get_policy_ex(NULL, NULL);
2476 has_fscrypt_support="yes"
2478 ]) # LC_FSCRYPT_SUPPORT
2483 # Lustre linux kernel checks
2485 AC_DEFUN([LC_PROG_LINUX], [
2486 AC_MSG_NOTICE([Lustre kernel checks
2487 ==============================================================================])
2492 LC_CONFIG_HEALTH_CHECK_WRITE
2493 LC_CONFIG_LRU_RESIZE
2498 LC_HAVE_PROJECT_QUOTA
2505 LC_HAVE_DENTRY_D_U_D_ALIAS
2506 LC_HAVE_DENTRY_D_CHILD
2507 LC_PID_NS_FOR_CHILDREN
2510 LC_OLDSIZE_TRUNCATE_PAGECACHE
2511 LC_PTR_ERR_OR_ZERO_MISSING
2513 LC_REGISTER_SHRINKER_RET
2518 LC_HAVE_D_IS_POSITIVE
2522 LC_HAVE_TRUNCATE_IPAGES_FINAL
2523 LC_IOPS_RENAME_WITH_FLAGS
2530 LC_DIRECTIO_USE_ITER
2531 LC_HAVE_IOV_ITER_INIT_DIRECTION
2532 LC_HAVE_IOV_ITER_TRUNCATE
2533 LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
2536 LC_HAVE_INTERVAL_BLK_INTEGRITY
2540 LC_PERCPU_COUNTER_INIT
2541 LC_NFS_FILLDIR_USE_CTX
2545 LC_HAVE_DQUOT_QC_DQBLK
2546 LC_HAVE_AIO_COMPLETE
2547 LC_HAVE_IS_ROOT_INODE
2550 LC_BACKING_DEV_INFO_REMOVAL
2551 LC_HAVE_BDI_CAP_MAP_COPY
2555 LC_HAVE_SYNC_READ_WRITE
2559 LC_BIO_ENDIO_USES_ONE_ARG
2560 LC_SYMLINK_OPS_USE_NAMEIDATA
2561 LC_ACCOUNT_PAGE_DIRTIED_3ARGS
2562 LC_HAVE_CRYPTO_ALLOC_SKCIPHER
2565 LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
2566 LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
2567 LC_HAVE_CACHE_HEAD_HLIST
2568 LC_HAVE_XATTR_HANDLER_SIMPLIFIED
2571 LC_HAVE_LOCKS_LOCK_FILE_WAIT
2572 LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
2573 LC_HAVE_XATTR_HANDLER_NAME
2575 LC_HAVE_SUBMIT_BIO_2ARGS
2576 LC_HAVE_CLEAN_BDEV_ALIASES
2583 LC_HAVE_IOP_GET_LINK
2586 LC_HAVE_IN_COMPAT_SYSCALL
2587 LC_HAVE_XATTR_HANDLER_INODE_PARAM
2594 LC_GENERIC_WRITE_SYNC_2ARGS
2595 LC_FOP_ITERATE_SHARED
2598 LC_EXPORT_DEFAULT_FILE_SPLICE_READ
2599 LC_HAVE_POSIX_ACL_VALID_USER_NS
2601 LC_FULL_NAME_HASH_3ARGS
2602 LC_STRUCT_POSIX_ACL_XATTR
2608 LC_POSIX_ACL_UPDATE_MODE
2611 LC_IOP_GENERIC_READLINK
2612 LC_HAVE_VM_FAULT_ADDRESS
2615 LC_INODEOPS_ENHANCED_GETATTR
2616 LC_VM_OPERATIONS_REMOVE_VMF_ARG
2617 LC_HAVE_KEY_USAGE_REFCOUNT
2618 LC_HAVE_CRYPTO_MAX_ALG_NAME_128
2622 LC_SUPER_BLOCK_S_UUID
2623 LC_SUPER_SETUP_BDI_NAME
2627 LC_BIO_INTEGRITY_ENABLED
2628 LC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL
2629 LC_HAVE_GET_INODE_USAGE
2632 LC_PAGEVEC_INIT_ONE_PARAM
2634 LC_INTERVAL_TREE_CACHED
2642 LC_ALLOC_FILE_PSEUDO
2646 LC_RADIX_TREE_TAG_SET
2647 LC_UAPI_LINUX_MOUNT_H
2648 LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
2651 LC_HAS_LINUX_SELINUX_ENABLED
2652 LB_HAVE_BVEC_ITER_ALL
2655 LC_ACCOUNT_PAGE_DIRTIED
2656 LC_KEYRING_SEARCH_4ARGS
2659 LC_BIO_BI_PHYS_SEGMENTS
2660 LC_LM_COMPARE_OWNER_EXISTS
2662 # kernel patch to extend integrity interface
2663 LC_BIO_INTEGRITY_PREP_FN
2666 AS_IF([test "x$enable_server" != xno], [
2676 # Check whether to build the client side of Lustre
2678 AC_DEFUN([LC_CONFIG_CLIENT], [
2679 AC_MSG_CHECKING([whether to build Lustre client support])
2680 AC_ARG_ENABLE([client],
2681 AC_HELP_STRING([--disable-client],
2682 [disable Lustre client support]),
2683 [], [enable_client="yes"])
2684 AC_MSG_RESULT([$enable_client])
2685 ]) # LC_CONFIG_CLIENT
2690 AC_DEFUN([LB_CONFIG_MPITESTS], [
2691 AC_ARG_ENABLE([mpitests],
2692 AC_HELP_STRING([--enable-mpitests=<yes|no|mpicc wrapper>],
2693 [include mpi tests]), [
2694 enable_mpitests="yes"
2697 MPICC_WRAPPER="mpicc"
2698 MPI_BIN=$(eval which $MPICC_WRAPPER | xargs dirname)
2701 enable_mpitests="no"
2705 MPICC_WRAPPER=$enableval
2706 MPI_BIN=$(eval echo $MPICC_WRAPPER | xargs dirname)
2710 enable_mpitests="yes"
2711 MPICC_WRAPPER="mpicc"
2712 MPI_BIN=$(eval which $MPICC_WRAPPER | xargs dirname)
2715 if test "x$enable_mpitests" != "xno"; then
2718 AC_CACHE_CHECK([whether mpitests can be built],
2719 lb_cv_mpi_tests, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([
2723 MPI_Initialized(&flag);
2726 ])], [lb_cv_mpi_tests="yes"], [lb_cv_mpi_tests="no"])
2728 enable_mpitests=$lb_cv_mpi_tests
2732 AC_SUBST(MPICC_WRAPPER)
2733 ]) # LB_CONFIG_MPITESTS
2738 # whether to enable quota support global control
2740 AC_DEFUN([LC_CONFIG_QUOTA], [
2741 AC_MSG_CHECKING([whether to enable quota support global control])
2742 AC_ARG_ENABLE([quota],
2743 AC_HELP_STRING([--enable-quota],
2744 [enable quota support]),
2745 [], [enable_quota="yes"])
2746 AS_IF([test "x$enable_quota" = xyes],
2747 [AC_MSG_RESULT([yes])],
2748 [AC_MSG_RESULT([no])])
2749 ]) # LC_CONFIG_QUOTA
2754 AC_DEFUN([LC_QUOTA], [
2758 AS_IF([test "x$enable_quota" != xno -a "x$enable_utils" != xno], [
2759 AC_CHECK_HEADER([sys/quota.h],
2760 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1,
2761 [Define to 1 if you have <sys/quota.h>.])],
2762 [AC_MSG_ERROR([don't find <sys/quota.h> in your system])])
2769 # configure support for optional OSD implementation
2771 AC_DEFUN([LC_OSD_ADDON], [
2772 AC_MSG_CHECKING([whether to use OSD addon])
2774 AC_HELP_STRING([--with-osd=path],
2775 [set path to optional osd]),
2782 OSDADDON="$with_osd"
2789 AS_IF([test $ENABLEOSDADDON -eq 0], [
2793 OSDMODNAME=$(basename $OSDADDON)
2794 AS_IF([test -e $LUSTRE/$OSDMODNAME], [
2795 AC_MSG_RESULT([can't link])
2797 ], [ln -s $OSDADDON $LUSTRE/$OSDMODNAME], [
2798 AC_MSG_RESULT([$OSDMODNAME])
2799 OSDADDON="obj-m += $OSDMODNAME/"
2801 AC_MSG_RESULT([can't link])
2811 # Check whether to enable Lustre client crypto
2813 AC_DEFUN([LC_CONFIG_CRYPTO], [
2814 AC_MSG_CHECKING([whether to enable Lustre client crypto])
2815 AC_ARG_ENABLE([crypto],
2816 AC_HELP_STRING([--enable-crypto=yes|no|in-kernel],
2817 [enable Lustre client crypto (default is yes), use 'in-kernel' to force use of in-kernel fscrypt instead of embedded llcrypt]),
2818 [], [enable_crypto="auto"])
2819 AS_IF([test "x$enable_crypto" != xno -a "x$enable_dist" = xno], [
2823 LC_FSCRYPT_SUPPORT])
2824 AS_IF([test "x$enable_crypto" = xin-kernel], [
2825 AS_IF([test "x$has_fscrypt_support" = xyes], [
2826 AC_DEFINE(HAVE_LUSTRE_CRYPTO, 1, [Enable Lustre client crypto via in-kernel fscrypt])], [
2827 AC_MSG_ERROR([Lustre client crypto cannot be enabled via in-kernel fscrypt.])
2828 enable_crypto=no])],
2829 [AS_IF([test "x$has_is_encrypted" = xyes], [
2830 AC_DEFINE(HAVE_LUSTRE_CRYPTO, 1, [Enable Lustre client crypto via embedded llcrypt])
2831 AC_DEFINE(CONFIG_LL_ENCRYPTION, 1, [embedded llcrypt])
2832 enable_crypto="embedded llcrypt"
2833 enable_llcrypt=yes], [
2834 AS_IF([test "x$enable_crypto" = xyes],
2835 [AC_MSG_ERROR([Lustre client crypto cannot be enabled because of lack of encryption support in your kernel.])])
2836 AS_IF([test "x$enable_crypto" != xno -a "x$enable_dist" = xno],
2837 [AC_MSG_WARN(Lustre client crypto cannot be enabled because of lack of encryption support in your kernel.)])
2838 enable_crypto=no])])
2839 AS_IF([test "x$enable_dist" != xno], [
2841 enable_llcrypt=yes])
2842 AC_MSG_RESULT([$enable_crypto])
2843 ]) # LC_CONFIG_CRYPTO
2848 # other configure checks
2850 AC_DEFUN([LC_CONFIGURE], [
2851 AC_MSG_NOTICE([Lustre core checks
2852 ==============================================================================])
2854 AS_IF([test $target_cpu == "i686" -o $target_cpu == "x86_64"],
2855 [CFLAGS="$CFLAGS -Wall -Werror"])
2857 # maximum MDS thread count
2860 # lustre/utils/gss/gss_util.c
2861 # lustre/utils/gss/gssd_proc.c
2862 # lustre/utils/gss/krb5_util.c
2863 # lustre/utils/llog_reader.c
2864 # lustre/utils/create_iam.c
2865 # lustre/utils/libiam.c
2866 AC_CHECK_HEADERS([netdb.h endian.h])
2867 AC_CHECK_FUNCS([gethostbyname])
2869 # lustre/utils/llverfs.c lustre/utils/libmount_utils_ldiskfs.c
2870 AC_CHECK_HEADERS([ext2fs/ext2fs.h], [], [
2871 AS_IF([test "x$enable_utils" = xyes -a "x$enable_ldiskfs" = xyes], [
2873 ext2fs.h not found. Please install e2fsprogs development package.
2878 # lustre/tests/statx_test.c
2879 AC_CHECK_FUNCS([statx])
2881 # lustre/utils/lfs.c
2882 AS_IF([test "$enable_dist" = "no"], [
2883 AC_CHECK_LIB([z], [crc32], [
2884 AC_CHECK_HEADER([zlib.h], [], [
2885 AC_MSG_ERROR([zlib.h not found.])])
2888 zlib library not found. Please install zlib development package.])
2894 AC_CHECK_LIB([selinux], [is_selinux_enabled],
2895 [AC_CHECK_HEADERS([selinux/selinux.h],
2896 [SELINUX="-lselinux"
2897 AC_DEFINE([HAVE_SELINUX], 1,
2898 [support for selinux ])],
2901 No libselinux-devel package found, unable to build selinux enabled tools
2906 No selinux package found, unable to build selinux enabled tools
2911 AC_CHECK_LIB([keyutils], [add_key])
2914 AC_MSG_CHECKING([whether to report minimum OST free space])
2915 AC_ARG_ENABLE([mindf],
2916 AC_HELP_STRING([--enable-mindf],
2917 [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
2918 [], [enable_mindf="no"])
2919 AC_MSG_RESULT([$enable_mindf])
2920 AS_IF([test "$enable_mindf" = "yes"],
2921 [AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])])
2923 AC_MSG_CHECKING([whether to randomly failing memory alloc])
2924 AC_ARG_ENABLE([fail_alloc],
2925 AC_HELP_STRING([--disable-fail-alloc],
2926 [disable randomly alloc failure]),
2927 [], [enable_fail_alloc="yes"])
2928 AC_MSG_RESULT([$enable_fail_alloc])
2929 AS_IF([test "x$enable_fail_alloc" != xno],
2930 [AC_DEFINE([RANDOM_FAIL_ALLOC], 1,
2931 [enable randomly alloc failure])])
2933 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
2934 AC_ARG_ENABLE([invariants],
2935 AC_HELP_STRING([--enable-invariants],
2936 [enable invariant checking (cpu intensive)]),
2937 [], [enable_invariants="no"])
2938 AC_MSG_RESULT([$enable_invariants])
2939 AS_IF([test "x$enable_invariants" = xyes],
2940 [AC_DEFINE([CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK], 1,
2941 [enable invariant checking])])
2943 AC_MSG_CHECKING([whether to track references with lu_ref])
2944 AC_ARG_ENABLE([lu_ref],
2945 AC_HELP_STRING([--enable-lu_ref],
2946 [enable lu_ref reference tracking code]),
2947 [], [enable_lu_ref="no"])
2948 AC_MSG_RESULT([$enable_lu_ref])
2949 AS_IF([test "x$enable_lu_ref" = xyes],
2950 [AC_DEFINE([CONFIG_LUSTRE_DEBUG_LU_REF], 1,
2951 [enable lu_ref reference tracking code])])
2953 AC_MSG_CHECKING([whether to enable page state tracking])
2954 AC_ARG_ENABLE([pgstate-track],
2955 AC_HELP_STRING([--enable-pgstate-track],
2956 [enable page state tracking]),
2957 [], [enable_pgstat_track="no"])
2958 AC_MSG_RESULT([$enable_pgstat_track])
2959 AS_IF([test "x$enable_pgstat_track" = xyes],
2960 [AC_DEFINE([CONFIG_DEBUG_PAGESTATE_TRACKING], 1,
2961 [enable page state tracking code])])
2964 AC_MSG_CHECKING([systemd unit file directory])
2965 AC_ARG_WITH([systemdsystemunitdir],
2966 [AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
2967 [Directory for systemd service files])],
2968 [], [with_systemdsystemunitdir=auto])
2969 AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"],
2970 [def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
2971 AS_IF([test "x$def_systemdsystemunitdir" = "x"],
2972 [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
2973 [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
2974 with_systemdsystemunitdir=no],
2975 [with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
2976 AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
2977 [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
2978 AC_MSG_RESULT([$with_systemdsystemunitdir])
2980 AC_MSG_CHECKING([bash-completion directory])
2981 AC_ARG_WITH([bash-completion-dir],
2982 AS_HELP_STRING([--with-bash-completion-dir[=PATH]],
2983 [Install the bash auto-completion script in this directory.]),
2985 [with_bash_completion_dir=yes])
2986 AS_IF([test "x$with_bash_completion_dir" = "xyes"], [
2987 BASH_COMPLETION_DIR="`pkg-config --variable=completionsdir bash-completion`"
2988 AS_IF([test "x$BASH_COMPLETION_DIR" = "x"], [
2989 [BASH_COMPLETION_DIR="/usr/share/bash-completion/completions"]
2992 BASH_COMPLETION_DIR="$with_bash_completion_dir"
2994 AC_SUBST([BASH_COMPLETION_DIR])
2995 AC_MSG_RESULT([$BASH_COMPLETION_DIR])
3001 # AM_CONDITIONALS for lustre
3003 AC_DEFUN([LC_CONDITIONALS], [
3004 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
3005 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
3006 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
3007 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
3008 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
3009 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
3010 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
3011 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
3012 AM_CONDITIONAL(GSS_SSK, test x$enable_ssk = xyes)
3013 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
3014 AM_CONDITIONAL(HAVE_SYSTEMD, test "x$with_systemdsystemunitdir" != "xno")
3015 AM_CONDITIONAL(ENABLE_BASH_COMPLETION, test "x$with_bash_completion_dir" != "xno")
3016 AM_CONDITIONAL(XATTR_HANDLER, test "x$lb_cv_compile_xattr_handler_flags" = xyes)
3017 AM_CONDITIONAL(SELINUX, test "$SELINUX" = "-lselinux")
3018 AM_CONDITIONAL(GETSEPOL, test x$enable_getsepol = xyes)
3019 AM_CONDITIONAL(LLCRYPT, test x$enable_llcrypt = xyes)
3020 AM_CONDITIONAL(LIBAIO, test x$enable_libaio = xyes)
3021 ]) # LC_CONDITIONALS
3026 # files that should be generated with AC_OUTPUT
3028 AC_DEFUN([LC_CONFIG_FILES],
3032 lustre/autoconf/Makefile
3033 lustre/conf/Makefile
3034 lustre/conf/resource/Makefile
3035 lustre/contrib/Makefile
3037 lustre/include/Makefile
3038 lustre/include/lustre/Makefile
3039 lustre/include/uapi/linux/lustre/Makefile
3040 lustre/kernel_patches/targets/4.18-rhel8.5.target
3041 lustre/kernel_patches/targets/4.18-rhel8.4.target
3042 lustre/kernel_patches/targets/4.18-rhel8.3.target
3043 lustre/kernel_patches/targets/4.18-rhel8.2.target
3044 lustre/kernel_patches/targets/4.18-rhel8.1.target
3045 lustre/kernel_patches/targets/4.18-rhel8.target
3046 lustre/kernel_patches/targets/3.10-rhel7.9.target
3047 lustre/kernel_patches/targets/3.10-rhel7.8.target
3048 lustre/kernel_patches/targets/3.10-rhel7.7.target
3049 lustre/kernel_patches/targets/3.10-rhel7.6.target
3050 lustre/kernel_patches/targets/3.10-rhel7.5.target
3051 lustre/kernel_patches/targets/4.14-rhel7.5.target
3052 lustre/kernel_patches/targets/4.14-rhel7.6.target
3053 lustre/kernel_patches/targets/4.12-sles12sp4.target
3054 lustre/kernel_patches/targets/4.12-sles12sp5.target
3055 lustre/kernel_patches/targets/4.12-sles15sp1.target
3056 lustre/kernel_patches/targets/5.3-sles15sp2.target
3057 lustre/kernel_patches/targets/5.3-sles15sp3.target
3058 lustre/kernel_patches/targets/3.x-fc18.target
3059 lustre/ldlm/Makefile
3061 lustre/fid/autoMakefile
3062 lustre/llite/Makefile
3063 lustre/llite/autoMakefile
3065 lustre/lov/autoMakefile
3067 lustre/mdc/autoMakefile
3069 lustre/lmv/autoMakefile
3070 lustre/lfsck/Makefile
3071 lustre/lfsck/autoMakefile
3073 lustre/mdt/autoMakefile
3075 lustre/mdd/autoMakefile
3077 lustre/fld/autoMakefile
3078 lustre/obdclass/Makefile
3079 lustre/obdclass/autoMakefile
3080 lustre/obdecho/Makefile
3081 lustre/obdecho/autoMakefile
3083 lustre/ofd/autoMakefile
3085 lustre/osc/autoMakefile
3087 lustre/ost/autoMakefile
3088 lustre/osd-ldiskfs/Makefile
3089 lustre/osd-ldiskfs/autoMakefile
3090 lustre/osd-zfs/Makefile
3091 lustre/osd-zfs/autoMakefile
3093 lustre/mgc/autoMakefile
3095 lustre/mgs/autoMakefile
3096 lustre/target/Makefile
3097 lustre/ptlrpc/Makefile
3098 lustre/ptlrpc/autoMakefile
3099 lustre/ptlrpc/gss/Makefile
3100 lustre/ptlrpc/gss/autoMakefile
3101 lustre/quota/Makefile
3102 lustre/quota/autoMakefile
3103 lustre/scripts/Makefile
3104 lustre/scripts/systemd/Makefile
3105 lustre/tests/Makefile
3106 lustre/tests/mpi/Makefile
3107 lustre/tests/lutf/Makefile
3108 lustre/tests/lutf/src/Makefile
3109 lustre/tests/kernel/Makefile
3110 lustre/tests/kernel/autoMakefile
3111 lustre/utils/Makefile
3112 lustre/utils/gss/Makefile
3114 lustre/osp/autoMakefile
3116 lustre/lod/autoMakefile
3118 ]) # LC_CONFIG_FILES