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], [
74 AC_MSG_CHECKING([if 'struct getinfo_fid2path' has anonymous union])
75 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
76 #include <linux/lustre/lustre_idl.h>
79 struct getinfo_fid2path gf;
80 struct lu_fid root_fid;
82 *gf.gf_root_fid = root_fid;
86 AC_DEFINE(HAVE_FID2PATH_ANON_UNIONS, 1, [union is unnamed])
92 ]) # LC_FID2PATH_ANON_UNION
97 # Ensure the stack size is at least 8k in Lustre server (all kernels)
99 AC_DEFUN([LC_SRC_STACK_SIZE], [
100 LB2_LINUX_TEST_SRC([stack_size_8k], [
101 #include <linux/thread_info.h>
103 #if THREAD_SIZE < 8192
104 #error "stack size < 8192"
108 AC_DEFUN([LC_STACK_SIZE], [
109 LB2_MSG_LINUX_TEST_RESULT([if stack size is at least 8k],
110 [stack_size_8k], [],[
112 [Lustre requires that Linux is configured with at least a 8KB stack.])
119 # Allow the user to set the MDS thread upper limit
121 AC_DEFUN([LC_MDS_MAX_THREADS], [
122 AC_MSG_CHECKING([for maximum number of MDS threads])
123 AC_ARG_WITH([mds_max_threads],
124 AS_HELP_STRING([--with-mds-max-threads=count],
125 [maximum threads available on the MDS: (default=512)]),
126 [AC_DEFINE_UNQUOTED(MDS_MAX_THREADS, $with_mds_max_threads,
127 [maximum number of MDS threads])])
128 AC_MSG_RESULT([$with_mds_max_threads])
129 ]) # LC_MDS_MAX_THREADS
134 # the pinger is temporary, until we have the recovery node in place
136 AC_DEFUN([LC_CONFIG_PINGER], [
137 AC_MSG_CHECKING([whether to enable Lustre pinger support])
138 AC_ARG_ENABLE([pinger],
139 AS_HELP_STRING([--disable-pinger],
140 [disable recovery pinger support]),
141 [], [enable_pinger="yes"])
142 AC_MSG_RESULT([$enable_pinger])
143 AS_IF([test "x$enable_pinger" != xno], [
144 AC_DEFINE(CONFIG_LUSTRE_FS_PINGER, 1, [Use the Pinger])
145 AC_SUBST(ENABLE_PINGER, yes)
147 AC_SUBST(ENABLE_PINGER, no)
149 ]) # LC_CONFIG_PINGER
154 # do checksum of bulk data between client and OST
156 AC_DEFUN([LC_CONFIG_CHECKSUM], [
157 AC_MSG_CHECKING([whether to enable data checksum support])
158 AC_ARG_ENABLE([checksum],
159 AS_HELP_STRING([--disable-checksum],
160 [disable data checksum support]),
161 [], [enable_checksum="yes"])
162 AC_MSG_RESULT([$enable_checksum])
163 AS_IF([test "x$enable_checksum" != xno], [
164 AC_DEFINE(CONFIG_ENABLE_CHECKSUM, 1, [do data checksums])
165 AC_SUBST(ENABLE_CHECKSUM, yes)
167 AC_SUBST(ENABLE_CHECKSUM, no)
169 ]) # LC_CONFIG_CHECKSUM
174 # enable distributed flock by default
176 AC_DEFUN([LC_CONFIG_FLOCK], [
177 AC_MSG_CHECKING([whether to enable flock by default])
178 AC_ARG_ENABLE([flock],
179 AS_HELP_STRING([--disable-flock],
180 [disable flock by default]),
181 [], [enable_flock="yes"])
182 AC_MSG_RESULT([$enable_flock])
183 AS_IF([test "x$enable_flock" != xno], [
184 AC_DEFINE(CONFIG_ENABLE_FLOCK, 1, [enable flock by default])
185 AC_SUBST(ENABLE_FLOCK, yes)
187 AC_SUBST(ENABLE_FLOCK, no)
192 # LC_CONFIG_LRU_RESIZE
194 AC_DEFUN([LC_CONFIG_LRU_RESIZE], [
195 AC_MSG_CHECKING([whether to enable lru self-adjusting])
196 AC_ARG_ENABLE([lru_resize],
197 AS_HELP_STRING([--enable-lru-resize],
198 [enable lru resize support]),
199 [], [enable_lru_resize="yes"])
200 AC_MSG_RESULT([$enable_lru_resize])
201 AS_IF([test "x$enable_lru_resize" != xno], [
202 AC_DEFINE(HAVE_LRU_RESIZE_SUPPORT, 1, [Enable lru resize support])
203 AC_SUBST(ENABLE_LRU_RESIZE, yes)
205 AC_SUBST(ENABLE_LRU_RESIZE, no)
207 ]) # LC_CONFIG_LRU_RESIZE
212 # Quota support. The kernel must support CONFIG_QUOTA.
214 AC_DEFUN([LC_SRC_CONFIG_QUOTA], [
215 LB2_SRC_CHECK_CONFIG_IM([QUOTA])
217 AC_DEFUN([LC_CONFIG_QUOTA], [
218 LB2_TEST_CHECK_CONFIG_IM([QUOTA],[],[AC_MSG_ERROR(
219 [Lustre quota requires that CONFIG_QUOTA is enabled in your kernel.])])
225 # fhandle kernel support for open_by_handle_at() and name_to_handle_at()
226 # system calls. The kernel must support CONFIG_FHANDLE.
228 AC_DEFUN([LC_SRC_CONFIG_FHANDLE], [
229 LB2_SRC_CHECK_CONFIG_IM([FHANDLE])
231 AC_DEFUN([LC_CONFIG_FHANDLE], [
232 LB2_TEST_CHECK_CONFIG_IM([FHANDLE],[],[AC_MSG_ERROR(
233 [Lustre fid handling requires that CONFIG_FHANDLE is enabled in your kernel.])])
234 ]) # LC_CONFIG_FHANDLE
237 # LC_POSIX_ACL_CONFIG
241 AC_DEFUN([LC_SRC_POSIX_ACL_CONFIG], [
242 LB2_SRC_CHECK_CONFIG_IM([FS_POSIX_ACL])
244 AC_DEFUN([LC_POSIX_ACL_CONFIG], [
245 LB2_TEST_CHECK_CONFIG_IM([FS_POSIX_ACL],
246 [AC_DEFINE(CONFIG_LUSTRE_FS_POSIX_ACL, 1, [Enable POSIX acl])],
248 ]) # LC_POSIX_ACL_CONFIG
250 # CRYPTO_MD5 check and warn only if GSS is not disabled.
253 # LC_CONFIG_GSS_KEYRING
255 # default 'auto', tests for dependencies, if found, enables;
256 # only called if gss is enabled
258 AC_DEFUN([LC_CONFIG_GSS_KEYRING], [
259 AC_MSG_CHECKING([whether to enable gss keyring backend])
260 AC_ARG_ENABLE([gss_keyring],
261 [AS_HELP_STRING([--disable-gss-keyring],
262 [disable gss keyring backend])],
263 [], [AS_IF([test "x$enable_gss" != xno], [
264 enable_gss_keyring="yes"], [
265 enable_gss_keyring="auto"])])
266 AC_MSG_RESULT([$enable_gss_keyring])
267 AS_IF([test "x$enable_gss_keyring" != xno], [
268 LB_CHECK_CONFIG_IM([KEYS], [], [
269 gss_keyring_conf_test="fail"
270 AC_MSG_WARN([GSS keyring backend requires that CONFIG_KEYS be enabled in your kernel.])])
272 AC_CHECK_LIB([keyutils], [keyctl_search], [], [
273 gss_keyring_conf_test="fail"
274 AC_MSG_WARN([GSS keyring backend requires libkeyutils])])
276 AS_IF([test "x$gss_keyring_conf_test" != xfail], [
277 AC_DEFINE([HAVE_GSS_KEYRING], [1],
278 [Define this if you enable gss keyring backend])
279 enable_gss_keyring="yes"
281 AS_IF([test "x$enable_gss_keyring" = xyes], [
282 AC_MSG_ERROR([Cannot enable gss_keyring. See above for details.])
289 ]) # LC_CONFIG_GSS_KEYRING
292 # LC_KEY_TYPE_INSTANTIATE_2ARGS
294 # rhel7 key_type->instantiate takes 2 args (struct key, struct key_preparsed_payload)
296 AC_DEFUN([LC_SRC_KEY_TYPE_INSTANTIATE_2ARGS], [
297 LB2_LINUX_TEST_SRC([key_type_instantiate_2args], [
298 #include <linux/key-type.h>
300 ((struct key_type *)0)->instantiate(0, NULL);
303 AC_DEFUN([LC_KEY_TYPE_INSTANTIATE_2ARGS], [
304 LB2_MSG_LINUX_TEST_RESULT([if 'key_type->instantiate' has two args],
305 [key_type_instantiate_2args], [
306 AC_DEFINE(HAVE_KEY_TYPE_INSTANTIATE_2ARGS, 1,
307 [key_type->instantiate has two args])
309 ]) # LC_KEY_TYPE_INSTANTIATE_2ARGS
314 AC_DEFUN([LC_CONFIG_SUNRPC], [
315 LB_CHECK_CONFIG_IM([SUNRPC], [], [
316 AS_IF([test "x$sunrpc_required" = xyes], [
319 kernel SUNRPC support is required by using GSS.
322 ]) # LC_CONFIG_SUNRPC
325 # LC_CONFIG_GSS (default 'auto' (tests for dependencies, if found, enables))
327 # Build gss and related tools of Lustre. Currently both kernel and user space
328 # parts are depend on linux platform.
330 AC_DEFUN([LC_CONFIG_GSS], [
331 AC_MSG_CHECKING([whether to enable gss support])
333 [AS_HELP_STRING([--enable-gss], [enable gss support])],
334 [], [enable_gss="auto"])
335 AC_MSG_RESULT([$enable_gss])
337 AC_ARG_VAR([TEST_JOBS],
338 [simultaneous jobs during configure (defaults to $(nproc))])
339 if test "x$ac_cv_env_TEST_JOBS_set" != "xset"; then
340 TEST_JOBS=${TEST_JOBS:-$(nproc)}
344 AC_ARG_VAR([TEST_DIR],
345 [location of temporary parallel configure tests (defaults to $PWD/lb2)])
346 TEST_DIR=${TEST_DIR:-${ac_pwd}/_lpb}
349 AS_IF([test "x$enable_gss" != xno], [
350 LC_CONFIG_GSS_KEYRING
352 sunrpc_required=$enable_gss
356 require_krb5=$enable_gss
360 AS_IF([test -n "$KRBDIR"], [
361 gss_conf_test="success"
363 gss_conf_test="failure"
366 AS_IF([test "x$gss_conf_test" = xsuccess && test "x$enable_gss" != xno], [
367 AC_DEFINE([HAVE_GSS], [1], [Define this is if you enable gss])
370 enable_gss_keyring="no"
374 AS_IF([test "x$enable_ssk" != xno], [
375 enable_ssk=$enable_gss
378 enable_gss_keyring="no"
384 # OpenSSL 1.0+ return int for HMAC functions but older SLES11 versions do not
385 AC_DEFUN([LC_OPENSSL_HMAC], [
386 has_hmac_functions="no"
387 saved_flags="$CFLAGS"
389 AC_MSG_CHECKING([whether OpenSSL has HMAC_Init_ex])
390 AS_IF([test "x$enable_ssk" != xno], [
391 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
392 #include <openssl/hmac.h>
393 #include <openssl/evp.h>
397 rc = HMAC_Init_ex(NULL, "test", 4, EVP_md_null(), NULL);
401 has_hmac_functions="yes"
404 AC_MSG_RESULT([$has_hmac_functions])
405 CFLAGS="$saved_flags"
408 # LC_OPENSSL_EVP_PKEY
410 # OpenSSL 3.0 introduces EVP_PKEY_get_params
411 AC_DEFUN([LC_OPENSSL_EVP_PKEY], [
413 saved_flags="$CFLAGS"
415 AC_MSG_CHECKING([whether OpenSSL has EVP_PKEY_get_params])
416 AS_IF([test "x$enable_ssk" != xno], [
417 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
418 #include <openssl/evp.h>
423 int rc = EVP_PKEY_get_params(NULL, params);
427 AC_DEFINE(HAVE_OPENSSL_EVP_PKEY, 1, [OpenSSL EVP_PKEY_get_params])
431 CFLAGS="$saved_flags"
432 AC_MSG_RESULT([$has_evp_pkey])
433 ]) # LC_OPENSSL_EVP_PKEY
438 # Check whether to enable Lustre client crypto
440 AC_DEFUN([LC_OPENSSL_SSK], [
441 AS_IF([test "x$enable_ssk" != xno], [
445 AS_IF([test "x$has_hmac_functions" = xyes -o "x$has_evp_pkey" = xyes], [
446 AC_DEFINE(HAVE_OPENSSL_SSK, 1, [OpenSSL HMAC functions needed for SSK])
450 AC_MSG_CHECKING([whether OpenSSL has functions needed for SSK])
451 AC_MSG_RESULT([$enable_ssk])
454 # LC_OPENSSL_GETSEPOL
456 # OpenSSL is needed for l_getsepol
457 AC_DEFUN([LC_OPENSSL_GETSEPOL], [
458 saved_flags="$CFLAGS"
460 AC_MSG_CHECKING([whether openssl-devel is present])
461 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
462 #include <openssl/evp.h>
465 EVP_MD_CTX *mdctx = EVP_MD_CTX_create();
469 AC_DEFINE(HAVE_OPENSSL_GETSEPOL, 1, [openssl-devel is present])
470 enable_getsepol="yes"
476 No openssl-devel headers found, unable to build l_getsepol and SELinux status checking
479 AC_MSG_RESULT([$enable_getsepol])
480 CFLAGS="$saved_flags"
481 ]) # LC_OPENSSL_GETSEPOL
484 AC_DEFUN([LC_HAVE_LIBAIO], [
485 AC_CHECK_HEADER([libaio.h],
487 AC_MSG_WARN([libaio is not installed on the system]))
491 # LC_INVALIDATE_RANGE
493 # 3.11 invalidatepage requires the length of the range to invalidate
495 AC_DEFUN([LC_SRC_INVALIDATE_RANGE], [
496 LB2_LINUX_TEST_SRC([address_space_ops_invalidatepage_3args], [
497 #include <linux/fs.h>
499 struct address_space_operations a_ops;
500 a_ops.invalidatepage(NULL, 0, 0);
503 AC_DEFUN([LC_INVALIDATE_RANGE], [
504 LB2_MSG_LINUX_TEST_RESULT(
505 [if 'address_space_operations.invalidatepage' requires 3 arguments],
506 [address_space_ops_invalidatepage_3args], [
507 AC_DEFINE(HAVE_INVALIDATE_RANGE, 1,
508 [address_space_operations.invalidatepage needs 3 arguments])
510 ]) # LC_INVALIDATE_RANGE
513 # LC_HAVE_DIR_CONTEXT
515 # 3.11 readdir now takes the new struct dir_context
517 AC_DEFUN([LC_SRC_HAVE_DIR_CONTEXT], [
518 LB2_LINUX_TEST_SRC([dir_context], [
519 #include <linux/fs.h>
521 #ifdef FMODE_KABI_ITERATE
522 #error "back to use readdir in kabi_extand mode"
524 struct dir_context ctx;
530 AC_DEFUN([LC_HAVE_DIR_CONTEXT], [
531 LB2_MSG_LINUX_TEST_RESULT([if 'dir_context' exist],
533 AC_DEFINE(HAVE_DIR_CONTEXT, 1, [dir_context exist])
535 ]) # LC_HAVE_DIR_CONTEXT
540 # 3.11 dentry_operations.d_compare() taken 5 arguments.
542 AC_DEFUN([LC_SRC_D_COMPARE_5ARGS], [
543 LB2_LINUX_TEST_SRC([d_compare_5args], [
544 #include <linux/dcache.h>
546 ((struct dentry_operations*)0)->d_compare(NULL,NULL,0,NULL,NULL);
549 AC_DEFUN([LC_D_COMPARE_5ARGS], [
550 LB2_MSG_LINUX_TEST_RESULT([if 'd_compare' taken 5 arguments],
552 AC_DEFINE(HAVE_D_COMPARE_5ARGS, 1,
553 [d_compare need 5 arguments])
555 ]) # LC_D_COMPARE_5ARGS
560 # 3.11 need to access d_count to get dentry reference count
562 AC_DEFUN([LC_SRC_HAVE_DCOUNT], [
563 LB2_LINUX_TEST_SRC([d_count], [
564 #include <linux/dcache.h>
566 struct dentry de = { };
569 count = d_count(&de);
572 AC_DEFUN([LC_HAVE_DCOUNT], [
573 LB2_MSG_LINUX_TEST_RESULT([if 'd_count' exists],
575 AC_DEFINE(HAVE_D_COUNT, 1, [d_count exist])
580 # LC_PID_NS_FOR_CHILDREN
582 # 3.11 replaces pid_ns by pid_ns_for_children in struct nsproxy
584 AC_DEFUN([LC_SRC_PID_NS_FOR_CHILDREN], [
585 LB2_LINUX_TEST_SRC([pid_ns_for_children], [
586 #include <linux/nsproxy.h>
589 ns.pid_ns_for_children = NULL;
592 AC_DEFUN([LC_PID_NS_FOR_CHILDREN], [
593 LB2_MSG_LINUX_TEST_RESULT([if 'struct nsproxy' has 'pid_ns_for_children'],
594 [pid_ns_for_children], [
595 AC_DEFINE(HAVE_PID_NS_FOR_CHILDREN, 1,
596 ['struct nsproxy' has 'pid_ns_for_children'])
598 ]) # LC_PID_NS_FOR_CHILDREN
601 # LC_OLDSIZE_TRUNCATE_PAGECACHE
603 # 3.12 truncate_pagecache without oldsize parameter
605 AC_DEFUN([LC_SRC_OLDSIZE_TRUNCATE_PAGECACHE], [
606 LB2_LINUX_TEST_SRC([truncate_pagecache_old_size], [
607 #include <linux/mm.h>
609 truncate_pagecache(NULL, 0, 0);
612 AC_DEFUN([LC_OLDSIZE_TRUNCATE_PAGECACHE], [
613 LB2_MSG_LINUX_TEST_RESULT([if 'truncate_pagecache' with 'old_size' parameter],
614 [truncate_pagecache_old_size], [
615 AC_DEFINE(HAVE_OLDSIZE_TRUNCATE_PAGECACHE, 1,
618 ]) # LC_OLDSIZE_TRUNCATE_PAGECACHE
623 # For some reason SLES11SP4 is missing the PTR_ERR_OR_ZERO macro
624 # It was added to linux kernel 3.12
626 AC_DEFUN([LC_SRC_PTR_ERR_OR_ZERO_MISSING], [
627 LB2_LINUX_TEST_SRC([is_err_or_null], [
628 #include <linux/err.h>
630 if (PTR_ERR_OR_ZERO(NULL)) return 0;
633 AC_DEFUN([LC_PTR_ERR_OR_ZERO_MISSING], [
634 LB2_MSG_LINUX_TEST_RESULT([if 'PTR_ERR_OR_ZERO' is missing],
636 AC_DEFINE(HAVE_PTR_ERR_OR_ZERO, 1,
637 ['PTR_ERR_OR_ZERO' exist])
639 ]) # LC_PTR_ERR_OR_ZERO_MISSING
642 # LC_HAVE_DENTRY_D_U_D_ALIAS
644 # 3.11 kernel moved d_alias to the union d_u in struct dentry
646 # Some distros move d_alias to d_u but it is still a struct list
648 AC_DEFUN([LC_SRC_HAVE_DENTRY_D_U_D_ALIAS_LIST], [
649 LB2_LINUX_TEST_SRC([d_alias_list], [
650 #include <linux/list.h>
651 #include <linux/dcache.h>
654 INIT_LIST_HEAD(&de.d_u.d_alias);
657 AC_DEFUN([LC_HAVE_DENTRY_D_U_D_ALIAS_LIST], [
658 LB2_MSG_LINUX_TEST_RESULT([if list 'dentry.d_u.d_alias' exist],
660 AC_DEFINE(HAVE_DENTRY_D_U_D_ALIAS, 1,
661 [list dentry.d_u.d_alias exist])
663 ]) # LC_HAVE_DENTRY_D_U_D_ALIAS_LIST
666 # LC_HAVE_DENTRY_D_U_D_ALIAS_HLIST
668 # Some distros move d_alias to d_u and it is an hlist
670 AC_DEFUN([LC_SRC_HAVE_DENTRY_D_U_D_ALIAS_HLIST], [
671 LB2_LINUX_TEST_SRC([d_alias_hlist], [
672 #include <linux/list.h>
673 #include <linux/dcache.h>
676 INIT_HLIST_NODE(&de.d_u.d_alias);
679 AC_DEFUN([LC_HAVE_DENTRY_D_U_D_ALIAS_HLIST], [
680 LB2_MSG_LINUX_TEST_RESULT([if hlist 'dentry.d_u.d_alias' exist],
682 AC_DEFINE(HAVE_DENTRY_D_U_D_ALIAS, 1,
683 [list dentry.d_u.d_alias exist])
685 ]) # LC_HAVE_DENTRY_D_U_D_ALIAS_HLIST
689 # LC_HAVE_DENTRY_D_CHILD
691 # 3.11 kernel d_child has been moved out of the union d_u
694 AC_DEFUN([LC_SRC_HAVE_DENTRY_D_CHILD], [
695 LB2_LINUX_TEST_SRC([d_child], [
696 #include <linux/list.h>
697 #include <linux/dcache.h>
700 INIT_LIST_HEAD(&de.d_child);
703 AC_DEFUN([LC_HAVE_DENTRY_D_CHILD], [
704 LB2_MSG_LINUX_TEST_RESULT([if 'dentry.d_child' exist],
706 AC_DEFINE(HAVE_DENTRY_D_CHILD, 1, [dentry.d_child exist])
708 ]) # LC_HAVE_DENTRY_D_CHILD
713 # 3.12 ki_left removed from struct kiocb
715 AC_DEFUN([LC_SRC_KIOCB_KI_LEFT], [
716 LB2_LINUX_TEST_SRC([kiocb_ki_left], [
717 #include <linux/aio.h>
719 ((struct kiocb*)0)->ki_left = 0;
722 AC_DEFUN([LC_KIOCB_KI_LEFT], [
723 LB2_MSG_LINUX_TEST_RESULT([if 'struct kiocb' with 'ki_left' member],
725 AC_DEFINE(HAVE_KIOCB_KI_LEFT, 1,
728 ]) # LC_KIOCB_KI_LEFT
731 # LC_REGISTER_SHRINKER_RET
733 # v3.11-8748-g1d3d4437eae1 register_shrinker returns a status
735 AC_DEFUN([LC_SRC_REGISTER_SHRINKER_RET], [
736 LB2_LINUX_TEST_SRC([register_shrinker_ret], [
737 #include <linux/mm.h>
739 if (register_shrinker(NULL))
740 unregister_shrinker(NULL);
743 AC_DEFUN([LC_REGISTER_SHRINKER_RET], [
744 LB2_MSG_LINUX_TEST_RESULT([if register_shrinker() returns status],
745 [register_shrinker_ret], [
746 AC_DEFINE(HAVE_REGISTER_SHRINKER_RET, 1,
747 [register_shrinker() returns status])
749 ]) # LC_REGISTER_SHRINKER_RET
752 # LC_VFS_RENAME_5ARGS
754 # 3.13 has vfs_rename with 5 args
756 AC_DEFUN([LC_SRC_VFS_RENAME_5ARGS], [
757 LB2_LINUX_TEST_SRC([vfs_rename_5args], [
758 #include <linux/fs.h>
760 vfs_rename(NULL, NULL, NULL, NULL, NULL);
763 AC_DEFUN([LC_VFS_RENAME_5ARGS], [
764 LB2_MSG_LINUX_TEST_RESULT([if Linux kernel has 'vfs_rename' with 5 args],
765 [vfs_rename_5args], [
766 AC_DEFINE(HAVE_VFS_RENAME_5ARGS, 1,
767 [kernel has vfs_rename with 5 args])
769 ]) # LC_VFS_RENAME_5ARGS
772 # LC_VFS_UNLINK_3ARGS
774 # 3.13 has vfs_unlink with 3 args
776 AC_DEFUN([LC_SRC_VFS_UNLINK_3ARGS], [
777 LB2_LINUX_TEST_SRC([vfs_unlink_3args], [
778 #include <linux/fs.h>
780 vfs_unlink(NULL, NULL, NULL);
783 AC_DEFUN([LC_VFS_UNLINK_3ARGS], [
784 LB2_MSG_LINUX_TEST_RESULT([if Linux kernel has 'vfs_unlink' with 3 args],
785 [vfs_unlink_3args], [
786 AC_DEFINE(HAVE_VFS_UNLINK_3ARGS, 1,
787 [kernel has vfs_unlink with 3 args])
789 ]) # LC_VFS_UNLINK_3ARGS
791 # LC_HAVE_D_IS_POSITIVE
793 # Kernel version 3.13 b18825a7c8e37a7cf6abb97a12a6ad71af160de7
794 # d_is_positive is added
796 AC_DEFUN([LC_SRC_HAVE_D_IS_POSITIVE], [
797 LB2_LINUX_TEST_SRC([d_is_positive], [
798 #include <linux/dcache.h>
803 AC_DEFUN([LC_HAVE_D_IS_POSITIVE], [
804 LB2_MSG_LINUX_TEST_RESULT([if 'd_is_positive' exist],
806 AC_DEFINE(HAVE_D_IS_POSITIVE, 1,
807 ['d_is_positive' is available])
809 ]) # LC_HAVE_D_IS_POSITIVE
814 # 3.14 move some of its data in struct bio into the new
817 AC_DEFUN([LC_SRC_HAVE_BVEC_ITER], [
818 LB2_LINUX_TEST_SRC([have_bvec_iter], [
819 #include <linux/bio.h>
821 struct bvec_iter iter;
823 iter.bi_bvec_done = 0;
826 AC_DEFUN([LC_HAVE_BVEC_ITER], [
827 LB2_MSG_LINUX_TEST_RESULT([if Linux kernel has struct bvec_iter],
829 AC_DEFINE(HAVE_BVEC_ITER, 1,
830 [kernel has struct bvec_iter])
832 ]) # LC_HAVE_BVEC_ITER
837 # 3.14 adds set_acl method to inode_operations
838 # see kernel commit 893d46e443346370cd4ea81d9d35f72952c62a37
840 AC_DEFUN([LC_SRC_IOP_SET_ACL], [
841 LB2_LINUX_TEST_SRC([inode_ops_set_acl], [
842 #include <linux/fs.h>
844 struct inode_operations iop;
848 AC_DEFUN([LC_IOP_SET_ACL], [
849 LB2_MSG_LINUX_TEST_RESULT([if 'inode_operations' has '.set_acl' member function],
850 [inode_ops_set_acl], [
851 AC_DEFINE(HAVE_IOP_SET_ACL, 1,
852 [inode_operations has .set_acl member function])
857 # LC_HAVE_TRUNCATE_IPAGE_FINAL
859 # 3.14 bring truncate_inode_pages_final for evict_inode
861 AC_DEFUN([LC_SRC_HAVE_TRUNCATE_IPAGES_FINAL], [
862 LB2_LINUX_TEST_SRC([truncate_ipages_final], [
863 #include <linux/mm.h>
865 truncate_inode_pages_final(NULL);
868 AC_DEFUN([LC_HAVE_TRUNCATE_IPAGES_FINAL], [
869 LB2_MSG_LINUX_TEST_RESULT([if Linux kernel has truncate_inode_pages_final],
870 [truncate_ipages_final], [
871 AC_DEFINE(HAVE_TRUNCATE_INODE_PAGES_FINAL, 1,
872 [kernel has truncate_inode_pages_final])
874 ]) # LC_HAVE_TRUNCATE_IPAGES_FINAL
877 # LC_IOPS_RENAME_WITH_FLAGS
879 # 3.14 has inode_operations->rename with 5 args
880 # commit 520c8b16505236fc82daa352e6c5e73cd9870cff
882 AC_DEFUN([LC_SRC_IOPS_RENAME_WITH_FLAGS], [
883 LB2_LINUX_TEST_SRC([iops_rename_with_flags], [
884 #include <linux/fs.h>
886 struct inode *i1 = NULL, *i2 = NULL;
887 struct dentry *d1 = NULL, *d2 = NULL;
889 rc = ((struct inode_operations *)0)->rename(i1, d1, i2, d2, 0);
891 ]) # LC_IOPS_RENAME_WITH_FLAGS
892 AC_DEFUN([LC_IOPS_RENAME_WITH_FLAGS], [
893 LB2_MSG_LINUX_TEST_RESULT([if 'inode_operations->rename' taken flags as argument],
894 [iops_rename_with_flags], [
895 AC_DEFINE(HAVE_IOPS_RENAME_WITH_FLAGS, 1,
896 [inode_operations->rename need flags as argument])
898 ]) # LC_IOPS_RENAME_WITH_FLAGS
901 # LC_VFS_RENAME_6ARGS
903 # 3.15 has vfs_rename with 6 args
905 AC_DEFUN([LC_SRC_VFS_RENAME_6ARGS], [
906 LB2_LINUX_TEST_SRC([vfs_rename_6args], [
907 #include <linux/fs.h>
909 vfs_rename(NULL, NULL, NULL, NULL, NULL, NULL);
912 AC_DEFUN([LC_VFS_RENAME_6ARGS], [
913 LB2_MSG_LINUX_TEST_RESULT([if Linux kernel has 'vfs_rename' with 6 args],
914 [vfs_rename_6args], [
915 AC_DEFINE(HAVE_VFS_RENAME_6ARGS, 1,
916 [kernel has vfs_rename with 6 args])
918 ]) # LC_VFS_RENAME_6ARGS
921 # LC_DIRECTIO_USE_ITER
923 # 3.16 kernel changes direct IO to use iov_iter
925 AC_DEFUN([LC_SRC_DIRECTIO_USE_ITER], [
926 LB2_LINUX_TEST_SRC([direct_io_iter], [
927 #include <linux/fs.h>
929 struct address_space_operations ops = { };
930 struct iov_iter *iter = NULL;
933 ops.direct_IO(0, NULL, iter, offset);
936 AC_DEFUN([LC_DIRECTIO_USE_ITER], [
937 LB2_MSG_LINUX_TEST_RESULT([if direct IO uses iov_iter],
939 AC_DEFINE(HAVE_DIRECTIO_ITER, 1, [direct IO uses iov_iter])
941 ]) # LC_DIRECTIO_USE_ITER
944 # LC_HAVE_IOV_ITER_INIT_DIRECTION
947 # 3.16 linux commit 71d8e532b1549a478e6a6a8a44f309d050294d00
948 # changed iov_iter_init api to start accepting a tag
949 # that defines if its a read or write operation
951 AC_DEFUN([LC_SRC_HAVE_IOV_ITER_INIT_DIRECTION], [
952 LB2_LINUX_TEST_SRC([iter_init], [
953 #include <linux/uio.h>
954 #include <linux/fs.h>
956 const struct iovec *iov = NULL;
958 iov_iter_init(NULL, READ, iov, 1, 0);
961 AC_DEFUN([LC_HAVE_IOV_ITER_INIT_DIRECTION], [
962 LB2_MSG_LINUX_TEST_RESULT([if 'iov_iter_init' takes a tag],
964 AC_DEFINE(HAVE_IOV_ITER_INIT_DIRECTION, 1,
965 [iov_iter_init handles directional tag])
967 ]) # LC_HAVE_IOV_ITER_INIT_DIRECTION
970 # LC_HAVE_IOV_ITER_TRUNCATE
973 # 3.16 introduces a new API iov_iter_truncate()
975 AC_DEFUN([LC_SRC_HAVE_IOV_ITER_TRUNCATE], [
976 LB2_LINUX_TEST_SRC([iter_truncate], [
977 #include <linux/uio.h>
978 #include <linux/fs.h>
980 struct iov_iter *i = NULL;
982 iov_iter_truncate(i, 0);
985 AC_DEFUN([LC_HAVE_IOV_ITER_TRUNCATE], [
986 LB2_MSG_LINUX_TEST_RESULT([if 'iov_iter_truncate' exists],
988 AC_DEFINE(HAVE_IOV_ITER_TRUNCATE, 1, [iov_iter_truncate exists])
990 ]) # LC_HAVE_IOV_ITER_TRUNCATE
993 # LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
995 # 3.16 introduces [read|write]_iter to struct file_operations
997 AC_DEFUN([LC_SRC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER], [
998 LB2_LINUX_TEST_SRC([file_function_iter], [
999 #include <linux/fs.h>
1001 ((struct file_operations *)NULL)->read_iter(NULL, NULL);
1002 ((struct file_operations *)NULL)->write_iter(NULL, NULL);
1005 AC_DEFUN([LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER], [
1006 LB2_MSG_LINUX_TEST_RESULT([if 'file_operations.[read|write]_iter' exist],
1007 [file_function_iter], [
1008 AC_DEFINE(HAVE_FILE_OPERATIONS_READ_WRITE_ITER, 1,
1009 [file_operations.[read|write]_iter functions exist])
1011 ]) # LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
1014 # LC_PAGECACHE_GET_PAGE
1016 # Kernel version 3.16 commit 2457aec63745e235bcafb7ef312b182d8682f0fc
1017 # @pagecache_get_page was introduced since Linux 3.16
1019 AC_DEFUN([LC_SRC_PAGECACHE_GET_PAGE], [
1020 LB2_LINUX_TEST_SRC([pagecache_get_page], [
1021 #include <linux/pagemap.h>
1023 pagecache_get_page(NULL, 0, 0, 0);
1026 AC_DEFUN([LC_PAGECACHE_GET_PAGE], [
1027 LB2_MSG_LINUX_TEST_RESULT([if 'pagecache_get_page' exists],
1028 [pagecache_get_page], [
1029 AC_DEFINE(HAVE_PAGECACHE_GET_PAGE, 1,
1030 ['pagecache_get_page' is available])
1032 ]) # LC_PAGECACHE_GET_PAGE
1035 # LC_HAVE_INTERVAL_BLK_INTEGRITY
1037 # 3.17 replace sector_size with interval in struct blk_integrity
1039 AC_DEFUN([LC_SRC_HAVE_INTERVAL_BLK_INTEGRITY], [
1040 LB2_LINUX_TEST_SRC([interval_blk_integrity], [
1041 #include <linux/blkdev.h>
1043 ((struct blk_integrity *)0)->interval = 0;
1046 AC_DEFUN([LC_HAVE_INTERVAL_BLK_INTEGRITY], [
1047 LB2_MSG_LINUX_TEST_RESULT([if 'blk_integrity.interval' exist],
1048 [interval_blk_integrity], [
1049 AC_DEFINE(HAVE_INTERVAL_BLK_INTEGRITY, 1,
1050 [blk_integrity.interval exist])
1052 ]) # LC_HAVE_INTERVAL_BLK_INTEGRITY
1057 # 3.17 replaces key_type::match with match_preparse
1058 # and has new struct key_match_data
1060 AC_DEFUN([LC_SRC_KEY_MATCH_DATA], [
1061 LB2_LINUX_TEST_SRC([key_match], [
1062 #include <linux/key-type.h>
1064 struct key_match_data data;
1066 data.raw_data = NULL;
1069 AC_DEFUN([LC_KEY_MATCH_DATA], [
1070 LB2_MSG_LINUX_TEST_RESULT([if struct key_match field exist],
1072 AC_DEFINE(HAVE_KEY_MATCH_DATA, 1, [struct key_match_data exist])
1074 ]) # LC_KEY_MATCH_DATA
1077 # LC_HAVE_BLK_INTEGRITY_ITER
1079 # Linux commit v3.17-rc5-69-g1859308853b1 replaces
1080 # struct blk_integrity_exchg with struct blk_integrity_iter
1082 # LB_CHECK_LINUX_HEADER has already run so we can rely on
1083 # HAVE_LINUX_BLK_INTEGRITY_HEADER being set correctly before
1086 AC_DEFUN([LC_SRC_HAVE_BLK_INTEGRITY_ITER], [
1087 LB2_LINUX_TEST_SRC([blk_integrity_iter], [
1088 #ifdef HAVE_LINUX_BLK_INTEGRITY_HEADER
1089 # include <linux/blk-integrity.h>
1091 # include <linux/blkdev.h>
1094 struct blk_integrity_iter iter;
1096 iter.prot_buf = NULL;
1099 AC_DEFUN([LC_HAVE_BLK_INTEGRITY_ITER], [
1100 LB2_MSG_LINUX_TEST_RESULT([if struct blk_integrity_iter exist],
1101 [blk_integrity_iter], [
1102 AC_DEFINE(HAVE_BLK_INTEGRITY_ITER, 1,
1103 [kernel has struct blk_integrity_iter])
1105 ]) # LC_HAVE_BLK_INTEGRITY_ITER
1108 # LC_NFS_FILLDIR_USE_CTX
1110 # 3.18 kernel moved from void cookie to struct dir_context
1112 AC_DEFUN([LC_SRC_NFS_FILLDIR_USE_CTX], [
1113 LB2_LINUX_TEST_SRC([filldir_ctx], [
1114 #include <linux/fs.h>
1116 int filldir(struct dir_context *ctx, const char* name,
1117 int i, loff_t off, u64 tmp, unsigned temp)
1122 struct dir_context ctx = {
1126 ctx.actor(NULL, "test", 0, (loff_t) 0, 0, 0);
1129 AC_DEFUN([LC_NFS_FILLDIR_USE_CTX], [
1130 LB2_MSG_LINUX_TEST_RESULT([if filldir_t uses struct dir_context],
1132 AC_DEFINE(HAVE_FILLDIR_USE_CTX, 1,
1133 [filldir_t needs struct dir_context as argument])
1135 ]) # LC_NFS_FILLDIR_USE_CTX
1138 # LC_PERCPU_COUNTER_INIT
1140 # 3.18 For kernels 3.18 and after percpu_counter_init starts
1141 # to pass a GFP_* memory allocation flag for internal
1142 # memory allocation purposes.
1144 AC_DEFUN([LC_SRC_PERCPU_COUNTER_INIT], [
1145 LB2_LINUX_TEST_SRC([percpu_counter_init], [
1146 #include <linux/percpu_counter.h>
1148 percpu_counter_init(NULL, 0, GFP_KERNEL);
1151 AC_DEFUN([LC_PERCPU_COUNTER_INIT], [
1152 LB2_MSG_LINUX_TEST_RESULT([if percpu_counter_init uses GFP_* flag as argument],
1153 [percpu_counter_init], [
1154 AC_DEFINE(HAVE_PERCPU_COUNTER_INIT_GFP_FLAG, 1,
1155 [percpu_counter_init uses GFP_* flag])
1157 ]) # LC_PERCPU_COUNTER_INIT
1160 # LC_KIOCB_HAS_NBYTES
1162 # 3.19 kernel removed ki_nbytes from struct kiocb
1164 AC_DEFUN([LC_SRC_KIOCB_HAS_NBYTES], [
1165 LB2_LINUX_TEST_SRC([ki_nbytes], [
1166 #include <linux/fs.h>
1168 struct kiocb iocb = { };
1173 AC_DEFUN([LC_KIOCB_HAS_NBYTES], [
1174 LB2_MSG_LINUX_TEST_RESULT([if struct kiocb has ki_nbytes field],
1176 AC_DEFINE(HAVE_KI_NBYTES, 1, [ki_nbytes field exist])
1178 ]) # LC_KIOCB_HAS_NBYTES
1181 # LC_HAVE_DQUOT_QC_DQBLK
1183 # 3.19 has quotactl_ops->[sg]et_dqblk that take struct kqid and qc_dqblk
1184 # Added in commit 14bf61ffe
1186 AC_DEFUN([LC_SRC_HAVE_DQUOT_QC_DQBLK], [
1187 LB2_LINUX_TEST_SRC([qc_dqblk], [
1188 #include <linux/fs.h>
1189 #include <linux/quota.h>
1191 ((struct quotactl_ops *)0)->set_dqblk(NULL, *((struct kqid*)0), (struct qc_dqblk*)0);
1194 AC_DEFUN([LC_HAVE_DQUOT_QC_DQBLK], [
1195 LB2_MSG_LINUX_TEST_RESULT([if 'quotactl_ops.set_dqblk' takes struct qc_dqblk],
1197 AC_DEFINE(HAVE_DQUOT_QC_DQBLK, 1,
1198 [quotactl_ops.set_dqblk takes struct qc_dqblk])
1199 AC_DEFINE(HAVE_DQUOT_KQID, 1,
1200 [quotactl_ops.set_dqblk takes struct kqid])
1202 ]) # LC_HAVE_DQUOT_QC_DQBLK
1205 # LC_HAVE_AIO_COMPLETE
1207 # 3.19 kernel makes aio_complete() static
1209 AC_DEFUN([LC_SRC_HAVE_AIO_COMPLETE], [
1210 LB2_LINUX_TEST_SRC([aio_complete], [
1211 #include <linux/aio.h>
1213 aio_complete(NULL, 0, 0);
1216 AC_DEFUN([LC_HAVE_AIO_COMPLETE], [
1217 LB2_MSG_LINUX_TEST_RESULT([if kernel has exported aio_complete()],
1219 AC_DEFINE(HAVE_AIO_COMPLETE, 1, [aio_complete defined])
1221 ]) # LC_HAVE_AIO_COMPLETE
1224 # LC_HAVE_IS_ROOT_INODE
1226 # 3.19 kernel adds is_root_inode()
1227 # Commit a7400222e3eb ("new helper: is_root_inode()")
1229 AC_DEFUN([LC_SRC_HAVE_IS_ROOT_INODE], [
1230 LB2_LINUX_TEST_SRC([is_root_inode], [
1231 #include <linux/fs.h>
1233 is_root_inode(NULL);
1236 AC_DEFUN([LC_HAVE_IS_ROOT_INODE], [
1237 LB2_MSG_LINUX_TEST_RESULT([if kernel has is_root_inode()],
1239 AC_DEFINE(HAVE_IS_ROOT_INODE, 1, [is_root_inode defined])
1241 ]) # LC_HAVE_IS_ROOT_INODE
1244 # LC_BACKING_DEV_INFO_REMOVAL
1246 # 3.20 kernel removed backing_dev_info from address_space
1248 AC_DEFUN([LC_SRC_BACKING_DEV_INFO_REMOVAL], [
1249 LB2_LINUX_TEST_SRC([backing_dev_info], [
1250 #include <linux/fs.h>
1252 struct address_space mapping;
1254 mapping.backing_dev_info = NULL;
1257 AC_DEFUN([LC_BACKING_DEV_INFO_REMOVAL], [
1258 LB2_MSG_LINUX_TEST_RESULT([if struct address_space has backing_dev_info],
1259 [backing_dev_info], [
1260 AC_DEFINE(HAVE_BACKING_DEV_INFO, 1, [backing_dev_info exist])
1262 ]) # LC_BACKING_DEV_INFO_REMOVAL
1265 # LC_HAVE_PROJECT_QUOTA
1267 # Kernel version v4.0-rc1-197-g847aac644e92
1269 AC_DEFUN([LC_SRC_HAVE_PROJECT_QUOTA], [
1270 LB2_LINUX_TEST_SRC([get_projid], [
1272 #include <linux/quota.h>
1274 struct dquot_operations ops = { };
1276 ops.get_projid(NULL, NULL);
1279 AC_DEFUN([LC_HAVE_PROJECT_QUOTA], [
1280 LB2_MSG_LINUX_TEST_RESULT([if get_projid exists],
1282 AC_DEFINE(HAVE_PROJECT_QUOTA, 1,
1283 [get_projid function exists])
1285 ]) # LC_HAVE_PROJECT_QUOTA
1290 # 4.1 kernel has iov_iter_rw
1292 AC_DEFUN([LC_SRC_IOV_ITER_RW], [
1293 LB2_LINUX_TEST_SRC([iov_iter_rw], [
1294 #include <linux/fs.h>
1295 #include <linux/uio.h>
1297 struct iov_iter *iter = NULL;
1302 AC_DEFUN([LC_IOV_ITER_RW], [
1303 LB2_MSG_LINUX_TEST_RESULT([if iov_iter_rw exist],
1305 AC_DEFINE(HAVE_IOV_ITER_RW, 1, [iov_iter_rw exist])
1310 # LC_HAVE_SYNC_READ_WRITE
1312 # 4.1 new_sync_[read|write] no longer exported
1314 AC_DEFUN([LC_HAVE_SYNC_READ_WRITE], [
1315 LB_CHECK_EXPORT([new_sync_read], [fs/read_write.c],
1316 [AC_DEFINE(HAVE_SYNC_READ_WRITE, 1,
1317 [new_sync_[read|write] is exported by the kernel])])
1318 ]) # LC_HAVE_SYNC_READ_WRITE
1323 # 4.1 redefined bi_cnt as __bi_cnt in commit dac56212e8127dbc0
1325 AC_DEFUN([LC_SRC_HAVE___BI_CNT], [
1326 LB2_LINUX_TEST_SRC([have___bi_cnt], [
1327 #include <asm/atomic.h>
1328 #include <linux/bio.h>
1329 #include <linux/blk_types.h>
1331 struct bio bio = { };
1333 cnt = atomic_read(&bio.__bi_cnt);
1336 AC_DEFUN([LC_HAVE___BI_CNT], [
1337 LB2_MSG_LINUX_TEST_RESULT([if Linux kernel has __bi_cnt in struct bio],
1339 AC_DEFINE(HAVE___BI_CNT, 1, [struct bio has __bi_cnt])
1341 ]) # LC_HAVE___BI_CNT
1344 # LC_SYMLINK_OPS_USE_NAMEIDATA
1346 # For the 4.2+ kernels the file system internal symlink api no
1347 # longer uses struct nameidata as a argument
1349 AC_DEFUN([LC_SRC_SYMLINK_OPS_USE_NAMEIDATA], [
1350 LB2_LINUX_TEST_SRC([symlink_use_nameidata], [
1351 #include <linux/namei.h>
1352 #include <linux/fs.h>
1354 struct nameidata *nd = NULL;
1356 ((struct inode_operations *)0)->follow_link(NULL, nd);
1357 ((struct inode_operations *)0)->put_link(NULL, nd, NULL);
1360 AC_DEFUN([LC_SYMLINK_OPS_USE_NAMEIDATA], [
1361 LB2_MSG_LINUX_TEST_RESULT([if symlink inode operations have struct nameidata argument],
1362 [symlink_use_nameidata], [
1363 AC_DEFINE(HAVE_SYMLINK_OPS_USE_NAMEIDATA, 1,
1364 [symlink inode operations need struct nameidata argument])
1366 ]) # LC_SYMLINK_OPS_USE_NAMEIDATA
1369 # LC_BIO_ENDIO_USES_ONE_ARG
1371 # 4.2 kernel bio_endio now only takes one argument
1373 AC_DEFUN([LC_SRC_BIO_ENDIO_USES_ONE_ARG], [
1374 LB2_LINUX_TEST_SRC([bio_endio], [
1375 #include <linux/bio.h>
1380 AC_DEFUN([LC_BIO_ENDIO_USES_ONE_ARG], [
1381 LB2_MSG_LINUX_TEST_RESULT([if 'bio_endio' with one argument exist],
1383 AC_DEFINE(HAVE_BIO_ENDIO_USES_ONE_ARG, 1,
1384 [bio_endio takes only one argument])
1386 ]) # LC_BIO_ENDIO_USES_ONE_ARG
1389 # LC_ACCOUNT_PAGE_DIRTIED_3ARGS
1391 # 4.2 [to 4.5] kernel page dirtied takes 3 arguments
1393 AC_DEFUN([LC_SRC_ACCOUNT_PAGE_DIRTIED_3ARGS], [
1394 LB2_LINUX_TEST_SRC([account_page_dirtied_3a], [
1395 #include <linux/mm.h>
1397 account_page_dirtied(NULL, NULL, NULL);
1400 AC_DEFUN([LC_ACCOUNT_PAGE_DIRTIED_3ARGS], [
1401 LB2_MSG_LINUX_TEST_RESULT([if 'account_page_dirtied' with 3 args exists],
1402 [account_page_dirtied_3a], [
1403 AC_DEFINE(HAVE_ACCOUNT_PAGE_DIRTIED_3ARGS, 1,
1404 [account_page_dirtied takes three arguments])
1406 ]) # LC_ACCOUNT_PAGE_DIRTIED_3ARGS
1409 # LC_HAVE_CRYPTO_ALLOC_SKCIPHER
1411 # Kernel version 4.12 commit 7a7ffe65c8c5
1412 # introduced crypto_alloc_skcipher().
1414 AC_DEFUN([LC_SRC_HAVE_CRYPTO_ALLOC_SKCIPHER], [
1415 LB2_LINUX_TEST_SRC([crypto_alloc_skcipher], [
1416 #include <crypto/skcipher.h>
1418 crypto_alloc_skcipher(NULL, 0, 0);
1421 AC_DEFUN([LC_HAVE_CRYPTO_ALLOC_SKCIPHER], [
1422 LB2_MSG_LINUX_TEST_RESULT([if crypto_alloc_skcipher is defined],
1423 [crypto_alloc_skcipher], [
1424 AC_DEFINE(HAVE_CRYPTO_ALLOC_SKCIPHER, 1,
1425 [crypto_alloc_skcipher is defined])
1427 ]) # LC_HAVE_CRYPTO_ALLOC_SKCIPHER
1430 # LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
1432 # 4.3 replace interval with interval_exp in 'struct blk_integrity'
1433 # 'struct blk_integrity_profile' is also added in this version,
1434 # thus use this to determine whether 'struct blk_integrity' has profile
1436 AC_DEFUN([LC_SRC_HAVE_INTERVAL_EXP_BLK_INTEGRITY], [
1437 LB2_LINUX_TEST_SRC([blk_integrity_interval_exp], [
1438 #include <linux/blkdev.h>
1440 ((struct blk_integrity *)0)->interval_exp = 0;
1443 AC_DEFUN([LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY], [
1444 LB2_MSG_LINUX_TEST_RESULT([if 'blk_integrity.interval_exp' exist],
1445 [blk_integrity_interval_exp], [
1446 AC_DEFINE(HAVE_INTERVAL_EXP_BLK_INTEGRITY, 1,
1447 [blk_integrity.interval_exp exist])
1449 ]) # LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
1452 # LC_HAVE_CACHE_HEAD_HLIST
1454 # 4.3 kernel swiched to hlist for cache_head
1456 AC_DEFUN([LC_SRC_HAVE_CACHE_HEAD_HLIST], [
1457 LB2_LINUX_TEST_SRC([cache_head_has_hlist], [
1458 #include <linux/sunrpc/cache.h>
1460 do {} while(sizeof(((struct cache_head *)0)->cache_list));
1463 AC_DEFUN([LC_HAVE_CACHE_HEAD_HLIST], [
1464 LB2_MSG_LINUX_TEST_RESULT([if 'struct cache_head' has 'cache_list' field],
1465 [cache_head_has_hlist], [
1466 AC_DEFINE(HAVE_CACHE_HEAD_HLIST, 1,
1467 [cache_head has hlist cache_list])
1469 ]) # LC_HAVE_CACHE_HEAD_HLIST
1472 # LC_HAVE_XATTR_HANDLER_SIMPLIFIED
1474 # Kernel version 4.3 commit e409de992e3ea3674393465f07cc71c948edd87a
1475 # simplified xattr_handler handling by passing in the handler pointer
1477 AC_DEFUN([LC_SRC_HAVE_XATTR_HANDLER_SIMPLIFIED], [
1478 LB2_LINUX_TEST_SRC([xattr_handler_simplified], [
1479 #include <linux/xattr.h>
1481 struct xattr_handler handler;
1483 ((struct xattr_handler *)0)->get(&handler, NULL, NULL, NULL, 0);
1484 ((struct xattr_handler *)0)->set(&handler, NULL, NULL, NULL, 0, 0);
1487 AC_DEFUN([LC_HAVE_XATTR_HANDLER_SIMPLIFIED], [
1488 LB2_MSG_LINUX_TEST_RESULT([if 'struct xattr_handler' functions pass in handler pointer],
1489 [xattr_handler_simplified], [
1490 AC_DEFINE(HAVE_XATTR_HANDLER_SIMPLIFIED, 1,
1491 [handler pointer is parameter])
1493 ]) # LC_HAVE_XATTR_HANDLER_SIMPLIFIED
1496 # LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
1498 # 4.3 replace interval with interval_exp in 'struct blk_integrity'.
1500 AC_DEFUN([LC_SRC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD], [
1501 LB2_LINUX_TEST_SRC([bio_integrity_payload_bip_iter], [
1502 #include <linux/bio.h>
1504 ((struct bio_integrity_payload *)0)->bip_iter.bi_size = 0;
1507 AC_DEFUN([LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD], [
1508 LB2_MSG_LINUX_TEST_RESULT([if 'bio_integrity_payload.bip_iter' exist],
1509 [bio_integrity_payload_bip_iter], [
1510 AC_DEFINE(HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD, 1,
1511 [bio_integrity_payload.bip_iter exist])
1513 ]) # LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
1516 # LC_BIO_INTEGRITY_PREP_FN
1518 # Lustre kernel patch extents bio_integrity_prep to accept optional
1519 # generate/verify_fn as extra args.
1521 AC_DEFUN([LC_SRC_BIO_INTEGRITY_PREP_FN], [
1522 LB2_LINUX_TEST_SRC([bio_integrity_prep_fn], [
1523 #include <linux/bio.h>
1525 bio_integrity_prep_fn(NULL, NULL, NULL);
1528 AC_DEFUN([LC_BIO_INTEGRITY_PREP_FN], [
1529 LB2_MSG_LINUX_TEST_RESULT([if 'bio_integrity_prep_fn' exists],
1530 [bio_integrity_prep_fn], [
1531 AC_DEFINE(HAVE_BIO_INTEGRITY_PREP_FN, 1,
1532 [kernel has bio_integrity_prep_fn])
1533 AC_SUBST(PATCHED_INTEGRITY_INTF)
1535 AC_SUBST(PATCHED_INTEGRITY_INTF, [#])
1537 ]) # LC_BIO_INTEGRITY_PREP_FN
1539 # LC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL
1541 # 13 kernel integrity API has changed and in 4.13+
1542 # (as well as in rhel 8.4) bio_integrity_prep() returns boolean true
1545 AC_DEFUN([LC_SRC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL], [
1546 LB2_LINUX_TEST_SRC([bio_integrity_prep_ret_bool], [
1547 #include <linux/bio.h>
1548 #include <linux/typecheck.h>
1550 #pragma GCC diagnostic warning "-Werror"
1551 typedef bool (*bio_integrity_prep_type)(struct bio *bio) ;
1553 typecheck_fn(bio_integrity_prep_type, bio_integrity_prep);
1556 AC_DEFUN([LC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL], [
1557 LB2_MSG_LINUX_TEST_RESULT([if 'bio_integrity_prep_fn' returns bool],
1558 [bio_integrity_prep_ret_bool], [
1559 AC_DEFINE(HAVE_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL, 1,
1560 [bio_integrity_prep_fn returns bool])
1562 ]) # LC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL
1567 # 4.4/4.8 redefined bi_rw as bi_opf (SLES12/kernel commit 4382e33ad37486)
1569 AC_DEFUN([LC_SRC_HAVE_BI_OPF], [
1570 LB2_LINUX_TEST_SRC([have_bi_opf], [
1571 #include <linux/bio.h>
1578 AC_DEFUN([LC_HAVE_BI_OPF], [
1579 LB2_MSG_LINUX_TEST_RESULT([if Linux kernel has bi_opf in struct bio],
1581 AC_DEFINE(HAVE_BI_OPF, 1, [struct bio has bi_opf])
1586 # LC_HAVE_SUBMIT_BIO_2ARGS
1588 # 4.4 removed an argument from submit_bio
1590 AC_DEFUN([LC_SRC_HAVE_SUBMIT_BIO_2ARGS], [
1591 LB2_LINUX_TEST_SRC([have_submit_bio_2args], [
1592 #include <linux/bio.h>
1595 submit_bio(READ, &bio);
1598 AC_DEFUN([LC_HAVE_SUBMIT_BIO_2ARGS], [
1599 LB2_MSG_LINUX_TEST_RESULT([if submit_bio takes two arguments],
1600 [have_submit_bio_2args], [
1601 AC_DEFINE(HAVE_SUBMIT_BIO_2ARGS, 1,
1602 [submit_bio takes two arguments])
1604 ]) # LC_HAVE_SUBMIT_BIO_2_ARGS
1607 # LC_HAVE_CLEAN_BDEV_ALIASES
1609 # 4.4/4.9 unmap_underlying_metadata was replaced by clean_bdev_aliases
1610 # (SLES12/kernel commit 29f3ad7d8380364c)
1612 AC_DEFUN([LC_SRC_HAVE_CLEAN_BDEV_ALIASES], [
1613 LB2_LINUX_TEST_SRC([have_clean_bdev_aliases], [
1614 #include <linux/buffer_head.h>
1616 clean_bdev_aliases(NULL,1,1);
1619 AC_DEFUN([LC_HAVE_CLEAN_BDEV_ALIASES], [
1620 LB2_MSG_LINUX_TEST_RESULT([if kernel has clean_bdev_aliases],
1621 [have_clean_bdev_aliases], [
1622 AC_DEFINE(HAVE_CLEAN_BDEV_ALIASES, 1,
1623 [kernel has clean_bdev_aliases])
1625 ]) # LC_HAVE_CLEAN_BDEV_ALIASES
1628 # LC_HAVE_LOCKS_LOCK_FILE_WAIT
1630 # 4.4 kernel have moved locks API users to
1631 # locks_lock_inode_wait()
1633 AC_DEFUN([LC_SRC_HAVE_LOCKS_LOCK_FILE_WAIT], [
1634 LB2_LINUX_TEST_SRC([locks_lock_file_wait], [
1635 #include <linux/fs.h>
1637 locks_lock_file_wait(NULL, NULL);
1640 AC_DEFUN([LC_HAVE_LOCKS_LOCK_FILE_WAIT], [
1641 LB2_MSG_LINUX_TEST_RESULT([if 'locks_lock_file_wait' exists],
1642 [locks_lock_file_wait], [
1643 AC_DEFINE(HAVE_LOCKS_LOCK_FILE_WAIT, 1,
1644 [kernel has locks_lock_file_wait])
1646 ]) # LC_HAVE_LOCKS_LOCK_FILE_WAIT
1649 # LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
1651 # 4.4 kernel merged type-specific data with the payload data for keys
1653 AC_DEFUN([LC_SRC_HAVE_KEY_PAYLOAD_DATA_ARRAY], [
1654 LB2_LINUX_TEST_SRC([key_payload_data_array], [
1655 #include <linux/key.h>
1657 struct key key = { };
1659 key.payload.data[0] = NULL;
1662 AC_DEFUN([LC_HAVE_KEY_PAYLOAD_DATA_ARRAY], [
1663 LB2_MSG_LINUX_TEST_RESULT([if 'struct key' has 'payload.data' as an array],
1664 [key_payload_data_array], [
1665 AC_DEFINE(HAVE_KEY_PAYLOAD_DATA_ARRAY, 1, [payload.data is an array])
1667 ]) # LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
1670 # LC_HAVE_XATTR_HANDLER_NAME
1672 # Kernel version 4.4 commit 98e9cb5711c68223f0e4d5201b9a6add255ec550
1673 # add a name member to struct xattr_handler
1675 AC_DEFUN([LC_SRC_HAVE_XATTR_HANDLER_NAME], [
1676 LB2_LINUX_TEST_SRC([xattr_handler_name], [
1677 #include <linux/xattr.h>
1679 ((struct xattr_handler *)NULL)->name = NULL;
1682 AC_DEFUN([LC_HAVE_XATTR_HANDLER_NAME], [
1683 LB2_MSG_LINUX_TEST_RESULT([if 'struct xattr_handler' has a name member],
1684 [xattr_handler_name], [
1685 AC_DEFINE(HAVE_XATTR_HANDLER_NAME, 1,
1686 [xattr_handler has a name member])
1688 ]) # LC_HAVE_XATTR_HANDLER_NAME
1691 # LC_HAVE_FILE_DENTRY
1693 # 4.5 adds wrapper file_dentry
1695 AC_DEFUN([LC_SRC_HAVE_FILE_DENTRY], [
1696 LB2_LINUX_TEST_SRC([file_dentry], [
1697 #include <linux/fs.h>
1702 AC_DEFUN([LC_HAVE_FILE_DENTRY], [
1703 LB2_MSG_LINUX_TEST_RESULT([if Linux kernel has 'file_dentry'],
1705 AC_DEFINE(HAVE_FILE_DENTRY, 1, [kernel has file_dentry])
1707 ]) # LC_HAVE_FILE_DENTRY
1710 # LC_HAVE_INODE_LOCK
1712 # 4.5 introduced inode_lock
1714 AC_DEFUN([LC_SRC_HAVE_INODE_LOCK], [
1715 LB2_LINUX_TEST_SRC([inode_lock], [
1716 #include <linux/fs.h>
1721 AC_DEFUN([LC_HAVE_INODE_LOCK], [
1722 LB2_MSG_LINUX_TEST_RESULT([if 'inode_lock' is defined],
1724 AC_DEFINE(HAVE_INODE_LOCK, 1, [inode_lock is defined])
1726 ]) # LC_HAVE_INODE_LOCK
1729 # LC_HAVE_IOP_GET_LINK
1731 # 4.5 vfs replaced iop->follow_link with
1734 AC_DEFUN([LC_SRC_HAVE_IOP_GET_LINK], [
1735 LB2_LINUX_TEST_SRC([inode_ops_get_link], [
1736 #include <linux/fs.h>
1738 struct inode_operations iop;
1739 iop.get_link = NULL;
1742 AC_DEFUN([LC_HAVE_IOP_GET_LINK], [
1743 LB2_MSG_LINUX_TEST_RESULT([if 'iop' has 'get_link'],
1744 [inode_ops_get_link], [
1745 AC_DEFINE(HAVE_IOP_GET_LINK, 1, [have iop get_link])
1747 ]) # LC_HAVE_IOP_GET_LINK
1750 # LC_HAVE_IN_COMPAT_SYSCALL
1752 # 4.6 renamed is_compat_task to in_compat_syscall
1754 AC_DEFUN([LC_SRC_HAVE_IN_COMPAT_SYSCALL], [
1755 LB2_LINUX_TEST_SRC([in_compat_syscall], [
1756 #include <linux/compat.h>
1758 in_compat_syscall();
1761 AC_DEFUN([LC_HAVE_IN_COMPAT_SYSCALL], [
1762 LB2_MSG_LINUX_TEST_RESULT([if 'in_compat_syscall' is defined],
1763 [in_compat_syscall], [
1764 AC_DEFINE(HAVE_IN_COMPAT_SYSCALL, 1, [have in_compat_syscall])
1766 ]) # LC_HAVE_IN_COMPAT_SYSCALL
1769 # LC_HAVE_XATTR_HANDLER_INODE_PARAM
1771 # Kernel version 4.6 commit b296821a7c42fa58baa17513b2b7b30ae66f3336
1772 # and commit 5930122683dff58f0846b0f0405b4bd598a3ba6a added inode parameter
1773 # to xattr_handler functions
1775 AC_DEFUN([LC_SRC_HAVE_XATTR_HANDLER_INODE_PARAM], [
1776 LB2_LINUX_TEST_SRC([xattr_handler_inode_param], [
1777 #include <linux/xattr.h>
1779 const struct xattr_handler handler;
1781 ((struct xattr_handler *)0)->get(&handler, NULL, NULL, NULL, NULL, 0);
1782 ((struct xattr_handler *)0)->set(&handler, NULL, NULL, NULL, NULL, 0, 0);
1785 AC_DEFUN([LC_HAVE_XATTR_HANDLER_INODE_PARAM], [
1786 LB2_MSG_LINUX_TEST_RESULT([if 'struct xattr_handler' functions have inode parameter],
1787 [xattr_handler_inode_param], [
1788 AC_DEFINE(HAVE_XATTR_HANDLER_INODE_PARAM, 1, [needs inode parameter])
1790 ]) # LC_HAVE_XATTR_HANDLER_INODE_PARAM
1795 # Kernel version 4.6 commit 85c7f81041d57cfe9dc97f4680d5586b54534a39
1796 # introduced parallel lookups in the VFS layer. The inline function
1797 # d_in_lookup was added to notify when the same item was being queried
1800 AC_DEFUN([LC_SRC_D_IN_LOOKUP], [
1801 LB2_LINUX_TEST_SRC([d_in_lookup], [
1802 #include <linux/dcache.h>
1807 AC_DEFUN([LC_D_IN_LOOKUP], [
1808 LB2_MSG_LINUX_TEST_RESULT([if 'd_in_lookup' is defined],
1810 AC_DEFINE(HAVE_D_IN_LOOKUP, 1, [d_in_lookup is defined])
1815 # LC_LOCK_PAGE_MEMCG
1817 # Kernel version 4.6 adds lock_page_memcg(page)
1818 # Linux commit v5.15-12273-gab2f9d2d3626
1819 # mm: unexport {,un}lock_page_memcg
1821 AC_DEFUN([LC_SRC_LOCK_PAGE_MEMCG], [
1822 LB2_LINUX_TEST_SRC([lock_page_memcg], [
1823 #include <linux/memcontrol.h>
1825 lock_page_memcg(NULL);
1828 AC_DEFUN([LC_LOCK_PAGE_MEMCG], [
1829 LB2_MSG_LINUX_TEST_RESULT([if 'lock_page_memcg' is defined],
1830 [lock_page_memcg], [
1831 AC_DEFINE(HAVE_LOCK_PAGE_MEMCG, 1, [lock_page_memcg is defined])
1833 ]) # LC_LOCK_PAGE_MEMCG
1836 # LC_HAVE_DOWN_WRITE_KILLABLE
1838 # Kernel version v4.6-rc3-28-g916633a40370
1840 AC_DEFUN([LC_SRC_HAVE_DOWN_WRITE_KILLABLE], [
1841 LB2_LINUX_TEST_SRC([down_write_killable], [
1842 #include <linux/rwsem.h>
1844 struct rw_semaphore sem;
1848 rc = down_write_killable(&sem);
1852 AC_DEFUN([LC_HAVE_DOWN_WRITE_KILLABLE], [
1853 LB2_MSG_LINUX_TEST_RESULT([if down_write_killable exists],
1854 [down_write_killable], [
1855 AC_DEFINE(HAVE_DOWN_WRITE_KILLABLE, 1,
1856 [down_write_killable function exists])
1858 ]) # LC_HAVE_DOWN_WRITE_KILLABLE
1863 # Kernel version 4.7-rc5 commit 285b102d3b745f3c2c110c9c327741d87e64aacc
1864 # add new d_init to initialize dentry at allocation time
1866 AC_DEFUN([LC_SRC_D_INIT], [
1867 LB2_LINUX_TEST_SRC([d_init], [
1868 #include <linux/dcache.h>
1870 struct dentry_operations ops = { };
1873 rc = ops.d_init(NULL);
1876 AC_DEFUN([LC_D_INIT], [
1877 LB2_MSG_LINUX_TEST_RESULT([if dentry operations supports 'd_init'],
1879 AC_DEFINE(HAVE_D_INIT, 1, ['d_init' exists])
1886 # Kernel version 4.7 commit c8b8e32d700fe943a935e435ae251364d016c497
1887 # direct-io: eliminate the offset argument to ->direct_IO
1889 AC_DEFUN([LC_SRC_DIRECTIO_2ARGS], [
1890 LB2_LINUX_TEST_SRC([direct_io_2args], [
1891 #include <linux/fs.h>
1893 struct address_space_operations ops = { };
1894 struct iov_iter *iter = NULL;
1895 struct kiocb *iocb = NULL;
1898 rc = ops.direct_IO(iocb, iter);
1901 AC_DEFUN([LC_DIRECTIO_2ARGS], [
1902 LB2_MSG_LINUX_TEST_RESULT([if '->direct_IO()' takes 2 arguments],
1903 [direct_io_2args], [
1904 AC_DEFINE(HAVE_DIRECTIO_2ARGS, 1, [direct_IO has 2 arguments])
1906 ]) # LC_DIRECTIO_2ARGS
1909 # LC_GENERIC_WRITE_SYNC_2ARGS
1911 # Kernel version 4.7 commit dde0c2e79848298cc25621ad080d47f94dbd7cce
1912 # fs: add IOCB_SYNC and IOCB_DSYNC
1914 AC_DEFUN([LC_SRC_GENERIC_WRITE_SYNC_2ARGS], [
1915 LB2_LINUX_TEST_SRC([generic_write_sync_2args], [
1916 #include <linux/fs.h>
1918 struct kiocb *iocb = NULL;
1921 rc = generic_write_sync(iocb, 0);
1924 AC_DEFUN([LC_GENERIC_WRITE_SYNC_2ARGS], [
1925 LB2_MSG_LINUX_TEST_RESULT([if 'generic_write_sync()' takes 2 arguments],
1926 [generic_write_sync_2args], [
1927 AC_DEFINE(HAVE_GENERIC_WRITE_SYNC_2ARGS, 1,
1928 [generic_write_sync has 2 arguments])
1930 ]) # LC_GENERIC_WRITE_SYNC_2ARGS
1933 # LC_FOP_ITERATE_SHARED
1935 # Kernel v4.6-rc3-29-g6192269 adds iterate_shared method to file_operations
1937 AC_DEFUN([LC_SRC_FOP_ITERATE_SHARED], [
1938 LB2_LINUX_TEST_SRC([fop_iterate_shared], [
1939 #include <linux/fs.h>
1941 struct file_operations fop;
1942 fop.iterate_shared = NULL;
1945 AC_DEFUN([LC_FOP_ITERATE_SHARED], [
1946 LB2_MSG_LINUX_TEST_RESULT([if 'file_operations' has 'iterate_shared'],
1947 [fop_iterate_shared], [
1948 AC_DEFINE(HAVE_FOP_ITERATE_SHARED, 1,
1949 [file_operations has iterate_shared])
1951 ]) # LC_FOP_ITERATE_SHARED
1954 # LC_EXPORT_DEFAULT_FILE_SPLICE_READ
1956 # 4.8-rc8 commit 82c156f853840645604acd7c2cebcb75ed1b6652 switched
1957 # generic_file_splice_read() to using ->read_iter. We can test this
1958 # change since default_file_splice_read() is no longer exported.
1960 AC_DEFUN([LC_EXPORT_DEFAULT_FILE_SPLICE_READ], [
1961 LB_CHECK_EXPORT([default_file_splice_read], [fs/splice.c],
1962 [AC_DEFINE(HAVE_DEFAULT_FILE_SPLICE_READ_EXPORT, 1,
1963 [default_file_splice_read is exported])])
1964 ]) # LC_EXPORT_DEFAULT_FILE_SPLCE_READ
1967 # LC_HAVE_POSIX_ACL_VALID_USER_NS
1969 # 4.8 posix_acl_valid takes struct user_namespace
1971 AC_DEFUN([LC_SRC_HAVE_POSIX_ACL_VALID_USER_NS], [
1972 LB2_LINUX_TEST_SRC([posix_acl_valid], [
1973 #include <linux/fs.h>
1974 #include <linux/posix_acl.h>
1976 posix_acl_valid((struct user_namespace*)NULL, (const struct posix_acl*)NULL);
1979 AC_DEFUN([LC_HAVE_POSIX_ACL_VALID_USER_NS], [
1980 LB2_MSG_LINUX_TEST_RESULT([if 'posix_acl_valid' takes 'struct user_namespace'],
1981 [posix_acl_valid], [
1982 AC_DEFINE(HAVE_POSIX_ACL_VALID_USER_NS, 1,
1983 [posix_acl_valid takes struct user_namespace])
1985 ]) # LC_HAVE_POSIX_ACL_VALID_USER_NS
1988 # LC_D_COMPARE_4ARGS
1990 # Kernel version 4.8 commit 6fa67e707559303e086303aeecc9e8b91ef497d5
1991 # get rid of 'parent' argument of ->d_compare()
1993 AC_DEFUN([LC_SRC_D_COMPARE_4ARGS], [
1994 LB2_LINUX_TEST_SRC([d_compare_4args], [
1995 #include <linux/dcache.h>
1997 ((struct dentry_operations*)0)->d_compare(NULL,0,NULL,NULL);
2000 AC_DEFUN([LC_D_COMPARE_4ARGS], [
2001 LB2_MSG_LINUX_TEST_RESULT([if 'd_compare' taken 4 arguments],
2002 [d_compare_4args], [
2003 AC_DEFINE(HAVE_D_COMPARE_4ARGS, 1,
2004 [d_compare need 4 arguments])
2006 ]) # LC_D_COMPARE_4ARGS
2009 # LC_FULL_NAME_HASH_3ARGS
2011 # Kernel version 4.8 commit 8387ff2577eb9ed245df9a39947f66976c6bcd02
2012 # vfs: make the string hashes salt the hash
2014 AC_DEFUN([LC_SRC_FULL_NAME_HASH_3ARGS], [
2015 LB2_LINUX_TEST_SRC([full_name_hash_3args], [
2016 #include <linux/stringhash.h>
2019 hash = full_name_hash(NULL,NULL,0);
2022 AC_DEFUN([LC_FULL_NAME_HASH_3ARGS], [
2023 LB2_MSG_LINUX_TEST_RESULT([if 'full_name_hash' taken 3 arguments],
2024 [full_name_hash_3args], [
2025 AC_DEFINE(HAVE_FULL_NAME_HASH_3ARGS, 1,
2026 [full_name_hash need 3 arguments])
2028 ]) # LC_FULL_NAME_HASH_3ARGS
2031 # LC_STRUCT_POSIX_ACL_XATTR
2033 # Kernel version 4.8 commit 2211d5ba5c6c4e972ba6dbc912b2897425ea6621
2034 # posix_acl: xattr representation cleanups
2036 AC_DEFUN([LC_SRC_STRUCT_POSIX_ACL_XATTR], [
2037 LB2_LINUX_TEST_SRC([struct_posix_acl_xattr], [
2038 #include <linux/fs.h>
2039 #include <linux/posix_acl_xattr.h>
2041 struct posix_acl_xattr_header *h = NULL;
2042 struct posix_acl_xattr_entry *e;
2043 e = (void *)(h + 1);
2046 AC_DEFUN([LC_STRUCT_POSIX_ACL_XATTR], [
2047 LB2_MSG_LINUX_TEST_RESULT([if 'struct posix_acl_xattr_{header,entry}' defined],
2048 [struct_posix_acl_xattr], [
2049 AC_DEFINE(HAVE_STRUCT_POSIX_ACL_XATTR, 1,
2050 [struct posix_acl_xattr_{header,entry} defined])
2052 ]) # LC_STRUCT_POSIX_ACL_XATTR
2057 # Kernel version 4.8 commit fd50ecaddf8372a1d96e0daeaac0f93cf04e4d42
2058 # removed {get,set,remove}xattr inode operations
2060 AC_DEFUN([LC_SRC_IOP_XATTR], [
2061 LB2_LINUX_TEST_SRC([inode_ops_xattr], [
2062 #include <linux/fs.h>
2064 struct inode_operations iop;
2065 iop.setxattr = NULL;
2066 iop.getxattr = NULL;
2067 iop.removexattr = NULL;
2070 AC_DEFUN([LC_IOP_XATTR], [
2071 LB2_MSG_LINUX_TEST_RESULT([if 'inode_operations' has {get,set,remove}xattr members],
2072 [inode_ops_xattr], [
2073 AC_DEFINE(HAVE_IOP_XATTR, 1,
2074 [inode_operations has {get,set,remove}xattr members])
2081 # Kernel version 4.9 commit 81243eacfa400f5f7b89f4c2323d0de9982bb0fb
2082 # cred: simpler, 1D supplementary groups
2084 AC_DEFUN([LC_SRC_GROUP_INFO_GID], [
2085 LB2_LINUX_TEST_SRC([group_info_gid], [
2086 #include <linux/cred.h>
2089 p = ((struct group_info *)0)->gid;
2092 AC_DEFUN([LC_GROUP_INFO_GID], [
2093 LB2_MSG_LINUX_TEST_RESULT([if 'struct group_info' has member 'gid'],
2095 AC_DEFINE(HAVE_GROUP_INFO_GID, 1,
2096 [struct group_info has member gid])
2098 ]) # LC_GROUP_INFO_GID
2103 # Kernel version 4.9 commit 5d6c31910bc0713e37628dc0ce677dcb13c8ccf4
2104 # added __vfs_{get,set,remove}xattr helpers
2106 AC_DEFUN([LC_SRC_VFS_SETXATTR], [
2107 LB2_LINUX_TEST_SRC([vfs_setxattr], [
2108 #include <linux/xattr.h>
2110 __vfs_setxattr(NULL, NULL, NULL, NULL, 0, 0);
2113 AC_DEFUN([LC_VFS_SETXATTR], [
2114 LB2_MSG_LINUX_TEST_RESULT([if '__vfs_setxattr' helper is available],
2116 AC_DEFINE(HAVE_VFS_SETXATTR, 1, ['__vfs_setxattr' is available])
2118 ]) # LC_VFS_SETXATTR
2121 # LC_POSIX_ACL_UPDATE_MODE
2123 # Kernel version 4.9 commit 073931017b49d9458aa351605b43a7e34598caef
2124 # posix_acl: Clear SGID bit when setting file permissions
2126 AC_DEFUN([LC_SRC_POSIX_ACL_UPDATE_MODE], [
2127 LB2_LINUX_TEST_SRC([posix_acl_update_mode], [
2128 #include <linux/fs.h>
2129 #include <linux/posix_acl.h>
2131 posix_acl_update_mode(NULL, NULL, NULL);
2134 AC_DEFUN([LC_POSIX_ACL_UPDATE_MODE], [
2135 LB2_MSG_LINUX_TEST_RESULT([if 'posix_acl_update_mode' exists],
2136 [posix_acl_update_mode], [
2137 AC_DEFINE(HAVE_POSIX_ACL_UPDATE_MODE, 1,
2138 ['posix_acl_update_mode' is available])
2140 ]) # LC_POSIX_ACL_UPDATE_MODE
2143 # LC_HAVE_BDI_IO_PAGES
2145 # Kernel version 4.9 commit 9491ae4aade6814afcfa67f4eb3e3342c2b39750
2146 # mm: don't cap request size based on read-ahead setting
2147 # This patch introduces a bdi hint, io_pages.
2149 AC_DEFUN([LC_SRC_HAVE_BDI_IO_PAGES], [
2150 LB2_LINUX_TEST_SRC([bdi_has_io_pages], [
2151 #include <linux/backing-dev.h>
2153 struct backing_dev_info info;
2158 AC_DEFUN([LC_HAVE_BDI_IO_PAGES], [
2159 LB2_MSG_LINUX_TEST_RESULT([if 'struct backing_dev_info' has 'io_pages' field],
2160 [bdi_has_io_pages], [
2161 AC_DEFINE(HAVE_BDI_IO_PAGES, 1,
2162 [backing_dev_info has io_pages])
2164 ]) # LC_HAVE_BDI_IO_PAGES
2167 # LC_IOP_GENERIC_READLINK
2169 # Kernel version 4.10 commit dfeef68862edd7d4bafe68ef7aeb5f658ef24bb5
2170 # removed generic_readlink from individual file systems
2172 AC_DEFUN([LC_SRC_IOP_GENERIC_READLINK], [
2173 LB2_LINUX_TEST_SRC([inode_ops_readlink], [
2174 #include <linux/fs.h>
2176 struct inode_operations iop;
2177 iop.readlink = generic_readlink;
2180 AC_DEFUN([LC_IOP_GENERIC_READLINK], [
2181 LB2_MSG_LINUX_TEST_RESULT([if 'generic_readlink' still exist],
2182 [inode_ops_readlink], [
2183 AC_DEFINE(HAVE_IOP_GENERIC_READLINK, 1,
2184 [generic_readlink has been removed])
2186 ]) # LC_IOP_GENERIC_READLINK
2189 # LC_HAVE_VM_FAULT_ADDRESS
2191 # Kernel version 4.10 commit 1a29d85eb0f19b7d8271923d8917d7b4f5540b3e
2192 # removed virtual_address field. Need to use address field instead
2194 AC_DEFUN([LC_SRC_HAVE_VM_FAULT_ADDRESS], [
2195 LB2_LINUX_TEST_SRC([vm_fault_address], [
2196 #include <linux/mm.h>
2198 struct vm_fault vmf = { 0 };
2199 unsigned long addr = (unsigned long)vmf.address;
2203 AC_DEFUN([LC_HAVE_VM_FAULT_ADDRESS], [
2204 LB2_MSG_LINUX_TEST_RESULT([if 'struct vm_fault' replaced virtual_address with address field],
2205 [vm_fault_address], [
2206 AC_DEFINE(HAVE_VM_FAULT_ADDRESS, 1,
2207 [virtual_address has been replaced by address field])
2209 ]) # LC_HAVE_VM_FAULT_ADDRESS
2212 # LC_INODEOPS_ENHANCED_GETATTR
2214 # Kernel version 4.11 commit a528d35e8bfcc521d7cb70aaf03e1bd296c8493f
2215 # expanded getattr to be able to get more stat information.
2217 AC_DEFUN([LC_SRC_INODEOPS_ENHANCED_GETATTR], [
2218 LB2_LINUX_TEST_SRC([getattr_path], [
2219 #include <linux/fs.h>
2223 ((struct inode_operations *)1)->getattr(&path, NULL, 0, 0);
2226 AC_DEFUN([LC_INODEOPS_ENHANCED_GETATTR], [
2227 LB2_MSG_LINUX_TEST_RESULT([if 'inode_operations' getattr member can gather advance stats],
2229 AC_DEFINE(HAVE_INODEOPS_ENHANCED_GETATTR, 1,
2230 [inode_operations .getattr member function can gather advance stats])
2232 ]) # LC_INODEOPS_ENHANCED_GETATTR
2235 # LC_VM_OPERATIONS_REMOVE_VMF_ARG
2237 # Kernel version 4.11 commit 11bac80004499ea59f361ef2a5516c84b6eab675
2238 # removed struct vm_area_struct as an argument for vm_operations since
2239 # in the same kernel version struct vma_area_struct was folded into
2242 AC_DEFUN([LC_SRC_VM_OPERATIONS_REMOVE_VMF_ARG], [
2243 LB2_LINUX_TEST_SRC([vm_operations_no_vm_area_struct], [
2244 #include <linux/mm.h>
2246 struct vm_fault vmf;
2248 ((struct vm_operations_struct *)0)->fault(&vmf);
2249 ((struct vm_operations_struct *)0)->page_mkwrite(&vmf);
2252 AC_DEFUN([LC_VM_OPERATIONS_REMOVE_VMF_ARG], [
2253 LB2_MSG_LINUX_TEST_RESULT([if 'struct vm_operations' removed struct vm_area_struct],
2254 [vm_operations_no_vm_area_struct], [
2255 AC_DEFINE(HAVE_VM_OPS_USE_VM_FAULT_ONLY, 1,
2256 ['struct vm_operations' remove struct vm_area_struct argument])
2258 ]) # LC_VM_OPERATIONS_REMOVE_VMF_ARG
2261 # LC_HAVE_KEY_USAGE_REFCOUNT
2263 # Kernel version 4.11 commit fff292914d3a2f1efd05ca71c2ba72a3c663201e
2264 # converted key.usage from atomic_t to refcount_t.
2266 AC_DEFUN([LC_SRC_HAVE_KEY_USAGE_REFCOUNT], [
2267 LB2_LINUX_TEST_SRC([key_usage_refcount], [
2268 #include <linux/key.h>
2270 struct key key = { };
2272 refcount_read(&key.usage);
2275 AC_DEFUN([LC_HAVE_KEY_USAGE_REFCOUNT], [
2276 LB2_MSG_LINUX_TEST_RESULT([if 'key.usage' is refcount_t],
2277 [key_usage_refcount], [
2278 AC_DEFINE(HAVE_KEY_USAGE_REFCOUNT, 1,
2279 [key.usage is of type refcount_t])
2281 ]) #LC_HAVE_KEY_USAGE_REFCOUNT
2284 # LC_HAVE_CRYPTO_MAX_ALG_NAME_128
2286 # Kernel version 4.11 commit f437a3f477cce402dbec6537b29e9e33962c9f73
2287 # switched CRYPTO_MAX_ALG_NAME from 64 to 128.
2289 AC_DEFUN([LC_SRC_HAVE_CRYPTO_MAX_ALG_NAME_128], [
2290 LB2_LINUX_TEST_SRC([crypto_max_alg_name], [
2291 #include <linux/crypto.h>
2293 #if CRYPTO_MAX_ALG_NAME != 128
2298 AC_DEFUN([LC_HAVE_CRYPTO_MAX_ALG_NAME_128], [
2299 LB2_MSG_LINUX_TEST_RESULT([if 'CRYPTO_MAX_ALG_NAME' is 128],
2300 [crypto_max_alg_name], [
2301 AC_DEFINE(HAVE_CRYPTO_MAX_ALG_NAME_128, 1,
2302 ['CRYPTO_MAX_ALG_NAME' is 128])
2304 ]) # LC_HAVE_CRYPTO_MAX_ALG_NAME_128
2307 # LC_HAVE_FSMAP_HEADER
2309 # Kernel version 4.11-rc4 commit 80c9f490f344be7999f57fc31a8ed956f8c65f3b
2310 # vfs: add common GETFSMAP ioctl definitions
2312 AC_DEFUN([LC_SRC_HAVE_FSMAP_HEADER], [
2313 LB2_CHECK_LINUX_HEADER_SRC([linux/fsmap.h], [-Werror])
2315 AC_DEFUN([LC_HAVE_FSMAP_HEADER], [
2316 LB2_CHECK_LINUX_HEADER_RESULT([linux/fsmap.h], [
2317 AC_DEFINE(HAVE_FSMAP_H, 1,
2318 [fsmap.h is present])
2320 ]) # LC_HAVE_FSMAP_HEADER
2323 # Kernel version 4.12 commit 47f38c539e9a42344ff5a664942075bd4df93876
2324 # CURRENT_TIME is not 64 bit time safe so it was replaced with
2327 AC_DEFUN([LC_SRC_CURRENT_TIME], [
2328 LB2_LINUX_TEST_SRC([current_time], [
2329 #include <linux/fs.h>
2333 attr.ia_atime = current_time(NULL);
2336 AC_DEFUN([LC_CURRENT_TIME], [
2337 LB2_MSG_LINUX_TEST_RESULT([if CURRENT_TIME has been replaced with current_time],
2339 AC_DEFINE(HAVE_CURRENT_TIME, 1,
2340 [current_time() has replaced CURRENT_TIME])
2342 ]) # LC_CURRENT_TIME
2345 # LC_HAVE_GET_INODE_USAGE
2347 # Kernel version v4.12-rc2-43-g7a9ca53aea10
2349 AC_DEFUN([LC_SRC_HAVE_GET_INODE_USAGE], [
2350 LB2_LINUX_TEST_SRC([get_inode_usage], [
2352 #include <linux/quota.h>
2354 struct dquot_operations ops = { };
2356 ops.get_inode_usage(NULL, NULL);
2359 AC_DEFUN([LC_HAVE_GET_INODE_USAGE], [
2360 LB2_MSG_LINUX_TEST_RESULT([if get_inode_usage exists],
2361 [get_inode_usage], [
2362 AC_DEFINE(HAVE_GET_INODE_USAGE, 1,
2363 [get_inode_usage function exists])
2365 ]) # LC_HAVE_GET_INODE_USAGE
2368 # LC_SUPER_SETUP_BDI_NAME
2370 # Kernel version 4.12 commit 9594caf216dc0fe3e318b34af0127276db661241
2371 # unified bdi handling
2373 AC_DEFUN([LC_SRC_SUPER_SETUP_BDI_NAME], [
2374 LB2_LINUX_TEST_SRC([super_setup_bdi_name], [
2375 #include <linux/fs.h>
2377 super_setup_bdi_name(NULL, "lustre");
2380 AC_DEFUN([LC_SUPER_SETUP_BDI_NAME], [
2381 LB2_MSG_LINUX_TEST_RESULT([if 'super_setup_bdi_name' exist],
2382 [super_setup_bdi_name], [
2383 AC_DEFINE(HAVE_SUPER_SETUP_BDI_NAME, 1,
2384 ['super_setup_bdi_name' is available])
2386 ]) # LC_SUPER_SETUP_BDI_NAME
2391 # 4.12 replace bi_error to bi_status
2393 AC_DEFUN([LC_SRC_BI_STATUS], [
2394 LB2_LINUX_TEST_SRC([bi_status], [
2395 #include <linux/blk_types.h>
2397 ((struct bio *)0)->bi_status = 0;
2400 AC_DEFUN([LC_BI_STATUS], [
2401 LB2_MSG_LINUX_TEST_RESULT([if 'bi_status' exist],
2403 AC_DEFINE(HAVE_BI_STATUS, 1, ['bi_status' is available])
2408 # LC_PAGEVEC_INIT_ONE_PARAM
2410 # 4.14 pagevec_init takes one parameter
2412 AC_DEFUN([LC_SRC_PAGEVEC_INIT_ONE_PARAM], [
2413 LB2_LINUX_TEST_SRC([pagevec_init], [
2414 #include <linux/pagevec.h>
2419 AC_DEFUN([LC_PAGEVEC_INIT_ONE_PARAM], [
2420 LB2_MSG_LINUX_TEST_RESULT([if 'pagevec_init' takes one parameter],
2422 AC_DEFINE(HAVE_PAGEVEC_INIT_ONE_PARAM, 1,
2423 ['pagevec_init' takes one parameter])
2425 ]) # LC_PAGEVEC_INIT_ONE_PARAM
2430 # 4.14 replaced bi_bdev to bi_disk
2432 AC_DEFUN([LC_SRC_BI_BDEV], [
2433 LB2_LINUX_TEST_SRC([bi_bdev], [
2434 #include <linux/bio.h>
2436 ((struct bio *)0)->bi_bdev = NULL;
2439 AC_DEFUN([LC_BI_BDEV], [
2440 LB2_MSG_LINUX_TEST_RESULT([if 'bi_bdev' exist],
2442 AC_DEFINE(HAVE_BI_BDEV, 1, ['bi_bdev' is available])
2447 # LC_INTERVAL_TREE_CACHED
2449 # 4.14 f808c13fd3738948e10196496959871130612b61
2450 # switched INTERVAL_TREE_DEFINE to use cached RB_Trees.
2452 AC_DEFUN([LC_SRC_INTERVAL_TREE_CACHED], [
2453 LB2_LINUX_TEST_SRC([itree_cached], [
2454 #include <linux/interval_tree_generic.h>
2455 struct foo { struct rb_node rb; int last; int a,b;};
2456 #define START(n) ((n)->a)
2457 #define LAST(n) ((n)->b)
2458 struct rb_root_cached tree;
2459 INTERVAL_TREE_DEFINE(struct foo, rb, int, last,
2460 START, LAST, , foo);
2462 foo_insert(NULL, &tree);
2465 AC_DEFUN([LC_INTERVAL_TREE_CACHED], [
2466 LB2_MSG_LINUX_TEST_RESULT([if interval_trees use rb_tree_cached],
2468 AC_DEFINE(HAVE_INTERVAL_TREE_CACHED, 1,
2469 [interval trees use rb_tree_cached])
2471 ]) # LC_INTERVAL_TREE_CACHED
2476 # 4.14 introduced IS_ENCRYPTED and S_ENCRYPTED
2478 AC_DEFUN([LC_IS_ENCRYPTED], [
2479 LB_CHECK_COMPILE([if IS_ENCRYPTED is defined],
2481 #include <linux/fs.h>
2483 (void)IS_ENCRYPTED((struct inode *)1);
2485 has_is_encrypted="yes"
2487 ]) # LC_IS_ENCRYPTED used by LC_CONFIG_CRYPTO
2492 # kernel 4.17 commit b93b016313b3ba8003c3b8bb71f569af91f19fc7
2494 AC_DEFUN([LC_SRC_I_PAGES], [
2495 LB2_LINUX_TEST_SRC([i_pages], [
2496 #include <linux/fs.h>
2498 struct address_space mapping = {};
2501 i_pages = &mapping.i_pages;
2504 AC_DEFUN([LC_I_PAGES], [
2505 LB2_MSG_LINUX_TEST_RESULT([if struct address_space has i_pages],
2507 AC_DEFINE(HAVE_I_PAGES, 1, [struct address_space has i_pages])
2514 # kernel 4.17 commit 3d3539018d2cbd12e5af4a132636ee7fd8d43ef0
2515 # mm: create the new vm_fault_t type
2517 AC_DEFUN([LC_SRC_VM_FAULT_T], [
2518 LB2_LINUX_TEST_SRC([vm_fault_t], [
2519 #include <linux/mm_types.h>
2521 vm_fault_t x = VM_FAULT_SIGBUS;
2525 AC_DEFUN([LC_VM_FAULT_T], [
2526 LB2_MSG_LINUX_TEST_RESULT([if vm_fault_t type exists],
2528 AC_DEFINE(HAVE_VM_FAULT_T, 1, [if vm_fault_t type exists])
2535 # kernel 4.17 commit 3d3539018d2cbd12e5af4a132636ee7fd8d43ef0
2536 # mm: VM_FAULT_RETRY is defined in enum vm_fault_reason
2538 AC_DEFUN([LC_SRC_VM_FAULT_RETRY], [
2539 LB2_LINUX_TEST_SRC([VM_FAULT_RETRY], [
2540 #include <linux/mm.h>
2542 #ifndef VM_FAULT_RETRY
2548 AC_DEFUN([LC_VM_FAULT_RETRY], [
2549 LB2_MSG_LINUX_TEST_RESULT([if VM_FAULT_RETRY is defined],
2551 AC_DEFINE(HAVE_VM_FAULT_RETRY, 1,
2552 [if VM_FAULT_RETRY is defined])
2554 ]) # LC_VM_FAULT_RETRY
2557 # LC_ALLOC_FILE_PSEUDO
2559 # kernel 4.18-rc1 commit d93aa9d82aea80b80f225dbf9c7986df444d8106
2560 # new wrapper: alloc_file_pseudo()
2562 AC_DEFUN([LC_SRC_ALLOC_FILE_PSEUDO], [
2563 LB2_LINUX_TEST_SRC([alloc_file_pseudo], [
2564 #include <linux/file.h>
2567 file = alloc_file_pseudo(NULL, NULL, "[test]",
2571 AC_DEFUN([LC_ALLOC_FILE_PSEUDO], [
2572 LB2_MSG_LINUX_TEST_RESULT([if 'alloc_file_pseudo' is defined],
2573 [alloc_file_pseudo], [
2574 AC_DEFINE(HAVE_ALLOC_FILE_PSEUDO, 1,
2575 ['alloc_file_pseudo' exist])
2577 ]) # LC_ALLOC_FILE_PSEUDO
2580 # LC_INODE_TIMESPEC64
2582 # kernel 4.17-rc7 commit 8efd6894ff089adeeac7cb9f32125b85d963d1bc
2583 # fs: add timespec64_truncate()
2584 # kernel 4.18 commit 95582b00838837fc07e042979320caf917ce3fe6
2585 # inode timestamps switched to timespec64
2586 # kernel 4.19-rc2 commit 976516404ff3fab2a8caa8bd6f5efc1437fed0b8
2587 # y2038: remove unused time interfaces
2591 # When inode times are timespec64 stop using the deprecated
2594 # kernel v5.5-rc1-6-gba70609d5ec6 ba70609d5ec664a8f36ba1c857fcd97a478adf79
2595 # fs: Delete timespec64_trunc()
2597 AC_DEFUN([LC_SRC_INODE_TIMESPEC64], [
2598 LB2_LINUX_TEST_SRC([inode_timespec64], [
2599 #include <linux/fs.h>
2601 struct inode *inode = NULL;
2602 struct timespec64 ts = {0, 1};
2604 inode->i_atime = ts;
2608 AC_DEFUN([LC_INODE_TIMESPEC64], [
2609 LB2_MSG_LINUX_TEST_RESULT([if inode timestamps are struct timespec64],
2610 [inode_timespec64], [
2611 AC_DEFINE(HAVE_INODE_TIMESPEC64, 1,
2612 [inode times are using timespec64])
2614 ]) # LC_INODE_TIMESPEC64
2617 # LC_RADIX_TREE_TAG_SET
2619 # kernel 4.20 commit v4.19-rc5-248-g9b89a0355144
2620 # xarray: Add XArray marks - replaced radix_tree_tag_set
2622 AC_DEFUN([LC_SRC_RADIX_TREE_TAG_SET], [
2623 LB2_LINUX_TEST_SRC([radix_tree_tag_set], [
2624 #include <linux/fs.h>
2625 #include <linux/radix-tree.h>
2627 radix_tree_tag_set(NULL, 0, PAGECACHE_TAG_DIRTY);
2630 AC_DEFUN([LC_RADIX_TREE_TAG_SET], [
2631 LB2_MSG_LINUX_TEST_RESULT([if 'radix_tree_tag_set' exists],
2632 [radix_tree_tag_set], [
2633 AC_DEFINE(HAVE_RADIX_TREE_TAG_SET, 1,
2634 [radix_tree_tag_set exists])
2636 ]) # LC_RADIX_TREE_TAG_SET
2639 # LC_UAPI_LINUX_MOUNT_H
2641 # kernel 4.20 commit e262e32d6bde0f77fb0c95d977482fc872c51996
2642 # vfs: Suppress MS_* flag defs within the kernel ...
2644 AC_DEFUN([LC_SRC_UAPI_LINUX_MOUNT_H], [
2645 LB2_LINUX_TEST_SRC([uapi_linux_mount], [
2646 #include <uapi/linux/mount.h>
2652 AC_DEFUN([LC_UAPI_LINUX_MOUNT_H], [
2653 LB2_MSG_LINUX_TEST_RESULT([if MS_RDONLY was moved to uapi/linux/mount.h],
2654 [uapi_linux_mount], [
2655 AC_DEFINE(HAVE_UAPI_LINUX_MOUNT_H, 1,
2656 [if MS_RDONLY was moved to uapi/linux/mount.h])
2658 ]) # LC_UAPI_LINUX_MOUNT_H
2661 # LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
2663 # kernel 4.20 commit 1863d77f15da0addcd293a1719fa5d3ef8cde3ca
2664 # SUNRPC: Replace the cache_detail->hash_lock with a regular spinlock
2666 # Now that the reader functions are all RCU protected, use a regular
2667 # spinlock rather than a reader/writer lock.
2669 AC_DEFUN([LC_SRC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK], [
2670 LB2_LINUX_TEST_SRC([hash_lock_isa_spinlock_t], [
2671 #include <linux/sunrpc/cache.h>
2673 spinlock_t *lock = &(((struct cache_detail *)0)->hash_lock);
2677 AC_DEFUN([LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK], [
2678 LB2_MSG_LINUX_TEST_RESULT([if cache_detail->hash_lock is a spinlock],
2679 [hash_lock_isa_spinlock_t], [
2680 AC_DEFINE(HAVE_CACHE_HASH_SPINLOCK, 1,
2681 [if cache_detail->hash_lock is a spinlock])
2683 ]) # LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
2686 # LC_GENL_FAMILY_HAS_RESV_START_OP
2688 # Linux v5.0-11693-g3b0f31f2b8c9
2689 # genetlink: make policy common to family
2691 AC_DEFUN([LC_SRC_GENL_FAMILY_HAS_RESV_START_OP], [
2692 LB2_LINUX_TEST_SRC([genl_family_has_resv_start_op], [
2693 #include <net/genetlink.h>
2695 static const struct genl_family family = {
2696 .resv_start_op = 42,
2701 AC_DEFUN([LC_GENL_FAMILY_HAS_RESV_START_OP], [
2702 LB2_MSG_LINUX_TEST_RESULT([if struct genl_family has resv_start_op member],
2703 [genl_family_has_resv_start_op], [
2704 AC_DEFINE(GENL_FAMILY_HAS_RESV_START_OP, 1,
2705 [struct genl_family has resv_start_op member])
2707 ]) # LC_GENL_FAMILY_HAS_RESV_START_OP
2710 # LC_HAVE_BVEC_ITER_ALL
2712 # kernel 5.1 commit 6dc4f100c175dd0511ae8674786e7c9006cdfbfa
2713 # block: allow bio_for_each_segment_all() to iterate over multi-page bvec
2715 AC_DEFUN([LC_SRC_HAVE_BVEC_ITER_ALL], [
2716 LB2_LINUX_TEST_SRC([struct_bvec_iter_all], [
2717 #include <linux/bvec.h>
2719 struct bvec_iter_all iter;
2723 AC_DEFUN([LC_HAVE_BVEC_ITER_ALL], [
2724 LB2_MSG_LINUX_TEST_RESULT([if bvec_iter_all exists for multi-page bvec iternation],
2725 [struct_bvec_iter_all], [
2726 AC_DEFINE(HAVE_BVEC_ITER_ALL, 1,
2727 [if bvec_iter_all exists for multi-page bvec iternation])
2729 ]) # LC_HAVE_BVEC_ITER_ALL
2732 # LC_ACCOUNT_PAGE_DIRTIED
2734 # After 5.2 kernel page dirtied is not exported
2736 AC_DEFUN([LC_ACCOUNT_PAGE_DIRTIED], [
2737 LB_CHECK_EXPORT([account_page_dirtied], [mm/page-writeback.c],
2738 [AC_DEFINE(HAVE_ACCOUNT_PAGE_DIRTIED_EXPORT, 1,
2739 [account_page_dirtied is exported])])
2740 ]) # LC_ACCOUNT_PAGE_DIRTIED
2743 # LC_KEYRING_SEARCH_4ARGS
2745 # Kernel 5.2 commit dcf49dbc8077
2746 # keys: Add a 'recurse' flag for keyring searches
2748 AC_DEFUN([LC_SRC_KEYRING_SEARCH_4ARGS], [
2749 LB2_LINUX_TEST_SRC([keyring_search_4args], [
2750 #include <linux/key.h>
2753 keyring_search(keyring, NULL, NULL, false);
2756 AC_DEFUN([LC_KEYRING_SEARCH_4ARGS], [
2757 LB2_MSG_LINUX_TEST_RESULT([if 'keyring_search' has 4 args],
2758 [keyring_search_4args], [
2759 AC_DEFINE(HAVE_KEYRING_SEARCH_4ARGS, 1,
2760 [keyring_search has 4 args])
2762 ]) # LC_KEYRING_SEARCH_4ARGS
2765 # LC_BIO_BI_PHYS_SEGMENTS
2767 # kernel 5.3-rc1 commit 14ccb66b3f585b2bc21e7256c96090abed5a512c
2768 # block: remove the bi_phys_segments field in struct bio
2770 AC_DEFUN([LC_SRC_BIO_BI_PHYS_SEGMENTS], [
2771 LB2_LINUX_TEST_SRC([bye_bio_bi_phys_segments], [
2772 #include <linux/bio.h>
2774 struct bio *bio = NULL;
2775 bio->bi_phys_segments++;
2778 AC_DEFUN([LC_BIO_BI_PHYS_SEGMENTS], [
2779 LB2_MSG_LINUX_TEST_RESULT([if struct bio has bi_phys_segments member],
2780 [bye_bio_bi_phys_segments], [
2781 AC_DEFINE(HAVE_BIO_BI_PHYS_SEGMENTS, 1,
2782 [struct bio has bi_phys_segments member])
2784 ]) # LC_BIO_BI_PHYS_SEGMENTS
2787 # LC_HAVE_FLUSH_DELAYED_FPUT
2789 # kernel commit v3.5-rc6-284-g4a9d4b024a31 adds flush_delayed_fput()
2790 # kernel commit v5.3-rc2-13-g7239a40ca8bf exports flush_delayed_fput()
2792 AC_DEFUN([LC_HAVE_FLUSH_DELAYED_FPUT], [
2793 LB_CHECK_EXPORT([flush_delayed_fput], [fs/file_table.c],
2794 [AC_DEFINE(HAVE_FLUSH_DELAYED_FPUT, 1,
2795 [flush_delayed_fput() is exported by the kernel])])
2796 ]) # LC_FLUSH_DELAYED_FPUT
2799 # LC_LM_COMPARE_OWNER_EXISTS
2801 # kernel 5.3-rc3 commit f85d93385e9fe6886a751f647f6812a89bf6bee3
2802 # locks: Cleanup lm_compare_owner and lm_owner_key
2803 # removed lm_compare_owner
2805 AC_DEFUN([LC_SRC_LM_COMPARE_OWNER_EXISTS], [
2806 LB2_LINUX_TEST_SRC([lock_manager_ops_lm_compare_owner], [
2807 #include <linux/fs.h>
2809 struct lock_manager_operations lm_ops;
2810 lm_ops.lm_compare_owner = NULL;
2813 AC_DEFUN([LC_LM_COMPARE_OWNER_EXISTS], [
2814 LB2_MSG_LINUX_TEST_RESULT([if lock_manager_operations has lm_compare_owner],
2815 [lock_manager_ops_lm_compare_owner], [
2816 AC_DEFINE(HAVE_LM_COMPARE_OWNER, 1,
2817 [lock_manager_operations has lm_compare_owner])
2819 ]) # LC_LM_COMPARE_OWNER_EXISTS
2822 # LC_FSCRYPT_SUPPORT
2824 # 5.4 introduced fscrypt encryption policies v2
2826 AC_DEFUN([LC_FSCRYPT_SUPPORT], [
2827 LB_CHECK_COMPILE([for fscrypt in-kernel support],
2829 #define __FS_HAS_ENCRYPTION 0
2830 #include <linux/fscrypt.h>
2832 fscrypt_ioctl_get_policy_ex(NULL, NULL);
2834 has_fscrypt_support="yes"
2836 ]) # LC_FSCRYPT_SUPPORT used by LC_CONFIG_CRYPTO
2839 # LC_FSCRYPT_DIGESTED_NAME
2841 # Kernel 5.5-rc4 edc440e3d27fb31e6f9663cf413fad97d714c060
2842 # improved the format of no-key names. This results in the
2843 # removal of FSCRYPT_FNAME_DIGEST and FSCRYPT_FNAME_DIGEST_SIZE.
2845 AC_DEFUN([LC_SRC_FSCRYPT_DIGESTED_NAME], [
2846 LB2_LINUX_TEST_SRC([fscrypt_digested_name], [
2847 #include <linux/fscrypt.h>
2849 struct fscrypt_digested_name fname;
2854 AC_DEFUN([LC_FSCRYPT_DIGESTED_NAME], [
2855 LB2_MSG_LINUX_TEST_RESULT([if fscrypt has 'struct fscrypt_digested_name'],
2856 [fscrypt_digested_name], [
2857 AC_DEFINE(HAVE_FSCRYPT_DIGESTED_NAME, 1,
2858 ['struct fscrypt_digested_name' exists])
2860 ]) # LC_FSCRYPT_DIGESTED_NAME
2863 # LC_FSCRYPT_DUMMY_CONTEXT_ENABLED
2865 # Kernel 5.7-rc7 ed318a6cc0b620440e65f48eb527dc3df7269ce4
2866 # replaces fscrypt_dummy_context_enabled() with
2867 # fscrypt_get_dummy_context(). Later kernels rename
2868 # fscrypt_get_dummy_context() to fscrypt_get_dummy_policy()
2869 # which is why we test fscrypt_dummy_context_enabled().
2871 AC_DEFUN([LC_SRC_FSCRYPT_DUMMY_CONTEXT_ENABLED], [
2872 LB2_LINUX_TEST_SRC([fscrypt_dummy_context_enabled], [
2873 #include <linux/fscrypt.h>
2875 fscrypt_dummy_context_enabled(NULL);
2878 AC_DEFUN([LC_FSCRYPT_DUMMY_CONTEXT_ENABLED], [
2879 LB2_MSG_LINUX_TEST_RESULT([if fscrypt_dummy_context_enabled() exists],
2880 [fscrypt_dummy_context_enabled], [
2881 AC_DEFINE(HAVE_FSCRYPT_DUMMY_CONTEXT_ENABLED, 1,
2882 [fscrypt_dummy_context_enabled() exists])
2884 ]) # LC_FSCRYPT_DUMMY_CONTEXT_ENABLED
2887 # LC_HAVE_KTHREAD_USE_MM
2889 # kernel 5.8 commit f5678e7f2ac31c270334b936352f0ef2fe7dd2b3
2890 # kernel: better document the use_mm/unuse_mm API contract
2892 AC_DEFUN([LC_SRC_HAVE_KTHREAD_USE_MM], [
2893 LB2_LINUX_TEST_SRC([kthread_use_mm], [
2894 #include <linux/kthread.h>
2896 kthread_use_mm(NULL);
2899 AC_DEFUN([LC_HAVE_KTHREAD_USE_MM], [
2900 LB2_MSG_LINUX_TEST_RESULT([if have kthread_use_mm], [kthread_use_mm], [
2901 AC_DEFINE(HAVE_KTHREAD_USE_MM, 1, ['kthread_use_mm' exists])
2903 ]) # LC_HAVE_KTHREAD_USE_MM
2906 # LC_FSCRYPT_FNAME_ALLOC_BUFFER
2908 # Kernel 5.9-rc4 8b10fe68985278de4926daa56ad6af701839e40a
2909 # removed the inode parameter for the fscrypt function
2910 # fscrypt_fname_alloc_buffer()
2912 AC_DEFUN([LC_SRC_FSCRYPT_FNAME_ALLOC_BUFFER], [
2913 LB2_LINUX_TEST_SRC([fscrypt_fname_alloc_buffer], [
2914 #include <linux/fscrypt.h>
2916 fscrypt_fname_alloc_buffer(0, NULL);
2919 AC_DEFUN([LC_FSCRYPT_FNAME_ALLOC_BUFFER], [
2920 LB2_MSG_LINUX_TEST_RESULT([if fscrypt_fname_alloc_buffer() removed inode parameter],
2921 [fscrypt_fname_alloc_buffer], [
2922 AC_DEFINE(HAVE_FSCRYPT_FNAME_ALLOC_BUFFER_NO_INODE, 1,
2923 [fscrypt_fname_alloc_buffer() does not have inode parameter])
2925 ]) # LC_FSCRYPT_FNAME_ALLOC_BUFFER
2928 # LC_FSCRYPT_SET_CONTEXT
2930 # Kernel 5.9-rc4 a992b20cd4ee360dbbe6f69339cb07146e4304d6
2931 # fscrypt_get_encryption_info() is not GFP_NOFS safe which
2932 # is used by fscrypt_inherit_context. Replace fscrypt_inherit_context,
2933 # with two new functions, fscrypt_prepare_new_inode() and
2934 # fscrypt_set_context()
2936 AC_DEFUN([LC_SRC_FSCRYPT_SET_CONTEXT], [
2937 LB2_LINUX_TEST_SRC([fscrypt_set_context], [
2938 #include <linux/fscrypt.h>
2940 fscrypt_set_context(NULL, NULL);
2941 fscrypt_prepare_new_inode(NULL, NULL, NULL);
2944 AC_DEFUN([LC_FSCRYPT_SET_CONTEXT], [
2945 LB2_MSG_LINUX_TEST_RESULT([if 'fscrypt_set_context()' exists],
2946 [fscrypt_set_context], [
2947 AC_DEFINE(HAVE_FSCRYPT_SET_CONTEXT, 1,
2948 [fscrypt_set_context() does exist])
2950 ]) # LC_FSCRYPT_SET_CONTEXT
2953 # LC_FSCRYPT_D_REVALIDATE
2955 # kernel 5.9-rc4 5b2a828b98ec1872799b1b4d82113c76a12d594f
2956 # exported fscrypt_d_revalidate()
2958 AC_DEFUN([LC_FSCRYPT_D_REVALIDATE], [
2959 LB_CHECK_EXPORT([fscrypt_d_revalidate], [fs/crypto/fname.c],
2960 [AC_DEFINE(HAVE_FSCRYPT_D_REVALIDATE, 1,
2961 [fscrypt_d_revalidate() is exported by the kernel])])
2962 ]) # LC_FSCRYPT_D_REVALIDATE
2965 # LC_FSCRYPT_NOKEY_NAME
2967 # kernel 5.9-rc4 70fb2612aab62d47e03f82eaa7384a8d30ca175d
2968 # renamed is_ciphertext_name to is_nokey_name
2970 AC_DEFUN([LC_SRC_FSCRYPT_NOKEY_NAME], [
2971 LB2_LINUX_TEST_SRC([fname_is_nokey_name], [
2972 #include <linux/fscrypt.h>
2974 struct fscrypt_name fname;
2976 fname.is_nokey_name = true;
2979 AC_DEFUN([LC_FSCRYPT_NOKEY_NAME], [
2980 LB2_MSG_LINUX_TEST_RESULT([if struct fscrypt_name has is_nokey_name field],
2981 [fname_is_nokey_name], [
2982 AC_DEFINE(HAVE_FSCRYPT_NOKEY_NAME, 1,
2983 [struct fscrypt_name has is_nokey_name field])
2985 ]) # LC_FSCRYPT_NOKEY_NAME
2988 # LC_FSCRYPT_SET_TEST_DUMMY_ENC_CHAR_ARG
2989 # Kernel 5.9-rc4 c8c868abc91ff23f6f5c4444c419de7c277d77e1
2990 # changed fscrypt_set_test_dummy_encryption() take a 'const char *
2992 AC_DEFUN([LC_SRC_FSCRYPT_SET_TEST_DUMMY_ENC_CHAR_ARG], [
2993 LB2_LINUX_TEST_SRC([fscrypt_set_test_dummy_encryption], [
2994 #include <linux/fscrypt.h>
2997 fscrypt_set_test_dummy_encryption(NULL, arg, NULL);
3000 AC_DEFUN([LC_FSCRYPT_SET_TEST_DUMMY_ENC_CHAR_ARG], [
3001 LB2_MSG_LINUX_TEST_RESULT([if fscrypt_set_test_dummy_encryption() take 'const char' parameter],
3002 [fscrypt_set_test_dummy_encryption], [
3003 AC_DEFINE(HAVE_FSCRYPT_SET_TEST_DUMMY_ENC_CHAR_ARG, 1,
3004 [fscrypt_set_test_dummy_encryption() take 'const char' parameter])
3006 ]) # LC_FSCRYPT_SET_TEST_DUMMY_ENC_CHAR_ARG
3009 # LC_FSCRYPT_DUMMY_POLICY
3011 # Kernel 5.9-rc4 ac4acb1f4b2b6b7e8d913537cccec8789903e164
3012 # move the test dummy context for fscrypt_policy which is
3013 # also used by the user land interface.
3015 AC_DEFUN([LC_SRC_FSCRYPT_DUMMY_POLICY], [
3016 LB2_LINUX_TEST_SRC([fscrypt_free_dummy_policy], [
3017 #include <linux/fscrypt.h>
3019 fscrypt_free_dummy_policy(NULL);
3022 AC_DEFUN([LC_FSCRYPT_DUMMY_POLICY], [
3023 LB2_MSG_LINUX_TEST_RESULT([if fscrypt_free_dummy_policy() exists],
3024 [fscrypt_free_dummy_policy], [
3025 AC_DEFINE(HAVE_FSCRYPT_DUMMY_POLICY, 1,
3026 [fscrypt_free_dummy_policy() exists])
3028 ]) # LC_FSCRYPT_DUMMY_POLICY
3031 # LC_HAVE_ITER_FILE_SPLICE_WRITE
3033 # Linux commit v5.9-rc1-6-g36e2c7421f02
3034 # fs: don't allow splice read/write without explicit ops
3036 AC_DEFUN([LC_SRC_HAVE_ITER_FILE_SPLICE_WRITE], [
3037 LB2_LINUX_TEST_SRC([iter_file_splice_write], [
3038 #include <linux/fs.h>
3040 (void)iter_file_splice_write(NULL, NULL, NULL, 1, 0);
3043 AC_DEFUN([LC_HAVE_ITER_FILE_SPLICE_WRITE], [
3044 LB2_MSG_LINUX_TEST_RESULT([if iter_file_splice_write() exists],
3045 [iter_file_splice_write], [
3046 AC_DEFINE(HAVE_ITER_FILE_SPLICE_WRITE, 1,
3047 ['iter_file_splice_write' exists])
3049 ]) # LC_HAVE_ITER_FILE_SPLICE_WRITE
3052 # LC_HAVE_BDI_DEBUG_STATS
3054 # Linux kernel v5.10 commit 2d146b924ec3c0873f06308d149684dc1105d9a3
3055 # backing-dev: no need to check return value of debugfs_create functions
3056 # backing_dev_info.debug_stats was remove.
3058 AC_DEFUN([LC_SRC_HAVE_BDI_DEBUG_STATS], [
3059 LB2_LINUX_TEST_SRC([bdi_has_debug_stats], [
3060 #include <linux/backing-dev-defs.h>
3062 struct backing_dev_info info;
3064 info.debug_stats = NULL;
3067 AC_DEFUN([LC_HAVE_BDI_DEBUG_STATS], [
3068 LB2_MSG_LINUX_TEST_RESULT(
3069 [if 'struct backing_dev_info' has 'debug_stats' field],
3070 [bdi_has_debug_stats], [
3071 AC_DEFINE(HAVE_BDI_DEBUG_STATS, 1,
3072 [backing_dev_info has debug_stats])
3074 ]) # LC_HAVE_BDI_DEBUG_STATS
3077 # LC_FSCRYPT_IS_NOKEY_NAME
3079 # Kernel 5.10-rc4 159e1de201b6fca10bfec50405a3b53a561096a8
3080 # introduced fscrypt_is_nokey_name() inline macro. While
3081 # introduced for 5.10 kernels it was backported to earlier
3082 # Ubuntu kernels. Also it hides the change introduced due
3083 # to git commit 501e43fbe for kernel 5.9 which also was
3084 # backported to earlier Ubuntu kernels.
3086 AC_DEFUN([LC_SRC_FSCRYPT_IS_NOKEY_NAME], [
3087 LB2_LINUX_TEST_SRC([fscrypt_is_no_key_name], [
3088 #include <linux/fscrypt.h>
3090 fscrypt_is_nokey_name(NULL);
3093 AC_DEFUN([LC_FSCRYPT_IS_NOKEY_NAME], [
3094 LB2_MSG_LINUX_TEST_RESULT([if fscrypt_is_no_key_name() exists],
3095 [fscrypt_is_no_key_name], [
3096 AC_DEFINE(HAVE_FSCRYPT_IS_NOKEY_NAME, 1,
3097 [fscrypt_is_nokey_name() exists])
3099 ]) # LC_FSCRYPT_IS_NOKEY_NAME
3102 # LC_FSCRYPT_PREPARE_READDIR
3104 # Kernel 5.10-rc4 ec0caa974cd092549ab282deb8ec7ea73b36eba0
3105 # replaced fscrypt_get_encryption_info() with
3106 # fscrypt_prepare_readdir()
3108 AC_DEFUN([LC_SRC_FSCRYPT_PREPARE_READDIR], [
3109 LB2_LINUX_TEST_SRC([fscrypt_prepare_readdir], [
3110 #include <linux/fscrypt.h>
3112 fscrypt_prepare_readdir(NULL);
3115 AC_DEFUN([LC_FSCRYPT_PREPARE_READDIR], [
3116 LB2_MSG_LINUX_TEST_RESULT([if fscrypt_prepare_readdir() exists],
3117 [fscrypt_prepare_readdir], [
3118 AC_DEFINE(HAVE_FSCRYPT_PREPARE_READDIR, 1,
3119 [fscrypt_prepare_readdir() exists])
3121 ]) # LC_FSCRYPT_PREPARE_READDIR
3126 # Linux: v5.11-rc5-9-g309dca309fc3
3127 # block: store a block_device pointer in struct bio
3128 # created bio_set_dev macro
3129 # Linux: v5.15-rc6-127-gcf6d6238cdd3
3130 # block: turn macro helpers into inline functions
3131 # created inline function(s).
3133 # Only provide a bio_set_dev it is is not proveded by the kernel
3135 AC_DEFUN([LC_SRC_BIO_SET_DEV], [
3136 LB2_LINUX_TEST_SRC([bio_set_dev], [
3137 #include <linux/bio.h>
3139 struct bio *bio = NULL;
3140 struct block_device *bdev = NULL;
3142 bio_set_dev(bio, bdev);
3145 AC_DEFUN([LC_BIO_SET_DEV], [
3146 LB2_MSG_LINUX_TEST_RESULT([if 'bio_set_dev' is available],
3148 AC_DEFINE(HAVE_BIO_SET_DEV, 1, ['bio_set_dev' is available])
3153 # LC_HAVE_USER_NAMESPACE_ARG
3155 # kernel 5.12 commit 549c7297717c32ee53f156cd949e055e601f67bb
3156 # fs: make helpers idmap mount aware
3157 # Extend some inode methods with an additional user namespace argument.
3159 AC_DEFUN([LC_SRC_HAVE_USER_NAMESPACE_ARG], [
3160 LB2_LINUX_TEST_SRC([inode_ops_has_user_namespace_argument], [
3161 #include <linux/fs.h>
3163 struct inode_operations *iops = NULL;
3164 struct user_namespace *user_ns = NULL;
3166 iops->getattr(user_ns, NULL, NULL, 0, 0);
3169 AC_DEFUN([LC_HAVE_USER_NAMESPACE_ARG], [
3170 LB2_MSG_LINUX_TEST_RESULT([if 'inode_operations' members have user namespace argument],
3171 [inode_ops_has_user_namespace_argument], [
3172 AC_DEFINE(HAVE_USER_NAMESPACE_ARG, 1,
3173 ['inode_operations' members have user namespace argument])
3175 ]) # LC_HAVE_USER_NAMESPACE_ARG
3178 # LC_HAVE_FILEATTR_GET
3180 # kernel 5.13 4c5b479975212065ef39786e115fde42847e95a9
3181 # vfs: add fileattr ops
3182 # Add inode operations to replace FS_IOC_[SG]ETFLAGS ioctl
3183 # The type signature of ->fileattr_set is not stable for the
3184 # first few iterations, so don't commit to a particular signature
3185 # here. Hopefully we will only want to support the final version.
3187 AC_DEFUN([LC_SRC_HAVE_FILEATTR_GET], [
3188 LB2_LINUX_TEST_SRC([fileattr_set], [
3189 #include <linux/fs.h>
3191 struct inode_operations *iops = NULL;
3192 iops->fileattr_get(NULL, NULL);
3195 AC_DEFUN([LC_HAVE_FILEATTR_GET], [
3196 LB2_MSG_LINUX_TEST_RESULT(
3197 [if 'inode_operations' has fileattr_get (and fileattr_set)],
3199 AC_DEFINE(HAVE_FILEATTR_GET, 1,
3200 ['inode_operations' has fileattr_get and fileattr_set])
3203 ]) # LC_HAVE_FILEATTR_GET
3205 # LC_HAVE_COPY_PAGE_FROM_ITER_ATOMIC
3207 # Kernel 5.13 commit f0b65f39ac505e8f1dcdaa165aa7b8c0bd6fd454
3208 # iov_iter: replace iov_iter_copy_from_user_atomic() with iterator-advancing variant
3210 AC_DEFUN([LC_SRC_HAVE_COPY_PAGE_FROM_ITER_ATOMIC], [
3211 LB2_LINUX_TEST_SRC([copy_page_from_iter_atomic], [
3212 #include <linux/uio.h>
3214 copy_page_from_iter_atomic(NULL, 0, 0, NULL);
3217 AC_DEFUN([LC_HAVE_COPY_PAGE_FROM_ITER_ATOMIC], [
3218 LB2_MSG_LINUX_TEST_RESULT([if have copy_page_from_iter_atomic],
3219 [copy_page_from_iter_atomic], [
3220 AC_DEFINE(HAVE_COPY_PAGE_FROM_ITER_ATOMIC, 1,
3221 ['copy_page_from_iter_atomic' exists])
3223 ]) # LC_HAVE_COPY_PAGE_FROM_ITER_ATOMIC
3226 # LC_HAVE_GET_ACL_RCU_ARG
3228 # kernel 5.15 commit 0cad6246621b5887d5b33fea84219d2a71f2f99a
3229 # vfs: add rcu argument to ->get_acl() callback
3230 # Add a rcu argument to the ->get_acl() callback to allow
3231 # get_cached_acl_rcu() to call the ->get_acl() method.
3233 AC_DEFUN([LC_SRC_HAVE_GET_ACL_RCU_ARG], [
3234 LB2_LINUX_TEST_SRC([get_acl_rcu_argument], [
3235 #include <linux/fs.h>
3237 ((struct inode_operations *)1)->get_acl((struct inode *)NULL, 0, false);
3240 AC_DEFUN([LC_HAVE_GET_ACL_RCU_ARG], [
3241 LB2_MSG_LINUX_TEST_RESULT([if 'get_acl' has a rcu argument],
3242 [get_acl_rcu_argument], [
3243 AC_DEFINE(HAVE_GET_ACL_RCU_ARG, 1,
3244 ['get_acl' has a rcu argument])
3246 ]) # LC_HAVE_GET_ACL_RCU_ARG
3248 # LC_HAVE_FAULT_IN_IOV_ITER_READABLE
3250 # Kernel 5.15 commit a6294593e8a1290091d0b078d5d33da5e0cd3dfe
3251 # iov_iter: Turn iov_iter_fault_in_readable into fault_in_iov_iter_readable
3253 AC_DEFUN([LC_SRC_HAVE_FAULT_IN_IOV_ITER_READABLE], [
3254 LB2_LINUX_TEST_SRC([fault_in_iov_iter_readable], [
3255 #include <linux/uio.h>
3257 fault_in_iov_iter_readable(NULL, 0);
3260 AC_DEFUN([LC_HAVE_FAULT_IN_IOV_ITER_READABLE], [
3261 LB2_MSG_LINUX_TEST_RESULT([if have fault_in_iov_iter_readable],
3262 [fault_in_iov_iter_readable], [
3263 AC_DEFINE(HAVE_FAULT_IN_IOV_ITER_READABLE, 1,
3264 ['fault_in_iov_iter_readable' exists])
3266 ]) # LC_HAVE_FAULT_IN_IOV_ITER_READABLE
3269 # LC_HAVE_INVALIDATE_LOCK
3271 # Kernel version v5.15-rc1 commit 730633f0b7f951726e87f912a6323641f674ae34
3272 # mm: Protect operations adding pages to page cache with invalidate_lock
3274 AC_DEFUN([LC_HAVE_INVALIDATE_LOCK], [
3275 tmp_flags="$EXTRA_KCFLAGS"
3276 EXTRA_KCFLAGS="-Werror"
3277 LB_CHECK_COMPILE([if have address_space have invalidate_lock member],
3278 address_space_invalidate_lock, [
3279 #include <linux/fs.h>
3281 struct address_space *mapping = NULL;
3283 filemap_invalidate_lock(mapping);
3285 AC_DEFINE(HAVE_INVALIDATE_LOCK, 1,
3286 [address_space invalidate_lock member exists])
3288 EXTRA_KCFLAGS="$tmp_flags"
3289 ]) # LC_HAVE_INVALIDATE_LOCK
3292 # LC_HAVE_SECURITY_DENTRY_INIT_WITH_XATTR_NAME_ARG
3294 # Linux v5.15-rc1-20-g15bf32398ad4
3295 # security: Return xattr name from security_dentry_init_security()
3297 AC_DEFUN([LC_SRC_HAVE_SECURITY_DENTRY_INIT_WITH_XATTR_NAME_ARG], [
3298 LB2_LINUX_TEST_SRC([security_dentry_init_security_xattr_name_arg], [
3299 #include <linux/security.h>
3301 struct dentry *dentry = NULL;
3303 const struct qstr *name = NULL;
3304 const char *xattr_name = NULL;
3307 int rc = security_dentry_init_security(dentry, mode, name, &xattr_name,
3313 AC_DEFUN([LC_HAVE_SECURITY_DENTRY_INIT_WITH_XATTR_NAME_ARG], [
3314 LB2_MSG_LINUX_TEST_RESULT([if security_dentry_init_security() returns xattr name],
3315 [security_dentry_init_security_xattr_name_arg], [
3316 AC_DEFINE(HAVE_SECURITY_DENTRY_INIT_WITH_XATTR_NAME_ARG, 1,
3317 [security_dentry_init_security() returns xattr name])
3319 ]) # LC_HAVE_SECURITY_DENTRY_INIT_WITH_XATTR_NAME_ARG
3322 # LC_HAVE_KIOCB_COMPLETE_2ARGS
3324 # kernel v5.15-rc6-145-g6b19b766e8f0
3325 # fs: get rid of the res2 iocb->ki_complete argument
3327 AC_DEFUN([LC_SRC_HAVE_KIOCB_COMPLETE_2ARGS], [
3328 LB2_LINUX_TEST_SRC([kiocb_ki_complete_2args], [
3329 #include <linux/fs.h>
3331 static void complete_fn(struct kiocb *iocb, long ret)
3337 struct kiocb *kio = NULL;
3339 kio->ki_complete = complete_fn;
3342 AC_DEFUN([LC_HAVE_KIOCB_COMPLETE_2ARGS], [
3343 LB2_MSG_LINUX_TEST_RESULT([if kiocb->ki_complete() has 2 arguments],
3344 [kiocb_ki_complete_2args], [
3345 AC_DEFINE(HAVE_KIOCB_COMPLETE_2ARGS, 1,
3346 [kiocb->ki_complete() has 2 arguments])
3348 ]) # LC_HAVE_KIOCB_COMPLETE_2ARGS
3351 # LC_EXPORTS_DELETE_FROM_PAGE_CACHE
3353 # Linux commit v5.16-rc4-44-g452e9e6992fe
3354 # filemap: Add filemap_remove_folio and __filemap_remove_folio
3356 # Also removes the export of delete_from_page_cache
3358 AC_DEFUN([LC_EXPORTS_DELETE_FROM_PAGE_CACHE], [
3359 LB_CHECK_EXPORT([delete_from_page_cache], [mm/filemap.c],
3360 [AC_DEFINE(HAVE_DELETE_FROM_PAGE_CACHE, 1,
3361 [delete_from_page_cache is exported])])
3362 ]) # LC_EXPORTS_DELETE_FROM_PAGE_CACHE
3366 # LC_HAVE_WB_STAT_MOD
3368 # Kernel 5.16-rc1 bd3488e7b4d61780eb3dfaca1cc6f4026bcffd48
3369 # mm/writeback: Rename __add_wb_stat() to wb_stat_mod()
3371 AC_DEFUN([LC_HAVE_WB_STAT_MOD], [
3372 tmp_flags="$EXTRA_KCFLAGS"
3373 EXTRA_KCFLAGS="-Werror"
3374 LB_CHECK_COMPILE([if wb_stat_mod() exists],
3376 #include <linux/backing-dev.h>
3378 wb_stat_mod(NULL, WB_WRITEBACK, 1);
3380 AC_DEFINE(HAVE_WB_STAT_MOD, 1,
3381 [wb_stat_mod() exists])
3383 EXTRA_KCFLAGS="$tmp_flags"
3384 ]) # LC_HAVE_WB_STAT_MOD
3387 # LC_HAVE_INVALIDATE_FOLIO
3389 # linux commit v5.17-rc4-10-g128d1f8241d6
3390 # fs: Add invalidate_folio() aops method
3392 AC_DEFUN([LC_SRC_HAVE_INVALIDATE_FOLIO], [
3393 LB2_LINUX_TEST_SRC([address_spaace_operaions_invalidate_folio], [
3394 #include <linux/fs.h>
3396 struct address_space_operations *aops = NULL;
3397 struct folio *folio = NULL;
3398 aops->invalidate_folio(folio, 0, PAGE_SIZE);
3402 AC_DEFUN([LC_HAVE_INVALIDATE_FOLIO], [
3403 LB2_MSG_LINUX_TEST_RESULT([if have address_spaace_operaions->invalidate_folio() member],
3404 [address_spaace_operaions_invalidate_folio], [
3405 AC_DEFINE(HAVE_INVALIDATE_FOLIO, 1,
3406 [address_spaace_operaions->invalidate_folio() member exists])
3408 ]) # LC_HAVE_INVALIDATE_FOLIO
3411 # LC_HAVE_DIRTY_FOLIO
3413 # linux commit v5.17-rc4-38-g6f31a5a261db
3414 # fs: Add aops->dirty_folio
3415 # ... replaces ->set_page_dirty() with ->dirty_folio()
3417 AC_DEFUN([LC_SRC_HAVE_DIRTY_FOLIO], [
3418 LB2_LINUX_TEST_SRC([address_spaace_operaions_dirty_folio], [
3419 #include <linux/fs.h>
3421 struct address_space_operations *aops = NULL;
3422 struct address_space *mapping = NULL;
3423 struct folio *folio = NULL;
3424 bool dirty = aops->dirty_folio(mapping, folio);
3428 AC_DEFUN([LC_HAVE_DIRTY_FOLIO], [
3429 LB2_MSG_LINUX_TEST_RESULT([if have address_spaace_operaions->dirty_folio() member],
3430 [address_spaace_operaions_dirty_folio], [
3431 AC_DEFINE(HAVE_DIRTY_FOLIO, 1,
3432 [address_spaace_operaions->dirty_folio() member exists])
3434 ]) # LC_HAVE_DIRTY_FOLIO
3437 # LC_HAVE_ALLOC_INODE_SB
3439 # linux commit v5.17-49-g8b9f3ac5b01d
3440 # fs: introduce alloc_inode_sb() to allocate filesystems specific inode
3442 AC_DEFUN([LC_SRC_HAVE_ALLOC_INODE_SB], [
3443 LB2_LINUX_TEST_SRC([alloc_inode_sb], [
3444 #include <linux/fs.h>
3446 struct super_block *sb = NULL;
3447 struct kmem_cache *cache = NULL;
3449 (void)alloc_inode_sb(sb, cache, GFP_NOFS);
3452 AC_DEFUN([LC_HAVE_ALLOC_INODE_SB], [
3453 LB2_MSG_LINUX_TEST_RESULT([if alloc_inode_sb() exists],
3455 AC_DEFINE(HAVE_ALLOC_INODE_SB, 1,
3456 [alloc_inode_sb() exists])
3458 ]) # LC_HAVE_ALLOC_INODE_SB
3461 # LC_GRAB_CACHE_PAGE_WRITE_BEGIN_WITH_FLAGS
3463 # Linux commit v5.18-rc5-221-gb7446e7cf15f
3464 # fs: Remove aop flags parameter from grab_cache_page_write_begin()
3466 AC_DEFUN([LC_SRC_GRAB_CACHE_PAGE_WRITE_BEGIN_WITH_FLAGS], [
3467 LB2_LINUX_TEST_SRC([grab_cache_page_write_begin_with_flags], [
3468 #include <linux/pagemap.h>
3470 struct address_space *mapping = NULL;
3471 (void)grab_cache_page_write_begin(mapping, 0, 1);
3474 AC_DEFUN([LC_GRAB_CACHE_PAGE_WRITE_BEGIN_WITH_FLAGS], [
3475 LB2_MSG_LINUX_TEST_RESULT([if grab_cache_page_write_begin() has flags argument],
3476 [grab_cache_page_write_begin_with_flags], [
3477 AC_DEFINE(HAVE_GRAB_CACHE_PAGE_WRITE_BEGIN_WITH_FLAGS, 1,
3478 [grab_cache_page_write_begin() has flags argument])
3480 ]) # LC_GRAB_CACHE_PAGE_WRITE_BEGIN_WITH_FLAGS
3483 # LC_HAVE_ADDRESS_SPACE_OPERATIONS_READ_FOLIO
3485 # Linux commit v5.18-rc5-241-g5efe7448a142
3486 # fs: Introduce aops->read_folio
3488 AC_DEFUN([LC_SRC_HAVE_ADDRESS_SPACE_OPERATIONS_READ_FOLIO], [
3489 LB2_LINUX_TEST_SRC([address_space_operations_read_folio], [
3490 #include <linux/fs.h>
3492 struct address_space_operations *aops = NULL;
3493 struct file *file = NULL;
3494 struct folio *folio = NULL;
3495 int err = aops->read_folio(file, folio);
3499 AC_DEFUN([LC_HAVE_ADDRESS_SPACE_OPERATIONS_READ_FOLIO], [
3500 LB2_MSG_LINUX_TEST_RESULT([if struct address_space_operations() has read_folio()],
3501 [address_space_operations_read_folio], [
3502 AC_DEFINE(HAVE_AOPS_READ_FOLIO, 1,
3503 [struct address_space_operations() has read_folio()])
3505 ]) # LC_HAVE_ADDRESS_SPACE_OPERATIONS_READ_FOLIO
3508 # LC_HAVE_READ_CACHE_PAGE_FILLER_WITH_FILE
3510 # Linux commit v5.18-rc5-280-ge9b5b23e957e
3511 # fs: Change the type of filler_t
3513 AC_DEFUN([LC_SRC_HAVE_READ_CACHE_PAGE_FILLER_WITH_FILE], [
3514 LB2_LINUX_TEST_SRC([read_cache_page_filler_with_file], [
3515 #include <linux/pagemap.h>
3516 static inline int _filler(struct file *file, struct folio *f)
3521 struct address_space *mapping = NULL;
3522 struct file *file = NULL;
3523 struct page *page = read_cache_page(mapping, 0, _filler, file);
3527 AC_DEFUN([LC_HAVE_READ_CACHE_PAGE_FILLER_WITH_FILE], [
3528 LB2_MSG_LINUX_TEST_RESULT([if read_cache_page() filler_t needs struct file],
3529 [read_cache_page_filler_with_file], [
3530 AC_DEFINE(HAVE_READ_CACHE_PAGE_WANTS_FILE, 1,
3531 [read_cache_page() filler_t needs struct file])
3533 ]) # LC_HAVE_READ_CACHE_PAGE_FILLER_WITH_FILE
3536 # LC_HAVE_ADDRESS_SPACE_OPERATIONS_RELEASE_FOLIO
3538 # Linux commit v5.18-rc5-282-gfa29000b6b26
3539 # fs: Add aops->release_folio
3541 AC_DEFUN([LC_SRC_HAVE_ADDRESS_SPACE_OPERATIONS_RELEASE_FOLIO], [
3542 LB2_LINUX_TEST_SRC([address_space_operations_release_folio], [
3543 #include <linux/fs.h>
3545 struct address_space_operations *aops = NULL;
3546 struct folio *folio = NULL;
3547 int err = aops->release_folio(folio, GFP_KERNEL);
3551 AC_DEFUN([LC_HAVE_ADDRESS_SPACE_OPERATIONS_RELEASE_FOLIO], [
3552 LB2_MSG_LINUX_TEST_RESULT([if struct address_space_operations() has release_folio()],
3553 [address_space_operations_release_folio], [
3554 AC_DEFINE(HAVE_AOPS_RELEASE_FOLIO, 1,
3555 [struct address_space_operations() has release_folio()])
3557 ]) # LC_HAVE_ADDRESS_SPACE_OPERATIONS_RELEASE_FOLIO
3560 # LC_HAVE_LSMCONTEXT_INIT
3562 # repo: git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/jammy
3563 # kernel linux-hwe-5.19 commit fef1deb99dad87dd700afae76b35c5b5750e33a8
3564 # LSM: Removed scaffolding function lsmcontext_init
3566 AC_DEFUN([LC_SRC_HAVE_LSMCONTEXT_INIT], [
3567 LB2_LINUX_TEST_SRC([lsmcontext_init], [
3568 #include <linux/security.h>
3570 struct lsmcontext ctx = {};
3572 lsmcontext_init(&ctx, "", 0, 0);
3575 AC_DEFUN([LC_HAVE_LSMCONTEXT_INIT], [
3576 LB2_MSG_LINUX_TEST_RESULT([if lsmcontext_init is available],
3577 [lsmcontext_init], [
3578 AC_DEFINE(HAVE_LSMCONTEXT_INIT, 1,
3579 [lsmcontext_init is available])
3581 ]) # LC_HAVE_LSMCONTEXT_INIT
3584 # LC_SECURITY_DENTRY_INIT_SECURTY_WITH_CTX
3586 # repo: git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/jammy
3587 # kernel linux-hwe-5.19 commit 57d0004bc811254916be30f94c86d9607867deb0
3588 # LSM: Use lsmcontext in security_dentry_init_security
3590 AC_DEFUN([LC_SRC_SECURITY_DENTRY_INIT_SECURTY_WITH_CTX], [
3591 LB2_LINUX_TEST_SRC([security_dentry_init_security_with_ctx], [
3592 #include <linux/security.h>
3594 struct dentry *dentry = NULL;
3595 const struct qstr *name = NULL;
3596 struct lsmcontext *ctx = NULL;
3597 const char *xattr_name = "";
3599 (void)security_dentry_init_security(dentry, 0, name,
3603 AC_DEFUN([LC_SECURITY_DENTRY_INIT_SECURTY_WITH_CTX], [
3604 LB2_MSG_LINUX_TEST_RESULT([if security_dentry_init_security needs lsmcontext],
3605 [security_dentry_init_security_with_ctx], [
3606 AC_DEFINE(HAVE_SECURITY_DENTRY_INIT_SECURTY_WITH_CTX, 1,
3607 [security_dentry_init_security needs lsmcontext])
3609 ]) # LC_SECURITY_DENTRY_INIT_SECURTY_WITH_CTX
3614 # Linux commit v5.19-rc2-6-g868941b14441
3615 # fs: remove no_llseek
3617 AC_DEFUN([LC_SRC_HAVE_NO_LLSEEK], [
3618 LB2_LINUX_TEST_SRC([no_llseek], [
3619 #include <linux/fs.h>
3621 static const struct file_operations fops = {
3622 .llseek = &no_llseek,
3627 AC_DEFUN([LC_HAVE_NO_LLSEEK], [
3628 LB2_MSG_LINUX_TEST_RESULT([if no_llseek() is available],
3630 AC_DEFINE(HAVE_NO_LLSEEK, 1, [no_llseek() is available])
3632 ]) # LC_HAVE_NO_LLSEEK
3635 # LC_DQUOT_TRANSFER_WITH_USER_NS
3637 # Linux commit v5.19-rc3-6-g71e7b535b890
3638 # quota: port quota helpers mount ids
3640 AC_DEFUN([LC_SRC_DQUOT_TRANSFER_WITH_USER_NS], [
3641 LB2_LINUX_TEST_SRC([dquot_transfer], [
3642 #include <linux/quotaops.h>
3644 struct user_namespace *userns = NULL;
3645 struct inode *inode = NULL;
3646 struct iattr *iattr = NULL;
3647 int err __attribute__ ((unused));
3649 err = dquot_transfer(userns, inode, iattr);
3652 AC_DEFUN([LC_DQUOT_TRANSFER_WITH_USER_NS], [
3653 LB2_MSG_LINUX_TEST_RESULT([if dquot_transfer() has user_ns argument],
3655 AC_DEFINE(HAVE_DQUOT_TRANSFER_WITH_USER_NS, 1,
3656 [dquot_transfer() has user_ns argument])
3658 ]) # LC_DQUOT_TRANSFER_WITH_USER_NS
3661 # LC_HAVE_ADDRESS_SPACE_OPERATIONS_MIGRATE_FOLIO
3663 # Linux commit v5.19-rc3-392-g5490da4f06d1
3664 # fs: Add aops->migrate_folio
3666 AC_DEFUN([LC_SRC_HAVE_ADDRESS_SPACE_OPERATIONS_MIGRATE_FOLIO], [
3667 LB2_LINUX_TEST_SRC([address_space_operations_migrate_folio], [
3668 #include <linux/fs.h>
3670 struct address_space_operations *aops = NULL;
3671 struct address_space *m = NULL;
3672 struct folio *src = NULL;
3673 struct folio *dst = NULL;
3674 int err = aops->migrate_folio(m, dst, src, MIGRATE_ASYNC);
3678 AC_DEFUN([LC_HAVE_ADDRESS_SPACE_OPERATIONS_MIGRATE_FOLIO], [
3679 LB2_MSG_LINUX_TEST_RESULT([if struct address_space_operations() has migrate_folio()],
3680 [address_space_operations_migrate_folio], [
3681 AC_DEFINE(HAVE_AOPS_MIGRATE_FOLIO, 1,
3682 [struct address_space_operations() has migrate_folio()])
3684 ]) # LC_HAVE_ADDRESS_SPACE_OPERATIONS_MIGRATE_FOLIO
3687 # LC_REGISTER_SHRINKER_FORMAT_NAMED
3689 # Linux commit v5.19-rc4-52-ge33c267ab70d
3690 # mm: shrinkers: provide shrinkers with names
3692 AC_DEFUN([LC_SRC_REGISTER_SHRINKER_FORMAT_NAMED], [
3693 LB2_LINUX_TEST_SRC([register_shrinker_format], [
3694 #include <linux/mm.h>
3696 if (register_shrinker(NULL, "lustre-%ps", __func__))
3697 unregister_shrinker(NULL);
3700 AC_DEFUN([LC_REGISTER_SHRINKER_FORMAT_NAMED], [
3701 LB2_MSG_LINUX_TEST_RESULT([if register_shrinker() returns status],
3702 [register_shrinker_format], [
3703 AC_DEFINE(HAVE_REGISTER_SHRINKER_FORMAT_NAMED, 1,
3704 [register_shrinker() returns status])
3706 ]) # LC_REGISTER_SHRINKER_FORMAT_NAMED
3709 # LC_HAVE_VFS_SETXATTR_NON_CONST_VALUE
3711 # From Linux commit v5.19-rc5-17-g0c5fd887d2bb
3712 # acl: move idmapped mount fixup into vfs_{g,s}etxattr()
3713 # Until Linux commit v6.0-rc3-6-g6344e66970c6
3714 # xattr: constify value argument in vfs_setxattr()
3716 AC_DEFUN([LC_SRC_HAVE_VFS_SETXATTR_NON_CONST_VALUE], [
3717 LB2_LINUX_TEST_SRC([vfs_setxattr_non_const_value_arg], [
3718 #include <linux/xattr.h>
3720 struct dentry *de = NULL;
3721 const char *name = "an.xattr";
3722 const void *value = NULL;
3723 int err = vfs_setxattr(&init_user_ns, de, name, value, 0, 0);
3726 ]) # LC_HAVE_VFS_SETXATTR_NON_CONST_VALUE
3727 AC_DEFUN([LC_HAVE_VFS_SETXATTR_NON_CONST_VALUE], [
3728 LB2_MSG_LINUX_TEST_RESULT([if vfs_setxattr() value argument is non-const],
3729 [vfs_setxattr_non_const_value_arg], [
3730 AC_DEFINE([VFS_SETXATTR_VALUE(value)],
3732 [vfs_setxattr() value argument is const void *])
3734 AC_DEFINE([VFS_SETXATTR_VALUE(value)],
3735 [((void *)(value))],
3736 [vfs_setxattr() value argument is non-const])
3738 ]) # LC_HAVE_VFS_SETXATTR_NON_CONST_VALUE
3741 # LC_HAVE_IOV_ITER_GET_PAGES_ALLOC2
3743 # Linux commit v5.19-10313-geba2d3d79829
3744 # get rid of non-advancing variants
3746 AC_DEFUN([LC_SRC_HAVE_IOV_ITER_GET_PAGES_ALLOC2], [
3747 LB2_LINUX_TEST_SRC([iov_iter_get_pages_alloc2], [
3748 #include <linux/uio.h>
3750 struct iov_iter *iter = NULL;
3751 struct page ***pages = NULL;
3754 size_t result __attribute__ ((unused));
3755 result = iov_iter_get_pages_alloc2(iter, pages, maxsize, &start);
3758 AC_DEFUN([LC_HAVE_IOV_ITER_GET_PAGES_ALLOC2], [
3759 LB2_MSG_LINUX_TEST_RESULT([if iov_iter_get_pages_alloc2() is available],
3760 [iov_iter_get_pages_alloc2], [
3761 AC_DEFINE(HAVE_IOV_ITER_GET_PAGES_ALLOC2, 1,
3762 [iov_iter_get_pages_alloc2() is available])
3764 ]) # LC_HAVE_IOV_ITER_GET_PAGES_ALLOC2
3767 # LC_HAVE_GET_RANDOM_U32_AND_U64
3769 # Linux commit v4.10-rc3-6-gc440408cf690
3770 # random: convert get_random_int/long into get_random_u32/u64
3771 # Linux commit v6.0-11338-gde492c83cae0
3772 # prandom: remove unused functions
3774 AC_DEFUN([LC_SRC_HAVE_GET_RANDOM_U32_AND_U64], [
3775 LB2_LINUX_TEST_SRC([get_random_u32_and_u64], [
3776 #include <linux/random.h>
3778 u32 rand32 = get_random_u32();
3779 u64 rand64 = get_random_u64();
3784 AC_DEFUN([LC_HAVE_GET_RANDOM_U32_AND_U64], [
3785 LB2_MSG_LINUX_TEST_RESULT([if get_random_u32() and get_random_u64() are available],
3786 [get_random_u32_and_u64], [
3787 AC_DEFINE(HAVE_GET_RANDOM_U32_AND_U64, 1,
3788 [get_random_[u32|u64] are available])
3790 AC_DEFINE([get_random_u32()], [prandom_u32()],
3791 [get_random_u32() is not available, use prandom_u32])
3793 ]) # LC_HAVE_GET_RANDOM_U32_AND_U64
3796 # LC_NFS_FILLDIR_USE_CTX_RETURN_BOOL
3798 # Linux commit v6.0-rc1-2-g25885a35a720
3799 # Change calling conventions for filldir_t
3801 AC_DEFUN([LC_SRC_NFS_FILLDIR_USE_CTX_RETURN_BOOL], [
3802 LB2_LINUX_TEST_SRC([filldir_ctx_return_bool], [
3803 #include <linux/fs.h>
3805 bool filldir(struct dir_context *ctx, const char* name,
3806 int i, loff_t off, u64 tmp, unsigned temp)
3811 struct dir_context ctx = {
3815 ctx.actor(NULL, "test", 0, (loff_t) 0, 0, 0);
3818 AC_DEFUN([LC_NFS_FILLDIR_USE_CTX_RETURN_BOOL], [
3819 LB2_MSG_LINUX_TEST_RESULT([if filldir_t uses struct dir_context and returns bool],
3820 [filldir_ctx_return_bool], [
3821 AC_DEFINE(HAVE_FILLDIR_USE_CTX_RETURN_BOOL, 1,
3822 [filldir_t needs struct dir_context and returns bool])
3823 AC_DEFINE(HAVE_FILLDIR_USE_CTX, 1,
3824 [filldir_t needs struct dir_context as argument])
3825 AC_DEFINE(FILLDIR_TYPE, bool,
3826 [filldir_t return type is bool or int])
3828 AC_DEFINE(FILLDIR_TYPE, int,
3829 [filldir_t return type is bool or int])
3831 ]) # LC_NFS_FILLDIR_USE_CTX_RETURN_BOOL
3834 # LC_HAVE_FILEMAP_GET_FOLIOS_CONTIG
3836 # Linux commit v6.0-rc3-94-g35b471467f88
3837 # filemap: add filemap_get_folios_contig()
3839 AC_DEFUN([LC_SRC_HAVE_FILEMAP_GET_FOLIOS_CONTIG], [
3840 LB2_LINUX_TEST_SRC([filemap_get_folios_contig], [
3841 #include <linux/pagemap.h>
3843 struct address_space *m = NULL;
3845 struct folio_batch *fbatch = NULL;
3846 (void)filemap_get_folios_contig(m, &start, ULONG_MAX, fbatch);
3849 AC_DEFUN([LC_HAVE_FILEMAP_GET_FOLIOS_CONTIG], [
3850 LB2_MSG_LINUX_TEST_RESULT([if filemap_get_folios_contig() is available],
3851 [filemap_get_folios_contig], [
3852 AC_DEFINE(HAVE_FILEMAP_GET_FOLIOS_CONTIG, 1,
3853 [filemap_get_folios_contig() is available])
3855 ]) # LC_HAVE_FILEMAP_GET_FOLIOS_CONTIG
3858 # LC_HAVE_GET_RANDOM_U32_BELOW
3860 # Linux commit v6.1-13825-g3c202d14a9d7
3861 # prandom: remove prandom_u32_max()
3863 AC_DEFUN([LC_SRC_HAVE_GET_RANDOM_U32_BELOW], [
3864 LB2_LINUX_TEST_SRC([get_random_u32_below], [
3865 #include <linux/random.h>
3867 u32 rand32 = get_random_u32_below(99);
3871 AC_DEFUN([LC_HAVE_GET_RANDOM_U32_BELOW], [
3872 LB2_MSG_LINUX_TEST_RESULT([if get_random_u32_below()is available],
3873 [get_random_u32_below], [
3874 AC_DEFINE(HAVE_GET_RANDOM_U32_BELOW, 1,
3875 [get_random_u32_below() is available])
3877 AC_DEFINE([get_random_u32_below(v)], [prandom_u32_max(v)],
3878 [get_random_u32_below() is not available])
3880 ]) # LC_HAVE_GET_RANDOM_U32_BELOW
3883 # LC_HAVE_ACL_WITH_DENTRY
3885 # Linux commit v6.1-rc1-2-g138060ba92b3
3886 # fs: pass dentry to set acl method
3887 # Linux commit v6.1-rc1-4-g7420332a6ff4
3888 # fs: add new get acl method
3890 AC_DEFUN([LC_SRC_HAVE_ACL_WITH_DENTRY], [
3891 LB2_LINUX_TEST_SRC([acl_with_dentry], [
3892 #include <linux/fs.h>
3894 struct dentry *dentry = NULL;
3896 ((struct inode_operations *)1)->get_acl(NULL, dentry, 0);
3900 AC_DEFUN([LC_HAVE_ACL_WITH_DENTRY], [
3901 LB2_MSG_LINUX_TEST_RESULT([if 'get_acl' and 'set_acl' use dentry argument],
3902 [acl_with_dentry], [
3903 AC_DEFINE(HAVE_ACL_WITH_DENTRY, 1,
3904 ['get_acl' and 'set_acl' use dentry argument])
3906 ]) # LC_HAVE_ACL_WITH_DENTRY
3909 # LC_HAVE_U64_CAPABILITY
3911 # linux kernel v6.2-13111-gf122a08b197d
3912 # capability: just use a 'u64' instead of a 'u32[2]' array
3914 AC_DEFUN([LC_SRC_HAVE_U64_CAPABILITY], [
3915 LB2_LINUX_TEST_SRC([kernel_cap_t_has_u64_value], [
3916 #include <linux/cred.h>
3917 #include <linux/capability.h>
3919 kernel_cap_t cap __attribute__ ((unused));
3920 cap.val = 0xffffffffffffffffull;
3923 AC_DEFUN([LC_HAVE_U64_CAPABILITY], [
3924 LB2_MSG_LINUX_TEST_RESULT([if 'kernel_cap_t' has u64 val],
3925 [kernel_cap_t_has_u64_value], [
3926 AC_DEFINE(HAVE_U64_CAPABILITY, 1,
3927 ['kernel_cap_t' has u64 val])
3929 ]) # LC_HAVE_U64_CAPABILITY
3932 # LC_HAVE_MNT_IDMAP_ARG
3934 # linux kernel v6.2-rc1-4-gb74d24f7a74f
3935 # fs: port ->getattr() to pass mnt_idmap
3936 # linux kernel v6.2-rc1-3-gc1632a0f1120
3937 # fs: port ->setattr() to pass mnt_idmap
3939 AC_DEFUN([LC_SRC_HAVE_MNT_IDMAP_ARG], [
3940 LB2_LINUX_TEST_SRC([inode_ops_getattr_has_mnt_idmap_argument], [
3941 #include <linux/mount.h>
3942 #include <linux/fs.h>
3944 ((struct inode_operations *)1)->getattr((struct mnt_idmap *)NULL,
3948 AC_DEFUN([LC_HAVE_MNT_IDMAP_ARG], [
3949 LB2_MSG_LINUX_TEST_RESULT([if 'inode_operations' members have mnt_idmap argument],
3950 [inode_ops_getattr_has_mnt_idmap_argument], [
3951 AC_DEFINE(HAVE_MNT_IDMAP_ARG, 1,
3952 ['inode_operations' members have mnt_idmap argument])
3953 AC_DEFINE(HAVE_USER_NAMESPACE_ARG, 1,
3954 [use mnt_idmap in place of user_namespace argument])
3955 AC_DEFINE(HAVE_DQUOT_TRANSFER_WITH_USER_NS, 1,
3956 [use mnt_idmap with dquot_transfer])
3958 ]) # LC_HAVE_MNT_IDMAP_ARG
3961 # LC_HAVE_LOCKS_LOCK_FILE_WAIT_IN_FILELOCK
3963 # Linux commit v6.2-rc3-9-g5970e15dbcfe
3964 # filelock: move file locking definitions to separate header file
3966 AC_DEFUN([LC_SRC_HAVE_LOCKS_LOCK_FILE_WAIT_IN_FILELOCK], [
3967 LB2_LINUX_TEST_SRC([locks_lock_file_wait_in_filelock], [
3968 #include <linux/filelock.h>
3970 locks_lock_file_wait(NULL, NULL);
3973 AC_DEFUN([LC_HAVE_LOCKS_LOCK_FILE_WAIT_IN_FILELOCK], [
3974 LB2_MSG_LINUX_TEST_RESULT([if 'locks_lock_file_wait' exists in filelock.h],
3975 [locks_lock_file_wait_in_filelock], [
3976 AC_DEFINE(HAVE_LOCKS_LOCK_FILE_WAIT, 1,
3977 [kernel has locks_lock_file_wait in filelock.h])
3978 AC_DEFINE(HAVE_LINUX_FILELOCK_HEADER, 1,
3979 [linux/filelock.h is present])
3981 ]) # LC_HAVE_LOCKS_LOCK_FILE_WAIT_IN_FILELOCK
3984 # LC_HAVE_IOV_ITER_IOVEC
3986 # linux kernel v6.3-rc4-32-g6eb203e1a868
3987 # iov_iter: remove iov_iter_iovec()
3989 AC_DEFUN([LC_SRC_HAVE_IOV_ITER_IOVEC], [
3990 LB2_LINUX_TEST_SRC([iov_iter_iovec_exists], [
3991 #include <linux/uio.h>
3993 struct iovec iov __attribute__ ((unused));
3994 struct iov_iter i = { };
3996 iov = iov_iter_iovec(&i);
3999 AC_DEFUN([LC_HAVE_IOV_ITER_IOVEC], [
4000 LB2_MSG_LINUX_TEST_RESULT([if 'iov_iter_iovec' is available],
4001 [iov_iter_iovec_exists], [
4002 AC_DEFINE(HAVE_IOV_ITER_IOVEC, 1,
4003 ['iov_iter_iovec' is available])
4005 ]) # LC_HAVE_IOV_ITER_IOVEC
4008 # LC_HAVE_IOVEC_WITH_IOV_MEMBER
4010 # linux kernel v6.3-rc4-34-g747b1f65d39a
4011 # iov_iter: overlay struct iovec and ubuf/len
4012 # This renames iov_iter member iov to __iov and now __iov == __ubuf_iovec
4013 # And provides the iov_iter() accessor to return __iov or __ubuf_iovec
4015 AC_DEFUN([LC_SRC_HAVE_IOVEC_WITH_IOV_MEMBER], [
4016 LB2_LINUX_TEST_SRC([iov_iter_has___iov_member], [
4017 #include <linux/uio.h>
4019 struct iov_iter iter = { };
4020 size_t len __attribute__ ((unused));
4022 len = iter.__iov->iov_len;
4025 AC_DEFUN([LC_HAVE_IOVEC_WITH_IOV_MEMBER], [
4026 LB2_MSG_LINUX_TEST_RESULT([if 'iov_iter_iovec' is available],
4027 [iov_iter_has___iov_member], [
4028 AC_DEFINE(HAVE___IOV_MEMBER, __iov,
4029 ['struct iov_iter' has '__iov' member])
4030 AC_DEFINE(HAVE_ITER_IOV, 1,
4031 [iter_iov() is available])
4033 AC_DEFINE(iter_iov(iter), (iter)->__iov,
4034 ['iov_iter()' provides iov])
4035 AC_DEFINE(__iov, iov,
4036 ['struct iov_iter' has 'iov' member])
4038 ]) # LC_HAVE_IOVEC_WITH_IOV_MEMBER
4041 # LC_HAVE_CLASS_CREATE_MODULE_ARG
4043 # linux kernel v6.3-rc1-13-g1aaba11da9aa
4044 # driver core: class: remove module * from class_create()
4046 AC_DEFUN([LC_SRC_HAVE_CLASS_CREATE_MODULE_ARG], [
4047 LB2_LINUX_TEST_SRC([class_create_without_module_arg], [
4048 #include <linux/device/class.h>
4050 struct class *class __attribute__ ((unused));
4052 class = class_create("empty");
4057 AC_DEFUN([LC_HAVE_CLASS_CREATE_MODULE_ARG], [
4058 LB2_MSG_LINUX_TEST_RESULT([if 'class_create' does not have module arg],
4059 [class_create_without_module_arg], [
4060 AC_DEFINE([ll_class_create(name)],
4061 [class_create((name))],
4062 ['class_create' does not have module arg])
4064 AC_DEFINE([ll_class_create(name)],
4065 [class_create(THIS_MODULE, (name))],
4066 ['class_create' expects module arg])
4068 ]) # LC_HAVE_CLASS_CREATE_MODULE_ARG
4073 # Lustre linux kernel checks
4075 AC_DEFUN([LC_PROG_LINUX_SRC], [
4076 AS_IF([test "x$enable_gss" != xno], [
4077 LC_SRC_KEY_TYPE_INSTANTIATE_2ARGS
4078 LB2_SRC_CHECK_CONFIG_IM([CRYPTO_MD5])
4079 LB2_SRC_CHECK_CONFIG_IM([CRYPTO_SHA1])
4080 LB2_SRC_CHECK_CONFIG_IM([CRYPTO_SHA256])
4081 LB2_SRC_CHECK_CONFIG_IM([CRYPTO_SHA512])
4083 AS_IF([test "x$enable_server" != xno], [
4087 LC_SRC_CONFIG_FHANDLE
4088 LC_SRC_POSIX_ACL_CONFIG
4089 LC_SRC_HAVE_PROJECT_QUOTA
4092 LC_SRC_INVALIDATE_RANGE
4093 LC_SRC_HAVE_DIR_CONTEXT
4094 LC_SRC_D_COMPARE_5ARGS
4096 LC_SRC_PID_NS_FOR_CHILDREN
4099 LC_SRC_OLDSIZE_TRUNCATE_PAGECACHE
4100 LC_SRC_PTR_ERR_OR_ZERO_MISSING
4101 LC_SRC_HAVE_DENTRY_D_U_D_ALIAS_LIST
4102 LC_SRC_HAVE_DENTRY_D_U_D_ALIAS_HLIST
4103 LC_SRC_HAVE_DENTRY_D_CHILD
4104 LC_SRC_KIOCB_KI_LEFT
4105 LC_SRC_REGISTER_SHRINKER_RET
4108 LC_SRC_VFS_RENAME_5ARGS
4109 LC_SRC_VFS_UNLINK_3ARGS
4110 LC_SRC_HAVE_D_IS_POSITIVE
4113 LC_SRC_HAVE_BVEC_ITER
4114 LC_SRC_HAVE_TRUNCATE_IPAGES_FINAL
4115 LC_SRC_IOPS_RENAME_WITH_FLAGS
4119 LC_SRC_VFS_RENAME_6ARGS
4122 LC_SRC_DIRECTIO_USE_ITER
4123 LC_SRC_HAVE_IOV_ITER_INIT_DIRECTION
4124 LC_SRC_HAVE_IOV_ITER_TRUNCATE
4125 LC_SRC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
4126 LC_SRC_PAGECACHE_GET_PAGE
4129 LC_SRC_HAVE_INTERVAL_BLK_INTEGRITY
4130 LC_SRC_KEY_MATCH_DATA
4131 LC_SRC_HAVE_BLK_INTEGRITY_ITER
4134 LC_SRC_NFS_FILLDIR_USE_CTX
4135 LC_SRC_PERCPU_COUNTER_INIT
4138 LC_SRC_KIOCB_HAS_NBYTES
4139 LC_SRC_HAVE_DQUOT_QC_DQBLK
4140 LC_SRC_HAVE_AIO_COMPLETE
4141 LC_SRC_HAVE_IS_ROOT_INODE
4144 LC_SRC_BACKING_DEV_INFO_REMOVAL
4148 LC_SRC_HAVE___BI_CNT
4151 LC_SRC_BIO_ENDIO_USES_ONE_ARG
4152 LC_SRC_SYMLINK_OPS_USE_NAMEIDATA
4153 LC_SRC_ACCOUNT_PAGE_DIRTIED_3ARGS
4154 LC_SRC_HAVE_CRYPTO_ALLOC_SKCIPHER
4157 LC_SRC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
4158 LC_SRC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
4159 LC_SRC_HAVE_CACHE_HEAD_HLIST
4160 LC_SRC_HAVE_XATTR_HANDLER_SIMPLIFIED
4163 LC_SRC_HAVE_LOCKS_LOCK_FILE_WAIT
4164 LC_SRC_HAVE_KEY_PAYLOAD_DATA_ARRAY
4165 LC_SRC_HAVE_XATTR_HANDLER_NAME
4166 LC_SRC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL
4168 LC_SRC_HAVE_SUBMIT_BIO_2ARGS
4169 LC_SRC_HAVE_CLEAN_BDEV_ALIASES
4172 LC_SRC_HAVE_FILE_DENTRY
4175 LC_SRC_HAVE_INODE_LOCK
4176 LC_SRC_HAVE_IOP_GET_LINK
4177 LC_SRC_HAVE_IN_COMPAT_SYSCALL
4178 LC_SRC_HAVE_XATTR_HANDLER_INODE_PARAM
4179 LC_SRC_LOCK_PAGE_MEMCG
4180 LC_SRC_HAVE_DOWN_WRITE_KILLABLE
4185 LC_SRC_DIRECTIO_2ARGS
4186 LC_SRC_GENERIC_WRITE_SYNC_2ARGS
4187 LC_SRC_FOP_ITERATE_SHARED
4190 LC_SRC_HAVE_POSIX_ACL_VALID_USER_NS
4191 LC_SRC_D_COMPARE_4ARGS
4192 LC_SRC_FULL_NAME_HASH_3ARGS
4193 LC_SRC_STRUCT_POSIX_ACL_XATTR
4197 LC_SRC_GROUP_INFO_GID
4199 LC_SRC_POSIX_ACL_UPDATE_MODE
4200 LC_SRC_HAVE_BDI_IO_PAGES
4203 LC_SRC_IOP_GENERIC_READLINK
4204 LC_SRC_HAVE_VM_FAULT_ADDRESS
4207 LC_SRC_INODEOPS_ENHANCED_GETATTR
4208 LC_SRC_VM_OPERATIONS_REMOVE_VMF_ARG
4209 LC_SRC_HAVE_KEY_USAGE_REFCOUNT
4210 LC_SRC_HAVE_CRYPTO_MAX_ALG_NAME_128
4211 LC_SRC_HAVE_FSMAP_HEADER
4215 LC_SRC_SUPER_SETUP_BDI_NAME
4219 LC_SRC_HAVE_GET_INODE_USAGE
4222 LC_SRC_PAGEVEC_INIT_ONE_PARAM
4224 LC_SRC_INTERVAL_TREE_CACHED
4228 LC_SRC_VM_FAULT_RETRY
4232 LC_SRC_INODE_TIMESPEC64
4233 LC_SRC_ALLOC_FILE_PSEUDO
4236 LC_SRC_RADIX_TREE_TAG_SET
4237 LC_SRC_UAPI_LINUX_MOUNT_H
4238 LC_SRC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
4241 LC_SRC_GENL_FAMILY_HAS_RESV_START_OP
4244 LC_SRC_HAVE_BVEC_ITER_ALL
4247 LC_SRC_KEYRING_SEARCH_4ARGS
4250 LC_SRC_BIO_BI_PHYS_SEGMENTS
4251 LC_SRC_LM_COMPARE_OWNER_EXISTS
4254 LC_SRC_FSCRYPT_DIGESTED_NAME
4257 LC_SRC_FSCRYPT_DUMMY_CONTEXT_ENABLED
4260 LC_SRC_HAVE_KTHREAD_USE_MM
4263 LC_SRC_FSCRYPT_FNAME_ALLOC_BUFFER
4264 LC_SRC_FSCRYPT_SET_CONTEXT
4265 LC_SRC_FSCRYPT_NOKEY_NAME
4266 LC_SRC_FSCRYPT_SET_TEST_DUMMY_ENC_CHAR_ARG
4267 LC_SRC_FSCRYPT_DUMMY_POLICY
4268 LC_SRC_HAVE_ITER_FILE_SPLICE_WRITE
4271 LC_SRC_HAVE_BDI_DEBUG_STATS
4272 LC_SRC_FSCRYPT_IS_NOKEY_NAME
4273 LC_SRC_FSCRYPT_PREPARE_READDIR
4279 LC_SRC_HAVE_USER_NAMESPACE_ARG
4282 LC_SRC_HAVE_COPY_PAGE_FROM_ITER_ATOMIC
4283 LC_SRC_HAVE_FILEATTR_GET
4286 LC_SRC_HAVE_GET_ACL_RCU_ARG
4287 LC_SRC_HAVE_FAULT_IN_IOV_ITER_READABLE
4290 LC_SRC_HAVE_SECURITY_DENTRY_INIT_WITH_XATTR_NAME_ARG
4291 LC_SRC_HAVE_KIOCB_COMPLETE_2ARGS
4294 LC_SRC_HAVE_INVALIDATE_FOLIO
4295 LC_SRC_HAVE_DIRTY_FOLIO
4298 LC_SRC_HAVE_ALLOC_INODE_SB
4301 LC_SRC_GRAB_CACHE_PAGE_WRITE_BEGIN_WITH_FLAGS
4302 LC_SRC_HAVE_ADDRESS_SPACE_OPERATIONS_READ_FOLIO
4303 LC_SRC_HAVE_READ_CACHE_PAGE_FILLER_WITH_FILE
4304 LC_SRC_HAVE_ADDRESS_SPACE_OPERATIONS_RELEASE_FOLIO
4305 LC_SRC_HAVE_LSMCONTEXT_INIT
4306 LC_SRC_SECURITY_DENTRY_INIT_SECURTY_WITH_CTX
4309 LC_SRC_HAVE_NO_LLSEEK
4310 LC_SRC_DQUOT_TRANSFER_WITH_USER_NS
4311 LC_SRC_HAVE_ADDRESS_SPACE_OPERATIONS_MIGRATE_FOLIO
4312 LC_SRC_REGISTER_SHRINKER_FORMAT_NAMED
4313 LC_SRC_HAVE_VFS_SETXATTR_NON_CONST_VALUE
4314 LC_SRC_HAVE_IOV_ITER_GET_PAGES_ALLOC2
4317 LC_SRC_HAVE_GET_RANDOM_U32_AND_U64
4318 LC_SRC_NFS_FILLDIR_USE_CTX_RETURN_BOOL
4319 LC_SRC_HAVE_FILEMAP_GET_FOLIOS_CONTIG
4322 LC_SRC_HAVE_GET_RANDOM_U32_BELOW
4323 LC_SRC_HAVE_ACL_WITH_DENTRY
4326 LC_SRC_HAVE_MNT_IDMAP_ARG
4327 LC_SRC_HAVE_LOCKS_LOCK_FILE_WAIT_IN_FILELOCK
4328 LC_SRC_HAVE_U64_CAPABILITY
4331 LC_SRC_HAVE_IOV_ITER_IOVEC
4332 LC_SRC_HAVE_IOVEC_WITH_IOV_MEMBER
4333 LC_SRC_HAVE_CLASS_CREATE_MODULE_ARG
4335 # kernel patch to extend integrity interface
4336 LC_SRC_BIO_INTEGRITY_PREP_FN
4339 AC_DEFUN([LC_PROG_LINUX_RESULTS], [
4340 AS_IF([test "x$enable_gss" != xno], [
4341 LC_KEY_TYPE_INSTANTIATE_2ARGS
4343 LB2_TEST_CHECK_CONFIG_IM([CRYPTO_MD5], [],
4345 [kernel MD5 support is recommended by using GSS.])])
4346 LB2_TEST_CHECK_CONFIG_IM([CRYPTO_SHA1], [],
4348 [kernel SHA1 support is recommended by using GSS.])])
4349 LB2_TEST_CHECK_CONFIG_IM([CRYPTO_SHA256], [],
4351 [kernel SHA256 support is recommended by using GSS.])])
4352 LB2_TEST_CHECK_CONFIG_IM([CRYPTO_SHA512], [],
4354 [kernel SHA512 support is recommended by using GSS.])])
4356 AS_IF([test "x$enable_server" != xno], [
4362 LC_HAVE_PROJECT_QUOTA
4369 LC_HAVE_DENTRY_D_U_D_ALIAS_LIST
4370 LC_HAVE_DENTRY_D_U_D_ALIAS_HLIST
4371 LC_HAVE_DENTRY_D_CHILD
4372 LC_PID_NS_FOR_CHILDREN
4375 LC_OLDSIZE_TRUNCATE_PAGECACHE
4376 LC_PTR_ERR_OR_ZERO_MISSING
4378 LC_REGISTER_SHRINKER_RET
4383 LC_HAVE_D_IS_POSITIVE
4387 LC_HAVE_TRUNCATE_IPAGES_FINAL
4388 LC_IOPS_RENAME_WITH_FLAGS
4395 LC_DIRECTIO_USE_ITER
4396 LC_HAVE_IOV_ITER_INIT_DIRECTION
4397 LC_HAVE_IOV_ITER_TRUNCATE
4398 LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
4399 LC_PAGECACHE_GET_PAGE
4402 LC_HAVE_INTERVAL_BLK_INTEGRITY
4404 LC_HAVE_BLK_INTEGRITY_ITER
4407 LC_PERCPU_COUNTER_INIT
4408 LC_NFS_FILLDIR_USE_CTX
4412 LC_HAVE_DQUOT_QC_DQBLK
4413 LC_HAVE_AIO_COMPLETE
4414 LC_HAVE_IS_ROOT_INODE
4417 LC_BACKING_DEV_INFO_REMOVAL
4424 LC_BIO_ENDIO_USES_ONE_ARG
4425 LC_SYMLINK_OPS_USE_NAMEIDATA
4426 LC_ACCOUNT_PAGE_DIRTIED_3ARGS
4427 LC_HAVE_CRYPTO_ALLOC_SKCIPHER
4430 LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
4431 LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
4432 LC_HAVE_CACHE_HEAD_HLIST
4433 LC_HAVE_XATTR_HANDLER_SIMPLIFIED
4436 LC_HAVE_LOCKS_LOCK_FILE_WAIT
4437 LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
4438 LC_HAVE_XATTR_HANDLER_NAME
4440 LC_HAVE_SUBMIT_BIO_2ARGS
4441 LC_HAVE_CLEAN_BDEV_ALIASES
4448 LC_HAVE_IOP_GET_LINK
4451 LC_HAVE_IN_COMPAT_SYSCALL
4452 LC_HAVE_XATTR_HANDLER_INODE_PARAM
4454 LC_HAVE_DOWN_WRITE_KILLABLE
4460 LC_GENERIC_WRITE_SYNC_2ARGS
4461 LC_FOP_ITERATE_SHARED
4464 LC_HAVE_POSIX_ACL_VALID_USER_NS
4466 LC_FULL_NAME_HASH_3ARGS
4467 LC_STRUCT_POSIX_ACL_XATTR
4473 LC_POSIX_ACL_UPDATE_MODE
4474 LC_HAVE_BDI_IO_PAGES
4477 LC_IOP_GENERIC_READLINK
4478 LC_HAVE_VM_FAULT_ADDRESS
4481 LC_INODEOPS_ENHANCED_GETATTR
4482 LC_VM_OPERATIONS_REMOVE_VMF_ARG
4483 LC_HAVE_KEY_USAGE_REFCOUNT
4484 LC_HAVE_CRYPTO_MAX_ALG_NAME_128
4485 LC_HAVE_FSMAP_HEADER
4489 LC_SUPER_SETUP_BDI_NAME
4493 LC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL
4494 LC_HAVE_GET_INODE_USAGE
4497 LC_PAGEVEC_INIT_ONE_PARAM
4499 LC_INTERVAL_TREE_CACHED
4507 LC_ALLOC_FILE_PSEUDO
4511 LC_RADIX_TREE_TAG_SET
4512 LC_UAPI_LINUX_MOUNT_H
4513 LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
4516 LC_GENL_FAMILY_HAS_RESV_START_OP
4519 LC_HAVE_BVEC_ITER_ALL
4522 LC_KEYRING_SEARCH_4ARGS
4525 LC_BIO_BI_PHYS_SEGMENTS
4526 LC_HAVE_FLUSH_DELAYED_FPUT
4527 LC_LM_COMPARE_OWNER_EXISTS
4530 LC_FSCRYPT_DIGESTED_NAME
4533 LC_FSCRYPT_DUMMY_CONTEXT_ENABLED
4536 LC_HAVE_KTHREAD_USE_MM
4539 LC_HAVE_ITER_FILE_SPLICE_WRITE
4542 LC_FSCRYPT_FNAME_ALLOC_BUFFER
4543 LC_FSCRYPT_SET_CONTEXT
4544 LC_FSCRYPT_D_REVALIDATE
4545 LC_FSCRYPT_NOKEY_NAME
4546 LC_FSCRYPT_SET_TEST_DUMMY_ENC_CHAR_ARG
4547 LC_FSCRYPT_DUMMY_POLICY
4550 LC_HAVE_BDI_DEBUG_STATS
4551 LC_FSCRYPT_IS_NOKEY_NAME
4552 LC_FSCRYPT_PREPARE_READDIR
4558 LC_HAVE_USER_NAMESPACE_ARG
4561 LC_HAVE_FILEATTR_GET
4562 LC_HAVE_COPY_PAGE_FROM_ITER_ATOMIC
4565 LC_HAVE_GET_ACL_RCU_ARG
4568 LC_HAVE_GET_ACL_RCU_ARG
4569 LC_HAVE_INVALIDATE_LOCK
4570 LC_HAVE_FAULT_IN_IOV_ITER_READABLE
4573 LC_HAVE_SECURITY_DENTRY_INIT_WITH_XATTR_NAME_ARG
4574 LC_HAVE_KIOCB_COMPLETE_2ARGS
4575 LC_EXPORTS_DELETE_FROM_PAGE_CACHE
4579 LC_HAVE_INVALIDATE_FOLIO
4583 LC_HAVE_ALLOC_INODE_SB
4586 LC_GRAB_CACHE_PAGE_WRITE_BEGIN_WITH_FLAGS
4587 LC_HAVE_ADDRESS_SPACE_OPERATIONS_READ_FOLIO
4588 LC_HAVE_READ_CACHE_PAGE_FILLER_WITH_FILE
4589 LC_HAVE_ADDRESS_SPACE_OPERATIONS_RELEASE_FOLIO
4590 LC_HAVE_LSMCONTEXT_INIT
4591 LC_SECURITY_DENTRY_INIT_SECURTY_WITH_CTX
4595 LC_DQUOT_TRANSFER_WITH_USER_NS
4596 LC_HAVE_ADDRESS_SPACE_OPERATIONS_MIGRATE_FOLIO
4597 LC_REGISTER_SHRINKER_FORMAT_NAMED
4598 LC_HAVE_VFS_SETXATTR_NON_CONST_VALUE
4599 LC_HAVE_IOV_ITER_GET_PAGES_ALLOC2
4602 LC_HAVE_GET_RANDOM_U32_AND_U64
4603 LC_NFS_FILLDIR_USE_CTX_RETURN_BOOL
4604 LC_HAVE_FILEMAP_GET_FOLIOS_CONTIG
4607 LC_HAVE_GET_RANDOM_U32_BELOW
4608 LC_HAVE_ACL_WITH_DENTRY
4611 LC_HAVE_MNT_IDMAP_ARG
4612 LC_HAVE_LOCKS_LOCK_FILE_WAIT_IN_FILELOCK
4613 LC_HAVE_U64_CAPABILITY
4616 LC_HAVE_IOV_ITER_IOVEC
4617 LC_HAVE_IOVEC_WITH_IOV_MEMBER
4618 LC_HAVE_CLASS_CREATE_MODULE_ARG
4620 # kernel patch to extend integrity interface
4621 LC_BIO_INTEGRITY_PREP_FN
4627 # Lustre linux kernel checks
4629 AC_DEFUN([LC_PROG_LINUX], [
4630 AC_MSG_NOTICE([Lustre kernel checks
4631 ==============================================================================])
4636 LC_CONFIG_LRU_RESIZE
4639 LC_GLIBC_SUPPORT_FHANDLES
4640 LC_GLIBC_SUPPORT_COPY_FILE_RANGE
4644 # 4.1.0 - Check export
4645 LC_HAVE_SYNC_READ_WRITE
4647 # 4.8 - Check export
4648 LC_EXPORT_DEFAULT_FILE_SPLICE_READ
4650 # 5.2 - Check export
4651 LC_ACCOUNT_PAGE_DIRTIED
4658 # Check whether to build the client side of Lustre
4660 AC_DEFUN([LC_CONFIG_CLIENT], [
4661 AC_MSG_CHECKING([whether to build Lustre client support])
4662 AC_ARG_ENABLE([client],
4663 AS_HELP_STRING([--disable-client],
4664 [disable Lustre client support]),
4665 [], [enable_client="yes"])
4666 AC_MSG_RESULT([$enable_client])
4667 ]) # LC_CONFIG_CLIENT
4672 AC_DEFUN([LB_CONFIG_MPITESTS], [
4673 AC_ARG_ENABLE([mpitests],
4674 AS_HELP_STRING([--enable-mpitests=<yes|no|mpicc wrapper>],
4675 [include mpi tests]), [
4676 enable_mpitests="yes"
4679 MPICC_WRAPPER="mpicc"
4680 MPI_BIN=$(eval which $MPICC_WRAPPER | xargs dirname)
4683 enable_mpitests="no"
4687 MPICC_WRAPPER=$enableval
4688 MPI_BIN=$(eval echo $MPICC_WRAPPER | xargs dirname)
4692 enable_mpitests="yes"
4693 MPICC_WRAPPER="mpicc"
4694 MPI_BIN=$(eval which $MPICC_WRAPPER | xargs dirname)
4697 if test "x$enable_mpitests" != "xno"; then
4700 AC_CACHE_CHECK([whether mpitests can be built],
4701 lb_cv_mpi_tests, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([
4705 MPI_Initialized(&flag);
4708 ])], [lb_cv_mpi_tests="yes"], [lb_cv_mpi_tests="no"])
4710 enable_mpitests=$lb_cv_mpi_tests
4714 AC_SUBST(MPICC_WRAPPER)
4715 ]) # LB_CONFIG_MPITESTS
4720 # whether to enable quota support global control
4722 AC_DEFUN([LC_ENABLE_QUOTA], [
4723 AC_MSG_CHECKING([whether to enable quota support global control])
4724 AC_ARG_ENABLE([quota],
4725 AS_HELP_STRING([--enable-quota],
4726 [enable quota support]),
4727 [], [enable_quota="yes"])
4728 AS_IF([test "x$enable_quota" = xyes],
4729 [AC_MSG_RESULT([yes])],
4730 [AC_MSG_RESULT([no])])
4731 ]) # LC_ENABLE_QUOTA
4736 AC_DEFUN([LC_QUOTA], [
4740 AS_IF([test "x$enable_quota" != xno -a "x$enable_utils" != xno], [
4741 AC_CHECK_HEADER([sys/quota.h],
4742 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1,
4743 [Define to 1 if you have <sys/quota.h>.])],
4744 [AC_MSG_ERROR([did not find <sys/quota.h> on your system])])
4751 # configure support for optional OSD implementation
4753 AC_DEFUN([LC_OSD_ADDON], [
4754 AC_MSG_CHECKING([whether to use OSD addon])
4756 AS_HELP_STRING([--with-osd=path],
4757 [set path to optional osd]),
4764 OSDADDON="$with_osd"
4771 AS_IF([test $ENABLEOSDADDON -eq 0], [
4775 OSDMODNAME=$(basename $OSDADDON)
4776 AS_IF([test -e $LUSTRE/$OSDMODNAME], [
4777 AC_MSG_RESULT([cannot link])
4779 ], [ln -s $OSDADDON $LUSTRE/$OSDMODNAME], [
4780 AC_MSG_RESULT([$OSDMODNAME])
4781 OSDADDON="obj-m += $OSDMODNAME/"
4783 AC_MSG_RESULT([cannot link])
4793 # Check whether to enable Lustre client crypto
4795 AC_DEFUN([LC_CONFIG_CRYPTO], [
4796 AC_MSG_CHECKING([whether to enable Lustre client crypto])
4797 AC_ARG_ENABLE([crypto],
4798 AS_HELP_STRING([--enable-crypto=yes|no|in-kernel],
4799 [enable Lustre client crypto (default is yes), use 'in-kernel' to force use of in-kernel fscrypt instead of embedded llcrypt]),
4800 [], [enable_crypto="auto"])
4801 AS_IF([test "x$enable_crypto" != xno -a "x$enable_dist" = xno], [
4805 LC_FSCRYPT_SUPPORT])
4806 AS_IF([test "x$enable_crypto" = xin-kernel], [
4807 AS_IF([test "x$has_fscrypt_support" = xyes], [
4808 AC_DEFINE(HAVE_LUSTRE_CRYPTO, 1, [Enable Lustre client crypto via in-kernel fscrypt])], [
4809 AC_MSG_ERROR([Lustre client crypto cannot be enabled via in-kernel fscrypt.])
4810 enable_crypto=no])],
4811 [AS_IF([test "x$has_is_encrypted" = xyes], [
4812 AC_DEFINE(HAVE_LUSTRE_CRYPTO, 1, [Enable Lustre client crypto via embedded llcrypt])
4813 AC_DEFINE(CONFIG_LL_ENCRYPTION, 1, [embedded llcrypt])
4814 AC_DEFINE(HAVE_FSCRYPT_DUMMY_CONTEXT_ENABLED, 1, [embedded llcrypt uses llcrypt_dummy_context_enabled()])
4815 enable_crypto="embedded-llcrypt"
4816 enable_llcrypt=yes], [
4817 AS_IF([test "x$enable_crypto" = xyes],
4818 [AC_MSG_ERROR([Lustre client crypto cannot be enabled because of lack of encryption support in your kernel.])])
4819 AS_IF([test "x$enable_crypto" != xno -a "x$enable_dist" = xno],
4820 [AC_MSG_WARN(Lustre client crypto cannot be enabled because of lack of encryption support in your kernel.)])
4821 enable_crypto=no])])
4822 AS_IF([test "x$enable_dist" != xno], [
4824 enable_llcrypt=yes])
4825 AC_MSG_RESULT([$enable_crypto])
4826 ]) # LC_CONFIG_CRYPTO
4831 # other configure checks
4833 AC_DEFUN([LC_CONFIGURE], [
4834 AC_MSG_NOTICE([Lustre core checks
4835 ==============================================================================])
4837 # maximum MDS thread count
4840 # lustre/utils/gss/gss_util.c
4841 # lustre/utils/llog_reader.c
4842 # lustre/utils/create_iam.c
4843 # lustre/utils/libiam.c
4844 AC_CHECK_HEADERS([netdb.h endian.h])
4846 # lustre/utils/llverfs.c lustre/utils/libmount_utils_ldiskfs.c
4847 AC_CHECK_HEADERS([ext2fs/ext2fs.h], [], [
4848 AS_IF([test "x$enable_utils" = xyes -a "x$enable_ldiskfs" = xyes], [
4850 ext2fs.h not found. Please install e2fsprogs development package.
4855 # lustre/tests/statx_test.c
4856 AC_CHECK_FUNCS([statx])
4858 # lustre/utils/lfs.c
4859 AS_IF([test "$enable_dist" = "no"], [
4860 AC_CHECK_LIB([z], [crc32], [
4861 AC_CHECK_HEADER([zlib.h], [], [
4862 AC_MSG_ERROR([zlib.h not found.])])
4865 zlib library not found. Please install zlib development package.])
4871 AC_CHECK_LIB([selinux], [is_selinux_enabled],
4872 [AC_CHECK_HEADERS([selinux/selinux.h],
4873 [SELINUX="-lselinux"
4874 AC_DEFINE([HAVE_SELINUX], 1,
4875 [support for selinux ])],
4878 No libselinux-devel package found, unable to build selinux enabled tools
4883 No selinux package found, unable to build selinux enabled tools
4888 AC_CHECK_LIB([keyutils], [add_key])
4891 AC_MSG_CHECKING([whether to report minimum OST free space])
4892 AC_ARG_ENABLE([mindf],
4893 AS_HELP_STRING([--enable-mindf],
4894 [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
4895 [], [enable_mindf="no"])
4896 AC_MSG_RESULT([$enable_mindf])
4897 AS_IF([test "$enable_mindf" = "yes"], [
4898 AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])
4899 AC_SUBST(ENABLE_MINDF, yes)
4901 AC_SUBST(ENABLE_MINDF, no)
4904 AC_MSG_CHECKING([whether to randomly failing memory alloc])
4905 AC_ARG_ENABLE([fail_alloc],
4906 AS_HELP_STRING([--disable-fail-alloc],
4907 [disable randomly alloc failure]),
4908 [], [enable_fail_alloc="yes"])
4909 AC_MSG_RESULT([$enable_fail_alloc])
4910 AS_IF([test "x$enable_fail_alloc" != xno], [
4911 AC_DEFINE([RANDOM_FAIL_ALLOC], 1, [enable randomly alloc failure])
4912 AC_SUBST(ENABLE_FAIL_ALLOC, yes)
4914 AC_SUBST(ENABLE_FAIL_ALLOC, no)
4917 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
4918 AC_ARG_ENABLE([invariants],
4919 AS_HELP_STRING([--enable-invariants],
4920 [enable invariant checking (cpu intensive)]),
4921 [], [enable_invariants="no"])
4922 AC_MSG_RESULT([$enable_invariants])
4923 AS_IF([test "x$enable_invariants" = xyes], [
4924 AC_DEFINE([CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK], 1,
4925 [enable invariant checking])
4926 AC_SUBST(ENABLE_INVARIANTS, yes)
4928 AC_SUBST(ENABLE_INVARIANTS, no)
4931 AC_MSG_CHECKING([whether to track references with lu_ref])
4932 AC_ARG_ENABLE([lu_ref],
4933 AS_HELP_STRING([--enable-lu_ref],
4934 [enable lu_ref reference tracking code]),
4935 [], [enable_lu_ref="no"])
4936 AC_MSG_RESULT([$enable_lu_ref])
4937 AS_IF([test "x$enable_lu_ref" = xyes], [
4938 AC_DEFINE([CONFIG_LUSTRE_DEBUG_LU_REF], 1,
4939 [enable lu_ref reference tracking code])
4940 AC_SUBST(ENABLE_LU_REF, yes)
4942 AC_SUBST(ENABLE_LU_REF, no)
4945 AC_MSG_CHECKING([whether to enable page state tracking])
4946 AC_ARG_ENABLE([pgstate-track],
4947 AS_HELP_STRING([--enable-pgstate-track],
4948 [enable page state tracking]),
4949 [], [enable_pgstat_track="no"])
4950 AC_MSG_RESULT([$enable_pgstat_track])
4951 AS_IF([test "x$enable_pgstat_track" = xyes], [
4952 AC_DEFINE([CONFIG_DEBUG_PAGESTATE_TRACKING], 1,
4953 [enable page state tracking code])
4954 AC_SUBST(ENABLE_PGSTAT_TRACK, yes)
4956 AC_SUBST(ENABLE_PGSTAT_TRACK, no)
4960 AC_MSG_CHECKING([systemd unit file directory])
4961 AC_ARG_WITH([systemdsystemunitdir],
4962 [AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
4963 [Directory for systemd service files])],
4964 [], [with_systemdsystemunitdir=auto])
4965 AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"],
4966 [def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
4967 AS_IF([test "x$def_systemdsystemunitdir" = "x"],
4968 [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
4969 [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
4970 with_systemdsystemunitdir=no],
4971 [with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
4972 AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
4973 [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
4974 AC_MSG_RESULT([$with_systemdsystemunitdir])
4976 AC_MSG_CHECKING([bash-completion directory])
4977 AC_ARG_WITH([bash-completion-dir],
4978 AS_HELP_STRING([--with-bash-completion-dir[=PATH]],
4979 [Install the bash auto-completion script in this directory.]),
4981 [with_bash_completion_dir=yes])
4982 AS_IF([test "x$with_bash_completion_dir" = "xyes"], [
4983 BASH_COMPLETION_DIR="`pkg-config --variable=completionsdir bash-completion`"
4984 AS_IF([test "x$BASH_COMPLETION_DIR" = "x"], [
4985 [BASH_COMPLETION_DIR="/usr/share/bash-completion/completions"]
4988 BASH_COMPLETION_DIR="$with_bash_completion_dir"
4990 AC_SUBST([BASH_COMPLETION_DIR])
4991 AC_MSG_RESULT([$BASH_COMPLETION_DIR])
4997 # AM_CONDITIONALS for lustre
4999 AC_DEFUN([LC_CONDITIONALS], [
5000 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
5001 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
5002 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
5003 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
5004 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
5005 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
5006 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
5007 AM_CONDITIONAL(GSS_SSK, test x$enable_ssk = xyes)
5008 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
5009 AM_CONDITIONAL(HAVE_SYSTEMD, test "x$with_systemdsystemunitdir" != "xno")
5010 AM_CONDITIONAL(ENABLE_BASH_COMPLETION, test "x$with_bash_completion_dir" != "xno")
5011 AM_CONDITIONAL(XATTR_HANDLER, test "x$lb_cv_compile_xattr_handler_flags" = xyes)
5012 AM_CONDITIONAL(SELINUX, test "$SELINUX" = "-lselinux")
5013 AM_CONDITIONAL(GETSEPOL, test x$enable_getsepol = xyes)
5014 AM_CONDITIONAL(LLCRYPT, test x$enable_llcrypt = xyes)
5015 AM_CONDITIONAL(LIBAIO, test x$enable_libaio = xyes)
5016 ]) # LC_CONDITIONALS
5021 # files that should be generated with AC_OUTPUT
5023 AC_DEFUN([LC_CONFIG_FILES],
5027 lustre/autoconf/Makefile
5028 lustre/conf/Makefile
5029 lustre/conf/resource/Makefile
5031 lustre/include/Makefile
5032 lustre/include/lustre/Makefile
5033 lustre/include/uapi/linux/lustre/Makefile
5034 lustre/kernel_patches/targets/5.14-rhel9.3.target
5035 lustre/kernel_patches/targets/5.14-rhel9.2.target
5036 lustre/kernel_patches/targets/5.14-rhel9.1.target
5037 lustre/kernel_patches/targets/5.14-rhel9.0.target
5038 lustre/kernel_patches/targets/4.18-rhel8.9.target
5039 lustre/kernel_patches/targets/4.18-rhel8.8.target
5040 lustre/kernel_patches/targets/4.18-rhel8.7.target
5041 lustre/kernel_patches/targets/4.18-rhel8.6.target
5042 lustre/kernel_patches/targets/4.18-rhel8.5.target
5043 lustre/kernel_patches/targets/4.18-rhel8.4.target
5044 lustre/kernel_patches/targets/4.18-rhel8.3.target
5045 lustre/kernel_patches/targets/4.18-rhel8.2.target
5046 lustre/kernel_patches/targets/4.18-rhel8.1.target
5047 lustre/kernel_patches/targets/4.18-rhel8.target
5048 lustre/kernel_patches/targets/3.10-rhel7.9.target
5049 lustre/kernel_patches/targets/3.10-rhel7.8.target
5050 lustre/kernel_patches/targets/3.10-rhel7.7.target
5051 lustre/kernel_patches/targets/3.10-rhel7.6.target
5052 lustre/kernel_patches/targets/3.10-rhel7.5.target
5053 lustre/kernel_patches/targets/4.14-rhel7.5.target
5054 lustre/kernel_patches/targets/4.14-rhel7.6.target
5055 lustre/kernel_patches/targets/4.12-sles12sp4.target
5056 lustre/kernel_patches/targets/4.12-sles12sp5.target
5057 lustre/kernel_patches/targets/4.12-sles15sp1.target
5058 lustre/kernel_patches/targets/5.3-sles15sp2.target
5059 lustre/kernel_patches/targets/5.3-sles15sp3.target
5060 lustre/kernel_patches/targets/5.14-sles15sp4.target
5061 lustre/kernel_patches/targets/5.14-sles15sp5.target
5062 lustre/kernel_patches/targets/3.x-fc18.target
5063 lustre/kernel_patches/targets/5.10-oe2203.target
5064 lustre/kernel_patches/targets/5.10-oe2203sp1.target
5065 lustre/kernel_patches/targets/5.10-oe2203sp2.target
5066 lustre/ldlm/Makefile
5067 lustre/ldlm/autoMakefile
5068 lustre/ec/autoMakefile
5071 lustre/fid/autoMakefile
5072 lustre/llite/Makefile
5073 lustre/llite/autoMakefile
5075 lustre/lov/autoMakefile
5077 lustre/mdc/autoMakefile
5079 lustre/lmv/autoMakefile
5080 lustre/lfsck/Makefile
5081 lustre/lfsck/autoMakefile
5083 lustre/mdt/autoMakefile
5085 lustre/mdd/autoMakefile
5087 lustre/fld/autoMakefile
5088 lustre/obdclass/Makefile
5089 lustre/obdclass/autoMakefile
5090 lustre/obdecho/Makefile
5091 lustre/obdecho/autoMakefile
5093 lustre/ofd/autoMakefile
5095 lustre/osc/autoMakefile
5097 lustre/ost/autoMakefile
5098 lustre/osd-ldiskfs/Makefile
5099 lustre/osd-ldiskfs/autoMakefile
5100 lustre/osd-zfs/Makefile
5101 lustre/osd-zfs/autoMakefile
5103 lustre/mgc/autoMakefile
5105 lustre/mgs/autoMakefile
5106 lustre/target/Makefile
5107 lustre/target/autoMakefile
5108 lustre/ptlrpc/Makefile
5109 lustre/ptlrpc/autoMakefile
5110 lustre/ptlrpc/gss/Makefile
5111 lustre/ptlrpc/gss/autoMakefile
5112 lustre/quota/Makefile
5113 lustre/quota/autoMakefile
5114 lustre/scripts/Makefile
5115 lustre/scripts/systemd/Makefile
5116 lustre/tests/Makefile
5117 lustre/tests/mpi/Makefile
5118 lustre/tests/iabf/Makefile
5119 lustre/tests/lutf/Makefile
5120 lustre/tests/lutf/src/Makefile
5121 lustre/kunit/Makefile
5122 lustre/kunit/autoMakefile
5123 lustre/utils/Makefile
5124 lustre/utils/gss/Makefile
5126 lustre/osp/autoMakefile
5128 lustre/lod/autoMakefile
5130 ]) # LC_CONFIG_FILES