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], [
73 CFLAGS="$CFLAGS -Werror"
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 AC_DEFUN([LC_IOC_REMOVE_ENTRY], [
99 CFLAGS="$CFLAGS -Werror"
100 AC_MSG_CHECKING([if ioctl IOC_REMOVE_ENTRY' is supported])
101 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
102 #include <sys/ioctl.h>
103 #include <linux/lustre/lustre_ioctl.h>
106 return ioctl(0, LL_IOC_REMOVE_ENTRY, NULL);
109 AC_DEFINE(HAVE_IOC_REMOVE_ENTRY, 1,
110 [IOC_REMOVE_ENTRY ioctl exists])
115 CFLAGS="$saved_flags"
116 ]) # LC_IOC_REMOVE_ENTRY
121 # Ensure the stack size is at least 8k in Lustre server (all kernels)
123 AC_DEFUN([LC_STACK_SIZE], [
124 LB_CHECK_COMPILE([if stack size is at least 8k],
126 #include <linux/thread_info.h>
128 #if THREAD_SIZE < 8192
129 #error "stack size < 8192"
131 ], [], [AC_MSG_ERROR([
133 Lustre requires that Linux is configured with at least a 8KB stack.
140 # Allow the user to set the MDS thread upper limit
142 AC_DEFUN([LC_MDS_MAX_THREADS], [
143 AC_MSG_CHECKING([for maximum number of MDS threads])
144 AC_ARG_WITH([mds_max_threads],
145 AS_HELP_STRING([--with-mds-max-threads=count],
146 [maximum threads available on the MDS: (default=512)]),
147 [AC_DEFINE_UNQUOTED(MDS_MAX_THREADS, $with_mds_max_threads,
148 [maximum number of MDS threads])])
149 AC_MSG_RESULT([$with_mds_max_threads])
150 ]) # LC_MDS_MAX_THREADS
155 # the pinger is temporary, until we have the recovery node in place
157 AC_DEFUN([LC_CONFIG_PINGER], [
158 AC_MSG_CHECKING([whether to enable Lustre pinger support])
159 AC_ARG_ENABLE([pinger],
160 AS_HELP_STRING([--disable-pinger],
161 [disable recovery pinger support]),
162 [], [enable_pinger="yes"])
163 AC_MSG_RESULT([$enable_pinger])
164 AS_IF([test "x$enable_pinger" != xno],
165 [AC_DEFINE(CONFIG_LUSTRE_FS_PINGER, 1,[Use the Pinger])])
166 ]) # LC_CONFIG_PINGER
171 # do checksum of bulk data between client and OST
173 AC_DEFUN([LC_CONFIG_CHECKSUM], [
174 AC_MSG_CHECKING([whether to enable data checksum support])
175 AC_ARG_ENABLE([checksum],
176 AS_HELP_STRING([--disable-checksum],
177 [disable data checksum support]),
178 [], [enable_checksum="yes"])
179 AC_MSG_RESULT([$enable_checksum])
180 AS_IF([test "x$enable_checksum" != xno],
181 [AC_DEFINE(ENABLE_CHECKSUM, 1, [do data checksums])])
182 ]) # LC_CONFIG_CHECKSUM
187 # enable distributed flock by default
189 AC_DEFUN([LC_CONFIG_FLOCK], [
190 AC_MSG_CHECKING([whether to enable flock by default])
191 AC_ARG_ENABLE([flock],
192 AS_HELP_STRING([--disable-flock],
193 [disable flock by default]),
194 [], [enable_flock="yes"])
195 AC_MSG_RESULT([$enable_flock])
196 AS_IF([test "x$enable_flock" != xno],
197 [AC_DEFINE(ENABLE_FLOCK, 1, [enable flock by default])])
201 # LC_CONFIG_HEALTH_CHECK_WRITE
203 # Turn off the actual write to the disk
205 AC_DEFUN([LC_CONFIG_HEALTH_CHECK_WRITE], [
206 AC_MSG_CHECKING([whether to enable a write with the health check])
207 AC_ARG_ENABLE([health_write],
208 AS_HELP_STRING([--enable-health_write],
209 [enable disk writes when doing health check]),
210 [], [enable_health_write="no"])
211 AC_MSG_RESULT([$enable_health_write])
212 AS_IF([test "x$enable_health_write" != xno],
213 [AC_DEFINE(USE_HEALTH_CHECK_WRITE, 1, [Write when Checking Health])])
214 ]) # LC_CONFIG_HEALTH_CHECK_WRITE
217 # LC_CONFIG_LRU_RESIZE
219 AC_DEFUN([LC_CONFIG_LRU_RESIZE], [
220 AC_MSG_CHECKING([whether to enable lru self-adjusting])
221 AC_ARG_ENABLE([lru_resize],
222 AS_HELP_STRING([--enable-lru-resize],
223 [enable lru resize support]),
224 [], [enable_lru_resize="yes"])
225 AC_MSG_RESULT([$enable_lru_resize])
226 AS_IF([test "x$enable_lru_resize" != xno],
227 [AC_DEFINE(HAVE_LRU_RESIZE_SUPPORT, 1, [Enable lru resize support])])
228 ]) # LC_CONFIG_LRU_RESIZE
233 # Quota support. The kernel must support CONFIG_QUOTA.
235 AC_DEFUN([LC_QUOTA_CONFIG], [
236 LB_CHECK_CONFIG_IM([QUOTA], [],
239 Lustre quota requires that CONFIG_QUOTA is enabled in your kernel.
246 # fhandle kernel support for open_by_handle_at() and name_to_handle_at()
247 # system calls. The kernel must support CONFIG_FHANDLE.
249 AC_DEFUN([LC_CONFIG_FHANDLE], [
250 LB_CHECK_CONFIG_IM([FHANDLE], [],
253 Lustre fid handling requires that CONFIG_FHANDLE is enabled in your kernel.
255 ]) # LC_CONFIG_FHANDLE
258 # LC_POSIX_ACL_CONFIG
262 AC_DEFUN([LC_POSIX_ACL_CONFIG], [
263 LB_CHECK_CONFIG_IM([FS_POSIX_ACL],
264 [AC_DEFINE(CONFIG_LUSTRE_FS_POSIX_ACL, 1, [Enable POSIX acl])
266 ]) # LC_POSIX_ACL_CONFIG
268 LB_CHECK_CONFIG_IM([CRYPTO_MD5], [],
269 [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
272 # LC_CONFIG_GSS_KEYRING
274 # default 'auto', tests for dependencies, if found, enables;
275 # only called if gss is enabled
277 AC_DEFUN([LC_CONFIG_GSS_KEYRING], [
278 AC_MSG_CHECKING([whether to enable gss keyring backend])
279 AC_ARG_ENABLE([gss_keyring],
280 [AS_HELP_STRING([--disable-gss-keyring],
281 [disable gss keyring backend])],
282 [], [AS_IF([test "x$enable_gss" != xno], [
283 enable_gss_keyring="yes"], [
284 enable_gss_keyring="auto"])])
285 AC_MSG_RESULT([$enable_gss_keyring])
286 AS_IF([test "x$enable_gss_keyring" != xno], [
287 LB_CHECK_CONFIG_IM([KEYS], [], [
288 gss_keyring_conf_test="fail"
289 AC_MSG_WARN([GSS keyring backend requires that CONFIG_KEYS be enabled in your kernel.])])
291 AC_CHECK_LIB([keyutils], [keyctl_search], [], [
292 gss_keyring_conf_test="fail"
293 AC_MSG_WARN([GSS keyring backend requires libkeyutils])])
295 AS_IF([test "x$gss_keyring_conf_test" != xfail], [
296 AC_DEFINE([HAVE_GSS_KEYRING], [1],
297 [Define this if you enable gss keyring backend])
298 enable_gss_keyring="yes"
300 AS_IF([test "x$enable_gss_keyring" = xyes], [
301 AC_MSG_ERROR([Cannot enable gss_keyring. See above for details.])
308 ]) # LC_CONFIG_GSS_KEYRING
311 # LC_KEY_TYPE_INSTANTIATE_2ARGS
313 # rhel7 key_type->instantiate takes 2 args (struct key, struct key_preparsed_payload)
315 AC_DEFUN([LC_KEY_TYPE_INSTANTIATE_2ARGS], [
316 LB_CHECK_COMPILE([if 'key_type->instantiate' has two args],
317 key_type_instantiate_2args, [
318 #include <linux/key-type.h>
320 ((struct key_type *)0)->instantiate(0, NULL);
322 AC_DEFINE(HAVE_KEY_TYPE_INSTANTIATE_2ARGS, 1,
323 [key_type->instantiate has two args])
325 ]) # LC_KEY_TYPE_INSTANTIATE_2ARGS
330 AC_DEFUN([LC_CONFIG_SUNRPC], [
331 LB_CHECK_CONFIG_IM([SUNRPC], [], [
332 AS_IF([test "x$sunrpc_required" = xyes], [
335 kernel SUNRPC support is required by using GSS.
338 ]) # LC_CONFIG_SUNRPC
341 # LC_CONFIG_GSS (default 'auto' (tests for dependencies, if found, enables))
343 # Build gss and related tools of Lustre. Currently both kernel and user space
344 # parts are depend on linux platform.
346 AC_DEFUN([LC_CONFIG_GSS], [
347 AC_MSG_CHECKING([whether to enable gss support])
349 [AS_HELP_STRING([--enable-gss], [enable gss support])],
350 [], [enable_gss="auto"])
351 AC_MSG_RESULT([$enable_gss])
353 AC_ARG_VAR([TEST_JOBS],
354 [simultaneous jobs during configure (defaults to $(nproc))])
355 if test "x$ac_cv_env_TEST_JOBS_set" != "xset"; then
356 TEST_JOBS=${TEST_JOBS:-$(nproc)}
360 AC_ARG_VAR([TEST_DIR],
361 [location of temporary parallel configure tests (defaults to $PWD/lb2)])
362 TEST_DIR=${TEST_DIR:-$PWD/_lpb}
365 AS_IF([test "x$enable_gss" != xno], [
366 LC_CONFIG_GSS_KEYRING
367 LC_KEY_TYPE_INSTANTIATE_2ARGS
368 sunrpc_required=$enable_gss
372 LB_CHECK_CONFIG_IM([CRYPTO_MD5], [],
373 [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
374 LB_CHECK_CONFIG_IM([CRYPTO_SHA1], [],
375 [AC_MSG_WARN([kernel SHA1 support is recommended by using GSS.])])
376 LB_CHECK_CONFIG_IM([CRYPTO_SHA256], [],
377 [AC_MSG_WARN([kernel SHA256 support is recommended by using GSS.])])
378 LB_CHECK_CONFIG_IM([CRYPTO_SHA512], [],
379 [AC_MSG_WARN([kernel SHA512 support is recommended by using GSS.])])
381 require_krb5=$enable_gss
385 AS_IF([test -n "$KRBDIR"], [
386 gss_conf_test="success"
388 gss_conf_test="failure"
391 AS_IF([test "x$gss_conf_test" = xsuccess && test "x$enable_gss" != xno], [
392 AC_DEFINE([HAVE_GSS], [1], [Define this is if you enable gss])
395 enable_gss_keyring="no"
399 AS_IF([test "x$enable_ssk" != xno], [
400 enable_ssk=$enable_gss
403 enable_gss_keyring="no"
409 # OpenSSL 1.0+ return int for HMAC functions but older SLES11 versions do not
410 AC_DEFUN([LC_OPENSSL_HMAC], [
411 has_hmac_functions="no"
412 saved_flags="$CFLAGS"
413 CFLAGS="$CFLAGS -Werror"
414 AC_MSG_CHECKING([whether OpenSSL has HMAC_Init_ex])
415 AS_IF([test "x$enable_ssk" != xno], [
416 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
417 #include <openssl/hmac.h>
418 #include <openssl/evp.h>
422 rc = HMAC_Init_ex(NULL, "test", 4, EVP_md_null(), NULL);
425 has_hmac_functions="yes"
428 AC_MSG_RESULT([$has_hmac_functions])
429 CFLAGS="$saved_flags"
432 # LC_OPENSSL_EVP_PKEY
434 # OpenSSL 3.0 introduces EVP_PKEY_get_params
435 AC_DEFUN([LC_OPENSSL_EVP_PKEY], [
437 saved_flags="$CFLAGS"
438 CFLAGS="$CFLAGS -Werror"
439 AC_MSG_CHECKING([whether OpenSSL has EVP_PKEY_get_params])
440 AS_IF([test "x$enable_ssk" != xno], [
441 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
442 #include <openssl/evp.h>
447 int rc = EVP_PKEY_get_params(NULL, params);
450 AC_DEFINE(HAVE_OPENSSL_EVP_PKEY, 1, [OpenSSL EVP_PKEY_get_params])
454 CFLAGS="$saved_flags"
455 AC_MSG_RESULT([$has_evp_pkey])
456 ]) # LC_OPENSSL_EVP_PKEY
461 # Check whether to enable Lustre client crypto
463 AC_DEFUN([LC_OPENSSL_SSK], [
464 AC_MSG_CHECKING([whether OpenSSL has functions needed for SSK])
465 AS_IF([test "x$enable_ssk" != xno], [
471 AS_IF([test "x$has_hmac_functions" = xyes -o "x$has_evp_pkey" = xyes], [
472 AC_DEFINE(HAVE_OPENSSL_SSK, 1, [OpenSSL HMAC functions needed for SSK])
476 AC_MSG_RESULT([$enable_ssk])
479 # LC_OPENSSL_GETSEPOL
481 # OpenSSL is needed for l_getsepol
482 AC_DEFUN([LC_OPENSSL_GETSEPOL], [
483 saved_flags="$CFLAGS"
484 CFLAGS="$CFLAGS -Werror"
485 AC_MSG_CHECKING([whether openssl-devel is present])
486 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
487 #include <openssl/evp.h>
490 EVP_MD_CTX *mdctx = EVP_MD_CTX_create();
493 AC_DEFINE(HAVE_OPENSSL_GETSEPOL, 1, [openssl-devel is present])
494 enable_getsepol="yes"
500 No openssl-devel headers found, unable to build l_getsepol and SELinux status checking
503 AC_MSG_RESULT([$enable_getsepol])
504 CFLAGS="$saved_flags"
505 ]) # LC_OPENSSL_GETSEPOL
508 AC_DEFUN([LC_HAVE_LIBAIO], [
509 AC_CHECK_HEADER([libaio.h],
511 AC_MSG_WARN([libaio is not installed in the system]))
514 AC_DEFUN([LC_HAVE_PROJECT_QUOTA], [
515 LB_CHECK_COMPILE([if get_projid exists],
518 #include <linux/quota.h>
520 struct dquot_operations ops = { };
522 ops.get_projid(NULL, NULL);
524 AC_DEFINE(HAVE_PROJECT_QUOTA, 1,
525 [get_projid function exists])
527 ]) # LC_HAVE_PROJECT_QUOTA
529 AC_DEFUN([LC_HAVE_GET_INODE_USAGE], [
530 LB_CHECK_COMPILE([if get_inode_usage exists],
533 #include <linux/quota.h>
535 struct dquot_operations ops = { };
537 ops.get_inode_usage(NULL, NULL);
539 AC_DEFINE(HAVE_GET_INODE_USAGE, 1,
540 [get_inode_usage function exists])
542 ]) # LC_HAVE_GET_INODE_USAGE
545 # LC_INVALIDATE_RANGE
547 # 3.11 invalidatepage requires the length of the range to invalidate
549 AC_DEFUN([LC_INVALIDATE_RANGE], [
550 LB_CHECK_COMPILE([if 'address_space_operations.invalidatepage' requires 3 arguments],
551 address_space_ops_invalidatepage_3args, [
552 #include <linux/fs.h>
554 struct address_space_operations a_ops;
555 a_ops.invalidatepage(NULL, 0, 0);
557 AC_DEFINE(HAVE_INVALIDATE_RANGE, 1,
558 [address_space_operations.invalidatepage needs 3 arguments])
560 ]) # LC_INVALIDATE_RANGE
563 # LC_HAVE_DIR_CONTEXT
565 # 3.11 readdir now takes the new struct dir_context
567 AC_DEFUN([LC_HAVE_DIR_CONTEXT], [
568 LB_CHECK_COMPILE([if 'dir_context' exist],
570 #include <linux/fs.h>
572 #ifdef FMODE_KABI_ITERATE
573 #error "back to use readdir in kabi_extand mode"
575 struct dir_context ctx;
580 AC_DEFINE(HAVE_DIR_CONTEXT, 1,
583 ]) # LC_HAVE_DIR_CONTEXT
588 # 3.11 dentry_operations.d_compare() taken 5 arguments.
590 AC_DEFUN([LC_D_COMPARE_5ARGS], [
591 LB_CHECK_COMPILE([if 'd_compare' taken 5 arguments],
593 #include <linux/dcache.h>
595 ((struct dentry_operations*)0)->d_compare(NULL,NULL,0,NULL,NULL);
597 AC_DEFINE(HAVE_D_COMPARE_5ARGS, 1,
598 [d_compare need 5 arguments])
600 ]) # LC_D_COMPARE_5ARGS
605 # 3.11 need to access d_count to get dentry reference count
607 AC_DEFUN([LC_HAVE_DCOUNT], [
608 LB_CHECK_COMPILE([if 'd_count' exists],
610 #include <linux/dcache.h>
612 struct dentry de = { };
615 count = d_count(&de);
617 AC_DEFINE(HAVE_D_COUNT, 1,
623 # LC_PID_NS_FOR_CHILDREN
625 # 3.11 replaces pid_ns by pid_ns_for_children in struct nsproxy
627 AC_DEFUN([LC_PID_NS_FOR_CHILDREN], [
628 LB_CHECK_COMPILE([if 'struct nsproxy' has 'pid_ns_for_children'],
629 pid_ns_for_children, [
630 #include <linux/nsproxy.h>
633 ns.pid_ns_for_children = NULL;
635 AC_DEFINE(HAVE_PID_NS_FOR_CHILDREN, 1,
636 ['struct nsproxy' has 'pid_ns_for_children'])
638 ]) # LC_PID_NS_FOR_CHILDREN
641 # LC_OLDSIZE_TRUNCATE_PAGECACHE
643 # 3.12 truncate_pagecache without oldsize parameter
645 AC_DEFUN([LC_OLDSIZE_TRUNCATE_PAGECACHE], [
646 LB_CHECK_COMPILE([if 'truncate_pagecache' with 'old_size' parameter],
647 truncate_pagecache_old_size, [
648 #include <linux/mm.h>
650 truncate_pagecache(NULL, 0, 0);
652 AC_DEFINE(HAVE_OLDSIZE_TRUNCATE_PAGECACHE, 1,
655 ]) # LC_OLDSIZE_TRUNCATE_PAGECACHE
660 # For some reason SLES11SP4 is missing the PTR_ERR_OR_ZERO macro
661 # It was added to linux kernel 3.12
663 AC_DEFUN([LC_PTR_ERR_OR_ZERO_MISSING], [
664 LB_CHECK_COMPILE([if 'PTR_ERR_OR_ZERO' is missing],
666 #include <linux/err.h>
668 if (PTR_ERR_OR_ZERO(NULL)) return 0;
670 AC_DEFINE(HAVE_PTR_ERR_OR_ZERO, 1,
671 ['PTR_ERR_OR_ZERO' exist])
673 ]) # LC_PTR_ERR_OR_ZERO_MISSING
676 # LC_HAVE_DENTRY_D_U_D_ALIAS
678 # 3.11 kernel moved d_alias to the union d_u in struct dentry
680 # Some distros move d_alias to d_u but it is still a struct list
682 AC_DEFUN([LC_HAVE_DENTRY_D_U_D_ALIAS], [
683 AS_IF([test "x$lb_cv_compile_i_dentry_d_alias_list" = xyes], [
684 LB_CHECK_COMPILE([if list 'dentry.d_u.d_alias' exist],
686 #include <linux/list.h>
687 #include <linux/dcache.h>
690 INIT_LIST_HEAD(&de.d_u.d_alias);
692 AC_DEFINE(HAVE_DENTRY_D_U_D_ALIAS, 1,
693 [list dentry.d_u.d_alias exist])
696 LB_CHECK_COMPILE([if hlist 'dentry.d_u.d_alias' exist],
698 #include <linux/list.h>
699 #include <linux/dcache.h>
702 INIT_HLIST_NODE(&de.d_u.d_alias);
704 AC_DEFINE(HAVE_DENTRY_D_U_D_ALIAS, 1,
705 [hlist dentry.d_u.d_alias exist])
708 ]) # LC_HAVE_DENTRY_D_U_D_ALIAS
711 # LC_HAVE_DENTRY_D_CHILD
713 # 3.11 kernel d_child has been moved out of the union d_u
716 AC_DEFUN([LC_HAVE_DENTRY_D_CHILD], [
717 LB_CHECK_COMPILE([if 'dentry.d_child' exist],
719 #include <linux/list.h>
720 #include <linux/dcache.h>
723 INIT_LIST_HEAD(&de.d_child);
725 AC_DEFINE(HAVE_DENTRY_D_CHILD, 1,
726 [dentry.d_child exist])
728 ]) # LC_HAVE_DENTRY_D_CHILD
733 # 3.12 ki_left removed from struct kiocb
735 AC_DEFUN([LC_KIOCB_KI_LEFT], [
736 LB_CHECK_COMPILE([if 'struct kiocb' with 'ki_left' member],
738 #include <linux/aio.h>
740 ((struct kiocb*)0)->ki_left = 0;
742 AC_DEFINE(HAVE_KIOCB_KI_LEFT, 1,
745 ]) # LC_KIOCB_KI_LEFT
748 # LC_REGISTER_SHRINKER_RET
750 # v3.11-8748-g1d3d4437eae1 register_shrinker returns a status
752 AC_DEFUN([LC_REGISTER_SHRINKER_RET], [
753 LB_CHECK_COMPILE([if register_shrinker() returns status],
754 register_shrinker_ret, [
755 #include <linux/mm.h>
757 if (register_shrinker(NULL))
758 unregister_shrinker(NULL);
760 AC_DEFINE(HAVE_REGISTER_SHRINKER_RET, 1,
761 [register_shrinker() returns status])
763 ]) # LC_REGISTER_SHRINKER_RET
766 # LC_VFS_RENAME_5ARGS
768 # 3.13 has vfs_rename with 5 args
770 AC_DEFUN([LC_VFS_RENAME_5ARGS], [
771 LB_CHECK_COMPILE([if Linux kernel has 'vfs_rename' with 5 args],
773 #include <linux/fs.h>
775 vfs_rename(NULL, NULL, NULL, NULL, NULL);
777 AC_DEFINE(HAVE_VFS_RENAME_5ARGS, 1,
778 [kernel has vfs_rename with 5 args])
780 ]) # LC_VFS_RENAME_5ARGS
783 # LC_VFS_UNLINK_3ARGS
785 # 3.13 has vfs_unlink with 3 args
787 AC_DEFUN([LC_VFS_UNLINK_3ARGS], [
788 LB_CHECK_COMPILE([if Linux kernel has 'vfs_unlink' with 3 args],
790 #include <linux/fs.h>
792 vfs_unlink(NULL, NULL, NULL);
794 AC_DEFINE(HAVE_VFS_UNLINK_3ARGS, 1,
795 [kernel has vfs_unlink with 3 args])
797 ]) # LC_VFS_UNLINK_3ARGS
799 # LC_HAVE_D_IS_POSITIVE
801 # Kernel version 3.13 b18825a7c8e37a7cf6abb97a12a6ad71af160de7
802 # d_is_positive is added
804 AC_DEFUN([LC_HAVE_D_IS_POSITIVE], [
805 LB_CHECK_COMPILE([if 'd_is_positive' exist],
807 #include <linux/dcache.h>
811 AC_DEFINE(HAVE_D_IS_POSITIVE, 1,
812 ['d_is_positive' is available])
814 ]) # LC_HAVE_D_IS_POSITIVE
819 # 3.14 move some of its data in struct bio into the new
822 AC_DEFUN([LC_HAVE_BVEC_ITER], [
823 LB_CHECK_COMPILE([if Linux kernel has struct bvec_iter],
825 #include <linux/bio.h>
827 struct bvec_iter iter;
829 iter.bi_bvec_done = 0;
831 AC_DEFINE(HAVE_BVEC_ITER, 1,
832 [kernel has struct bvec_iter])
834 ]) # LC_HAVE_BVEC_ITER
839 # 3.14 adds set_acl method to inode_operations
840 # see kernel commit 893d46e443346370cd4ea81d9d35f72952c62a37
842 AC_DEFUN([LC_IOP_SET_ACL], [
843 LB_CHECK_COMPILE([if 'inode_operations' has '.set_acl' member function],
845 #include <linux/fs.h>
847 struct inode_operations iop;
850 AC_DEFINE(HAVE_IOP_SET_ACL, 1,
851 [inode_operations has .set_acl member function])
856 # LC_HAVE_TRUNCATE_IPAGE_FINAL
858 # 3.14 bring truncate_inode_pages_final for evict_inode
860 AC_DEFUN([LC_HAVE_TRUNCATE_IPAGES_FINAL], [
861 LB_CHECK_COMPILE([if Linux kernel has truncate_inode_pages_final],
862 truncate_ipages_final, [
863 #include <linux/mm.h>
865 truncate_inode_pages_final(NULL);
867 AC_DEFINE(HAVE_TRUNCATE_INODE_PAGES_FINAL, 1,
868 [kernel has truncate_inode_pages_final])
870 ]) # LC_HAVE_TRUNCATE_IPAGES_FINAL
873 # LC_IOPS_RENAME_WITH_FLAGS
875 # 3.14 has inode_operations->rename with 5 args
876 # commit 520c8b16505236fc82daa352e6c5e73cd9870cff
878 AC_DEFUN([LC_IOPS_RENAME_WITH_FLAGS], [
879 LB_CHECK_COMPILE([if 'inode_operations->rename' taken flags as argument],
880 iops_rename_with_flags, [
881 #include <linux/fs.h>
883 struct inode *i1 = NULL, *i2 = NULL;
884 struct dentry *d1 = NULL, *d2 = NULL;
886 rc = ((struct inode_operations *)0)->rename(i1, d1, i2, d2, 0);
888 AC_DEFINE(HAVE_IOPS_RENAME_WITH_FLAGS, 1,
889 [inode_operations->rename need flags as argument])
891 ]) # LC_IOPS_RENAME_WITH_FLAGS
894 # LC_VFS_RENAME_6ARGS
896 # 3.15 has vfs_rename with 6 args
898 AC_DEFUN([LC_VFS_RENAME_6ARGS], [
899 LB_CHECK_COMPILE([if Linux kernel has 'vfs_rename' with 6 args],
901 #include <linux/fs.h>
903 vfs_rename(NULL, NULL, NULL, NULL, NULL, NULL);
905 AC_DEFINE(HAVE_VFS_RENAME_6ARGS, 1,
906 [kernel has vfs_rename with 6 args])
908 ]) # LC_VFS_RENAME_6ARGS
911 # LC_DIRECTIO_USE_ITER
913 # 3.16 kernel changes direct IO to use iov_iter
915 AC_DEFUN([LC_DIRECTIO_USE_ITER], [
916 LB_CHECK_COMPILE([if direct IO uses iov_iter],
918 #include <linux/fs.h>
920 struct address_space_operations ops = { };
921 struct iov_iter *iter = NULL;
924 ops.direct_IO(0, NULL, iter, offset);
926 AC_DEFINE(HAVE_DIRECTIO_ITER, 1,
927 [direct IO uses iov_iter])
929 ]) # LC_DIRECTIO_USE_ITER
932 # LC_HAVE_IOV_ITER_INIT_DIRECTION
935 # 3.16 linux commit 71d8e532b1549a478e6a6a8a44f309d050294d00
936 # changed iov_iter_init api to start accepting a tag
937 # that defines if its a read or write operation
939 AC_DEFUN([LC_HAVE_IOV_ITER_INIT_DIRECTION], [
940 tmp_flags="$EXTRA_KCFLAGS"
941 EXTRA_KCFLAGS="-Werror"
942 LB_CHECK_COMPILE([if 'iov_iter_init' takes a tag],
944 #include <linux/uio.h>
945 #include <linux/fs.h>
947 const struct iovec *iov = NULL;
949 iov_iter_init(NULL, READ, iov, 1, 0);
951 AC_DEFINE(HAVE_IOV_ITER_INIT_DIRECTION, 1,
952 [iov_iter_init handles directional tag])
954 EXTRA_KCFLAGS="$tmp_flags"
955 ]) # LC_HAVE_IOV_ITER_INIT_DIRECTION
958 # LC_HAVE_IOV_ITER_TRUNCATE
961 # 3.16 introduces a new API iov_iter_truncate()
963 AC_DEFUN([LC_HAVE_IOV_ITER_TRUNCATE], [
964 tmp_flags="$EXTRA_KCFLAGS"
965 EXTRA_KCFLAGS="-Werror"
966 LB_CHECK_COMPILE([if 'iov_iter_truncate' exists ],
968 #include <linux/uio.h>
969 #include <linux/fs.h>
971 struct iov_iter *i = NULL;
973 iov_iter_truncate(i, 0);
975 AC_DEFINE(HAVE_IOV_ITER_TRUNCATE, 1, [iov_iter_truncate exists])
977 EXTRA_KCFLAGS="$tmp_flags"
978 ]) # LC_HAVE_IOV_ITER_TRUNCATE
981 # LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
983 # 3.16 introduces [read|write]_iter to struct file_operations
985 AC_DEFUN([LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER], [
986 LB_CHECK_COMPILE([if 'file_operations.[read|write]_iter' exist],
987 file_function_iter, [
988 #include <linux/fs.h>
990 ((struct file_operations *)NULL)->read_iter(NULL, NULL);
991 ((struct file_operations *)NULL)->write_iter(NULL, NULL);
993 AC_DEFINE(HAVE_FILE_OPERATIONS_READ_WRITE_ITER, 1,
994 [file_operations.[read|write]_iter functions exist])
996 ]) # LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
999 # LC_HAVE_INTERVAL_BLK_INTEGRITY
1001 # 3.17 replace sector_size with interval in struct blk_integrity
1003 AC_DEFUN([LC_HAVE_INTERVAL_BLK_INTEGRITY], [
1004 LB_CHECK_COMPILE([if 'blk_integrity.interval' exist],
1005 interval_blk_integrity, [
1006 #include <linux/blkdev.h>
1008 ((struct blk_integrity *)0)->interval = 0;
1010 AC_DEFINE(HAVE_INTERVAL_BLK_INTEGRITY, 1,
1011 [blk_integrity.interval exist])
1013 ]) # LC_HAVE_INTERVAL_BLK_INTEGRITY
1018 # 3.17 replaces key_type::match with match_preparse
1019 # and has new struct key_match_data
1021 AC_DEFUN([LC_KEY_MATCH_DATA], [
1022 LB_CHECK_COMPILE([if struct key_match field exist],
1024 #include <linux/key-type.h>
1026 struct key_match_data data;
1028 data.raw_data = NULL;
1030 AC_DEFINE(HAVE_KEY_MATCH_DATA, 1,
1031 [struct key_match_data exist])
1033 ]) # LC_KEY_MATCH_DATA
1036 # LC_NFS_FILLDIR_USE_CTX
1038 # 3.18 kernel moved from void cookie to struct dir_context
1040 AC_DEFUN([LC_NFS_FILLDIR_USE_CTX], [
1041 tmp_flags="$EXTRA_KCFLAGS"
1042 EXTRA_KCFLAGS="-Werror"
1043 LB_CHECK_COMPILE([if filldir_t uses struct dir_context],
1045 #include <linux/fs.h>
1047 int filldir(struct dir_context *ctx, const char* name,
1048 int i, loff_t off, u64 tmp, unsigned temp)
1053 struct dir_context ctx = {
1057 ctx.actor(NULL, "test", 0, (loff_t) 0, 0, 0);
1059 AC_DEFINE(HAVE_FILLDIR_USE_CTX, 1,
1060 [filldir_t needs struct dir_context as argument])
1062 EXTRA_KCFLAGS="$tmp_flags"
1063 ]) # LC_NFS_FILLDIR_USE_CTX
1066 # LC_PERCPU_COUNTER_INIT
1068 # 3.18 For kernels 3.18 and after percpu_counter_init starts
1069 # to pass a GFP_* memory allocation flag for internal
1070 # memory allocation purposes.
1072 AC_DEFUN([LC_PERCPU_COUNTER_INIT], [
1073 LB_CHECK_COMPILE([if percpu_counter_init uses GFP_* flag as argument],
1074 percpu_counter_init, [
1075 #include <linux/percpu_counter.h>
1077 percpu_counter_init(NULL, 0, GFP_KERNEL);
1079 AC_DEFINE(HAVE_PERCPU_COUNTER_INIT_GFP_FLAG, 1,
1080 [percpu_counter_init uses GFP_* flag])
1082 ]) # LC_PERCPU_COUNTER_INIT
1085 # LC_KIOCB_HAS_NBYTES
1087 # 3.19 kernel removed ki_nbytes from struct kiocb
1089 AC_DEFUN([LC_KIOCB_HAS_NBYTES], [
1090 LB_CHECK_COMPILE([if struct kiocb has ki_nbytes field],
1092 #include <linux/fs.h>
1094 struct kiocb iocb = { };
1098 AC_DEFINE(HAVE_KI_NBYTES, 1, [ki_nbytes field exist])
1100 ]) # LC_KIOCB_HAS_NBYTES
1103 # LC_HAVE_DQUOT_QC_DQBLK
1105 # 3.19 has quotactl_ops->[sg]et_dqblk that take struct kqid and qc_dqblk
1106 # Added in commit 14bf61ffe
1108 AC_DEFUN([LC_HAVE_DQUOT_QC_DQBLK], [
1109 tmp_flags="$EXTRA_KCFLAGS"
1110 EXTRA_KCFLAGS="-Werror"
1111 LB_CHECK_COMPILE([if 'quotactl_ops.set_dqblk' takes struct qc_dqblk],
1113 #include <linux/fs.h>
1114 #include <linux/quota.h>
1116 ((struct quotactl_ops *)0)->set_dqblk(NULL, *((struct kqid*)0), (struct qc_dqblk*)0);
1118 AC_DEFINE(HAVE_DQUOT_QC_DQBLK, 1,
1119 [quotactl_ops.set_dqblk takes struct qc_dqblk])
1120 AC_DEFINE(HAVE_DQUOT_KQID, 1,
1121 [quotactl_ops.set_dqblk takes struct kqid])
1123 EXTRA_KCFLAGS="$tmp_flags"
1124 ]) # LC_HAVE_DQUOT_QC_DQBLK
1127 # LC_HAVE_AIO_COMPLETE
1129 # 3.19 kernel makes aio_complete() static
1131 AC_DEFUN([LC_HAVE_AIO_COMPLETE], [
1132 LB_CHECK_COMPILE([if kernel has exported aio_complete() ],
1134 #include <linux/aio.h>
1136 aio_complete(NULL, 0, 0);
1138 AC_DEFINE(HAVE_AIO_COMPLETE, 1, [aio_complete defined])
1140 ]) # LC_HAVE_AIO_COMPLETE
1143 # LC_HAVE_IS_ROOT_INODE
1145 # 3.19 kernel adds is_root_inode()
1146 # Commit a7400222e3eb ("new helper: is_root_inode()")
1148 AC_DEFUN([LC_HAVE_IS_ROOT_INODE], [
1149 LB_CHECK_COMPILE([if kernel has is_root_inode() ],
1151 #include <linux/fs.h>
1153 is_root_inode(NULL);
1155 AC_DEFINE(HAVE_IS_ROOT_INODE, 1, [is_root_inode defined])
1157 ]) # LC_HAVE_IS_ROOT_INODE
1160 # LC_BACKING_DEV_INFO_REMOVAL
1162 # 3.20 kernel removed backing_dev_info from address_space
1164 AC_DEFUN([LC_BACKING_DEV_INFO_REMOVAL], [
1165 LB_CHECK_COMPILE([if struct address_space has backing_dev_info],
1167 #include <linux/fs.h>
1169 struct address_space mapping;
1171 mapping.backing_dev_info = NULL;
1173 AC_DEFINE(HAVE_BACKING_DEV_INFO, 1, [backing_dev_info exist])
1175 ]) # LC_BACKING_DEV_INFO_REMOVAL
1178 # LC_HAVE_BDI_CAP_MAP_COPY
1180 # 3.20 removed mmap handling for backing devices since
1181 # it breaks on non-MMU systems. See kernel commit
1182 # b4caecd48005fbed3949dde6c1cb233142fd69e9
1184 AC_DEFUN([LC_HAVE_BDI_CAP_MAP_COPY], [
1185 LB_CHECK_COMPILE([if have 'BDI_CAP_MAP_COPY'],
1187 #include <linux/backing-dev.h>
1189 struct backing_dev_info info;
1191 info.capabilities = BDI_CAP_MAP_COPY;
1193 AC_DEFINE(HAVE_BDI_CAP_MAP_COPY, 1,
1194 [BDI_CAP_MAP_COPY exist])
1196 ]) # LC_HAVE_BDI_CAP_MAP_COPY
1201 # 4.1 kernel has iov_iter_rw
1203 AC_DEFUN([LC_IOV_ITER_RW], [
1204 LB_CHECK_COMPILE([if iov_iter_rw exist],
1206 #include <linux/fs.h>
1207 #include <linux/uio.h>
1209 struct iov_iter *iter = NULL;
1213 AC_DEFINE(HAVE_IOV_ITER_RW, 1,
1214 [iov_iter_rw exist])
1219 # LC_HAVE_SYNC_READ_WRITE
1221 # 4.1 new_sync_[read|write] no longer exported
1223 AC_DEFUN([LC_HAVE_SYNC_READ_WRITE], [
1224 LB_CHECK_EXPORT([new_sync_read], [fs/read_write.c],
1225 [AC_DEFINE(HAVE_SYNC_READ_WRITE, 1,
1226 [new_sync_[read|write] is exported by the kernel])])
1227 ]) # LC_HAVE_SYNC_READ_WRITE
1232 # 4.1 redefined bi_cnt as __bi_cnt in commit dac56212e8127dbc0
1234 AC_DEFUN([LC_HAVE___BI_CNT], [
1235 LB_CHECK_COMPILE([if Linux kernel has __bi_cnt in struct bio],
1237 #include <asm/atomic.h>
1238 #include <linux/bio.h>
1239 #include <linux/blk_types.h>
1241 struct bio bio = { };
1243 cnt = atomic_read(&bio.__bi_cnt);
1245 AC_DEFINE(HAVE___BI_CNT, 1,
1246 [struct bio has __bi_cnt])
1248 ]) # LC_HAVE___BI_CNT
1251 # LC_SYMLINK_OPS_USE_NAMEIDATA
1253 # For the 4.2+ kernels the file system internal symlink api no
1254 # longer uses struct nameidata as a argument
1256 AC_DEFUN([LC_SYMLINK_OPS_USE_NAMEIDATA], [
1257 LB_CHECK_COMPILE([if symlink inode operations have struct nameidata argument],
1258 symlink_use_nameidata, [
1259 #include <linux/namei.h>
1260 #include <linux/fs.h>
1262 struct nameidata *nd = NULL;
1264 ((struct inode_operations *)0)->follow_link(NULL, nd);
1265 ((struct inode_operations *)0)->put_link(NULL, nd, NULL);
1267 AC_DEFINE(HAVE_SYMLINK_OPS_USE_NAMEIDATA, 1,
1268 [symlink inode operations need struct nameidata argument])
1270 ]) # LC_SYMLINK_OPS_USE_NAMEIDATA
1273 # LC_BIO_ENDIO_USES_ONE_ARG
1275 # 4.2 kernel bio_endio now only takes one argument
1277 AC_DEFUN([LC_BIO_ENDIO_USES_ONE_ARG], [
1278 LB_CHECK_COMPILE([if 'bio_endio' with one argument exist],
1280 #include <linux/bio.h>
1284 AC_DEFINE(HAVE_BIO_ENDIO_USES_ONE_ARG, 1,
1285 [bio_endio takes only one argument])
1287 ]) # LC_BIO_ENDIO_USES_ONE_ARG
1290 # LC_ACCOUNT_PAGE_DIRTIED_3ARGS
1292 # 4.2 [to 4.5] kernel page dirtied takes 3 arguments
1294 AC_DEFUN([LC_ACCOUNT_PAGE_DIRTIED_3ARGS], [
1295 LB_CHECK_COMPILE([if 'account_page_dirtied' with 3 args exists],
1296 account_page_dirtied, [
1297 #include <linux/mm.h>
1299 account_page_dirtied(NULL, NULL, NULL);
1301 AC_DEFINE(HAVE_ACCOUNT_PAGE_DIRTIED_3ARGS, 1,
1302 [account_page_dirtied takes three arguments])
1304 ]) # LC_ACCOUNT_PAGE_DIRTIED_3ARGS
1307 # LC_HAVE_CRYPTO_ALLOC_SKCIPHER
1309 # Kernel version 4.12 commit 7a7ffe65c8c5
1310 # introduced crypto_alloc_skcipher().
1312 AC_DEFUN([LC_HAVE_CRYPTO_ALLOC_SKCIPHER], [
1313 LB_CHECK_COMPILE([if crypto_alloc_skcipher is defined],
1314 crypto_alloc_skcipher, [
1315 #include <crypto/skcipher.h>
1317 crypto_alloc_skcipher(NULL, 0, 0);
1319 AC_DEFINE(HAVE_CRYPTO_ALLOC_SKCIPHER, 1,
1320 [crypto_alloc_skcipher is defined])
1322 ]) # LC_HAVE_CRYPTO_ALLOC_SKCIPHER
1325 # LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
1327 # 4.3 replace interval with interval_exp in 'struct blk_integrity'
1328 # 'struct blk_integrity_profile' is also added in this version,
1329 # thus use this to determine whether 'struct blk_integrity' has profile
1331 AC_DEFUN([LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY], [
1332 LB_CHECK_COMPILE([if 'blk_integrity.interval_exp' exist],
1333 blk_integrity_interval_exp, [
1334 #include <linux/blkdev.h>
1336 ((struct blk_integrity *)0)->interval_exp = 0;
1338 AC_DEFINE(HAVE_INTERVAL_EXP_BLK_INTEGRITY, 1,
1339 [blk_integrity.interval_exp exist])
1341 ]) # LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
1344 # LC_HAVE_CACHE_HEAD_HLIST
1346 # 4.3 kernel swiched to hlist for cache_head
1348 AC_DEFUN([LC_HAVE_CACHE_HEAD_HLIST], [
1349 LB_CHECK_COMPILE([if 'struct cache_head' has 'cache_list' field],
1350 cache_head_has_hlist, [
1351 #include <linux/sunrpc/cache.h>
1353 do {} while(sizeof(((struct cache_head *)0)->cache_list));
1355 AC_DEFINE(HAVE_CACHE_HEAD_HLIST, 1,
1356 [cache_head has hlist cache_list])
1358 ]) # LC_HAVE_CACHE_HEAD_HLIST
1361 # LC_HAVE_XATTR_HANDLER_SIMPLIFIED
1363 # Kernel version 4.3 commit e409de992e3ea3674393465f07cc71c948edd87a
1364 # simplified xattr_handler handling by passing in the handler pointer
1366 AC_DEFUN([LC_HAVE_XATTR_HANDLER_SIMPLIFIED], [
1367 tmp_flags="$EXTRA_KCFLAGS"
1368 EXTRA_KCFLAGS="-Werror"
1369 LB_CHECK_COMPILE([if 'struct xattr_handler' functions pass in handler pointer],
1370 xattr_handler_simplified, [
1371 #include <linux/xattr.h>
1373 struct xattr_handler handler;
1375 ((struct xattr_handler *)0)->get(&handler, NULL, NULL, NULL, 0);
1376 ((struct xattr_handler *)0)->set(&handler, NULL, NULL, NULL, 0, 0);
1378 AC_DEFINE(HAVE_XATTR_HANDLER_SIMPLIFIED, 1, [handler pointer is parameter])
1380 EXTRA_KCFLAGS="$tmp_flags"
1381 ]) # LC_HAVE_XATTR_HANDLER_SIMPLIFIED
1384 # LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
1386 # 4.3 replace interval with interval_exp in 'struct blk_integrity'.
1388 AC_DEFUN([LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD], [
1389 LB_CHECK_COMPILE([if 'bio_integrity_payload.bip_iter' exist],
1390 bio_integrity_payload_bip_iter, [
1391 #include <linux/bio.h>
1393 ((struct bio_integrity_payload *)0)->bip_iter.bi_size = 0;
1395 AC_DEFINE(HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD, 1,
1396 [bio_integrity_payload.bip_iter exist])
1398 ]) # LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
1401 # LC_BIO_INTEGRITY_PREP_FN
1403 # Lustre kernel patch extents bio_integrity_prep to accept optional
1404 # generate/verify_fn as extra args.
1406 AC_DEFUN([LC_BIO_INTEGRITY_PREP_FN], [
1407 LB_CHECK_COMPILE([if 'bio_integrity_prep_fn' exists],
1408 bio_integrity_prep_fn, [
1409 #include <linux/bio.h>
1411 bio_integrity_prep_fn(NULL, NULL, NULL);
1413 AC_DEFINE(HAVE_BIO_INTEGRITY_PREP_FN, 1,
1414 [kernel has bio_integrity_prep_fn])
1415 AC_SUBST(PATCHED_INTEGRITY_INTF)
1417 AC_SUBST(PATCHED_INTEGRITY_INTF, [#])
1419 ]) # LC_BIO_INTEGRITY_PREP_FN
1421 # LC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL
1423 # 13 kernel integrity API has changed and in 4.13+
1424 # (as well as in rhel 8.4) bio_integrity_prep() returns boolean true
1427 AC_DEFUN([LC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL], [
1428 LB_CHECK_COMPILE([if 'bio_integrity_prep_fn' returns bool],
1429 bio_integrity_prep, [
1430 #include <linux/bio.h>
1431 #include <linux/typecheck.h>
1433 #pragma GCC diagnostic warning "-Werror"
1434 typedef bool (*bio_integrity_prep_type)(struct bio *bio) ;
1436 typecheck_fn(bio_integrity_prep_type, bio_integrity_prep);
1438 AC_DEFINE(HAVE_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL, 1,
1439 [bio_integrity_prep_fn returns bool])
1441 ]) # LC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL
1446 # 4.4/4.8 redefined bi_rw as bi_opf (SLES12/kernel commit 4382e33ad37486)
1448 AC_DEFUN([LC_HAVE_BI_OPF], [
1449 LB_CHECK_COMPILE([if Linux kernel has bi_opf in struct bio],
1451 #include <linux/bio.h>
1457 AC_DEFINE(HAVE_BI_OPF, 1,
1458 [struct bio has bi_opf])
1463 # LC_HAVE_SUBMIT_BIO_2ARGS
1465 # 4.4 removed an argument from submit_bio
1467 AC_DEFUN([LC_HAVE_SUBMIT_BIO_2ARGS], [
1468 LB_CHECK_COMPILE([if submit_bio takes two arguments],
1469 have_submit_bio_2args, [
1470 #include <linux/bio.h>
1473 submit_bio(READ, &bio);
1475 AC_DEFINE(HAVE_SUBMIT_BIO_2ARGS, 1,
1476 [submit_bio takes two arguments])
1478 ]) # LC_HAVE_SUBMIT_BIO_2_ARGS
1481 # LC_HAVE_CLEAN_BDEV_ALIASES
1483 # 4.4/4.9 unmap_underlying_metadata was replaced by clean_bdev_aliases
1484 # (SLES12/kernel commit 29f3ad7d8380364c)
1486 AC_DEFUN([LC_HAVE_CLEAN_BDEV_ALIASES], [
1487 LB_CHECK_COMPILE([if kernel has clean_bdev_aliases],
1488 have_clean_bdev_aliases, [
1489 #include <linux/buffer_head.h>
1491 clean_bdev_aliases(NULL,1,1);
1493 AC_DEFINE(HAVE_CLEAN_BDEV_ALIASES, 1,
1494 [kernel has clean_bdev_aliases])
1496 ]) # LC_HAVE_CLEAN_BDEV_ALIASES
1499 # LC_HAVE_LOCKS_LOCK_FILE_WAIT
1501 # 4.4 kernel have moved locks API users to
1502 # locks_lock_inode_wait()
1504 AC_DEFUN([LC_HAVE_LOCKS_LOCK_FILE_WAIT], [
1505 LB_CHECK_COMPILE([if 'locks_lock_file_wait' exists],
1506 locks_lock_file_wait, [
1507 #include <linux/fs.h>
1509 locks_lock_file_wait(NULL, NULL);
1511 AC_DEFINE(HAVE_LOCKS_LOCK_FILE_WAIT, 1,
1512 [kernel has locks_lock_file_wait])
1514 ]) # LC_HAVE_LOCKS_LOCK_FILE_WAIT
1517 # LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
1519 # 4.4 kernel merged type-specific data with the payload data for keys
1521 AC_DEFUN([LC_HAVE_KEY_PAYLOAD_DATA_ARRAY], [
1522 LB_CHECK_COMPILE([if 'struct key' has 'payload.data' as an array],
1523 key_payload_data_array, [
1524 #include <linux/key.h>
1526 struct key key = { };
1528 key.payload.data[0] = NULL;
1530 AC_DEFINE(HAVE_KEY_PAYLOAD_DATA_ARRAY, 1, [payload.data is an array])
1532 ]) #LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
1535 # LC_HAVE_XATTR_HANDLER_NAME
1537 # Kernel version 4.4 commit 98e9cb5711c68223f0e4d5201b9a6add255ec550
1538 # add a name member to struct xattr_handler
1540 AC_DEFUN([LC_HAVE_XATTR_HANDLER_NAME], [
1541 tmp_flags="$EXTRA_KCFLAGS"
1542 EXTRA_KCFLAGS="-Werror"
1543 LB_CHECK_COMPILE([if 'struct xattr_handler' has a name member],
1544 xattr_handler_name, [
1545 #include <linux/xattr.h>
1547 ((struct xattr_handler *)NULL)->name = NULL;
1549 AC_DEFINE(HAVE_XATTR_HANDLER_NAME, 1, [xattr_handler has a name member])
1551 EXTRA_KCFLAGS="$tmp_flags"
1552 ]) # LC_HAVE_XATTR_HANDLER_NAME
1555 # LC_HAVE_FILE_DENTRY
1557 # 4.5 adds wrapper file_dentry
1559 AC_DEFUN([LC_HAVE_FILE_DENTRY], [
1560 LB_CHECK_COMPILE([if Linux kernel has 'file_dentry'],
1562 #include <linux/fs.h>
1566 AC_DEFINE(HAVE_FILE_DENTRY, 1,
1567 [kernel has file_dentry])
1569 ]) # LC_HAVE_FILE_DENTRY
1572 # LC_HAVE_INODE_LOCK
1574 # 4.5 introduced inode_lock
1576 AC_DEFUN([LC_HAVE_INODE_LOCK], [
1577 LB_CHECK_COMPILE([if 'inode_lock' is defined],
1579 #include <linux/fs.h>
1583 AC_DEFINE(HAVE_INODE_LOCK, 1,
1584 [inode_lock is defined])
1586 ]) # LC_HAVE_INODE_LOCK
1589 # LC_HAVE_IOP_GET_LINK
1591 # 4.5 vfs replaced iop->follow_link with
1594 AC_DEFUN([LC_HAVE_IOP_GET_LINK], [
1595 LB_CHECK_COMPILE([if 'iop' has 'get_link'],
1596 inode_ops_get_link, [
1597 #include <linux/fs.h>
1599 struct inode_operations iop;
1600 iop.get_link = NULL;
1602 AC_DEFINE(HAVE_IOP_GET_LINK, 1,
1603 [have iop get_link])
1605 ]) # LC_HAVE_IOP_GET_LINK
1608 # LC_HAVE_IN_COMPAT_SYSCALL
1610 # 4.6 renamed is_compat_task to in_compat_syscall
1612 AC_DEFUN([LC_HAVE_IN_COMPAT_SYSCALL], [
1613 LB_CHECK_COMPILE([if 'in_compat_syscall' is defined],
1614 in_compat_syscall, [
1615 #include <linux/compat.h>
1617 in_compat_syscall();
1619 AC_DEFINE(HAVE_IN_COMPAT_SYSCALL, 1,
1620 [have in_compat_syscall])
1622 ]) # LC_HAVE_IN_COMPAT_SYSCALL
1625 # LC_HAVE_XATTR_HANDLER_INODE_PARAM
1627 # Kernel version 4.6 commit b296821a7c42fa58baa17513b2b7b30ae66f3336
1628 # and commit 5930122683dff58f0846b0f0405b4bd598a3ba6a added inode parameter
1629 # to xattr_handler functions
1631 AC_DEFUN([LC_HAVE_XATTR_HANDLER_INODE_PARAM], [
1632 tmp_flags="$EXTRA_KCFLAGS"
1633 EXTRA_KCFLAGS="-Werror"
1634 LB_CHECK_COMPILE([if 'struct xattr_handler' functions have inode parameter],
1635 xattr_handler_inode_param, [
1636 #include <linux/xattr.h>
1638 const struct xattr_handler handler;
1640 ((struct xattr_handler *)0)->get(&handler, NULL, NULL, NULL, NULL, 0);
1641 ((struct xattr_handler *)0)->set(&handler, NULL, NULL, NULL, NULL, 0, 0);
1643 AC_DEFINE(HAVE_XATTR_HANDLER_INODE_PARAM, 1, [needs inode parameter])
1645 EXTRA_KCFLAGS="$tmp_flags"
1646 ]) # LC_HAVE_XATTR_HANDLER_INODE_PARAM
1651 # Kernel version 4.6 commit 85c7f81041d57cfe9dc97f4680d5586b54534a39
1652 # introduced parallel lookups in the VFS layer. The inline function
1653 # d_in_lookup was added to notify when the same item was being queried
1656 AC_DEFUN([LC_D_IN_LOOKUP], [
1657 tmp_flags="$EXTRA_KCFLAGS"
1658 EXTRA_KCFLAGS="-Werror"
1659 LB_CHECK_COMPILE([if 'd_in_lookup' is defined],
1661 #include <linux/dcache.h>
1665 AC_DEFINE(HAVE_D_IN_LOOKUP, 1, [d_in_lookup is defined])
1667 EXTRA_KCFLAGS="$tmp_flags"
1671 # LC_LOCK_PAGE_MEMCG
1673 # Kernel version 4.6 adds lock_page_memcg
1675 AC_DEFUN([LC_LOCK_PAGE_MEMCG], [
1676 LB_CHECK_COMPILE([if 'lock_page_memcg' is defined],
1678 #include <linux/memcontrol.h>
1680 lock_page_memcg(NULL);
1682 AC_DEFINE(HAVE_LOCK_PAGE_MEMCG, 1,
1683 [lock_page_memcg is defined])
1685 ]) # LC_LOCK_PAGE_MEMCG
1690 # Kernel version 4.7-rc5 commit 285b102d3b745f3c2c110c9c327741d87e64aacc
1691 # add new d_init to initialize dentry at allocation time
1693 AC_DEFUN([LC_D_INIT], [
1694 LB_CHECK_COMPILE([if dentry operations supports 'd_init'],
1696 #include <linux/dcache.h>
1698 struct dentry_operations ops = { };
1701 rc = ops.d_init(NULL);
1703 AC_DEFINE(HAVE_D_INIT, 1, ['d_init' exists])
1710 # Kernel version 4.7 commit c8b8e32d700fe943a935e435ae251364d016c497
1711 # direct-io: eliminate the offset argument to ->direct_IO
1713 AC_DEFUN([LC_DIRECTIO_2ARGS], [
1714 LB_CHECK_COMPILE([if '->direct_IO()' taken 2 arguments],
1716 #include <linux/fs.h>
1718 struct address_space_operations ops = { };
1719 struct iov_iter *iter = NULL;
1720 struct kiocb *iocb = NULL;
1723 rc = ops.direct_IO(iocb, iter);
1725 AC_DEFINE(HAVE_DIRECTIO_2ARGS, 1,
1726 [direct_IO need 2 arguments])
1728 ]) # LC_DIRECTIO_2ARGS
1731 # LC_GENERIC_WRITE_SYNC_2ARGS
1733 # Kernel version 4.7 commit dde0c2e79848298cc25621ad080d47f94dbd7cce
1734 # fs: add IOCB_SYNC and IOCB_DSYNC
1736 AC_DEFUN([LC_GENERIC_WRITE_SYNC_2ARGS], [
1737 LB_CHECK_COMPILE([if 'generic_write_sync()' taken 2 arguments],
1738 generic_write_sync_2args, [
1739 #include <linux/fs.h>
1741 struct kiocb *iocb = NULL;
1744 rc = generic_write_sync(iocb, 0);
1746 AC_DEFINE(HAVE_GENERIC_WRITE_SYNC_2ARGS, 1,
1747 [generic_write_sync need 2 arguments])
1749 ]) # LC_GENERIC_WRITE_SYNC_2ARGS
1752 # LC_FOP_ITERATE_SHARED
1754 # Kernel v4.6-rc3-29-g6192269 adds iterate_shared method to file_operations
1756 AC_DEFUN([LC_FOP_ITERATE_SHARED], [
1757 LB_CHECK_COMPILE([if 'file_operations' has 'iterate_shared'],
1758 fop_iterate_shared, [
1759 #include <linux/fs.h>
1761 struct file_operations fop;
1762 fop.iterate_shared = NULL;
1764 AC_DEFINE(HAVE_FOP_ITERATE_SHARED, 1,
1765 [file_operations has iterate_shared])
1767 ]) # LC_FOP_ITERATE_SHARED
1770 # LC_EXPORT_DEFAULT_FILE_SPLICE_READ
1772 # 4.8-rc8 commit 82c156f853840645604acd7c2cebcb75ed1b6652 switched
1773 # generic_file_splice_read() to using ->read_iter. We can test this
1774 # change since default_file_splice_read() is no longer exported.
1776 AC_DEFUN([LC_EXPORT_DEFAULT_FILE_SPLICE_READ], [
1777 LB_CHECK_EXPORT([default_file_splice_read], [fs/splice.c],
1778 [AC_DEFINE(HAVE_DEFAULT_FILE_SPLICE_READ_EXPORT, 1,
1779 [default_file_splice_read is exported])])
1780 ]) # LC_EXPORT_DEFAULT_FILE_SPLCE_READ
1783 # LC_HAVE_POSIX_ACL_VALID_USER_NS
1785 # 4.8 posix_acl_valid takes struct user_namespace
1787 AC_DEFUN([LC_HAVE_POSIX_ACL_VALID_USER_NS], [
1788 LB_CHECK_COMPILE([if 'posix_acl_valid' takes 'struct user_namespace'],
1790 #include <linux/fs.h>
1791 #include <linux/posix_acl.h>
1793 posix_acl_valid((struct user_namespace*)NULL, (const struct posix_acl*)NULL);
1795 AC_DEFINE(HAVE_POSIX_ACL_VALID_USER_NS, 1,
1796 [posix_acl_valid takes struct user_namespace])
1798 ]) # LC_HAVE_POSIX_ACL_VALID_USER_NS
1801 # LC_D_COMPARE_4ARGS
1803 # Kernel version 4.8 commit 6fa67e707559303e086303aeecc9e8b91ef497d5
1804 # get rid of 'parent' argument of ->d_compare()
1806 AC_DEFUN([LC_D_COMPARE_4ARGS], [
1807 LB_CHECK_COMPILE([if 'd_compare' taken 4 arguments],
1809 #include <linux/dcache.h>
1811 ((struct dentry_operations*)0)->d_compare(NULL,0,NULL,NULL);
1813 AC_DEFINE(HAVE_D_COMPARE_4ARGS, 1,
1814 [d_compare need 4 arguments])
1816 ]) # LC_D_COMPARE_4ARGS
1819 # LC_FULL_NAME_HASH_3ARGS
1821 # Kernel version 4.8 commit 8387ff2577eb9ed245df9a39947f66976c6bcd02
1822 # vfs: make the string hashes salt the hash
1824 AC_DEFUN([LC_FULL_NAME_HASH_3ARGS], [
1825 LB_CHECK_COMPILE([if 'full_name_hash' taken 3 arguments],
1826 full_name_hash_3args, [
1827 #include <linux/stringhash.h>
1830 hash = full_name_hash(NULL,NULL,0);
1832 AC_DEFINE(HAVE_FULL_NAME_HASH_3ARGS, 1,
1833 [full_name_hash need 3 arguments])
1835 ]) # LC_FULL_NAME_HASH_3ARGS
1838 # LC_STRUCT_POSIX_ACL_XATTR
1840 # Kernel version 4.8 commit 2211d5ba5c6c4e972ba6dbc912b2897425ea6621
1841 # posix_acl: xattr representation cleanups
1843 AC_DEFUN([LC_STRUCT_POSIX_ACL_XATTR], [
1844 LB_CHECK_COMPILE([if 'struct posix_acl_xattr_{header,entry}' defined],
1845 struct_posix_acl_xattr, [
1846 #include <linux/fs.h>
1847 #include <linux/posix_acl_xattr.h>
1849 struct posix_acl_xattr_header *h = NULL;
1850 struct posix_acl_xattr_entry *e;
1851 e = (void *)(h + 1);
1853 AC_DEFINE(HAVE_STRUCT_POSIX_ACL_XATTR, 1,
1854 [struct posix_acl_xattr_{header,entry} defined])
1856 ]) # LC_STRUCT_POSIX_ACL_XATTR
1861 # Kernel version 4.8 commit fd50ecaddf8372a1d96e0daeaac0f93cf04e4d42
1862 # removed {get,set,remove}xattr inode operations
1864 AC_DEFUN([LC_IOP_XATTR], [
1865 LB_CHECK_COMPILE([if 'inode_operations' has {get,set,remove}xattr members],
1867 #include <linux/fs.h>
1869 struct inode_operations iop;
1870 iop.setxattr = NULL;
1871 iop.getxattr = NULL;
1872 iop.removexattr = NULL;
1874 AC_DEFINE(HAVE_IOP_XATTR, 1,
1875 [inode_operations has {get,set,remove}xattr members])
1882 # Kernel version 4.9 commit 81243eacfa400f5f7b89f4c2323d0de9982bb0fb
1883 # cred: simpler, 1D supplementary groups
1885 AC_DEFUN([LC_GROUP_INFO_GID], [
1886 LB_CHECK_COMPILE([if 'struct group_info' has member 'gid'],
1888 #include <linux/cred.h>
1891 p = ((struct group_info *)0)->gid;
1893 AC_DEFINE(HAVE_GROUP_INFO_GID, 1,
1894 [struct group_info has member gid])
1896 ]) # LC_GROUP_INFO_GID
1901 # Kernel version 4.9 commit 5d6c31910bc0713e37628dc0ce677dcb13c8ccf4
1902 # added __vfs_{get,set,remove}xattr helpers
1904 AC_DEFUN([LC_VFS_SETXATTR], [
1905 LB_CHECK_COMPILE([if '__vfs_setxattr' helper is available],
1907 #include <linux/xattr.h>
1909 __vfs_setxattr(NULL, NULL, NULL, NULL, 0, 0);
1911 AC_DEFINE(HAVE_VFS_SETXATTR, 1,
1912 ['__vfs_setxattr is available])
1914 ]) # LC_VFS_SETXATTR
1917 # LC_POSIX_ACL_UPDATE_MODE
1919 # Kernel version 4.9 commit 073931017b49d9458aa351605b43a7e34598caef
1920 # posix_acl: Clear SGID bit when setting file permissions
1922 AC_DEFUN([LC_POSIX_ACL_UPDATE_MODE], [
1923 LB_CHECK_COMPILE([if 'posix_acl_update_mode' exists],
1924 posix_acl_update_mode, [
1925 #include <linux/fs.h>
1926 #include <linux/posix_acl.h>
1928 posix_acl_update_mode(NULL, NULL, NULL);
1930 AC_DEFINE(HAVE_POSIX_ACL_UPDATE_MODE, 1,
1931 ['posix_acl_update_mode' is available])
1933 ]) # LC_POSIX_ACL_UPDATE_MODE
1936 # LC_IOP_GENERIC_READLINK
1938 # Kernel version 4.10 commit dfeef68862edd7d4bafe68ef7aeb5f658ef24bb5
1939 # removed generic_readlink from individual file systems
1941 AC_DEFUN([LC_IOP_GENERIC_READLINK], [
1942 LB_CHECK_COMPILE([if 'generic_readlink' still exist],
1943 inode_ops_readlink, [
1944 #include <linux/fs.h>
1946 struct inode_operations iop;
1947 iop.readlink = generic_readlink;
1949 AC_DEFINE(HAVE_IOP_GENERIC_READLINK, 1,
1950 [generic_readlink has been removed])
1952 ]) # LC_IOP_GENERIC_READLINK
1955 # LC_HAVE_VM_FAULT_ADDRESS
1957 # Kernel version 4.10 commit 1a29d85eb0f19b7d8271923d8917d7b4f5540b3e
1958 # removed virtual_address field. Need to use address field instead
1960 AC_DEFUN([LC_HAVE_VM_FAULT_ADDRESS], [
1961 LB_CHECK_COMPILE([if 'struct vm_fault' replaced virtual_address with address field],
1963 #include <linux/mm.h>
1965 unsigned long vaddr = ((struct vm_fault *)0)->address;
1968 AC_DEFINE(HAVE_VM_FAULT_ADDRESS, 1,
1969 [virtual_address has been replaced by address field])
1971 ]) # LC_HAVE_VM_FAULT_ADDRESS
1974 # LC_INODEOPS_ENHANCED_GETATTR
1976 # Kernel version 4.11 commit a528d35e8bfcc521d7cb70aaf03e1bd296c8493f
1977 # expanded getattr to be able to get more stat information.
1979 AC_DEFUN([LC_INODEOPS_ENHANCED_GETATTR], [
1980 LB_CHECK_COMPILE([if 'inode_operations' getattr member can gather advance stats],
1982 #include <linux/fs.h>
1986 ((struct inode_operations *)1)->getattr(&path, NULL, 0, 0);
1988 AC_DEFINE(HAVE_INODEOPS_ENHANCED_GETATTR, 1,
1989 [inode_operations .getattr member function can gather advance stats])
1991 ]) # LC_INODEOPS_ENHANCED_GETATTR
1994 # LC_VM_OPERATIONS_REMOVE_VMF_ARG
1996 # Kernel version 4.11 commit 11bac80004499ea59f361ef2a5516c84b6eab675
1997 # removed struct vm_area_struct as an argument for vm_operations since
1998 # in the same kernel version struct vma_area_struct was folded into
2001 AC_DEFUN([LC_VM_OPERATIONS_REMOVE_VMF_ARG], [
2002 LB_CHECK_COMPILE([if 'struct vm_operations' removed struct vm_area_struct],
2003 vm_operations_no_vm_area_struct, [
2004 #include <linux/mm.h>
2006 struct vm_fault vmf;
2008 ((struct vm_operations_struct *)0)->fault(&vmf);
2009 ((struct vm_operations_struct *)0)->page_mkwrite(&vmf);
2011 AC_DEFINE(HAVE_VM_OPS_USE_VM_FAULT_ONLY, 1,
2012 ['struct vm_operations' remove struct vm_area_struct argument])
2014 ]) # LC_VM_OPERATIONS_REMOVE_VMF_ARG
2017 # LC_HAVE_KEY_USAGE_REFCOUNT
2019 # Kernel version 4.11 commit fff292914d3a2f1efd05ca71c2ba72a3c663201e
2020 # converted key.usage from atomic_t to refcount_t.
2022 AC_DEFUN([LC_HAVE_KEY_USAGE_REFCOUNT], [
2023 LB_CHECK_COMPILE([if 'key.usage' is refcount_t],
2024 key_usage_refcount, [
2025 #include <linux/key.h>
2027 struct key key = { };
2029 refcount_read(&key.usage);
2031 AC_DEFINE(HAVE_KEY_USAGE_REFCOUNT, 1, [key.usage is of type refcount_t])
2033 ]) #LC_HAVE_KEY_USAGE_REFCOUNT
2036 # LC_HAVE_CRYPTO_MAX_ALG_NAME_128
2038 # Kernel version 4.11 commit f437a3f477cce402dbec6537b29e9e33962c9f73
2039 # switched CRYPTO_MAX_ALG_NAME from 64 to 128.
2041 AC_DEFUN([LC_HAVE_CRYPTO_MAX_ALG_NAME_128], [
2042 LB_CHECK_COMPILE([if 'CRYPTO_MAX_ALG_NAME' is 128],
2043 crypto_max_alg_name, [
2044 #include <linux/crypto.h>
2046 #if CRYPTO_MAX_ALG_NAME != 128
2050 AC_DEFINE(HAVE_CRYPTO_MAX_ALG_NAME_128, 1,
2051 ['CRYPTO_MAX_ALG_NAME' is 128])
2053 ]) # LC_HAVE_CRYPTO_MAX_ALG_NAME_128
2056 # Kernel version 4.12 commit 47f38c539e9a42344ff5a664942075bd4df93876
2057 # CURRENT_TIME is not 64 bit time safe so it was replaced with
2060 AC_DEFUN([LC_CURRENT_TIME], [
2061 LB_CHECK_COMPILE([if CURRENT_TIME has been replaced with current_time],
2063 #include <linux/fs.h>
2067 attr.ia_atime = current_time(NULL);
2069 AC_DEFINE(HAVE_CURRENT_TIME, 1,
2070 [current_time() has replaced CURRENT_TIME])
2072 ]) # LIBCFS_CURRENT_TIME
2075 # Kernel version 4.12-rc3 85787090a21eb749d8b347eaf9ff1a455637473c
2076 # changed struct super_block s_uuid into a proper uuid_t
2078 AC_DEFUN([LC_SUPER_BLOCK_S_UUID], [
2079 LB_CHECK_COMPILE([if 'struct super_block' s_uuid is uuid_t],
2080 super_block_s_uuid, [
2081 #include <linux/fs.h>
2083 struct super_block sb;
2085 uuid_parse(NULL, &sb.s_uuid);
2087 AC_DEFINE(HAVE_S_UUID_AS_UUID_T, 1, ['s_uuid' is an uuid_t])
2089 ]) # LC_SUPER_BLOCK_S_UUID
2092 # LC_SUPER_SETUP_BDI_NAME
2094 # Kernel version 4.12 commit 9594caf216dc0fe3e318b34af0127276db661241
2095 # unified bdi handling
2097 AC_DEFUN([LC_SUPER_SETUP_BDI_NAME], [
2098 LB_CHECK_COMPILE([if 'super_setup_bdi_name' exist],
2099 super_setup_bdi_name, [
2100 #include <linux/fs.h>
2102 super_setup_bdi_name(NULL, "lustre");
2104 AC_DEFINE(HAVE_SUPER_SETUP_BDI_NAME, 1,
2105 ['super_setup_bdi_name' is available])
2107 ]) # LC_SUPER_SETUP_BDI_NAME
2112 # 4.12 replace bi_error to bi_status
2114 AC_DEFUN([LC_BI_STATUS], [
2115 LB_CHECK_COMPILE([if 'bi_status' exist],
2117 #include <linux/blk_types.h>
2119 ((struct bio *)0)->bi_status = 0;
2121 AC_DEFINE(HAVE_BI_STATUS, 1,
2122 ['bi_status' is available])
2127 # LC_BIO_INTEGRITY_ENABLED
2129 # 4.13 removed bio_integrity_enabled
2131 AC_DEFUN([LC_BIO_INTEGRITY_ENABLED], [
2132 LB_CHECK_COMPILE([if 'bio_integrity_enabled' exist],
2133 bio_integrity_enabled, [
2134 #include <linux/bio.h>
2136 bio_integrity_enabled(NULL);
2138 AC_DEFINE(HAVE_BIO_INTEGRITY_ENABLED, 1,
2139 ['bio_integrity_enabled' is available])
2141 ]) # LC_BIO_INTEGRITY_ENABLED
2144 # LC_PAGEVEC_INIT_ONE_PARAM
2146 # 4.14 pagevec_init takes one parameter
2148 AC_DEFUN([LC_PAGEVEC_INIT_ONE_PARAM], [
2149 LB_CHECK_COMPILE([if 'pagevec_init' takes one parameter],
2151 #include <linux/pagevec.h>
2155 AC_DEFINE(HAVE_PAGEVEC_INIT_ONE_PARAM, 1,
2156 ['pagevec_init' takes one parameter])
2158 ]) # LC_PAGEVEC_INIT_ONE_PARAM
2163 # 4.14 replaced bi_bdev to bi_disk
2165 AC_DEFUN([LC_BI_BDEV], [
2166 LB_CHECK_COMPILE([if 'bi_bdev' exist],
2168 #include <linux/bio.h>
2170 ((struct bio *)0)->bi_bdev = NULL;
2172 AC_DEFINE(HAVE_BI_BDEV, 1,
2173 ['bi_bdev' is available])
2178 # LC_INTERVAL_TREE_CACHED
2180 # 4.14 f808c13fd3738948e10196496959871130612b61
2181 # switched INTERVAL_TREE_DEFINE to use cached RB_Trees.
2183 AC_DEFUN([LC_INTERVAL_TREE_CACHED], [
2184 tmp_flags="$EXTRA_KCFLAGS"
2185 EXTRA_KCFLAGS="-Werror"
2186 LB_CHECK_COMPILE([if interval_trees use rb_tree_cached],
2188 #include <linux/interval_tree_generic.h>
2189 struct foo { struct rb_node rb; int last; int a,b;};
2190 #define START(n) ((n)->a)
2191 #define LAST(n) ((n)->b)
2192 struct rb_root_cached tree;
2193 INTERVAL_TREE_DEFINE(struct foo, rb, int, last,
2194 START, LAST, , foo);
2196 foo_insert(NULL, &tree);
2198 AC_DEFINE(HAVE_INTERVAL_TREE_CACHED, 1,
2199 [interval trees use rb_tree_cached])
2201 EXTRA_KCFLAGS="$tmp_flags"
2202 ]) # LC_INTERVAL_TREE_CACHED
2207 # 4.14 introduced IS_ENCRYPTED and S_ENCRYPTED
2209 AC_DEFUN([LC_IS_ENCRYPTED], [
2210 LB_CHECK_COMPILE([if IS_ENCRYPTED is defined],
2212 #include <linux/fs.h>
2214 IS_ENCRYPTED((struct inode *)0);
2216 has_is_encrypted="yes"
2218 ]) # LC_IS_ENCRYPTED
2223 # kernel 4.17 commit b93b016313b3ba8003c3b8bb71f569af91f19fc7
2225 AC_DEFUN([LC_I_PAGES], [
2226 LB_CHECK_COMPILE([if struct address_space has i_pages],
2228 #include <linux/fs.h>
2230 struct address_space mapping = {};
2233 i_pages = &mapping.i_pages;
2235 AC_DEFINE(HAVE_I_PAGES, 1,
2236 [struct address_space has i_pages])
2243 # kernel 4.17 commit 3d3539018d2cbd12e5af4a132636ee7fd8d43ef0
2244 # mm: create the new vm_fault_t type
2246 AC_DEFUN([LC_VM_FAULT_T], [
2247 LB_CHECK_COMPILE([if vm_fault_t type exists],
2249 #include <linux/mm_types.h>
2251 vm_fault_t x = VM_FAULT_SIGBUS;
2254 AC_DEFINE(HAVE_VM_FAULT_T, 1,
2255 [if vm_fault_t type exists])
2262 # kernel 4.17 commit 3d3539018d2cbd12e5af4a132636ee7fd8d43ef0
2263 # mm: VM_FAULT_RETRY is defined in enum vm_fault_reason
2265 AC_DEFUN([LC_VM_FAULT_RETRY], [
2266 LB_CHECK_COMPILE([if VM_FAULT_RETRY is defined],
2268 #include <linux/mm.h>
2270 #ifndef VM_FAULT_RETRY
2275 AC_DEFINE(HAVE_VM_FAULT_RETRY, 1,
2276 [if VM_FAULT_RETRY is defined])
2278 ]) # LC_VM_FAULT_RETRY
2281 # LC_ALLOC_FILE_PSEUDO
2283 # kernel 4.18-rc1 commit d93aa9d82aea80b80f225dbf9c7986df444d8106
2284 # new wrapper: alloc_file_pseudo()
2286 AC_DEFUN([LC_ALLOC_FILE_PSEUDO], [
2287 LB_CHECK_COMPILE([if 'alloc_file_pseudo' is defined],
2288 alloc_file_pseudo, [
2289 #include <linux/file.h>
2292 file = alloc_file_pseudo(NULL, NULL, "[test]",
2295 AC_DEFINE(HAVE_ALLOC_FILE_PSEUDO, 1,
2296 ['alloc_file_pseudo' exist])
2298 ]) # LC_ALLOC_FILE_PSEUDO
2301 # LC_INODE_TIMESPEC64
2303 # kernel 4.17-rc7 commit 8efd6894ff089adeeac7cb9f32125b85d963d1bc
2304 # fs: add timespec64_truncate()
2305 # kernel 4.18 commit 95582b00838837fc07e042979320caf917ce3fe6
2306 # inode timestamps switched to timespec64
2307 # kernel 4.19-rc2 commit 976516404ff3fab2a8caa8bd6f5efc1437fed0b8
2308 # y2038: remove unused time interfaces
2312 # When inode times are timespec64 stop using the deprecated
2315 # kernel v5.5-rc1-6-gba70609d5ec6 ba70609d5ec664a8f36ba1c857fcd97a478adf79
2316 # fs: Delete timespec64_trunc()
2318 AC_DEFUN([LC_INODE_TIMESPEC64], [
2319 tmp_flags="$EXTRA_KCFLAGS"
2320 EXTRA_KCFLAGS="-Werror"
2321 LB_CHECK_COMPILE([if inode timestamps are struct timespec64],
2323 #include <linux/fs.h>
2325 struct inode *inode = NULL;
2326 struct timespec64 ts = {0, 1};
2328 inode->i_atime = ts;
2331 AC_DEFINE(HAVE_INODE_TIMESPEC64, 1,
2332 [inode times are using timespec64])
2334 EXTRA_KCFLAGS="$tmp_flags"
2335 ]) # LC_INODE_TIMESPEC64
2338 # LC_RADIX_TREE_TAG_SET
2340 # kernel 4.20 commit v4.19-rc5-248-g9b89a0355144
2341 # xarray: Add XArray marks - replaced radix_tree_tag_set
2343 AC_DEFUN([LC_RADIX_TREE_TAG_SET], [
2344 tmp_flags="$EXTRA_KCFLAGS"
2345 EXTRA_KCFLAGS="-Werror"
2346 LB_CHECK_COMPILE([if 'radix_tree_tag_set' exists],
2347 radix_tree_tag_set, [
2348 #include <linux/fs.h>
2349 #include <linux/radix-tree.h>
2351 radix_tree_tag_set(NULL, 0, PAGECACHE_TAG_DIRTY);
2353 AC_DEFINE(HAVE_RADIX_TREE_TAG_SET, 1,
2354 [radix_tree_tag_set exists])
2356 EXTRA_KCFLAGS="$tmp_flags"
2357 ]) # LC_RADIX_TREE_TAG_SET
2360 # LC_UAPI_LINUX_MOUNT_H
2362 # kernel 4.20 commit e262e32d6bde0f77fb0c95d977482fc872c51996
2363 # vfs: Suppress MS_* flag defs within the kernel ...
2365 AC_DEFUN([LC_UAPI_LINUX_MOUNT_H], [
2366 tmp_flags="$EXTRA_KCFLAGS"
2367 EXTRA_KCFLAGS="-Werror"
2368 LB_CHECK_COMPILE([if MS_RDONLY was moved to uapi/linux/mount.h],
2370 #include <uapi/linux/mount.h>
2375 AC_DEFINE(HAVE_UAPI_LINUX_MOUNT_H, 1,
2376 [if MS_RDONLY was moved to uapi/linux/mount.h])
2378 EXTRA_KCFLAGS="$tmp_flags"
2379 ]) # LC_UAPI_LINUX_MOUNT_H
2382 # LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
2384 # kernel 4.20 commit 1863d77f15da0addcd293a1719fa5d3ef8cde3ca
2385 # SUNRPC: Replace the cache_detail->hash_lock with a regular spinlock
2387 # Now that the reader functions are all RCU protected, use a regular
2388 # spinlock rather than a reader/writer lock.
2390 AC_DEFUN([LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK], [
2391 tmp_flags="$EXTRA_KCFLAGS"
2392 EXTRA_KCFLAGS="-Werror"
2393 LB_CHECK_COMPILE([if cache_detail->hash_lock is a spinlock],
2394 hash_lock_isa_spinlock_t, [
2395 #include <linux/sunrpc/cache.h>
2397 spinlock_t *lock = &(((struct cache_detail *)0)->hash_lock);
2400 AC_DEFINE(HAVE_CACHE_HASH_SPINLOCK, 1,
2401 [if cache_detail->hash_lock is a spinlock])
2403 EXTRA_KCFLAGS="$tmp_flags"
2404 ]) # LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
2407 # LC_HAS_LINUX_SELINUX_ENABLED
2409 # kernel 5.1 commit 3d252529480c68bfd6a6774652df7c8968b28e41
2410 # SELinux: Remove unused selinux_is_enabled
2412 AC_DEFUN([LC_HAS_LINUX_SELINUX_ENABLED], [
2413 tmp_flags="$EXTRA_KCFLAGS"
2414 EXTRA_KCFLAGS="-Werror"
2415 LB_CHECK_COMPILE([if linux/selinux.h exists],
2416 selinux_is_enabled, [
2417 #include <linux/selinux.h>
2419 bool has_selinux = selinux_is_enabled();
2422 AC_DEFINE(HAVE_LINUX_SELINUX_IS_ENABLED, 1,
2423 [if linux/selinux.h exists])
2425 EXTRA_KCFLAGS="$tmp_flags"
2426 ]) # LC_HAS_LINUX_SELINUX_ENABLED
2429 # LB_HAVE_BVEC_ITER_ALL
2431 # kernel 5.1 commit 6dc4f100c175dd0511ae8674786e7c9006cdfbfa
2432 # block: allow bio_for_each_segment_all() to iterate over multi-page bvec
2434 AC_DEFUN([LB_HAVE_BVEC_ITER_ALL], [
2435 tmp_flags="$EXTRA_KCFLAGS"
2436 EXTRA_KCFLAGS="-Werror"
2437 LB_CHECK_COMPILE([if bvec_iter_all exists for multi-page bvec iternation],
2439 #include <linux/bvec.h>
2441 struct bvec_iter_all iter;
2444 AC_DEFINE(HAVE_BVEC_ITER_ALL, 1,
2445 [if bvec_iter_all exists for multi-page bvec iternation])
2447 EXTRA_KCFLAGS="$tmp_flags"
2448 ]) # LB_HAVE_BVEC_ITER_ALL
2451 # LC_ACCOUNT_PAGE_DIRTIED
2453 # After 5.2 kernel page dirtied is not exported
2455 AC_DEFUN([LC_ACCOUNT_PAGE_DIRTIED], [
2456 LB_CHECK_EXPORT([account_page_dirtied], [mm/page-writeback.c],
2457 [AC_DEFINE(HAVE_ACCOUNT_PAGE_DIRTIED_EXPORT, 1,
2458 [account_page_dirtied is exported])])
2459 ]) # LC_ACCOUNT_PAGE_DIRTIED
2462 # LC_KEYRING_SEARCH_4ARGS
2464 # Kernel 5.2 commit dcf49dbc8077
2465 # keys: Add a 'recurse' flag for keyring searches
2467 AC_DEFUN([LC_KEYRING_SEARCH_4ARGS], [
2468 LB_CHECK_COMPILE([if 'keyring_search' has 4 args],
2469 keyring_search_4args, [
2470 #include <linux/key.h>
2473 keyring_search(keyring, NULL, NULL, false);
2475 AC_DEFINE(HAVE_KEYRING_SEARCH_4ARGS, 1,
2476 [keyring_search has 4 args])
2478 ]) # LC_KEYRING_SEARCH_4ARGS
2481 # LC_BIO_BI_PHYS_SEGMENTS
2483 # kernel 5.3-rc1 commit 14ccb66b3f585b2bc21e7256c96090abed5a512c
2484 # block: remove the bi_phys_segments field in struct bio
2486 AC_DEFUN([LC_BIO_BI_PHYS_SEGMENTS], [
2487 tmp_flags="$EXTRA_KCFLAGS"
2488 EXTRA_KCFLAGS="-Werror"
2489 LB_CHECK_COMPILE([if struct bio has bi_phys_segments member],
2490 bye_bio_bi_phys_segments, [
2491 #include <linux/bio.h>
2493 struct bio *bio = NULL;
2494 bio->bi_phys_segments++;
2496 AC_DEFINE(HAVE_BIO_BI_PHYS_SEGMENTS, 1,
2497 [struct bio has bi_phys_segments member])
2499 EXTRA_KCFLAGS="$tmp_flags"
2500 ]) # LC_BIO_BI_PHYS_SEGMENTS
2503 # LC_LM_COMPARE_OWNER_EXISTS
2505 # kernel 5.3-rc3 commit f85d93385e9fe6886a751f647f6812a89bf6bee3
2506 # locks: Cleanup lm_compare_owner and lm_owner_key
2507 # removed lm_compare_owner
2509 AC_DEFUN([LC_LM_COMPARE_OWNER_EXISTS], [
2510 tmp_flags="$EXTRA_KCFLAGS"
2511 EXTRA_KCFLAGS="-Werror"
2512 LB_CHECK_COMPILE([if lock_manager_operations has lm_compare_owner],
2513 lock_manager_ops_lm_compare_owner, [
2514 #include <linux/fs.h>
2516 struct lock_manager_operations lm_ops;
2517 lm_ops.lm_compare_owner = NULL;
2519 AC_DEFINE(HAVE_LM_COMPARE_OWNER, 1,
2520 [lock_manager_operations has lm_compare_owner])
2522 EXTRA_KCFLAGS="$tmp_flags"
2523 ]) # LC_LM_COMPARE_OWNER_EXISTS
2526 # LC_FSCRYPT_SUPPORT
2528 # 5.4 introduced fscrypt encryption policies v2
2530 AC_DEFUN([LC_FSCRYPT_SUPPORT], [
2531 LB_CHECK_COMPILE([for fscrypt in-kernel support],
2533 #define __FS_HAS_ENCRYPTION 0
2534 #include <linux/fscrypt.h>
2536 fscrypt_ioctl_get_policy_ex(NULL, NULL);
2538 has_fscrypt_support="yes"
2540 ]) # LC_FSCRYPT_SUPPORT
2543 # LC_FSCRYPT_DIGESTED_NAME
2545 # Kernel 5.5-rc4 edc440e3d27fb31e6f9663cf413fad97d714c060
2546 # improved the format of no-key names. This results in the
2547 # removal of FSCRYPT_FNAME_DIGEST and FSCRYPT_FNAME_DIGEST_SIZE.
2549 AC_DEFUN([LC_FSCRYPT_DIGESTED_NAME], [
2550 tmp_flags="$EXTRA_KCFLAGS"
2551 EXTRA_KCFLAGS="-Werror"
2552 LB_CHECK_COMPILE([if fscrypt has 'struct fscrypt_digested_name'],
2553 fscrypt_digested_name, [
2554 #include <linux/fscrypt.h>
2556 struct fscrypt_digested_name fname;
2560 AC_DEFINE(HAVE_FSCRYPT_DIGESTED_NAME, 1,
2561 ['struct fscrypt_digested_name' exists])
2563 EXTRA_KCFLAGS="$tmp_flags"
2564 ]) # LC_FSCRYPT_DIGESTED_NAME
2567 # LC_FSCRYPT_DUMMY_CONTEXT_ENABLED
2569 # Kernel 5.7-rc7 ed318a6cc0b620440e65f48eb527dc3df7269ce4
2570 # replaces fscrypt_dummy_context_enabled() with
2571 # fscrypt_get_dummy_context(). Later kernels rename
2572 # fscrypt_get_dummy_context() to fscrypt_get_dummy_policy()
2573 # which is why we test fscrypt_dummy_context_enabled().
2575 AC_DEFUN([LC_FSCRYPT_DUMMY_CONTEXT_ENABLED], [
2576 tmp_flags="$EXTRA_KCFLAGS"
2577 EXTRA_KCFLAGS="-Werror"
2578 LB_CHECK_COMPILE([if fscrypt_dummy_context_enabled() exists],
2579 fscrypt_dummy_context_enabled, [
2580 #include <linux/fscrypt.h>
2582 fscrypt_dummy_context_enabled(NULL);
2584 AC_DEFINE(HAVE_FSCRYPT_DUMMY_CONTEXT_ENABLED, 1,
2585 [fscrypt_dummy_context_enabled() exists])
2587 EXTRA_KCFLAGS="$tmp_flags"
2588 ]) # LC_FSCRYPT_DUMMY_CONTEXT_ENABLED
2591 # LC_FSCRYPT_IS_NOKEY_NAME
2593 # Kernel 5.10-rc4 159e1de201b6fca10bfec50405a3b53a561096a8
2594 # introduced fscrypt_is_nokey_name() inline macro. While
2595 # introduced for 5.10 kernels it was backported to earlier
2596 # Ubuntu kernels. Also it hides the change introduced due
2597 # to git commit 501e43fbe for kernel 5.9 which also was
2598 # backported to earlier Ubuntu kernels.
2600 AC_DEFUN([LC_FSCRYPT_IS_NOKEY_NAME], [
2601 tmp_flags="$EXTRA_KCFLAGS"
2602 EXTRA_KCFLAGS="-Werror"
2603 LB_CHECK_COMPILE([if fscrypt_is_nokey_name() exists],
2604 fscrypt_is_no_key_name, [
2605 #include <linux/fscrypt.h>
2607 fscrypt_is_nokey_name(NULL);
2609 AC_DEFINE(HAVE_FSCRYPT_IS_NOKEY_NAME, 1,
2610 [fscrypt_is_nokey_name() exists])
2612 EXTRA_KCFLAGS="$tmp_flags"
2613 ]) # LC_FSCRYPT_IS_NOKEY_NAME
2616 # LC_HAVE_USER_NAMESPACE_ARG
2618 # kernel 5.12 commit 549c7297717c32ee53f156cd949e055e601f67bb
2619 # fs: make helpers idmap mount aware
2620 # Extend some inode methods with an additional user namespace argument.
2622 AC_DEFUN([LC_HAVE_USER_NAMESPACE_ARG], [
2623 tmp_flags="$EXTRA_KCFLAGS"
2624 EXTRA_KCFLAGS="-Werror"
2625 LB_CHECK_COMPILE([if 'inode_operations' members have user namespace argument],
2626 user_namespace_argument, [
2627 #include <linux/fs.h>
2629 ((struct inode_operations *)1)->getattr((struct user_namespace *)NULL,
2632 AC_DEFINE(HAVE_USER_NAMESPACE_ARG, 1,
2633 ['inode_operations' members have user namespace argument])
2635 EXTRA_KCFLAGS="$tmp_flags"
2636 ]) # LC_HAVE_USER_NAMESPACE_ARG
2639 # LC_HAVE_GET_ACL_RCU_ARG
2641 # kernel 5.15 commit 0cad6246621b5887d5b33fea84219d2a71f2f99a
2642 # vfs: add rcu argument to ->get_acl() callback
2643 # Add a rcu argument to the ->get_acl() callback to allow
2644 # get_cached_acl_rcu() to call the ->get_acl() method.
2646 AC_DEFUN([LC_HAVE_GET_ACL_RCU_ARG], [
2647 tmp_flags="$EXTRA_KCFLAGS"
2648 EXTRA_KCFLAGS="-Werror"
2649 LB_CHECK_COMPILE([if 'get_acl' has a rcu argument],
2650 get_acl_rcu_argument, [
2651 #include <linux/fs.h>
2653 ((struct inode_operations *)1)->get_acl((struct inode *)NULL, 0, false);
2655 AC_DEFINE(HAVE_GET_ACL_RCU_ARG, 1,
2656 ['get_acl' has a rcu argument])
2658 EXTRA_KCFLAGS="$tmp_flags"
2659 ]) # LC_HAVE_GET_ACL_RCU_ARG
2661 AC_DEFUN([LC_PROG_LINUX_SRC], [])
2662 AC_DEFUN([LC_PROG_LINUX_RESULTS], [])
2667 # Lustre linux kernel checks
2669 AC_DEFUN([LC_PROG_LINUX], [
2670 AC_MSG_NOTICE([Lustre kernel checks
2671 ==============================================================================])
2676 LC_CONFIG_HEALTH_CHECK_WRITE
2677 LC_CONFIG_LRU_RESIZE
2682 LC_HAVE_PROJECT_QUOTA
2689 LC_HAVE_DENTRY_D_U_D_ALIAS
2690 LC_HAVE_DENTRY_D_CHILD
2691 LC_PID_NS_FOR_CHILDREN
2694 LC_OLDSIZE_TRUNCATE_PAGECACHE
2695 LC_PTR_ERR_OR_ZERO_MISSING
2697 LC_REGISTER_SHRINKER_RET
2702 LC_HAVE_D_IS_POSITIVE
2706 LC_HAVE_TRUNCATE_IPAGES_FINAL
2707 LC_IOPS_RENAME_WITH_FLAGS
2714 LC_DIRECTIO_USE_ITER
2715 LC_HAVE_IOV_ITER_INIT_DIRECTION
2716 LC_HAVE_IOV_ITER_TRUNCATE
2717 LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
2720 LC_HAVE_INTERVAL_BLK_INTEGRITY
2724 LC_PERCPU_COUNTER_INIT
2725 LC_NFS_FILLDIR_USE_CTX
2729 LC_HAVE_DQUOT_QC_DQBLK
2730 LC_HAVE_AIO_COMPLETE
2731 LC_HAVE_IS_ROOT_INODE
2734 LC_BACKING_DEV_INFO_REMOVAL
2735 LC_HAVE_BDI_CAP_MAP_COPY
2739 LC_HAVE_SYNC_READ_WRITE
2743 LC_BIO_ENDIO_USES_ONE_ARG
2744 LC_SYMLINK_OPS_USE_NAMEIDATA
2745 LC_ACCOUNT_PAGE_DIRTIED_3ARGS
2746 LC_HAVE_CRYPTO_ALLOC_SKCIPHER
2749 LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
2750 LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
2751 LC_HAVE_CACHE_HEAD_HLIST
2752 LC_HAVE_XATTR_HANDLER_SIMPLIFIED
2755 LC_HAVE_LOCKS_LOCK_FILE_WAIT
2756 LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
2757 LC_HAVE_XATTR_HANDLER_NAME
2759 LC_HAVE_SUBMIT_BIO_2ARGS
2760 LC_HAVE_CLEAN_BDEV_ALIASES
2767 LC_HAVE_IOP_GET_LINK
2770 LC_HAVE_IN_COMPAT_SYSCALL
2771 LC_HAVE_XATTR_HANDLER_INODE_PARAM
2778 LC_GENERIC_WRITE_SYNC_2ARGS
2779 LC_FOP_ITERATE_SHARED
2782 LC_EXPORT_DEFAULT_FILE_SPLICE_READ
2783 LC_HAVE_POSIX_ACL_VALID_USER_NS
2785 LC_FULL_NAME_HASH_3ARGS
2786 LC_STRUCT_POSIX_ACL_XATTR
2792 LC_POSIX_ACL_UPDATE_MODE
2795 LC_IOP_GENERIC_READLINK
2796 LC_HAVE_VM_FAULT_ADDRESS
2799 LC_INODEOPS_ENHANCED_GETATTR
2800 LC_VM_OPERATIONS_REMOVE_VMF_ARG
2801 LC_HAVE_KEY_USAGE_REFCOUNT
2802 LC_HAVE_CRYPTO_MAX_ALG_NAME_128
2806 LC_SUPER_BLOCK_S_UUID
2807 LC_SUPER_SETUP_BDI_NAME
2811 LC_BIO_INTEGRITY_ENABLED
2812 LC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL
2813 LC_HAVE_GET_INODE_USAGE
2816 LC_PAGEVEC_INIT_ONE_PARAM
2818 LC_INTERVAL_TREE_CACHED
2826 LC_ALLOC_FILE_PSEUDO
2830 LC_RADIX_TREE_TAG_SET
2831 LC_UAPI_LINUX_MOUNT_H
2832 LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
2835 LC_HAS_LINUX_SELINUX_ENABLED
2836 LB_HAVE_BVEC_ITER_ALL
2839 LC_ACCOUNT_PAGE_DIRTIED
2840 LC_KEYRING_SEARCH_4ARGS
2843 LC_BIO_BI_PHYS_SEGMENTS
2844 LC_LM_COMPARE_OWNER_EXISTS
2847 LC_FSCRYPT_DIGESTED_NAME
2850 LC_FSCRYPT_DUMMY_CONTEXT_ENABLED
2853 LC_FSCRYPT_IS_NOKEY_NAME
2856 LC_HAVE_USER_NAMESPACE_ARG
2859 LC_HAVE_GET_ACL_RCU_ARG
2861 # kernel patch to extend integrity interface
2862 LC_BIO_INTEGRITY_PREP_FN
2865 AS_IF([test "x$enable_server" != xno], [
2875 # Check whether to build the client side of Lustre
2877 AC_DEFUN([LC_CONFIG_CLIENT], [
2878 AC_MSG_CHECKING([whether to build Lustre client support])
2879 AC_ARG_ENABLE([client],
2880 AS_HELP_STRING([--disable-client],
2881 [disable Lustre client support]),
2882 [], [enable_client="yes"])
2883 AC_MSG_RESULT([$enable_client])
2884 ]) # LC_CONFIG_CLIENT
2889 AC_DEFUN([LB_CONFIG_MPITESTS], [
2890 AC_ARG_ENABLE([mpitests],
2891 AS_HELP_STRING([--enable-mpitests=<yes|no|mpicc wrapper>],
2892 [include mpi tests]), [
2893 enable_mpitests="yes"
2896 MPICC_WRAPPER="mpicc"
2897 MPI_BIN=$(eval which $MPICC_WRAPPER | xargs dirname)
2900 enable_mpitests="no"
2904 MPICC_WRAPPER=$enableval
2905 MPI_BIN=$(eval echo $MPICC_WRAPPER | xargs dirname)
2909 enable_mpitests="yes"
2910 MPICC_WRAPPER="mpicc"
2911 MPI_BIN=$(eval which $MPICC_WRAPPER | xargs dirname)
2914 if test "x$enable_mpitests" != "xno"; then
2917 AC_CACHE_CHECK([whether mpitests can be built],
2918 lb_cv_mpi_tests, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([
2922 MPI_Initialized(&flag);
2925 ])], [lb_cv_mpi_tests="yes"], [lb_cv_mpi_tests="no"])
2927 enable_mpitests=$lb_cv_mpi_tests
2931 AC_SUBST(MPICC_WRAPPER)
2932 ]) # LB_CONFIG_MPITESTS
2937 # whether to enable quota support global control
2939 AC_DEFUN([LC_CONFIG_QUOTA], [
2940 AC_MSG_CHECKING([whether to enable quota support global control])
2941 AC_ARG_ENABLE([quota],
2942 AS_HELP_STRING([--enable-quota],
2943 [enable quota support]),
2944 [], [enable_quota="yes"])
2945 AS_IF([test "x$enable_quota" = xyes],
2946 [AC_MSG_RESULT([yes])],
2947 [AC_MSG_RESULT([no])])
2948 ]) # LC_CONFIG_QUOTA
2953 AC_DEFUN([LC_QUOTA], [
2957 AS_IF([test "x$enable_quota" != xno -a "x$enable_utils" != xno], [
2958 AC_CHECK_HEADER([sys/quota.h],
2959 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1,
2960 [Define to 1 if you have <sys/quota.h>.])],
2961 [AC_MSG_ERROR([don't find <sys/quota.h> in your system])])
2968 # configure support for optional OSD implementation
2970 AC_DEFUN([LC_OSD_ADDON], [
2971 AC_MSG_CHECKING([whether to use OSD addon])
2973 AS_HELP_STRING([--with-osd=path],
2974 [set path to optional osd]),
2981 OSDADDON="$with_osd"
2988 AS_IF([test $ENABLEOSDADDON -eq 0], [
2992 OSDMODNAME=$(basename $OSDADDON)
2993 AS_IF([test -e $LUSTRE/$OSDMODNAME], [
2994 AC_MSG_RESULT([can't link])
2996 ], [ln -s $OSDADDON $LUSTRE/$OSDMODNAME], [
2997 AC_MSG_RESULT([$OSDMODNAME])
2998 OSDADDON="obj-m += $OSDMODNAME/"
3000 AC_MSG_RESULT([can't link])
3010 # Check whether to enable Lustre client crypto
3012 AC_DEFUN([LC_CONFIG_CRYPTO], [
3013 AC_MSG_CHECKING([whether to enable Lustre client crypto])
3014 AC_ARG_ENABLE([crypto],
3015 AS_HELP_STRING([--enable-crypto=yes|no|in-kernel],
3016 [enable Lustre client crypto (default is yes), use 'in-kernel' to force use of in-kernel fscrypt instead of embedded llcrypt]),
3017 [], [enable_crypto="auto"])
3018 AS_IF([test "x$enable_crypto" != xno -a "x$enable_dist" = xno], [
3022 LC_FSCRYPT_SUPPORT])
3023 AS_IF([test "x$enable_crypto" = xin-kernel], [
3024 AS_IF([test "x$has_fscrypt_support" = xyes], [
3025 AC_DEFINE(HAVE_LUSTRE_CRYPTO, 1, [Enable Lustre client crypto via in-kernel fscrypt])], [
3026 AC_MSG_ERROR([Lustre client crypto cannot be enabled via in-kernel fscrypt.])
3027 enable_crypto=no])],
3028 [AS_IF([test "x$has_is_encrypted" = xyes], [
3029 AC_DEFINE(HAVE_LUSTRE_CRYPTO, 1, [Enable Lustre client crypto via embedded llcrypt])
3030 AC_DEFINE(CONFIG_LL_ENCRYPTION, 1, [embedded llcrypt])
3031 AC_DEFINE(HAVE_FSCRYPT_DUMMY_CONTEXT_ENABLED, 1, [embedded llcrypt uses llcrypt_dummy_context_enabled()])
3032 enable_crypto="embedded llcrypt"
3033 enable_llcrypt=yes], [
3034 AS_IF([test "x$enable_crypto" = xyes],
3035 [AC_MSG_ERROR([Lustre client crypto cannot be enabled because of lack of encryption support in your kernel.])])
3036 AS_IF([test "x$enable_crypto" != xno -a "x$enable_dist" = xno],
3037 [AC_MSG_WARN(Lustre client crypto cannot be enabled because of lack of encryption support in your kernel.)])
3038 enable_crypto=no])])
3039 AS_IF([test "x$enable_dist" != xno], [
3041 enable_llcrypt=yes])
3042 AC_MSG_RESULT([$enable_crypto])
3043 ]) # LC_CONFIG_CRYPTO
3048 # other configure checks
3050 AC_DEFUN([LC_CONFIGURE], [
3051 AC_MSG_NOTICE([Lustre core checks
3052 ==============================================================================])
3054 AS_IF([test $target_cpu == "i686" -o $target_cpu == "x86_64"],
3055 [CFLAGS="$CFLAGS -Wall -Werror"])
3057 # maximum MDS thread count
3060 # lustre/utils/gss/gss_util.c
3061 # lustre/utils/gss/gssd_proc.c
3062 # lustre/utils/gss/krb5_util.c
3063 # lustre/utils/llog_reader.c
3064 # lustre/utils/create_iam.c
3065 # lustre/utils/libiam.c
3066 AC_CHECK_HEADERS([netdb.h endian.h])
3067 AC_CHECK_FUNCS([gethostbyname])
3069 # lustre/utils/llverfs.c lustre/utils/libmount_utils_ldiskfs.c
3070 AC_CHECK_HEADERS([ext2fs/ext2fs.h], [], [
3071 AS_IF([test "x$enable_utils" = xyes -a "x$enable_ldiskfs" = xyes], [
3073 ext2fs.h not found. Please install e2fsprogs development package.
3078 # lustre/tests/statx_test.c
3079 AC_CHECK_FUNCS([statx])
3081 # lustre/utils/lfs.c
3082 AS_IF([test "$enable_dist" = "no"], [
3083 AC_CHECK_LIB([z], [crc32], [
3084 AC_CHECK_HEADER([zlib.h], [], [
3085 AC_MSG_ERROR([zlib.h not found.])])
3088 zlib library not found. Please install zlib development package.])
3094 AC_CHECK_LIB([selinux], [is_selinux_enabled],
3095 [AC_CHECK_HEADERS([selinux/selinux.h],
3096 [SELINUX="-lselinux"
3097 AC_DEFINE([HAVE_SELINUX], 1,
3098 [support for selinux ])],
3101 No libselinux-devel package found, unable to build selinux enabled tools
3106 No selinux package found, unable to build selinux enabled tools
3111 AC_CHECK_LIB([keyutils], [add_key])
3114 AC_MSG_CHECKING([whether to report minimum OST free space])
3115 AC_ARG_ENABLE([mindf],
3116 AS_HELP_STRING([--enable-mindf],
3117 [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
3118 [], [enable_mindf="no"])
3119 AC_MSG_RESULT([$enable_mindf])
3120 AS_IF([test "$enable_mindf" = "yes"],
3121 [AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])])
3123 AC_MSG_CHECKING([whether to randomly failing memory alloc])
3124 AC_ARG_ENABLE([fail_alloc],
3125 AS_HELP_STRING([--disable-fail-alloc],
3126 [disable randomly alloc failure]),
3127 [], [enable_fail_alloc="yes"])
3128 AC_MSG_RESULT([$enable_fail_alloc])
3129 AS_IF([test "x$enable_fail_alloc" != xno],
3130 [AC_DEFINE([RANDOM_FAIL_ALLOC], 1,
3131 [enable randomly alloc failure])])
3133 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
3134 AC_ARG_ENABLE([invariants],
3135 AS_HELP_STRING([--enable-invariants],
3136 [enable invariant checking (cpu intensive)]),
3137 [], [enable_invariants="no"])
3138 AC_MSG_RESULT([$enable_invariants])
3139 AS_IF([test "x$enable_invariants" = xyes],
3140 [AC_DEFINE([CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK], 1,
3141 [enable invariant checking])])
3143 AC_MSG_CHECKING([whether to track references with lu_ref])
3144 AC_ARG_ENABLE([lu_ref],
3145 AS_HELP_STRING([--enable-lu_ref],
3146 [enable lu_ref reference tracking code]),
3147 [], [enable_lu_ref="no"])
3148 AC_MSG_RESULT([$enable_lu_ref])
3149 AS_IF([test "x$enable_lu_ref" = xyes],
3150 [AC_DEFINE([CONFIG_LUSTRE_DEBUG_LU_REF], 1,
3151 [enable lu_ref reference tracking code])])
3153 AC_MSG_CHECKING([whether to enable page state tracking])
3154 AC_ARG_ENABLE([pgstate-track],
3155 AS_HELP_STRING([--enable-pgstate-track],
3156 [enable page state tracking]),
3157 [], [enable_pgstat_track="no"])
3158 AC_MSG_RESULT([$enable_pgstat_track])
3159 AS_IF([test "x$enable_pgstat_track" = xyes],
3160 [AC_DEFINE([CONFIG_DEBUG_PAGESTATE_TRACKING], 1,
3161 [enable page state tracking code])])
3164 AC_MSG_CHECKING([systemd unit file directory])
3165 AC_ARG_WITH([systemdsystemunitdir],
3166 [AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
3167 [Directory for systemd service files])],
3168 [], [with_systemdsystemunitdir=auto])
3169 AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"],
3170 [def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
3171 AS_IF([test "x$def_systemdsystemunitdir" = "x"],
3172 [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
3173 [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
3174 with_systemdsystemunitdir=no],
3175 [with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
3176 AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
3177 [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
3178 AC_MSG_RESULT([$with_systemdsystemunitdir])
3180 AC_MSG_CHECKING([bash-completion directory])
3181 AC_ARG_WITH([bash-completion-dir],
3182 AS_HELP_STRING([--with-bash-completion-dir[=PATH]],
3183 [Install the bash auto-completion script in this directory.]),
3185 [with_bash_completion_dir=yes])
3186 AS_IF([test "x$with_bash_completion_dir" = "xyes"], [
3187 BASH_COMPLETION_DIR="`pkg-config --variable=completionsdir bash-completion`"
3188 AS_IF([test "x$BASH_COMPLETION_DIR" = "x"], [
3189 [BASH_COMPLETION_DIR="/usr/share/bash-completion/completions"]
3192 BASH_COMPLETION_DIR="$with_bash_completion_dir"
3194 AC_SUBST([BASH_COMPLETION_DIR])
3195 AC_MSG_RESULT([$BASH_COMPLETION_DIR])
3201 # AM_CONDITIONALS for lustre
3203 AC_DEFUN([LC_CONDITIONALS], [
3204 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
3205 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
3206 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
3207 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
3208 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
3209 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
3210 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
3211 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
3212 AM_CONDITIONAL(GSS_SSK, test x$enable_ssk = xyes)
3213 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
3214 AM_CONDITIONAL(HAVE_SYSTEMD, test "x$with_systemdsystemunitdir" != "xno")
3215 AM_CONDITIONAL(ENABLE_BASH_COMPLETION, test "x$with_bash_completion_dir" != "xno")
3216 AM_CONDITIONAL(XATTR_HANDLER, test "x$lb_cv_compile_xattr_handler_flags" = xyes)
3217 AM_CONDITIONAL(SELINUX, test "$SELINUX" = "-lselinux")
3218 AM_CONDITIONAL(GETSEPOL, test x$enable_getsepol = xyes)
3219 AM_CONDITIONAL(LLCRYPT, test x$enable_llcrypt = xyes)
3220 AM_CONDITIONAL(LIBAIO, test x$enable_libaio = xyes)
3221 ]) # LC_CONDITIONALS
3226 # files that should be generated with AC_OUTPUT
3228 AC_DEFUN([LC_CONFIG_FILES],
3232 lustre/autoconf/Makefile
3233 lustre/conf/Makefile
3234 lustre/conf/resource/Makefile
3235 lustre/contrib/Makefile
3237 lustre/include/Makefile
3238 lustre/include/lustre/Makefile
3239 lustre/include/uapi/linux/lustre/Makefile
3240 lustre/kernel_patches/targets/5.14-rhel9.0.target
3241 lustre/kernel_patches/targets/4.18-rhel8.7.target
3242 lustre/kernel_patches/targets/4.18-rhel8.6.target
3243 lustre/kernel_patches/targets/4.18-rhel8.5.target
3244 lustre/kernel_patches/targets/4.18-rhel8.4.target
3245 lustre/kernel_patches/targets/4.18-rhel8.3.target
3246 lustre/kernel_patches/targets/4.18-rhel8.2.target
3247 lustre/kernel_patches/targets/4.18-rhel8.1.target
3248 lustre/kernel_patches/targets/4.18-rhel8.target
3249 lustre/kernel_patches/targets/3.10-rhel7.9.target
3250 lustre/kernel_patches/targets/3.10-rhel7.8.target
3251 lustre/kernel_patches/targets/3.10-rhel7.7.target
3252 lustre/kernel_patches/targets/3.10-rhel7.6.target
3253 lustre/kernel_patches/targets/3.10-rhel7.5.target
3254 lustre/kernel_patches/targets/4.14-rhel7.5.target
3255 lustre/kernel_patches/targets/4.14-rhel7.6.target
3256 lustre/kernel_patches/targets/4.12-sles12sp4.target
3257 lustre/kernel_patches/targets/4.12-sles12sp5.target
3258 lustre/kernel_patches/targets/4.12-sles15sp1.target
3259 lustre/kernel_patches/targets/5.3-sles15sp2.target
3260 lustre/kernel_patches/targets/5.3-sles15sp3.target
3261 lustre/kernel_patches/targets/5.14-sles15sp4.target
3262 lustre/kernel_patches/targets/3.x-fc18.target
3263 lustre/ldlm/Makefile
3265 lustre/fid/autoMakefile
3266 lustre/llite/Makefile
3267 lustre/llite/autoMakefile
3269 lustre/lov/autoMakefile
3271 lustre/mdc/autoMakefile
3273 lustre/lmv/autoMakefile
3274 lustre/lfsck/Makefile
3275 lustre/lfsck/autoMakefile
3277 lustre/mdt/autoMakefile
3279 lustre/mdd/autoMakefile
3281 lustre/fld/autoMakefile
3282 lustre/obdclass/Makefile
3283 lustre/obdclass/autoMakefile
3284 lustre/obdecho/Makefile
3285 lustre/obdecho/autoMakefile
3287 lustre/ofd/autoMakefile
3289 lustre/osc/autoMakefile
3291 lustre/ost/autoMakefile
3292 lustre/osd-ldiskfs/Makefile
3293 lustre/osd-ldiskfs/autoMakefile
3294 lustre/osd-zfs/Makefile
3295 lustre/osd-zfs/autoMakefile
3297 lustre/mgc/autoMakefile
3299 lustre/mgs/autoMakefile
3300 lustre/target/Makefile
3301 lustre/ptlrpc/Makefile
3302 lustre/ptlrpc/autoMakefile
3303 lustre/ptlrpc/gss/Makefile
3304 lustre/ptlrpc/gss/autoMakefile
3305 lustre/quota/Makefile
3306 lustre/quota/autoMakefile
3307 lustre/scripts/Makefile
3308 lustre/scripts/systemd/Makefile
3309 lustre/tests/Makefile
3310 lustre/tests/mpi/Makefile
3311 lustre/tests/lutf/Makefile
3312 lustre/tests/lutf/src/Makefile
3313 lustre/tests/kernel/Makefile
3314 lustre/tests/kernel/autoMakefile
3315 lustre/utils/Makefile
3316 lustre/utils/gss/Makefile
3318 lustre/osp/autoMakefile
3320 lustre/lod/autoMakefile
3322 ]) # LC_CONFIG_FILES