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]))
450 # LC_INVALIDATE_RANGE
452 # 3.11 invalidatepage requires the length of the range to invalidate
454 AC_DEFUN([LC_INVALIDATE_RANGE], [
455 LB_CHECK_COMPILE([if 'address_space_operations.invalidatepage' requires 3 arguments],
456 address_space_ops_invalidatepage_3args, [
457 #include <linux/fs.h>
459 struct address_space_operations a_ops;
460 a_ops.invalidatepage(NULL, 0, 0);
462 AC_DEFINE(HAVE_INVALIDATE_RANGE, 1,
463 [address_space_operations.invalidatepage needs 3 arguments])
465 ]) # LC_INVALIDATE_RANGE
468 # LC_HAVE_DIR_CONTEXT
470 # 3.11 readdir now takes the new struct dir_context
472 AC_DEFUN([LC_HAVE_DIR_CONTEXT], [
473 LB_CHECK_COMPILE([if 'dir_context' exist],
475 #include <linux/fs.h>
477 #ifdef FMODE_KABI_ITERATE
478 #error "back to use readdir in kabi_extand mode"
480 struct dir_context ctx;
485 AC_DEFINE(HAVE_DIR_CONTEXT, 1,
488 ]) # LC_HAVE_DIR_CONTEXT
493 # 3.11 dentry_operations.d_compare() taken 5 arguments.
495 AC_DEFUN([LC_D_COMPARE_5ARGS], [
496 LB_CHECK_COMPILE([if 'd_compare' taken 5 arguments],
498 #include <linux/dcache.h>
500 ((struct dentry_operations*)0)->d_compare(NULL,NULL,0,NULL,NULL);
502 AC_DEFINE(HAVE_D_COMPARE_5ARGS, 1,
503 [d_compare need 5 arguments])
505 ]) # LC_D_COMPARE_5ARGS
510 # 3.11 need to access d_count to get dentry reference count
512 AC_DEFUN([LC_HAVE_DCOUNT], [
513 LB_CHECK_COMPILE([if 'd_count' exists],
515 #include <linux/dcache.h>
517 struct dentry de = { };
520 count = d_count(&de);
522 AC_DEFINE(HAVE_D_COUNT, 1,
528 # LC_PID_NS_FOR_CHILDREN
530 # 3.11 replaces pid_ns by pid_ns_for_children in struct nsproxy
532 AC_DEFUN([LC_PID_NS_FOR_CHILDREN], [
533 LB_CHECK_COMPILE([if 'struct nsproxy' has 'pid_ns_for_children'],
534 pid_ns_for_children, [
535 #include <linux/nsproxy.h>
538 ns.pid_ns_for_children = NULL;
540 AC_DEFINE(HAVE_PID_NS_FOR_CHILDREN, 1,
541 ['struct nsproxy' has 'pid_ns_for_children'])
543 ]) # LC_PID_NS_FOR_CHILDREN
546 # LC_OLDSIZE_TRUNCATE_PAGECACHE
548 # 3.12 truncate_pagecache without oldsize parameter
550 AC_DEFUN([LC_OLDSIZE_TRUNCATE_PAGECACHE], [
551 LB_CHECK_COMPILE([if 'truncate_pagecache' with 'old_size' parameter],
552 truncate_pagecache_old_size, [
553 #include <linux/mm.h>
555 truncate_pagecache(NULL, 0, 0);
557 AC_DEFINE(HAVE_OLDSIZE_TRUNCATE_PAGECACHE, 1,
560 ]) # LC_OLDSIZE_TRUNCATE_PAGECACHE
565 # For some reason SLES11SP4 is missing the PTR_ERR_OR_ZERO macro
566 # It was added to linux kernel 3.12
568 AC_DEFUN([LC_PTR_ERR_OR_ZERO_MISSING], [
569 LB_CHECK_COMPILE([if 'PTR_ERR_OR_ZERO' is missing],
571 #include <linux/err.h>
573 if (PTR_ERR_OR_ZERO(NULL)) return 0;
575 AC_DEFINE(HAVE_PTR_ERR_OR_ZERO, 1,
576 ['PTR_ERR_OR_ZERO' exist])
578 ]) # LC_PTR_ERR_OR_ZERO_MISSING
581 # LC_HAVE_DENTRY_D_U_D_ALIAS
583 # 3.11 kernel moved d_alias to the union d_u in struct dentry
585 # Some distros move d_alias to d_u but it is still a struct list
587 AC_DEFUN([LC_HAVE_DENTRY_D_U_D_ALIAS], [
588 AS_IF([test "x$lb_cv_compile_i_dentry_d_alias_list" = xyes], [
589 LB_CHECK_COMPILE([if list 'dentry.d_u.d_alias' exist],
591 #include <linux/list.h>
592 #include <linux/dcache.h>
595 INIT_LIST_HEAD(&de.d_u.d_alias);
597 AC_DEFINE(HAVE_DENTRY_D_U_D_ALIAS, 1,
598 [list dentry.d_u.d_alias exist])
601 LB_CHECK_COMPILE([if hlist 'dentry.d_u.d_alias' exist],
603 #include <linux/list.h>
604 #include <linux/dcache.h>
607 INIT_HLIST_NODE(&de.d_u.d_alias);
609 AC_DEFINE(HAVE_DENTRY_D_U_D_ALIAS, 1,
610 [hlist dentry.d_u.d_alias exist])
613 ]) # LC_HAVE_DENTRY_D_U_D_ALIAS
616 # LC_HAVE_DENTRY_D_CHILD
618 # 3.11 kernel d_child has been moved out of the union d_u
621 AC_DEFUN([LC_HAVE_DENTRY_D_CHILD], [
622 LB_CHECK_COMPILE([if 'dentry.d_child' exist],
624 #include <linux/list.h>
625 #include <linux/dcache.h>
628 INIT_LIST_HEAD(&de.d_child);
630 AC_DEFINE(HAVE_DENTRY_D_CHILD, 1,
631 [dentry.d_child exist])
633 ]) # LC_HAVE_DENTRY_D_CHILD
638 # 3.12 ki_left removed from struct kiocb
640 AC_DEFUN([LC_KIOCB_KI_LEFT], [
641 LB_CHECK_COMPILE([if 'struct kiocb' with 'ki_left' member],
643 #include <linux/aio.h>
645 ((struct kiocb*)0)->ki_left = 0;
647 AC_DEFINE(HAVE_KIOCB_KI_LEFT, 1,
650 ]) # LC_KIOCB_KI_LEFT
653 # LC_REGISTER_SHRINKER_RET
655 # v3.11-8748-g1d3d4437eae1 register_shrinker returns a status
657 AC_DEFUN([LC_REGISTER_SHRINKER_RET], [
658 LB_CHECK_COMPILE([if register_shrinker() returns status],
659 register_shrinker_ret, [
660 #include <linux/mm.h>
662 if (register_shrinker(NULL))
663 unregister_shrinker(NULL);
665 AC_DEFINE(HAVE_REGISTER_SHRINKER_RET, 1,
666 [register_shrinker() returns status])
668 ]) # LC_REGISTER_SHRINKER_RET
671 # LC_VFS_RENAME_5ARGS
673 # 3.13 has vfs_rename with 5 args
675 AC_DEFUN([LC_VFS_RENAME_5ARGS], [
676 LB_CHECK_COMPILE([if Linux kernel has 'vfs_rename' with 5 args],
678 #include <linux/fs.h>
680 vfs_rename(NULL, NULL, NULL, NULL, NULL);
682 AC_DEFINE(HAVE_VFS_RENAME_5ARGS, 1,
683 [kernel has vfs_rename with 5 args])
685 ]) # LC_VFS_RENAME_5ARGS
688 # LC_VFS_UNLINK_3ARGS
690 # 3.13 has vfs_unlink with 3 args
692 AC_DEFUN([LC_VFS_UNLINK_3ARGS], [
693 LB_CHECK_COMPILE([if Linux kernel has 'vfs_unlink' with 3 args],
695 #include <linux/fs.h>
697 vfs_unlink(NULL, NULL, NULL);
699 AC_DEFINE(HAVE_VFS_UNLINK_3ARGS, 1,
700 [kernel has vfs_unlink with 3 args])
702 ]) # LC_VFS_UNLINK_3ARGS
704 # LC_HAVE_D_IS_POSITIVE
706 # Kernel version 3.13 b18825a7c8e37a7cf6abb97a12a6ad71af160de7
707 # d_is_positive is added
709 AC_DEFUN([LC_HAVE_D_IS_POSITIVE], [
710 LB_CHECK_COMPILE([if 'd_is_positive' exist],
712 #include <linux/dcache.h>
716 AC_DEFINE(HAVE_D_IS_POSITIVE, 1,
717 ['d_is_positive' is available])
719 ]) # LC_HAVE_D_IS_POSITIVE
724 # 3.14 move some of its data in struct bio into the new
727 AC_DEFUN([LC_HAVE_BVEC_ITER], [
728 LB_CHECK_COMPILE([if Linux kernel has struct bvec_iter],
730 #include <linux/bio.h>
732 struct bvec_iter iter;
734 iter.bi_bvec_done = 0;
736 AC_DEFINE(HAVE_BVEC_ITER, 1,
737 [kernel has struct bvec_iter])
739 ]) # LC_HAVE_BVEC_ITER
744 # 3.14 adds set_acl method to inode_operations
745 # see kernel commit 893d46e443346370cd4ea81d9d35f72952c62a37
747 AC_DEFUN([LC_IOP_SET_ACL], [
748 LB_CHECK_COMPILE([if 'inode_operations' has '.set_acl' member function],
750 #include <linux/fs.h>
752 struct inode_operations iop;
755 AC_DEFINE(HAVE_IOP_SET_ACL, 1,
756 [inode_operations has .set_acl member function])
761 # LC_HAVE_TRUNCATE_IPAGE_FINAL
763 # 3.14 bring truncate_inode_pages_final for evict_inode
765 AC_DEFUN([LC_HAVE_TRUNCATE_IPAGES_FINAL], [
766 LB_CHECK_COMPILE([if Linux kernel has truncate_inode_pages_final],
767 truncate_ipages_final, [
768 #include <linux/mm.h>
770 truncate_inode_pages_final(NULL);
772 AC_DEFINE(HAVE_TRUNCATE_INODE_PAGES_FINAL, 1,
773 [kernel has truncate_inode_pages_final])
775 ]) # LC_HAVE_TRUNCATE_IPAGES_FINAL
778 # LC_IOPS_RENAME_WITH_FLAGS
780 # 3.14 has inode_operations->rename with 5 args
781 # commit 520c8b16505236fc82daa352e6c5e73cd9870cff
783 AC_DEFUN([LC_IOPS_RENAME_WITH_FLAGS], [
784 LB_CHECK_COMPILE([if 'inode_operations->rename' taken flags as argument],
785 iops_rename_with_flags, [
786 #include <linux/fs.h>
788 struct inode *i1 = NULL, *i2 = NULL;
789 struct dentry *d1 = NULL, *d2 = NULL;
791 rc = ((struct inode_operations *)0)->rename(i1, d1, i2, d2, 0);
793 AC_DEFINE(HAVE_IOPS_RENAME_WITH_FLAGS, 1,
794 [inode_operations->rename need flags as argument])
796 ]) # LC_IOPS_RENAME_WITH_FLAGS
799 # LC_VFS_RENAME_6ARGS
801 # 3.15 has vfs_rename with 6 args
803 AC_DEFUN([LC_VFS_RENAME_6ARGS], [
804 LB_CHECK_COMPILE([if Linux kernel has 'vfs_rename' with 6 args],
806 #include <linux/fs.h>
808 vfs_rename(NULL, NULL, NULL, NULL, NULL, NULL);
810 AC_DEFINE(HAVE_VFS_RENAME_6ARGS, 1,
811 [kernel has vfs_rename with 6 args])
813 ]) # LC_VFS_RENAME_6ARGS
816 # LC_DIRECTIO_USE_ITER
818 # 3.16 kernel changes direct IO to use iov_iter
820 AC_DEFUN([LC_DIRECTIO_USE_ITER], [
821 LB_CHECK_COMPILE([if direct IO uses iov_iter],
823 #include <linux/fs.h>
825 struct address_space_operations ops = { };
826 struct iov_iter *iter = NULL;
829 ops.direct_IO(0, NULL, iter, offset);
831 AC_DEFINE(HAVE_DIRECTIO_ITER, 1,
832 [direct IO uses iov_iter])
834 ]) # LC_DIRECTIO_USE_ITER
837 # LC_HAVE_IOV_ITER_INIT_DIRECTION
840 # 3.16 linux commit 71d8e532b1549a478e6a6a8a44f309d050294d00
841 # changed iov_iter_init api to start accepting a tag
842 # that defines if its a read or write operation
844 AC_DEFUN([LC_HAVE_IOV_ITER_INIT_DIRECTION], [
845 tmp_flags="$EXTRA_KCFLAGS"
846 EXTRA_KCFLAGS="-Werror"
847 LB_CHECK_COMPILE([if 'iov_iter_init' takes a tag],
849 #include <linux/uio.h>
850 #include <linux/fs.h>
852 const struct iovec *iov = NULL;
854 iov_iter_init(NULL, READ, iov, 1, 0);
856 AC_DEFINE(HAVE_IOV_ITER_INIT_DIRECTION, 1,
857 [iov_iter_init handles directional tag])
859 EXTRA_KCFLAGS="$tmp_flags"
860 ]) # LC_HAVE_IOV_ITER_INIT_DIRECTION
863 # LC_HAVE_IOV_ITER_TRUNCATE
866 # 3.16 introduces a new API iov_iter_truncate()
868 AC_DEFUN([LC_HAVE_IOV_ITER_TRUNCATE], [
869 tmp_flags="$EXTRA_KCFLAGS"
870 EXTRA_KCFLAGS="-Werror"
871 LB_CHECK_COMPILE([if 'iov_iter_truncate' exists ],
873 #include <linux/uio.h>
874 #include <linux/fs.h>
876 struct iov_iter *i = NULL;
878 iov_iter_truncate(i, 0);
880 AC_DEFINE(HAVE_IOV_ITER_TRUNCATE, 1, [iov_iter_truncate exists])
882 EXTRA_KCFLAGS="$tmp_flags"
883 ]) # LC_HAVE_IOV_ITER_TRUNCATE
886 # LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
888 # 3.16 introduces [read|write]_iter to struct file_operations
890 AC_DEFUN([LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER], [
891 LB_CHECK_COMPILE([if 'file_operations.[read|write]_iter' exist],
892 file_function_iter, [
893 #include <linux/fs.h>
895 ((struct file_operations *)NULL)->read_iter(NULL, NULL);
896 ((struct file_operations *)NULL)->write_iter(NULL, NULL);
898 AC_DEFINE(HAVE_FILE_OPERATIONS_READ_WRITE_ITER, 1,
899 [file_operations.[read|write]_iter functions exist])
901 ]) # LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
904 # LC_HAVE_INTERVAL_BLK_INTEGRITY
906 # 3.17 replace sector_size with interval in struct blk_integrity
908 AC_DEFUN([LC_HAVE_INTERVAL_BLK_INTEGRITY], [
909 LB_CHECK_COMPILE([if 'blk_integrity.interval' exist],
910 interval_blk_integrity, [
911 #include <linux/blkdev.h>
913 ((struct blk_integrity *)0)->interval = 0;
915 AC_DEFINE(HAVE_INTERVAL_BLK_INTEGRITY, 1,
916 [blk_integrity.interval exist])
918 ]) # LC_HAVE_INTERVAL_BLK_INTEGRITY
923 # 3.17 replaces key_type::match with match_preparse
924 # and has new struct key_match_data
926 AC_DEFUN([LC_KEY_MATCH_DATA], [
927 LB_CHECK_COMPILE([if struct key_match field exist],
929 #include <linux/key-type.h>
931 struct key_match_data data;
933 data.raw_data = NULL;
935 AC_DEFINE(HAVE_KEY_MATCH_DATA, 1,
936 [struct key_match_data exist])
938 ]) # LC_KEY_MATCH_DATA
941 # LC_NFS_FILLDIR_USE_CTX
943 # 3.18 kernel moved from void cookie to struct dir_context
945 AC_DEFUN([LC_NFS_FILLDIR_USE_CTX], [
946 tmp_flags="$EXTRA_KCFLAGS"
947 EXTRA_KCFLAGS="-Werror"
948 LB_CHECK_COMPILE([if filldir_t uses struct dir_context],
950 #include <linux/fs.h>
952 int filldir(struct dir_context *ctx, const char* name,
953 int i, loff_t off, u64 tmp, unsigned temp)
958 struct dir_context ctx = {
962 ctx.actor(NULL, "test", 0, (loff_t) 0, 0, 0);
964 AC_DEFINE(HAVE_FILLDIR_USE_CTX, 1,
965 [filldir_t needs struct dir_context as argument])
967 EXTRA_KCFLAGS="$tmp_flags"
968 ]) # LC_NFS_FILLDIR_USE_CTX
971 # LC_PERCPU_COUNTER_INIT
973 # 3.18 For kernels 3.18 and after percpu_counter_init starts
974 # to pass a GFP_* memory allocation flag for internal
975 # memory allocation purposes.
977 AC_DEFUN([LC_PERCPU_COUNTER_INIT], [
978 LB_CHECK_COMPILE([if percpu_counter_init uses GFP_* flag as argument],
979 percpu_counter_init, [
980 #include <linux/percpu_counter.h>
982 percpu_counter_init(NULL, 0, GFP_KERNEL);
984 AC_DEFINE(HAVE_PERCPU_COUNTER_INIT_GFP_FLAG, 1,
985 [percpu_counter_init uses GFP_* flag])
987 ]) # LC_PERCPU_COUNTER_INIT
990 # LC_KIOCB_HAS_NBYTES
992 # 3.19 kernel removed ki_nbytes from struct kiocb
994 AC_DEFUN([LC_KIOCB_HAS_NBYTES], [
995 LB_CHECK_COMPILE([if struct kiocb has ki_nbytes field],
997 #include <linux/fs.h>
999 struct kiocb iocb = { };
1003 AC_DEFINE(HAVE_KI_NBYTES, 1, [ki_nbytes field exist])
1005 ]) # LC_KIOCB_HAS_NBYTES
1008 # LC_HAVE_DQUOT_QC_DQBLK
1010 # 3.19 has quotactl_ops->[sg]et_dqblk that take struct kqid and qc_dqblk
1011 # Added in commit 14bf61ffe
1013 AC_DEFUN([LC_HAVE_DQUOT_QC_DQBLK], [
1014 tmp_flags="$EXTRA_KCFLAGS"
1015 EXTRA_KCFLAGS="-Werror"
1016 LB_CHECK_COMPILE([if 'quotactl_ops.set_dqblk' takes struct qc_dqblk],
1018 #include <linux/fs.h>
1019 #include <linux/quota.h>
1021 ((struct quotactl_ops *)0)->set_dqblk(NULL, *((struct kqid*)0), (struct qc_dqblk*)0);
1023 AC_DEFINE(HAVE_DQUOT_QC_DQBLK, 1,
1024 [quotactl_ops.set_dqblk takes struct qc_dqblk])
1025 AC_DEFINE(HAVE_DQUOT_KQID, 1,
1026 [quotactl_ops.set_dqblk takes struct kqid])
1028 EXTRA_KCFLAGS="$tmp_flags"
1029 ]) # LC_HAVE_DQUOT_QC_DQBLK
1032 # LC_HAVE_AIO_COMPLETE
1034 # 3.19 kernel makes aio_complete() static
1036 AC_DEFUN([LC_HAVE_AIO_COMPLETE], [
1037 LB_CHECK_COMPILE([if kernel has exported aio_complete() ],
1039 #include <linux/aio.h>
1041 aio_complete(NULL, 0, 0);
1043 AC_DEFINE(HAVE_AIO_COMPLETE, 1, [aio_complete defined])
1045 ]) # LC_HAVE_AIO_COMPLETE
1048 # LC_HAVE_IS_ROOT_INODE
1050 # 3.19 kernel adds is_root_inode()
1051 # Commit a7400222e3eb ("new helper: is_root_inode()")
1053 AC_DEFUN([LC_HAVE_IS_ROOT_INODE], [
1054 LB_CHECK_COMPILE([if kernel has is_root_inode() ],
1056 #include <linux/fs.h>
1058 is_root_inode(NULL);
1060 AC_DEFINE(HAVE_IS_ROOT_INODE, 1, [is_root_inode defined])
1062 ]) # LC_HAVE_IS_ROOT_INODE
1065 # LC_BACKING_DEV_INFO_REMOVAL
1067 # 3.20 kernel removed backing_dev_info from address_space
1069 AC_DEFUN([LC_BACKING_DEV_INFO_REMOVAL], [
1070 LB_CHECK_COMPILE([if struct address_space has backing_dev_info],
1072 #include <linux/fs.h>
1074 struct address_space mapping;
1076 mapping.backing_dev_info = NULL;
1078 AC_DEFINE(HAVE_BACKING_DEV_INFO, 1, [backing_dev_info exist])
1080 ]) # LC_BACKING_DEV_INFO_REMOVAL
1083 # LC_HAVE_BDI_CAP_MAP_COPY
1085 # 3.20 removed mmap handling for backing devices since
1086 # it breaks on non-MMU systems. See kernel commit
1087 # b4caecd48005fbed3949dde6c1cb233142fd69e9
1089 AC_DEFUN([LC_HAVE_BDI_CAP_MAP_COPY], [
1090 LB_CHECK_COMPILE([if have 'BDI_CAP_MAP_COPY'],
1092 #include <linux/backing-dev.h>
1094 struct backing_dev_info info;
1096 info.capabilities = BDI_CAP_MAP_COPY;
1098 AC_DEFINE(HAVE_BDI_CAP_MAP_COPY, 1,
1099 [BDI_CAP_MAP_COPY exist])
1101 ]) # LC_HAVE_BDI_CAP_MAP_COPY
1104 # LC_HAVE_PROJECT_QUOTA
1106 # Kernel version v4.0-rc1-197-g847aac644e92
1108 AC_DEFUN([LC_HAVE_PROJECT_QUOTA], [
1109 LB_CHECK_COMPILE([if get_projid exists],
1112 #include <linux/quota.h>
1114 struct dquot_operations ops = { };
1116 ops.get_projid(NULL, NULL);
1118 AC_DEFINE(HAVE_PROJECT_QUOTA, 1,
1119 [get_projid function exists])
1121 ]) # LC_HAVE_PROJECT_QUOTA
1126 # 4.1 kernel has iov_iter_rw
1128 AC_DEFUN([LC_IOV_ITER_RW], [
1129 LB_CHECK_COMPILE([if iov_iter_rw exist],
1131 #include <linux/fs.h>
1132 #include <linux/uio.h>
1134 struct iov_iter *iter = NULL;
1138 AC_DEFINE(HAVE_IOV_ITER_RW, 1,
1139 [iov_iter_rw exist])
1144 # LC_HAVE_SYNC_READ_WRITE
1146 # 4.1 new_sync_[read|write] no longer exported
1148 AC_DEFUN([LC_HAVE_SYNC_READ_WRITE], [
1149 LB_CHECK_EXPORT([new_sync_read], [fs/read_write.c],
1150 [AC_DEFINE(HAVE_SYNC_READ_WRITE, 1,
1151 [new_sync_[read|write] is exported by the kernel])])
1152 ]) # LC_HAVE_SYNC_READ_WRITE
1157 # 4.1 redefined bi_cnt as __bi_cnt in commit dac56212e8127dbc0
1159 AC_DEFUN([LC_HAVE___BI_CNT], [
1160 LB_CHECK_COMPILE([if Linux kernel has __bi_cnt in struct bio],
1162 #include <asm/atomic.h>
1163 #include <linux/bio.h>
1164 #include <linux/blk_types.h>
1166 struct bio bio = { };
1168 cnt = atomic_read(&bio.__bi_cnt);
1170 AC_DEFINE(HAVE___BI_CNT, 1,
1171 [struct bio has __bi_cnt])
1173 ]) # LC_HAVE___BI_CNT
1176 # LC_SYMLINK_OPS_USE_NAMEIDATA
1178 # For the 4.2+ kernels the file system internal symlink api no
1179 # longer uses struct nameidata as a argument
1181 AC_DEFUN([LC_SYMLINK_OPS_USE_NAMEIDATA], [
1182 LB_CHECK_COMPILE([if symlink inode operations have struct nameidata argument],
1183 symlink_use_nameidata, [
1184 #include <linux/namei.h>
1185 #include <linux/fs.h>
1187 struct nameidata *nd = NULL;
1189 ((struct inode_operations *)0)->follow_link(NULL, nd);
1190 ((struct inode_operations *)0)->put_link(NULL, nd, NULL);
1192 AC_DEFINE(HAVE_SYMLINK_OPS_USE_NAMEIDATA, 1,
1193 [symlink inode operations need struct nameidata argument])
1195 ]) # LC_SYMLINK_OPS_USE_NAMEIDATA
1198 # LC_BIO_ENDIO_USES_ONE_ARG
1200 # 4.2 kernel bio_endio now only takes one argument
1202 AC_DEFUN([LC_BIO_ENDIO_USES_ONE_ARG], [
1203 LB_CHECK_COMPILE([if 'bio_endio' with one argument exist],
1205 #include <linux/bio.h>
1209 AC_DEFINE(HAVE_BIO_ENDIO_USES_ONE_ARG, 1,
1210 [bio_endio takes only one argument])
1212 ]) # LC_BIO_ENDIO_USES_ONE_ARG
1215 # LC_ACCOUNT_PAGE_DIRTIED_3ARGS
1217 # 4.2 [to 4.5] kernel page dirtied takes 3 arguments
1219 AC_DEFUN([LC_ACCOUNT_PAGE_DIRTIED_3ARGS], [
1220 LB_CHECK_COMPILE([if 'account_page_dirtied' with 3 args exists],
1221 account_page_dirtied, [
1222 #include <linux/mm.h>
1224 account_page_dirtied(NULL, NULL, NULL);
1226 AC_DEFINE(HAVE_ACCOUNT_PAGE_DIRTIED_3ARGS, 1,
1227 [account_page_dirtied takes three arguments])
1229 ]) # LC_ACCOUNT_PAGE_DIRTIED_3ARGS
1232 # LC_HAVE_CRYPTO_ALLOC_SKCIPHER
1234 # Kernel version 4.12 commit 7a7ffe65c8c5
1235 # introduced crypto_alloc_skcipher().
1237 AC_DEFUN([LC_HAVE_CRYPTO_ALLOC_SKCIPHER], [
1238 LB_CHECK_COMPILE([if crypto_alloc_skcipher is defined],
1239 crypto_alloc_skcipher, [
1240 #include <crypto/skcipher.h>
1242 crypto_alloc_skcipher(NULL, 0, 0);
1244 AC_DEFINE(HAVE_CRYPTO_ALLOC_SKCIPHER, 1,
1245 [crypto_alloc_skcipher is defined])
1247 ]) # LC_HAVE_CRYPTO_ALLOC_SKCIPHER
1250 # LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
1252 # 4.3 replace interval with interval_exp in 'struct blk_integrity'
1253 # 'struct blk_integrity_profile' is also added in this version,
1254 # thus use this to determine whether 'struct blk_integrity' has profile
1256 AC_DEFUN([LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY], [
1257 LB_CHECK_COMPILE([if 'blk_integrity.interval_exp' exist],
1258 blk_integrity_interval_exp, [
1259 #include <linux/blkdev.h>
1261 ((struct blk_integrity *)0)->interval_exp = 0;
1263 AC_DEFINE(HAVE_INTERVAL_EXP_BLK_INTEGRITY, 1,
1264 [blk_integrity.interval_exp exist])
1266 ]) # LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
1269 # LC_HAVE_CACHE_HEAD_HLIST
1271 # 4.3 kernel swiched to hlist for cache_head
1273 AC_DEFUN([LC_HAVE_CACHE_HEAD_HLIST], [
1274 LB_CHECK_COMPILE([if 'struct cache_head' has 'cache_list' field],
1275 cache_head_has_hlist, [
1276 #include <linux/sunrpc/cache.h>
1278 do {} while(sizeof(((struct cache_head *)0)->cache_list));
1280 AC_DEFINE(HAVE_CACHE_HEAD_HLIST, 1,
1281 [cache_head has hlist cache_list])
1283 ]) # LC_HAVE_CACHE_HEAD_HLIST
1286 # LC_HAVE_XATTR_HANDLER_SIMPLIFIED
1288 # Kernel version 4.3 commit e409de992e3ea3674393465f07cc71c948edd87a
1289 # simplified xattr_handler handling by passing in the handler pointer
1291 AC_DEFUN([LC_HAVE_XATTR_HANDLER_SIMPLIFIED], [
1292 tmp_flags="$EXTRA_KCFLAGS"
1293 EXTRA_KCFLAGS="-Werror"
1294 LB_CHECK_COMPILE([if 'struct xattr_handler' functions pass in handler pointer],
1295 xattr_handler_simplified, [
1296 #include <linux/xattr.h>
1298 struct xattr_handler handler;
1300 ((struct xattr_handler *)0)->get(&handler, NULL, NULL, NULL, 0);
1301 ((struct xattr_handler *)0)->set(&handler, NULL, NULL, NULL, 0, 0);
1303 AC_DEFINE(HAVE_XATTR_HANDLER_SIMPLIFIED, 1, [handler pointer is parameter])
1305 EXTRA_KCFLAGS="$tmp_flags"
1306 ]) # LC_HAVE_XATTR_HANDLER_SIMPLIFIED
1309 # LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
1311 # 4.3 replace interval with interval_exp in 'struct blk_integrity'.
1313 AC_DEFUN([LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD], [
1314 LB_CHECK_COMPILE([if 'bio_integrity_payload.bip_iter' exist],
1315 bio_integrity_payload_bip_iter, [
1316 #include <linux/bio.h>
1318 ((struct bio_integrity_payload *)0)->bip_iter.bi_size = 0;
1320 AC_DEFINE(HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD, 1,
1321 [bio_integrity_payload.bip_iter exist])
1323 ]) # LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
1326 # LC_BIO_INTEGRITY_PREP_FN
1328 # Lustre kernel patch extents bio_integrity_prep to accept optional
1329 # generate/verify_fn as extra args.
1331 AC_DEFUN([LC_BIO_INTEGRITY_PREP_FN], [
1332 LB_CHECK_COMPILE([if 'bio_integrity_prep_fn' exists],
1333 bio_integrity_prep_fn, [
1334 #include <linux/bio.h>
1336 bio_integrity_prep_fn(NULL, NULL, NULL);
1338 AC_DEFINE(HAVE_BIO_INTEGRITY_PREP_FN, 1,
1339 [kernel has bio_integrity_prep_fn])
1340 AC_SUBST(PATCHED_INTEGRITY_INTF)
1342 AC_SUBST(PATCHED_INTEGRITY_INTF, [#])
1344 ]) # LC_BIO_INTEGRITY_PREP_FN
1346 # LC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL
1348 # 13 kernel integrity API has changed and in 4.13+
1349 # (as well as in rhel 8.4) bio_integrity_prep() returns boolean true
1352 AC_DEFUN([LC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL], [
1353 LB_CHECK_COMPILE([if 'bio_integrity_prep_fn' returns bool],
1354 bio_integrity_prep, [
1355 #include <linux/bio.h>
1356 #include <linux/typecheck.h>
1358 #pragma GCC diagnostic warning "-Werror"
1359 typedef bool (*bio_integrity_prep_type)(struct bio *bio) ;
1361 typecheck_fn(bio_integrity_prep_type, bio_integrity_prep);
1363 AC_DEFINE(HAVE_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL, 1,
1364 [bio_integrity_prep_fn returns bool])
1366 ]) # LC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL
1371 # 4.4/4.8 redefined bi_rw as bi_opf (SLES12/kernel commit 4382e33ad37486)
1373 AC_DEFUN([LC_HAVE_BI_OPF], [
1374 LB_CHECK_COMPILE([if Linux kernel has bi_opf in struct bio],
1376 #include <linux/bio.h>
1382 AC_DEFINE(HAVE_BI_OPF, 1,
1383 [struct bio has bi_opf])
1388 # LC_HAVE_SUBMIT_BIO_2ARGS
1390 # 4.4 removed an argument from submit_bio
1392 AC_DEFUN([LC_HAVE_SUBMIT_BIO_2ARGS], [
1393 LB_CHECK_COMPILE([if submit_bio takes two arguments],
1394 have_submit_bio_2args, [
1395 #include <linux/bio.h>
1398 submit_bio(READ, &bio);
1400 AC_DEFINE(HAVE_SUBMIT_BIO_2ARGS, 1,
1401 [submit_bio takes two arguments])
1403 ]) # LC_HAVE_SUBMIT_BIO_2_ARGS
1406 # LC_HAVE_CLEAN_BDEV_ALIASES
1408 # 4.4/4.9 unmap_underlying_metadata was replaced by clean_bdev_aliases
1409 # (SLES12/kernel commit 29f3ad7d8380364c)
1411 AC_DEFUN([LC_HAVE_CLEAN_BDEV_ALIASES], [
1412 LB_CHECK_COMPILE([if kernel has clean_bdev_aliases],
1413 have_clean_bdev_aliases, [
1414 #include <linux/buffer_head.h>
1416 clean_bdev_aliases(NULL,1,1);
1418 AC_DEFINE(HAVE_CLEAN_BDEV_ALIASES, 1,
1419 [kernel has clean_bdev_aliases])
1421 ]) # LC_HAVE_CLEAN_BDEV_ALIASES
1424 # LC_HAVE_LOCKS_LOCK_FILE_WAIT
1426 # 4.4 kernel have moved locks API users to
1427 # locks_lock_inode_wait()
1429 AC_DEFUN([LC_HAVE_LOCKS_LOCK_FILE_WAIT], [
1430 LB_CHECK_COMPILE([if 'locks_lock_file_wait' exists],
1431 locks_lock_file_wait, [
1432 #include <linux/fs.h>
1434 locks_lock_file_wait(NULL, NULL);
1436 AC_DEFINE(HAVE_LOCKS_LOCK_FILE_WAIT, 1,
1437 [kernel has locks_lock_file_wait])
1439 ]) # LC_HAVE_LOCKS_LOCK_FILE_WAIT
1442 # LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
1444 # 4.4 kernel merged type-specific data with the payload data for keys
1446 AC_DEFUN([LC_HAVE_KEY_PAYLOAD_DATA_ARRAY], [
1447 LB_CHECK_COMPILE([if 'struct key' has 'payload.data' as an array],
1448 key_payload_data_array, [
1449 #include <linux/key.h>
1451 struct key key = { };
1453 key.payload.data[0] = NULL;
1455 AC_DEFINE(HAVE_KEY_PAYLOAD_DATA_ARRAY, 1, [payload.data is an array])
1457 ]) #LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
1460 # LC_HAVE_XATTR_HANDLER_NAME
1462 # Kernel version 4.4 commit 98e9cb5711c68223f0e4d5201b9a6add255ec550
1463 # add a name member to struct xattr_handler
1465 AC_DEFUN([LC_HAVE_XATTR_HANDLER_NAME], [
1466 tmp_flags="$EXTRA_KCFLAGS"
1467 EXTRA_KCFLAGS="-Werror"
1468 LB_CHECK_COMPILE([if 'struct xattr_handler' has a name member],
1469 xattr_handler_name, [
1470 #include <linux/xattr.h>
1472 ((struct xattr_handler *)NULL)->name = NULL;
1474 AC_DEFINE(HAVE_XATTR_HANDLER_NAME, 1, [xattr_handler has a name member])
1476 EXTRA_KCFLAGS="$tmp_flags"
1477 ]) # LC_HAVE_XATTR_HANDLER_NAME
1480 # LC_HAVE_FILE_DENTRY
1482 # 4.5 adds wrapper file_dentry
1484 AC_DEFUN([LC_HAVE_FILE_DENTRY], [
1485 LB_CHECK_COMPILE([if Linux kernel has 'file_dentry'],
1487 #include <linux/fs.h>
1491 AC_DEFINE(HAVE_FILE_DENTRY, 1,
1492 [kernel has file_dentry])
1494 ]) # LC_HAVE_FILE_DENTRY
1497 # LC_HAVE_INODE_LOCK
1499 # 4.5 introduced inode_lock
1501 AC_DEFUN([LC_HAVE_INODE_LOCK], [
1502 LB_CHECK_COMPILE([if 'inode_lock' is defined],
1504 #include <linux/fs.h>
1508 AC_DEFINE(HAVE_INODE_LOCK, 1,
1509 [inode_lock is defined])
1511 ]) # LC_HAVE_INODE_LOCK
1514 # LC_HAVE_IOP_GET_LINK
1516 # 4.5 vfs replaced iop->follow_link with
1519 AC_DEFUN([LC_HAVE_IOP_GET_LINK], [
1520 LB_CHECK_COMPILE([if 'iop' has 'get_link'],
1521 inode_ops_get_link, [
1522 #include <linux/fs.h>
1524 struct inode_operations iop;
1525 iop.get_link = NULL;
1527 AC_DEFINE(HAVE_IOP_GET_LINK, 1,
1528 [have iop get_link])
1530 ]) # LC_HAVE_IOP_GET_LINK
1533 # LC_HAVE_IN_COMPAT_SYSCALL
1535 # 4.6 renamed is_compat_task to in_compat_syscall
1537 AC_DEFUN([LC_HAVE_IN_COMPAT_SYSCALL], [
1538 LB_CHECK_COMPILE([if 'in_compat_syscall' is defined],
1539 in_compat_syscall, [
1540 #include <linux/compat.h>
1542 in_compat_syscall();
1544 AC_DEFINE(HAVE_IN_COMPAT_SYSCALL, 1,
1545 [have in_compat_syscall])
1547 ]) # LC_HAVE_IN_COMPAT_SYSCALL
1550 # LC_HAVE_XATTR_HANDLER_INODE_PARAM
1552 # Kernel version 4.6 commit b296821a7c42fa58baa17513b2b7b30ae66f3336
1553 # and commit 5930122683dff58f0846b0f0405b4bd598a3ba6a added inode parameter
1554 # to xattr_handler functions
1556 AC_DEFUN([LC_HAVE_XATTR_HANDLER_INODE_PARAM], [
1557 tmp_flags="$EXTRA_KCFLAGS"
1558 EXTRA_KCFLAGS="-Werror"
1559 LB_CHECK_COMPILE([if 'struct xattr_handler' functions have inode parameter],
1560 xattr_handler_inode_param, [
1561 #include <linux/xattr.h>
1563 const struct xattr_handler handler;
1565 ((struct xattr_handler *)0)->get(&handler, NULL, NULL, NULL, NULL, 0);
1566 ((struct xattr_handler *)0)->set(&handler, NULL, NULL, NULL, NULL, 0, 0);
1568 AC_DEFINE(HAVE_XATTR_HANDLER_INODE_PARAM, 1, [needs inode parameter])
1570 EXTRA_KCFLAGS="$tmp_flags"
1571 ]) # LC_HAVE_XATTR_HANDLER_INODE_PARAM
1576 # Kernel version 4.6 commit 85c7f81041d57cfe9dc97f4680d5586b54534a39
1577 # introduced parallel lookups in the VFS layer. The inline function
1578 # d_in_lookup was added to notify when the same item was being queried
1581 AC_DEFUN([LC_D_IN_LOOKUP], [
1582 tmp_flags="$EXTRA_KCFLAGS"
1583 EXTRA_KCFLAGS="-Werror"
1584 LB_CHECK_COMPILE([if 'd_in_lookup' is defined],
1586 #include <linux/dcache.h>
1590 AC_DEFINE(HAVE_D_IN_LOOKUP, 1, [d_in_lookup is defined])
1592 EXTRA_KCFLAGS="$tmp_flags"
1596 # LC_LOCK_PAGE_MEMCG
1598 # Kernel version 4.6 adds lock_page_memcg
1600 AC_DEFUN([LC_LOCK_PAGE_MEMCG], [
1601 LB_CHECK_COMPILE([if 'lock_page_memcg' is defined],
1603 #include <linux/memcontrol.h>
1605 lock_page_memcg(NULL);
1607 AC_DEFINE(HAVE_LOCK_PAGE_MEMCG, 1,
1608 [lock_page_memcg is defined])
1610 ]) # LC_LOCK_PAGE_MEMCG
1613 # LC_HAVE_DOWN_WRITE_KILLABLE
1615 # Kernel version v4.6-rc3-28-g916633a40370
1617 AC_DEFUN([LC_HAVE_DOWN_WRITE_KILLABLE], [
1618 LB_CHECK_COMPILE([if down_write_killable exists],
1619 down_write_killable, [
1620 struct rw_semaphore sem;
1621 #include <linux/rwsem.h>
1625 rc = down_write_killable(&sem);
1627 AC_DEFINE(HAVE_DOWN_WRITE_KILLABLE, 1,
1628 [down_write_killable function exists])
1630 ]) # LC_HAVE_DOWN_WRITE_KILLABLE
1635 # Kernel version 4.7-rc5 commit 285b102d3b745f3c2c110c9c327741d87e64aacc
1636 # add new d_init to initialize dentry at allocation time
1638 AC_DEFUN([LC_D_INIT], [
1639 LB_CHECK_COMPILE([if dentry operations supports 'd_init'],
1641 #include <linux/dcache.h>
1643 struct dentry_operations ops = { };
1646 rc = ops.d_init(NULL);
1648 AC_DEFINE(HAVE_D_INIT, 1, ['d_init' exists])
1655 # Kernel version 4.7 commit c8b8e32d700fe943a935e435ae251364d016c497
1656 # direct-io: eliminate the offset argument to ->direct_IO
1658 AC_DEFUN([LC_DIRECTIO_2ARGS], [
1659 LB_CHECK_COMPILE([if '->direct_IO()' taken 2 arguments],
1661 #include <linux/fs.h>
1663 struct address_space_operations ops = { };
1664 struct iov_iter *iter = NULL;
1665 struct kiocb *iocb = NULL;
1668 rc = ops.direct_IO(iocb, iter);
1670 AC_DEFINE(HAVE_DIRECTIO_2ARGS, 1,
1671 [direct_IO need 2 arguments])
1673 ]) # LC_DIRECTIO_2ARGS
1676 # LC_GENERIC_WRITE_SYNC_2ARGS
1678 # Kernel version 4.7 commit dde0c2e79848298cc25621ad080d47f94dbd7cce
1679 # fs: add IOCB_SYNC and IOCB_DSYNC
1681 AC_DEFUN([LC_GENERIC_WRITE_SYNC_2ARGS], [
1682 LB_CHECK_COMPILE([if 'generic_write_sync()' taken 2 arguments],
1683 generic_write_sync_2args, [
1684 #include <linux/fs.h>
1686 struct kiocb *iocb = NULL;
1689 rc = generic_write_sync(iocb, 0);
1691 AC_DEFINE(HAVE_GENERIC_WRITE_SYNC_2ARGS, 1,
1692 [generic_write_sync need 2 arguments])
1694 ]) # LC_GENERIC_WRITE_SYNC_2ARGS
1697 # LC_FOP_ITERATE_SHARED
1699 # Kernel v4.6-rc3-29-g6192269 adds iterate_shared method to file_operations
1701 AC_DEFUN([LC_FOP_ITERATE_SHARED], [
1702 LB_CHECK_COMPILE([if 'file_operations' has 'iterate_shared'],
1703 fop_iterate_shared, [
1704 #include <linux/fs.h>
1706 struct file_operations fop;
1707 fop.iterate_shared = NULL;
1709 AC_DEFINE(HAVE_FOP_ITERATE_SHARED, 1,
1710 [file_operations has iterate_shared])
1712 ]) # LC_FOP_ITERATE_SHARED
1715 # LC_EXPORT_DEFAULT_FILE_SPLICE_READ
1717 # 4.8-rc8 commit 82c156f853840645604acd7c2cebcb75ed1b6652 switched
1718 # generic_file_splice_read() to using ->read_iter. We can test this
1719 # change since default_file_splice_read() is no longer exported.
1721 AC_DEFUN([LC_EXPORT_DEFAULT_FILE_SPLICE_READ], [
1722 LB_CHECK_EXPORT([default_file_splice_read], [fs/splice.c],
1723 [AC_DEFINE(HAVE_DEFAULT_FILE_SPLICE_READ_EXPORT, 1,
1724 [default_file_splice_read is exported])])
1725 ]) # LC_EXPORT_DEFAULT_FILE_SPLCE_READ
1728 # LC_HAVE_POSIX_ACL_VALID_USER_NS
1730 # 4.8 posix_acl_valid takes struct user_namespace
1732 AC_DEFUN([LC_HAVE_POSIX_ACL_VALID_USER_NS], [
1733 LB_CHECK_COMPILE([if 'posix_acl_valid' takes 'struct user_namespace'],
1735 #include <linux/fs.h>
1736 #include <linux/posix_acl.h>
1738 posix_acl_valid((struct user_namespace*)NULL, (const struct posix_acl*)NULL);
1740 AC_DEFINE(HAVE_POSIX_ACL_VALID_USER_NS, 1,
1741 [posix_acl_valid takes struct user_namespace])
1743 ]) # LC_HAVE_POSIX_ACL_VALID_USER_NS
1746 # LC_D_COMPARE_4ARGS
1748 # Kernel version 4.8 commit 6fa67e707559303e086303aeecc9e8b91ef497d5
1749 # get rid of 'parent' argument of ->d_compare()
1751 AC_DEFUN([LC_D_COMPARE_4ARGS], [
1752 LB_CHECK_COMPILE([if 'd_compare' taken 4 arguments],
1754 #include <linux/dcache.h>
1756 ((struct dentry_operations*)0)->d_compare(NULL,0,NULL,NULL);
1758 AC_DEFINE(HAVE_D_COMPARE_4ARGS, 1,
1759 [d_compare need 4 arguments])
1761 ]) # LC_D_COMPARE_4ARGS
1764 # LC_FULL_NAME_HASH_3ARGS
1766 # Kernel version 4.8 commit 8387ff2577eb9ed245df9a39947f66976c6bcd02
1767 # vfs: make the string hashes salt the hash
1769 AC_DEFUN([LC_FULL_NAME_HASH_3ARGS], [
1770 LB_CHECK_COMPILE([if 'full_name_hash' taken 3 arguments],
1771 full_name_hash_3args, [
1772 #include <linux/stringhash.h>
1775 hash = full_name_hash(NULL,NULL,0);
1777 AC_DEFINE(HAVE_FULL_NAME_HASH_3ARGS, 1,
1778 [full_name_hash need 3 arguments])
1780 ]) # LC_FULL_NAME_HASH_3ARGS
1783 # LC_STRUCT_POSIX_ACL_XATTR
1785 # Kernel version 4.8 commit 2211d5ba5c6c4e972ba6dbc912b2897425ea6621
1786 # posix_acl: xattr representation cleanups
1788 AC_DEFUN([LC_STRUCT_POSIX_ACL_XATTR], [
1789 LB_CHECK_COMPILE([if 'struct posix_acl_xattr_{header,entry}' defined],
1790 struct_posix_acl_xattr, [
1791 #include <linux/fs.h>
1792 #include <linux/posix_acl_xattr.h>
1794 struct posix_acl_xattr_header *h = NULL;
1795 struct posix_acl_xattr_entry *e;
1796 e = (void *)(h + 1);
1798 AC_DEFINE(HAVE_STRUCT_POSIX_ACL_XATTR, 1,
1799 [struct posix_acl_xattr_{header,entry} defined])
1801 ]) # LC_STRUCT_POSIX_ACL_XATTR
1806 # Kernel version 4.8 commit fd50ecaddf8372a1d96e0daeaac0f93cf04e4d42
1807 # removed {get,set,remove}xattr inode operations
1809 AC_DEFUN([LC_IOP_XATTR], [
1810 LB_CHECK_COMPILE([if 'inode_operations' has {get,set,remove}xattr members],
1812 #include <linux/fs.h>
1814 struct inode_operations iop;
1815 iop.setxattr = NULL;
1816 iop.getxattr = NULL;
1817 iop.removexattr = NULL;
1819 AC_DEFINE(HAVE_IOP_XATTR, 1,
1820 [inode_operations has {get,set,remove}xattr members])
1827 # Kernel version 4.9 commit 81243eacfa400f5f7b89f4c2323d0de9982bb0fb
1828 # cred: simpler, 1D supplementary groups
1830 AC_DEFUN([LC_GROUP_INFO_GID], [
1831 LB_CHECK_COMPILE([if 'struct group_info' has member 'gid'],
1833 #include <linux/cred.h>
1836 p = ((struct group_info *)0)->gid;
1838 AC_DEFINE(HAVE_GROUP_INFO_GID, 1,
1839 [struct group_info has member gid])
1841 ]) # LC_GROUP_INFO_GID
1846 # Kernel version 4.9 commit 5d6c31910bc0713e37628dc0ce677dcb13c8ccf4
1847 # added __vfs_{get,set,remove}xattr helpers
1849 AC_DEFUN([LC_VFS_SETXATTR], [
1850 LB_CHECK_COMPILE([if '__vfs_setxattr' helper is available],
1852 #include <linux/xattr.h>
1854 __vfs_setxattr(NULL, NULL, NULL, NULL, 0, 0);
1856 AC_DEFINE(HAVE_VFS_SETXATTR, 1,
1857 ['__vfs_setxattr is available])
1859 ]) # LC_VFS_SETXATTR
1862 # LC_POSIX_ACL_UPDATE_MODE
1864 # Kernel version 4.9 commit 073931017b49d9458aa351605b43a7e34598caef
1865 # posix_acl: Clear SGID bit when setting file permissions
1867 AC_DEFUN([LC_POSIX_ACL_UPDATE_MODE], [
1868 LB_CHECK_COMPILE([if 'posix_acl_update_mode' exists],
1869 posix_acl_update_mode, [
1870 #include <linux/fs.h>
1871 #include <linux/posix_acl.h>
1873 posix_acl_update_mode(NULL, NULL, NULL);
1875 AC_DEFINE(HAVE_POSIX_ACL_UPDATE_MODE, 1,
1876 ['posix_acl_update_mode' is available])
1878 ]) # LC_POSIX_ACL_UPDATE_MODE
1881 # LC_IOP_GENERIC_READLINK
1883 # Kernel version 4.10 commit dfeef68862edd7d4bafe68ef7aeb5f658ef24bb5
1884 # removed generic_readlink from individual file systems
1886 AC_DEFUN([LC_IOP_GENERIC_READLINK], [
1887 LB_CHECK_COMPILE([if 'generic_readlink' still exist],
1888 inode_ops_readlink, [
1889 #include <linux/fs.h>
1891 struct inode_operations iop;
1892 iop.readlink = generic_readlink;
1894 AC_DEFINE(HAVE_IOP_GENERIC_READLINK, 1,
1895 [generic_readlink has been removed])
1897 ]) # LC_IOP_GENERIC_READLINK
1900 # LC_HAVE_VM_FAULT_ADDRESS
1902 # Kernel version 4.10 commit 1a29d85eb0f19b7d8271923d8917d7b4f5540b3e
1903 # removed virtual_address field. Need to use address field instead
1905 AC_DEFUN([LC_HAVE_VM_FAULT_ADDRESS], [
1906 LB_CHECK_COMPILE([if 'struct vm_fault' replaced virtual_address with address field],
1908 #include <linux/mm.h>
1910 unsigned long vaddr = ((struct vm_fault *)0)->address;
1913 AC_DEFINE(HAVE_VM_FAULT_ADDRESS, 1,
1914 [virtual_address has been replaced by address field])
1916 ]) # LC_HAVE_VM_FAULT_ADDRESS
1919 # LC_INODEOPS_ENHANCED_GETATTR
1921 # Kernel version 4.11 commit a528d35e8bfcc521d7cb70aaf03e1bd296c8493f
1922 # expanded getattr to be able to get more stat information.
1924 AC_DEFUN([LC_INODEOPS_ENHANCED_GETATTR], [
1925 LB_CHECK_COMPILE([if 'inode_operations' getattr member can gather advance stats],
1927 #include <linux/fs.h>
1931 ((struct inode_operations *)1)->getattr(&path, NULL, 0, 0);
1933 AC_DEFINE(HAVE_INODEOPS_ENHANCED_GETATTR, 1,
1934 [inode_operations .getattr member function can gather advance stats])
1936 ]) # LC_INODEOPS_ENHANCED_GETATTR
1939 # LC_VM_OPERATIONS_REMOVE_VMF_ARG
1941 # Kernel version 4.11 commit 11bac80004499ea59f361ef2a5516c84b6eab675
1942 # removed struct vm_area_struct as an argument for vm_operations since
1943 # in the same kernel version struct vma_area_struct was folded into
1946 AC_DEFUN([LC_VM_OPERATIONS_REMOVE_VMF_ARG], [
1947 LB_CHECK_COMPILE([if 'struct vm_operations' removed struct vm_area_struct],
1948 vm_operations_no_vm_area_struct, [
1949 #include <linux/mm.h>
1951 struct vm_fault vmf;
1953 ((struct vm_operations_struct *)0)->fault(&vmf);
1954 ((struct vm_operations_struct *)0)->page_mkwrite(&vmf);
1956 AC_DEFINE(HAVE_VM_OPS_USE_VM_FAULT_ONLY, 1,
1957 ['struct vm_operations' remove struct vm_area_struct argument])
1959 ]) # LC_VM_OPERATIONS_REMOVE_VMF_ARG
1962 # LC_HAVE_KEY_USAGE_REFCOUNT
1964 # Kernel version 4.11 commit fff292914d3a2f1efd05ca71c2ba72a3c663201e
1965 # converted key.usage from atomic_t to refcount_t.
1967 AC_DEFUN([LC_HAVE_KEY_USAGE_REFCOUNT], [
1968 LB_CHECK_COMPILE([if 'key.usage' is refcount_t],
1969 key_usage_refcount, [
1970 #include <linux/key.h>
1972 struct key key = { };
1974 refcount_read(&key.usage);
1976 AC_DEFINE(HAVE_KEY_USAGE_REFCOUNT, 1, [key.usage is of type refcount_t])
1978 ]) #LC_HAVE_KEY_USAGE_REFCOUNT
1981 # LC_HAVE_CRYPTO_MAX_ALG_NAME_128
1983 # Kernel version 4.11 commit f437a3f477cce402dbec6537b29e9e33962c9f73
1984 # switched CRYPTO_MAX_ALG_NAME from 64 to 128.
1986 AC_DEFUN([LC_HAVE_CRYPTO_MAX_ALG_NAME_128], [
1987 LB_CHECK_COMPILE([if 'CRYPTO_MAX_ALG_NAME' is 128],
1988 crypto_max_alg_name, [
1989 #include <linux/crypto.h>
1991 #if CRYPTO_MAX_ALG_NAME != 128
1995 AC_DEFINE(HAVE_CRYPTO_MAX_ALG_NAME_128, 1,
1996 ['CRYPTO_MAX_ALG_NAME' is 128])
1998 ]) # LC_HAVE_CRYPTO_MAX_ALG_NAME_128
2001 # Kernel version 4.12 commit 47f38c539e9a42344ff5a664942075bd4df93876
2002 # CURRENT_TIME is not 64 bit time safe so it was replaced with
2005 AC_DEFUN([LC_CURRENT_TIME], [
2006 LB_CHECK_COMPILE([if CURRENT_TIME has been replaced with current_time],
2008 #include <linux/fs.h>
2012 attr.ia_atime = current_time(NULL);
2014 AC_DEFINE(HAVE_CURRENT_TIME, 1,
2015 [current_time() has replaced CURRENT_TIME])
2017 ]) # LIBCFS_CURRENT_TIME
2020 # LC_HAVE_GET_INODE_USAGE
2022 # Kernel version v4.12-rc2-43-g7a9ca53aea10
2024 AC_DEFUN([LC_HAVE_GET_INODE_USAGE], [
2025 LB_CHECK_COMPILE([if get_inode_usage exists],
2028 #include <linux/quota.h>
2030 struct dquot_operations ops = { };
2032 ops.get_inode_usage(NULL, NULL);
2034 AC_DEFINE(HAVE_GET_INODE_USAGE, 1,
2035 [get_inode_usage function exists])
2037 ]) # LC_HAVE_GET_INODE_USAGE
2041 # Kernel version 4.12-rc3 85787090a21eb749d8b347eaf9ff1a455637473c
2042 # changed struct super_block s_uuid into a proper uuid_t
2044 AC_DEFUN([LC_SUPER_BLOCK_S_UUID], [
2045 LB_CHECK_COMPILE([if 'struct super_block' s_uuid is uuid_t],
2046 super_block_s_uuid, [
2047 #include <linux/fs.h>
2049 struct super_block sb;
2051 uuid_parse(NULL, &sb.s_uuid);
2053 AC_DEFINE(HAVE_S_UUID_AS_UUID_T, 1, ['s_uuid' is an uuid_t])
2055 ]) # LC_SUPER_BLOCK_S_UUID
2058 # LC_SUPER_SETUP_BDI_NAME
2060 # Kernel version 4.12 commit 9594caf216dc0fe3e318b34af0127276db661241
2061 # unified bdi handling
2063 AC_DEFUN([LC_SUPER_SETUP_BDI_NAME], [
2064 LB_CHECK_COMPILE([if 'super_setup_bdi_name' exist],
2065 super_setup_bdi_name, [
2066 #include <linux/fs.h>
2068 super_setup_bdi_name(NULL, "lustre");
2070 AC_DEFINE(HAVE_SUPER_SETUP_BDI_NAME, 1,
2071 ['super_setup_bdi_name' is available])
2073 ]) # LC_SUPER_SETUP_BDI_NAME
2078 # 4.12 replace bi_error to bi_status
2080 AC_DEFUN([LC_BI_STATUS], [
2081 LB_CHECK_COMPILE([if 'bi_status' exist],
2083 #include <linux/blk_types.h>
2085 ((struct bio *)0)->bi_status = 0;
2087 AC_DEFINE(HAVE_BI_STATUS, 1,
2088 ['bi_status' is available])
2093 # LC_BIO_INTEGRITY_ENABLED
2095 # 4.13 removed bio_integrity_enabled
2097 AC_DEFUN([LC_BIO_INTEGRITY_ENABLED], [
2098 LB_CHECK_COMPILE([if 'bio_integrity_enabled' exist],
2099 bio_integrity_enabled, [
2100 #include <linux/bio.h>
2102 bio_integrity_enabled(NULL);
2104 AC_DEFINE(HAVE_BIO_INTEGRITY_ENABLED, 1,
2105 ['bio_integrity_enabled' is available])
2107 ]) # LC_BIO_INTEGRITY_ENABLED
2110 # LC_PAGEVEC_INIT_ONE_PARAM
2112 # 4.14 pagevec_init takes one parameter
2114 AC_DEFUN([LC_PAGEVEC_INIT_ONE_PARAM], [
2115 LB_CHECK_COMPILE([if 'pagevec_init' takes one parameter],
2117 #include <linux/pagevec.h>
2121 AC_DEFINE(HAVE_PAGEVEC_INIT_ONE_PARAM, 1,
2122 ['pagevec_init' takes one parameter])
2124 ]) # LC_PAGEVEC_INIT_ONE_PARAM
2129 # 4.14 replaced bi_bdev to bi_disk
2131 AC_DEFUN([LC_BI_BDEV], [
2132 LB_CHECK_COMPILE([if 'bi_bdev' exist],
2134 #include <linux/bio.h>
2136 ((struct bio *)0)->bi_bdev = NULL;
2138 AC_DEFINE(HAVE_BI_BDEV, 1,
2139 ['bi_bdev' is available])
2144 # LC_INTERVAL_TREE_CACHED
2146 # 4.14 f808c13fd3738948e10196496959871130612b61
2147 # switched INTERVAL_TREE_DEFINE to use cached RB_Trees.
2149 AC_DEFUN([LC_INTERVAL_TREE_CACHED], [
2150 tmp_flags="$EXTRA_KCFLAGS"
2151 EXTRA_KCFLAGS="-Werror"
2152 LB_CHECK_COMPILE([if interval_trees use rb_tree_cached],
2154 #include <linux/interval_tree_generic.h>
2155 struct foo { struct rb_node rb; int last; int a,b;};
2156 #define START(n) ((n)->a)
2157 #define LAST(n) ((n)->b)
2158 struct rb_root_cached tree;
2159 INTERVAL_TREE_DEFINE(struct foo, rb, int, last,
2160 START, LAST, , foo);
2162 foo_insert(NULL, &tree);
2164 AC_DEFINE(HAVE_INTERVAL_TREE_CACHED, 1,
2165 [interval trees use rb_tree_cached])
2167 EXTRA_KCFLAGS="$tmp_flags"
2168 ]) # LC_INTERVAL_TREE_CACHED
2173 # 4.14 introduced IS_ENCRYPTED and S_ENCRYPTED
2175 AC_DEFUN([LC_IS_ENCRYPTED], [
2176 LB_CHECK_COMPILE([if IS_ENCRYPTED is defined],
2178 #include <linux/fs.h>
2180 IS_ENCRYPTED((struct inode *)0);
2182 has_is_encrypted="yes"
2184 ]) # LC_IS_ENCRYPTED
2189 # kernel 4.17 commit b93b016313b3ba8003c3b8bb71f569af91f19fc7
2191 AC_DEFUN([LC_I_PAGES], [
2192 LB_CHECK_COMPILE([if struct address_space has i_pages],
2194 #include <linux/fs.h>
2196 struct address_space mapping = {};
2199 i_pages = &mapping.i_pages;
2201 AC_DEFINE(HAVE_I_PAGES, 1,
2202 [struct address_space has i_pages])
2209 # kernel 4.17 commit 3d3539018d2cbd12e5af4a132636ee7fd8d43ef0
2210 # mm: create the new vm_fault_t type
2212 AC_DEFUN([LC_VM_FAULT_T], [
2213 LB_CHECK_COMPILE([if vm_fault_t type exists],
2215 #include <linux/mm_types.h>
2217 vm_fault_t x = VM_FAULT_SIGBUS;
2220 AC_DEFINE(HAVE_VM_FAULT_T, 1,
2221 [if vm_fault_t type exists])
2228 # kernel 4.17 commit 3d3539018d2cbd12e5af4a132636ee7fd8d43ef0
2229 # mm: VM_FAULT_RETRY is defined in enum vm_fault_reason
2231 AC_DEFUN([LC_VM_FAULT_RETRY], [
2232 LB_CHECK_COMPILE([if VM_FAULT_RETRY is defined],
2234 #include <linux/mm.h>
2236 #ifndef VM_FAULT_RETRY
2241 AC_DEFINE(HAVE_VM_FAULT_RETRY, 1,
2242 [if VM_FAULT_RETRY is defined])
2244 ]) # LC_VM_FAULT_RETRY
2247 # LC_ALLOC_FILE_PSEUDO
2249 # kernel 4.18-rc1 commit d93aa9d82aea80b80f225dbf9c7986df444d8106
2250 # new wrapper: alloc_file_pseudo()
2252 AC_DEFUN([LC_ALLOC_FILE_PSEUDO], [
2253 LB_CHECK_COMPILE([if 'alloc_file_pseudo' is defined],
2254 alloc_file_pseudo, [
2255 #include <linux/file.h>
2258 file = alloc_file_pseudo(NULL, NULL, "[test]",
2261 AC_DEFINE(HAVE_ALLOC_FILE_PSEUDO, 1,
2262 ['alloc_file_pseudo' exist])
2264 ]) # LC_ALLOC_FILE_PSEUDO
2267 # LC_INODE_TIMESPEC64
2269 # kernel 4.17-rc7 commit 8efd6894ff089adeeac7cb9f32125b85d963d1bc
2270 # fs: add timespec64_truncate()
2271 # kernel 4.18 commit 95582b00838837fc07e042979320caf917ce3fe6
2272 # inode timestamps switched to timespec64
2273 # kernel 4.19-rc2 commit 976516404ff3fab2a8caa8bd6f5efc1437fed0b8
2274 # y2038: remove unused time interfaces
2278 # When inode times are timespec64 stop using the deprecated
2281 # kernel v5.5-rc1-6-gba70609d5ec6 ba70609d5ec664a8f36ba1c857fcd97a478adf79
2282 # fs: Delete timespec64_trunc()
2284 AC_DEFUN([LC_INODE_TIMESPEC64], [
2285 tmp_flags="$EXTRA_KCFLAGS"
2286 EXTRA_KCFLAGS="-Werror"
2287 LB_CHECK_COMPILE([if inode timestamps are struct timespec64],
2289 #include <linux/fs.h>
2291 struct inode *inode = NULL;
2292 struct timespec64 ts = {0, 1};
2294 inode->i_atime = ts;
2297 AC_DEFINE(HAVE_INODE_TIMESPEC64, 1,
2298 [inode times are using timespec64])
2300 EXTRA_KCFLAGS="$tmp_flags"
2301 ]) # LC_INODE_TIMESPEC64
2304 # LC_RADIX_TREE_TAG_SET
2306 # kernel 4.20 commit v4.19-rc5-248-g9b89a0355144
2307 # xarray: Add XArray marks - replaced radix_tree_tag_set
2309 AC_DEFUN([LC_RADIX_TREE_TAG_SET], [
2310 tmp_flags="$EXTRA_KCFLAGS"
2311 EXTRA_KCFLAGS="-Werror"
2312 LB_CHECK_COMPILE([if 'radix_tree_tag_set' exists],
2313 radix_tree_tag_set, [
2314 #include <linux/fs.h>
2315 #include <linux/radix-tree.h>
2317 radix_tree_tag_set(NULL, 0, PAGECACHE_TAG_DIRTY);
2319 AC_DEFINE(HAVE_RADIX_TREE_TAG_SET, 1,
2320 [radix_tree_tag_set exists])
2322 EXTRA_KCFLAGS="$tmp_flags"
2323 ]) # LC_RADIX_TREE_TAG_SET
2326 # LC_UAPI_LINUX_MOUNT_H
2328 # kernel 4.20 commit e262e32d6bde0f77fb0c95d977482fc872c51996
2329 # vfs: Suppress MS_* flag defs within the kernel ...
2331 AC_DEFUN([LC_UAPI_LINUX_MOUNT_H], [
2332 tmp_flags="$EXTRA_KCFLAGS"
2333 EXTRA_KCFLAGS="-Werror"
2334 LB_CHECK_COMPILE([if MS_RDONLY was moved to uapi/linux/mount.h],
2336 #include <uapi/linux/mount.h>
2341 AC_DEFINE(HAVE_UAPI_LINUX_MOUNT_H, 1,
2342 [if MS_RDONLY was moved to uapi/linux/mount.h])
2344 EXTRA_KCFLAGS="$tmp_flags"
2345 ]) # LC_UAPI_LINUX_MOUNT_H
2348 # LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
2350 # kernel 4.20 commit 1863d77f15da0addcd293a1719fa5d3ef8cde3ca
2351 # SUNRPC: Replace the cache_detail->hash_lock with a regular spinlock
2353 # Now that the reader functions are all RCU protected, use a regular
2354 # spinlock rather than a reader/writer lock.
2356 AC_DEFUN([LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK], [
2357 tmp_flags="$EXTRA_KCFLAGS"
2358 EXTRA_KCFLAGS="-Werror"
2359 LB_CHECK_COMPILE([if cache_detail->hash_lock is a spinlock],
2360 hash_lock_isa_spinlock_t, [
2361 #include <linux/sunrpc/cache.h>
2363 spinlock_t *lock = &(((struct cache_detail *)0)->hash_lock);
2366 AC_DEFINE(HAVE_CACHE_HASH_SPINLOCK, 1,
2367 [if cache_detail->hash_lock is a spinlock])
2369 EXTRA_KCFLAGS="$tmp_flags"
2370 ]) # LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
2373 # LC_HAS_LINUX_SELINUX_ENABLED
2375 # kernel 5.1 commit 3d252529480c68bfd6a6774652df7c8968b28e41
2376 # SELinux: Remove unused selinux_is_enabled
2378 AC_DEFUN([LC_HAS_LINUX_SELINUX_ENABLED], [
2379 tmp_flags="$EXTRA_KCFLAGS"
2380 EXTRA_KCFLAGS="-Werror"
2381 LB_CHECK_COMPILE([if linux/selinux.h exists],
2382 selinux_is_enabled, [
2383 #include <linux/selinux.h>
2385 bool has_selinux = selinux_is_enabled();
2388 AC_DEFINE(HAVE_LINUX_SELINUX_IS_ENABLED, 1,
2389 [if linux/selinux.h exists])
2391 EXTRA_KCFLAGS="$tmp_flags"
2392 ]) # LC_HAS_LINUX_SELINUX_ENABLED
2395 # LB_HAVE_BVEC_ITER_ALL
2397 # kernel 5.1 commit 6dc4f100c175dd0511ae8674786e7c9006cdfbfa
2398 # block: allow bio_for_each_segment_all() to iterate over multi-page bvec
2400 AC_DEFUN([LB_HAVE_BVEC_ITER_ALL], [
2401 tmp_flags="$EXTRA_KCFLAGS"
2402 EXTRA_KCFLAGS="-Werror"
2403 LB_CHECK_COMPILE([if bvec_iter_all exists for multi-page bvec iternation],
2405 #include <linux/bvec.h>
2407 struct bvec_iter_all iter;
2410 AC_DEFINE(HAVE_BVEC_ITER_ALL, 1,
2411 [if bvec_iter_all exists for multi-page bvec iternation])
2413 EXTRA_KCFLAGS="$tmp_flags"
2414 ]) # LB_HAVE_BVEC_ITER_ALL
2417 # LC_ACCOUNT_PAGE_DIRTIED
2419 # After 5.2 kernel page dirtied is not exported
2421 AC_DEFUN([LC_ACCOUNT_PAGE_DIRTIED], [
2422 LB_CHECK_EXPORT([account_page_dirtied], [mm/page-writeback.c],
2423 [AC_DEFINE(HAVE_ACCOUNT_PAGE_DIRTIED_EXPORT, 1,
2424 [account_page_dirtied is exported])])
2425 ]) # LC_ACCOUNT_PAGE_DIRTIED
2428 # LC_KEYRING_SEARCH_4ARGS
2430 # Kernel 5.2 commit dcf49dbc8077
2431 # keys: Add a 'recurse' flag for keyring searches
2433 AC_DEFUN([LC_KEYRING_SEARCH_4ARGS], [
2434 LB_CHECK_COMPILE([if 'keyring_search' has 4 args],
2435 keyring_search_4args, [
2436 #include <linux/key.h>
2439 keyring_search(keyring, NULL, NULL, false);
2441 AC_DEFINE(HAVE_KEYRING_SEARCH_4ARGS, 1,
2442 [keyring_search has 4 args])
2444 ]) # LC_KEYRING_SEARCH_4ARGS
2447 # LC_BIO_BI_PHYS_SEGMENTS
2449 # kernel 5.3-rc1 commit 14ccb66b3f585b2bc21e7256c96090abed5a512c
2450 # block: remove the bi_phys_segments field in struct bio
2452 AC_DEFUN([LC_BIO_BI_PHYS_SEGMENTS], [
2453 tmp_flags="$EXTRA_KCFLAGS"
2454 EXTRA_KCFLAGS="-Werror"
2455 LB_CHECK_COMPILE([if struct bio has bi_phys_segments member],
2456 bye_bio_bi_phys_segments, [
2457 #include <linux/bio.h>
2459 struct bio *bio = NULL;
2460 bio->bi_phys_segments++;
2462 AC_DEFINE(HAVE_BIO_BI_PHYS_SEGMENTS, 1,
2463 [struct bio has bi_phys_segments member])
2465 EXTRA_KCFLAGS="$tmp_flags"
2466 ]) # LC_BIO_BI_PHYS_SEGMENTS
2469 # LC_LM_COMPARE_OWNER_EXISTS
2471 # kernel 5.3-rc3 commit f85d93385e9fe6886a751f647f6812a89bf6bee3
2472 # locks: Cleanup lm_compare_owner and lm_owner_key
2473 # removed lm_compare_owner
2475 AC_DEFUN([LC_LM_COMPARE_OWNER_EXISTS], [
2476 tmp_flags="$EXTRA_KCFLAGS"
2477 EXTRA_KCFLAGS="-Werror"
2478 LB_CHECK_COMPILE([if lock_manager_operations has lm_compare_owner],
2479 lock_manager_ops_lm_compare_owner, [
2480 #include <linux/fs.h>
2482 struct lock_manager_operations lm_ops;
2483 lm_ops.lm_compare_owner = NULL;
2485 AC_DEFINE(HAVE_LM_COMPARE_OWNER, 1,
2486 [lock_manager_operations has lm_compare_owner])
2488 EXTRA_KCFLAGS="$tmp_flags"
2489 ]) # LC_LM_COMPARE_OWNER_EXISTS
2492 # LC_FSCRYPT_SUPPORT
2494 # 5.4 introduced fscrypt encryption policies v2
2496 AC_DEFUN([LC_FSCRYPT_SUPPORT], [
2497 LB_CHECK_COMPILE([for fscrypt in-kernel support],
2499 #define __FS_HAS_ENCRYPTION 0
2500 #include <linux/fscrypt.h>
2502 fscrypt_ioctl_get_policy_ex(NULL, NULL);
2504 has_fscrypt_support="yes"
2506 ]) # LC_FSCRYPT_SUPPORT
2509 # LC_FSCRYPT_DIGESTED_NAME
2511 # Kernel 5.5-rc4 edc440e3d27fb31e6f9663cf413fad97d714c060
2512 # improved the format of no-key names. This results in the
2513 # removal of FSCRYPT_FNAME_DIGEST and FSCRYPT_FNAME_DIGEST_SIZE.
2515 AC_DEFUN([LC_FSCRYPT_DIGESTED_NAME], [
2516 tmp_flags="$EXTRA_KCFLAGS"
2517 EXTRA_KCFLAGS="-Werror"
2518 LB_CHECK_COMPILE([if fscrypt has 'struct fscrypt_digested_name'],
2519 fscrypt_digested_name, [
2520 #include <linux/fscrypt.h>
2522 struct fscrypt_digested_name fname;
2526 AC_DEFINE(HAVE_FSCRYPT_DIGESTED_NAME, 1,
2527 ['struct fscrypt_digested_name' exists])
2529 EXTRA_KCFLAGS="$tmp_flags"
2530 ]) # LC_FSCRYPT_DIGESTED_NAME
2533 # LC_FSCRYPT_DUMMY_CONTEXT_ENABLED
2535 # Kernel 5.7-rc7 ed318a6cc0b620440e65f48eb527dc3df7269ce4
2536 # replaces fscrypt_dummy_context_enabled() with
2537 # fscrypt_get_dummy_context(). Later kernels rename
2538 # fscrypt_get_dummy_context() to fscrypt_get_dummy_policy()
2539 # which is why we test fscrypt_dummy_context_enabled().
2541 AC_DEFUN([LC_FSCRYPT_DUMMY_CONTEXT_ENABLED], [
2542 tmp_flags="$EXTRA_KCFLAGS"
2543 EXTRA_KCFLAGS="-Werror"
2544 LB_CHECK_COMPILE([if fscrypt_dummy_context_enabled() exists],
2545 fscrypt_dummy_context_enabled, [
2546 #include <linux/fscrypt.h>
2548 fscrypt_dummy_context_enabled(NULL);
2550 AC_DEFINE(HAVE_FSCRYPT_DUMMY_CONTEXT_ENABLED, 1,
2551 [fscrypt_dummy_context_enabled() exists])
2553 EXTRA_KCFLAGS="$tmp_flags"
2554 ]) # LC_FSCRYPT_DUMMY_CONTEXT_ENABLED
2557 # LC_FSCRYPT_IS_NOKEY_NAME
2559 # Kernel 5.10-rc4 159e1de201b6fca10bfec50405a3b53a561096a8
2560 # introduced fscrypt_is_nokey_name() inline macro. While
2561 # introduced for 5.10 kernels it was backported to earlier
2562 # Ubuntu kernels. Also it hides the change introduced due
2563 # to git commit 501e43fbe for kernel 5.9 which also was
2564 # backported to earlier Ubuntu kernels.
2566 AC_DEFUN([LC_FSCRYPT_IS_NOKEY_NAME], [
2567 tmp_flags="$EXTRA_KCFLAGS"
2568 EXTRA_KCFLAGS="-Werror"
2569 LB_CHECK_COMPILE([if fscrypt_is_nokey_name() exists],
2570 fscrypt_is_no_key_name, [
2571 #include <linux/fscrypt.h>
2573 fscrypt_is_nokey_name(NULL);
2575 AC_DEFINE(HAVE_FSCRYPT_IS_NOKEY_NAME, 1,
2576 [fscrypt_is_nokey_name() exists])
2578 EXTRA_KCFLAGS="$tmp_flags"
2579 ]) # LC_FSCRYPT_IS_NOKEY_NAME
2582 # LC_HAVE_USER_NAMESPACE_ARG
2584 # kernel 5.12 commit 549c7297717c32ee53f156cd949e055e601f67bb
2585 # fs: make helpers idmap mount aware
2586 # Extend some inode methods with an additional user namespace argument.
2588 AC_DEFUN([LC_HAVE_USER_NAMESPACE_ARG], [
2589 tmp_flags="$EXTRA_KCFLAGS"
2590 EXTRA_KCFLAGS="-Werror"
2591 LB_CHECK_COMPILE([if 'inode_operations' members have user namespace argument],
2592 user_namespace_argument, [
2593 #include <linux/fs.h>
2595 ((struct inode_operations *)1)->getattr((struct user_namespace *)NULL,
2598 AC_DEFINE(HAVE_USER_NAMESPACE_ARG, 1,
2599 ['inode_operations' members have user namespace argument])
2601 EXTRA_KCFLAGS="$tmp_flags"
2602 ]) # LC_HAVE_USER_NAMESPACE_ARG
2605 # LC_HAVE_GET_ACL_RCU_ARG
2607 # kernel 5.15 commit 0cad6246621b5887d5b33fea84219d2a71f2f99a
2608 # vfs: add rcu argument to ->get_acl() callback
2609 # Add a rcu argument to the ->get_acl() callback to allow
2610 # get_cached_acl_rcu() to call the ->get_acl() method.
2612 AC_DEFUN([LC_HAVE_GET_ACL_RCU_ARG], [
2613 tmp_flags="$EXTRA_KCFLAGS"
2614 EXTRA_KCFLAGS="-Werror"
2615 LB_CHECK_COMPILE([if 'get_acl' has a rcu argument],
2616 get_acl_rcu_argument, [
2617 #include <linux/fs.h>
2619 ((struct inode_operations *)1)->get_acl((struct inode *)NULL, 0, false);
2621 AC_DEFINE(HAVE_GET_ACL_RCU_ARG, 1,
2622 ['get_acl' has a rcu argument])
2624 EXTRA_KCFLAGS="$tmp_flags"
2625 ]) # LC_HAVE_GET_ACL_RCU_ARG
2627 AC_DEFUN([LC_PROG_LINUX_SRC], [])
2628 AC_DEFUN([LC_PROG_LINUX_RESULTS], [])
2633 # Lustre linux kernel checks
2635 AC_DEFUN([LC_PROG_LINUX], [
2636 AC_MSG_NOTICE([Lustre kernel checks
2637 ==============================================================================])
2642 LC_CONFIG_HEALTH_CHECK_WRITE
2643 LC_CONFIG_LRU_RESIZE
2648 LC_HAVE_PROJECT_QUOTA
2655 LC_HAVE_DENTRY_D_U_D_ALIAS
2656 LC_HAVE_DENTRY_D_CHILD
2657 LC_PID_NS_FOR_CHILDREN
2660 LC_OLDSIZE_TRUNCATE_PAGECACHE
2661 LC_PTR_ERR_OR_ZERO_MISSING
2663 LC_REGISTER_SHRINKER_RET
2668 LC_HAVE_D_IS_POSITIVE
2672 LC_HAVE_TRUNCATE_IPAGES_FINAL
2673 LC_IOPS_RENAME_WITH_FLAGS
2680 LC_DIRECTIO_USE_ITER
2681 LC_HAVE_IOV_ITER_INIT_DIRECTION
2682 LC_HAVE_IOV_ITER_TRUNCATE
2683 LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
2686 LC_HAVE_INTERVAL_BLK_INTEGRITY
2690 LC_PERCPU_COUNTER_INIT
2691 LC_NFS_FILLDIR_USE_CTX
2695 LC_HAVE_DQUOT_QC_DQBLK
2696 LC_HAVE_AIO_COMPLETE
2697 LC_HAVE_IS_ROOT_INODE
2700 LC_BACKING_DEV_INFO_REMOVAL
2701 LC_HAVE_BDI_CAP_MAP_COPY
2705 LC_HAVE_SYNC_READ_WRITE
2709 LC_BIO_ENDIO_USES_ONE_ARG
2710 LC_SYMLINK_OPS_USE_NAMEIDATA
2711 LC_ACCOUNT_PAGE_DIRTIED_3ARGS
2712 LC_HAVE_CRYPTO_ALLOC_SKCIPHER
2715 LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
2716 LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
2717 LC_HAVE_CACHE_HEAD_HLIST
2718 LC_HAVE_XATTR_HANDLER_SIMPLIFIED
2721 LC_HAVE_LOCKS_LOCK_FILE_WAIT
2722 LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
2723 LC_HAVE_XATTR_HANDLER_NAME
2725 LC_HAVE_SUBMIT_BIO_2ARGS
2726 LC_HAVE_CLEAN_BDEV_ALIASES
2733 LC_HAVE_IOP_GET_LINK
2736 LC_HAVE_IN_COMPAT_SYSCALL
2737 LC_HAVE_XATTR_HANDLER_INODE_PARAM
2739 LC_HAVE_DOWN_WRITE_KILLABLE
2745 LC_GENERIC_WRITE_SYNC_2ARGS
2746 LC_FOP_ITERATE_SHARED
2749 LC_EXPORT_DEFAULT_FILE_SPLICE_READ
2750 LC_HAVE_POSIX_ACL_VALID_USER_NS
2752 LC_FULL_NAME_HASH_3ARGS
2753 LC_STRUCT_POSIX_ACL_XATTR
2759 LC_POSIX_ACL_UPDATE_MODE
2762 LC_IOP_GENERIC_READLINK
2763 LC_HAVE_VM_FAULT_ADDRESS
2766 LC_INODEOPS_ENHANCED_GETATTR
2767 LC_VM_OPERATIONS_REMOVE_VMF_ARG
2768 LC_HAVE_KEY_USAGE_REFCOUNT
2769 LC_HAVE_CRYPTO_MAX_ALG_NAME_128
2773 LC_SUPER_BLOCK_S_UUID
2774 LC_SUPER_SETUP_BDI_NAME
2778 LC_BIO_INTEGRITY_ENABLED
2779 LC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL
2780 LC_HAVE_GET_INODE_USAGE
2783 LC_PAGEVEC_INIT_ONE_PARAM
2785 LC_INTERVAL_TREE_CACHED
2793 LC_ALLOC_FILE_PSEUDO
2797 LC_RADIX_TREE_TAG_SET
2798 LC_UAPI_LINUX_MOUNT_H
2799 LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
2802 LC_HAS_LINUX_SELINUX_ENABLED
2803 LB_HAVE_BVEC_ITER_ALL
2806 LC_ACCOUNT_PAGE_DIRTIED
2807 LC_KEYRING_SEARCH_4ARGS
2810 LC_BIO_BI_PHYS_SEGMENTS
2811 LC_LM_COMPARE_OWNER_EXISTS
2814 LC_FSCRYPT_DIGESTED_NAME
2817 LC_FSCRYPT_DUMMY_CONTEXT_ENABLED
2820 LC_FSCRYPT_IS_NOKEY_NAME
2823 LC_HAVE_USER_NAMESPACE_ARG
2826 LC_HAVE_GET_ACL_RCU_ARG
2828 # kernel patch to extend integrity interface
2829 LC_BIO_INTEGRITY_PREP_FN
2832 AS_IF([test "x$enable_server" != xno], [
2842 # Check whether to build the client side of Lustre
2844 AC_DEFUN([LC_CONFIG_CLIENT], [
2845 AC_MSG_CHECKING([whether to build Lustre client support])
2846 AC_ARG_ENABLE([client],
2847 AC_HELP_STRING([--disable-client],
2848 [disable Lustre client support]),
2849 [], [enable_client="yes"])
2850 AC_MSG_RESULT([$enable_client])
2851 ]) # LC_CONFIG_CLIENT
2856 AC_DEFUN([LB_CONFIG_MPITESTS], [
2857 AC_ARG_ENABLE([mpitests],
2858 AC_HELP_STRING([--enable-mpitests=<yes|no|mpicc wrapper>],
2859 [include mpi tests]), [
2860 enable_mpitests="yes"
2863 MPICC_WRAPPER="mpicc"
2864 MPI_BIN=$(eval which $MPICC_WRAPPER | xargs dirname)
2867 enable_mpitests="no"
2871 MPICC_WRAPPER=$enableval
2872 MPI_BIN=$(eval echo $MPICC_WRAPPER | xargs dirname)
2876 enable_mpitests="yes"
2877 MPICC_WRAPPER="mpicc"
2878 MPI_BIN=$(eval which $MPICC_WRAPPER | xargs dirname)
2881 if test "x$enable_mpitests" != "xno"; then
2884 AC_CACHE_CHECK([whether mpitests can be built],
2885 lb_cv_mpi_tests, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([
2889 MPI_Initialized(&flag);
2892 ])], [lb_cv_mpi_tests="yes"], [lb_cv_mpi_tests="no"])
2894 enable_mpitests=$lb_cv_mpi_tests
2898 AC_SUBST(MPICC_WRAPPER)
2899 ]) # LB_CONFIG_MPITESTS
2904 # whether to enable quota support global control
2906 AC_DEFUN([LC_CONFIG_QUOTA], [
2907 AC_MSG_CHECKING([whether to enable quota support global control])
2908 AC_ARG_ENABLE([quota],
2909 AC_HELP_STRING([--enable-quota],
2910 [enable quota support]),
2911 [], [enable_quota="yes"])
2912 AS_IF([test "x$enable_quota" = xyes],
2913 [AC_MSG_RESULT([yes])],
2914 [AC_MSG_RESULT([no])])
2915 ]) # LC_CONFIG_QUOTA
2920 AC_DEFUN([LC_QUOTA], [
2924 AS_IF([test "x$enable_quota" != xno -a "x$enable_utils" != xno], [
2925 AC_CHECK_HEADER([sys/quota.h],
2926 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1,
2927 [Define to 1 if you have <sys/quota.h>.])],
2928 [AC_MSG_ERROR([don't find <sys/quota.h> in your system])])
2935 # configure support for optional OSD implementation
2937 AC_DEFUN([LC_OSD_ADDON], [
2938 AC_MSG_CHECKING([whether to use OSD addon])
2940 AC_HELP_STRING([--with-osd=path],
2941 [set path to optional osd]),
2948 OSDADDON="$with_osd"
2955 AS_IF([test $ENABLEOSDADDON -eq 0], [
2959 OSDMODNAME=$(basename $OSDADDON)
2960 AS_IF([test -e $LUSTRE/$OSDMODNAME], [
2961 AC_MSG_RESULT([can't link])
2963 ], [ln -s $OSDADDON $LUSTRE/$OSDMODNAME], [
2964 AC_MSG_RESULT([$OSDMODNAME])
2965 OSDADDON="obj-m += $OSDMODNAME/"
2967 AC_MSG_RESULT([can't link])
2977 # Check whether to enable Lustre client crypto
2979 AC_DEFUN([LC_CONFIG_CRYPTO], [
2980 AC_MSG_CHECKING([whether to enable Lustre client crypto])
2981 AC_ARG_ENABLE([crypto],
2982 AC_HELP_STRING([--enable-crypto=yes|no|in-kernel],
2983 [enable Lustre client crypto (default is yes), use 'in-kernel' to force use of in-kernel fscrypt instead of embedded llcrypt]),
2984 [], [enable_crypto="auto"])
2985 AS_IF([test "x$enable_crypto" != xno -a "x$enable_dist" = xno], [
2989 LC_FSCRYPT_SUPPORT])
2990 AS_IF([test "x$enable_crypto" = xin-kernel], [
2991 AS_IF([test "x$has_fscrypt_support" = xyes], [
2992 AC_DEFINE(HAVE_LUSTRE_CRYPTO, 1, [Enable Lustre client crypto via in-kernel fscrypt])], [
2993 AC_MSG_ERROR([Lustre client crypto cannot be enabled via in-kernel fscrypt.])
2994 enable_crypto=no])],
2995 [AS_IF([test "x$has_is_encrypted" = xyes], [
2996 AC_DEFINE(HAVE_LUSTRE_CRYPTO, 1, [Enable Lustre client crypto via embedded llcrypt])
2997 AC_DEFINE(CONFIG_LL_ENCRYPTION, 1, [embedded llcrypt])
2998 AC_DEFINE(HAVE_FSCRYPT_DUMMY_CONTEXT_ENABLED, 1, [embedded llcrypt uses llcrypt_dummy_context_enabled()])
2999 enable_crypto="embedded llcrypt"
3000 enable_llcrypt=yes], [
3001 AS_IF([test "x$enable_crypto" = xyes],
3002 [AC_MSG_ERROR([Lustre client crypto cannot be enabled because of lack of encryption support in your kernel.])])
3003 AS_IF([test "x$enable_crypto" != xno -a "x$enable_dist" = xno],
3004 [AC_MSG_WARN(Lustre client crypto cannot be enabled because of lack of encryption support in your kernel.)])
3005 enable_crypto=no])])
3006 AS_IF([test "x$enable_dist" != xno], [
3008 enable_llcrypt=yes])
3009 AC_MSG_RESULT([$enable_crypto])
3010 ]) # LC_CONFIG_CRYPTO
3015 # other configure checks
3017 AC_DEFUN([LC_CONFIGURE], [
3018 AC_MSG_NOTICE([Lustre core checks
3019 ==============================================================================])
3021 AS_IF([test $target_cpu == "i686" -o $target_cpu == "x86_64"],
3022 [CFLAGS="$CFLAGS -Wall -Werror"])
3024 # maximum MDS thread count
3027 # lustre/utils/gss/gss_util.c
3028 # lustre/utils/gss/gssd_proc.c
3029 # lustre/utils/gss/krb5_util.c
3030 # lustre/utils/llog_reader.c
3031 # lustre/utils/create_iam.c
3032 # lustre/utils/libiam.c
3033 AC_CHECK_HEADERS([netdb.h endian.h])
3034 AC_CHECK_FUNCS([gethostbyname])
3036 # lustre/utils/llverfs.c lustre/utils/libmount_utils_ldiskfs.c
3037 AC_CHECK_HEADERS([ext2fs/ext2fs.h], [], [
3038 AS_IF([test "x$enable_utils" = xyes -a "x$enable_ldiskfs" = xyes], [
3040 ext2fs.h not found. Please install e2fsprogs development package.
3045 # lustre/tests/statx_test.c
3046 AC_CHECK_FUNCS([statx])
3048 # lustre/utils/lfs.c
3049 AS_IF([test "$enable_dist" = "no"], [
3050 AC_CHECK_LIB([z], [crc32], [
3051 AC_CHECK_HEADER([zlib.h], [], [
3052 AC_MSG_ERROR([zlib.h not found.])])
3055 zlib library not found. Please install zlib development package.])
3061 AC_CHECK_LIB([selinux], [is_selinux_enabled],
3062 [AC_CHECK_HEADERS([selinux/selinux.h],
3063 [SELINUX="-lselinux"
3064 AC_DEFINE([HAVE_SELINUX], 1,
3065 [support for selinux ])],
3068 No libselinux-devel package found, unable to build selinux enabled tools
3073 No selinux package found, unable to build selinux enabled tools
3078 AC_CHECK_LIB([keyutils], [add_key])
3081 AC_MSG_CHECKING([whether to report minimum OST free space])
3082 AC_ARG_ENABLE([mindf],
3083 AC_HELP_STRING([--enable-mindf],
3084 [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
3085 [], [enable_mindf="no"])
3086 AC_MSG_RESULT([$enable_mindf])
3087 AS_IF([test "$enable_mindf" = "yes"],
3088 [AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])])
3090 AC_MSG_CHECKING([whether to randomly failing memory alloc])
3091 AC_ARG_ENABLE([fail_alloc],
3092 AC_HELP_STRING([--disable-fail-alloc],
3093 [disable randomly alloc failure]),
3094 [], [enable_fail_alloc="yes"])
3095 AC_MSG_RESULT([$enable_fail_alloc])
3096 AS_IF([test "x$enable_fail_alloc" != xno],
3097 [AC_DEFINE([RANDOM_FAIL_ALLOC], 1,
3098 [enable randomly alloc failure])])
3100 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
3101 AC_ARG_ENABLE([invariants],
3102 AC_HELP_STRING([--enable-invariants],
3103 [enable invariant checking (cpu intensive)]),
3104 [], [enable_invariants="no"])
3105 AC_MSG_RESULT([$enable_invariants])
3106 AS_IF([test "x$enable_invariants" = xyes],
3107 [AC_DEFINE([CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK], 1,
3108 [enable invariant checking])])
3110 AC_MSG_CHECKING([whether to track references with lu_ref])
3111 AC_ARG_ENABLE([lu_ref],
3112 AC_HELP_STRING([--enable-lu_ref],
3113 [enable lu_ref reference tracking code]),
3114 [], [enable_lu_ref="no"])
3115 AC_MSG_RESULT([$enable_lu_ref])
3116 AS_IF([test "x$enable_lu_ref" = xyes],
3117 [AC_DEFINE([CONFIG_LUSTRE_DEBUG_LU_REF], 1,
3118 [enable lu_ref reference tracking code])])
3120 AC_MSG_CHECKING([whether to enable page state tracking])
3121 AC_ARG_ENABLE([pgstate-track],
3122 AC_HELP_STRING([--enable-pgstate-track],
3123 [enable page state tracking]),
3124 [], [enable_pgstat_track="no"])
3125 AC_MSG_RESULT([$enable_pgstat_track])
3126 AS_IF([test "x$enable_pgstat_track" = xyes],
3127 [AC_DEFINE([CONFIG_DEBUG_PAGESTATE_TRACKING], 1,
3128 [enable page state tracking code])])
3131 AC_MSG_CHECKING([systemd unit file directory])
3132 AC_ARG_WITH([systemdsystemunitdir],
3133 [AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
3134 [Directory for systemd service files])],
3135 [], [with_systemdsystemunitdir=auto])
3136 AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"],
3137 [def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
3138 AS_IF([test "x$def_systemdsystemunitdir" = "x"],
3139 [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
3140 [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
3141 with_systemdsystemunitdir=no],
3142 [with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
3143 AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
3144 [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
3145 AC_MSG_RESULT([$with_systemdsystemunitdir])
3147 AC_MSG_CHECKING([bash-completion directory])
3148 AC_ARG_WITH([bash-completion-dir],
3149 AS_HELP_STRING([--with-bash-completion-dir[=PATH]],
3150 [Install the bash auto-completion script in this directory.]),
3152 [with_bash_completion_dir=yes])
3153 AS_IF([test "x$with_bash_completion_dir" = "xyes"], [
3154 BASH_COMPLETION_DIR="`pkg-config --variable=completionsdir bash-completion`"
3155 AS_IF([test "x$BASH_COMPLETION_DIR" = "x"], [
3156 [BASH_COMPLETION_DIR="/usr/share/bash-completion/completions"]
3159 BASH_COMPLETION_DIR="$with_bash_completion_dir"
3161 AC_SUBST([BASH_COMPLETION_DIR])
3162 AC_MSG_RESULT([$BASH_COMPLETION_DIR])
3168 # AM_CONDITIONALS for lustre
3170 AC_DEFUN([LC_CONDITIONALS], [
3171 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
3172 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
3173 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
3174 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
3175 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
3176 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
3177 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
3178 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
3179 AM_CONDITIONAL(GSS_SSK, test x$enable_ssk = xyes)
3180 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
3181 AM_CONDITIONAL(HAVE_SYSTEMD, test "x$with_systemdsystemunitdir" != "xno")
3182 AM_CONDITIONAL(ENABLE_BASH_COMPLETION, test "x$with_bash_completion_dir" != "xno")
3183 AM_CONDITIONAL(XATTR_HANDLER, test "x$lb_cv_compile_xattr_handler_flags" = xyes)
3184 AM_CONDITIONAL(SELINUX, test "$SELINUX" = "-lselinux")
3185 AM_CONDITIONAL(GETSEPOL, test x$enable_getsepol = xyes)
3186 AM_CONDITIONAL(LLCRYPT, test x$enable_llcrypt = xyes)
3187 AM_CONDITIONAL(LIBAIO, test x$enable_libaio = xyes)
3188 ]) # LC_CONDITIONALS
3193 # files that should be generated with AC_OUTPUT
3195 AC_DEFUN([LC_CONFIG_FILES],
3199 lustre/autoconf/Makefile
3200 lustre/conf/Makefile
3201 lustre/conf/resource/Makefile
3202 lustre/contrib/Makefile
3204 lustre/include/Makefile
3205 lustre/include/lustre/Makefile
3206 lustre/include/uapi/linux/lustre/Makefile
3207 lustre/kernel_patches/targets/4.18-rhel8.5.target
3208 lustre/kernel_patches/targets/4.18-rhel8.4.target
3209 lustre/kernel_patches/targets/4.18-rhel8.3.target
3210 lustre/kernel_patches/targets/4.18-rhel8.2.target
3211 lustre/kernel_patches/targets/4.18-rhel8.1.target
3212 lustre/kernel_patches/targets/4.18-rhel8.target
3213 lustre/kernel_patches/targets/3.10-rhel7.9.target
3214 lustre/kernel_patches/targets/3.10-rhel7.8.target
3215 lustre/kernel_patches/targets/3.10-rhel7.7.target
3216 lustre/kernel_patches/targets/3.10-rhel7.6.target
3217 lustre/kernel_patches/targets/3.10-rhel7.5.target
3218 lustre/kernel_patches/targets/4.14-rhel7.5.target
3219 lustre/kernel_patches/targets/4.14-rhel7.6.target
3220 lustre/kernel_patches/targets/4.12-sles12sp4.target
3221 lustre/kernel_patches/targets/4.12-sles12sp5.target
3222 lustre/kernel_patches/targets/4.12-sles15sp1.target
3223 lustre/kernel_patches/targets/5.3-sles15sp2.target
3224 lustre/kernel_patches/targets/5.3-sles15sp3.target
3225 lustre/kernel_patches/targets/3.x-fc18.target
3226 lustre/ldlm/Makefile
3228 lustre/fid/autoMakefile
3229 lustre/llite/Makefile
3230 lustre/llite/autoMakefile
3232 lustre/lov/autoMakefile
3234 lustre/mdc/autoMakefile
3236 lustre/lmv/autoMakefile
3237 lustre/lfsck/Makefile
3238 lustre/lfsck/autoMakefile
3240 lustre/mdt/autoMakefile
3242 lustre/mdd/autoMakefile
3244 lustre/fld/autoMakefile
3245 lustre/obdclass/Makefile
3246 lustre/obdclass/autoMakefile
3247 lustre/obdecho/Makefile
3248 lustre/obdecho/autoMakefile
3250 lustre/ofd/autoMakefile
3252 lustre/osc/autoMakefile
3254 lustre/ost/autoMakefile
3255 lustre/osd-ldiskfs/Makefile
3256 lustre/osd-ldiskfs/autoMakefile
3257 lustre/osd-zfs/Makefile
3258 lustre/osd-zfs/autoMakefile
3260 lustre/mgc/autoMakefile
3262 lustre/mgs/autoMakefile
3263 lustre/target/Makefile
3264 lustre/ptlrpc/Makefile
3265 lustre/ptlrpc/autoMakefile
3266 lustre/ptlrpc/gss/Makefile
3267 lustre/ptlrpc/gss/autoMakefile
3268 lustre/quota/Makefile
3269 lustre/quota/autoMakefile
3270 lustre/scripts/Makefile
3271 lustre/scripts/systemd/Makefile
3272 lustre/tests/Makefile
3273 lustre/tests/mpi/Makefile
3274 lustre/tests/iabf/Makefile
3275 lustre/tests/lutf/Makefile
3276 lustre/tests/lutf/src/Makefile
3277 lustre/tests/kernel/Makefile
3278 lustre/tests/kernel/autoMakefile
3279 lustre/utils/Makefile
3280 lustre/utils/gss/Makefile
3282 lustre/osp/autoMakefile
3284 lustre/lod/autoMakefile
3286 ]) # LC_CONFIG_FILES