4 # Wrapper for AC_CONFIG_SUBDIR
6 AC_DEFUN([LC_CONFIG_SRCDIR], [
7 AC_CONFIG_SRCDIR([lustre/obdclass/obdo.c])
15 # lustre specific paths
17 AC_DEFUN([LC_PATH_DEFAULTS], [
18 # ptlrpc kernel build requires this
26 demodir='$(docdir)/demo'
29 pkgexampledir='${pkgdatadir}/examples'
30 AC_SUBST(pkgexampledir)
36 # is the target os supported?
38 AC_DEFUN([LC_TARGET_SUPPORTED], [
47 ]) # LC_TARGET_SUPPORTED
50 # LC_GLIBC_SUPPORT_FHANDLES
52 AC_DEFUN([LC_GLIBC_SUPPORT_FHANDLES], [
53 AC_CHECK_FUNCS([name_to_handle_at],
54 [AC_DEFINE(HAVE_FHANDLE_GLIBC_SUPPORT, 1,
55 [file handle and related syscalls are supported])],
56 [AC_MSG_WARN([file handle and related syscalls are not supported])])
57 ]) # LC_GLIBC_SUPPORT_FHANDLES
62 # Ensure the stack size is at least 8k in Lustre server (all kernels)
64 AC_DEFUN([LC_STACK_SIZE], [
65 LB_CHECK_COMPILE([if stack size is at least 8k],
67 #include <linux/thread_info.h>
69 #if THREAD_SIZE < 8192
70 #error "stack size < 8192"
72 ], [], [AC_MSG_ERROR([
74 Lustre requires that Linux is configured with at least a 8KB stack.
81 # Allow the user to set the MDS thread upper limit
83 AC_DEFUN([LC_MDS_MAX_THREADS], [
84 AC_MSG_CHECKING([for maximum number of MDS threads])
85 AC_ARG_WITH([mds_max_threads],
86 AC_HELP_STRING([--with-mds-max-threads=count],
87 [maximum threads available on the MDS: (default=512)]),
88 [AC_DEFINE_UNQUOTED(MDS_MAX_THREADS, $with_mds_max_threads,
89 [maximum number of MDS threads])])
90 AC_MSG_RESULT([$with_mds_max_threads])
91 ]) # LC_MDS_MAX_THREADS
96 # the pinger is temporary, until we have the recovery node in place
98 AC_DEFUN([LC_CONFIG_PINGER], [
99 AC_MSG_CHECKING([whether to enable Lustre pinger support])
100 AC_ARG_ENABLE([pinger],
101 AC_HELP_STRING([--disable-pinger],
102 [disable recovery pinger support]),
103 [], [enable_pinger="yes"])
104 AC_MSG_RESULT([$enable_pinger])
105 AS_IF([test "x$enable_pinger" != xno],
106 [AC_DEFINE(ENABLE_PINGER, 1,[Use the Pinger])])
107 ]) # LC_CONFIG_PINGER
112 # do checksum of bulk data between client and OST
114 AC_DEFUN([LC_CONFIG_CHECKSUM], [
115 AC_MSG_CHECKING([whether to enable data checksum support])
116 AC_ARG_ENABLE([checksum],
117 AC_HELP_STRING([--disable-checksum],
118 [disable data checksum support]),
119 [], [enable_checksum="yes"])
120 AC_MSG_RESULT([$enable_checksum])
121 AS_IF([test "x$enable_checksum" != xno],
122 [AC_DEFINE(ENABLE_CHECKSUM, 1, [do data checksums])])
123 ]) # LC_CONFIG_CHECKSUM
128 # enable distributed flock by default
130 AC_DEFUN([LC_CONFIG_FLOCK], [
131 AC_MSG_CHECKING([whether to enable flock by default])
132 AC_ARG_ENABLE([flock],
133 AC_HELP_STRING([--disable-flock],
134 [disable flock by default]),
135 [], [enable_flock="yes"])
136 AC_MSG_RESULT([$enable_flock])
137 AS_IF([test "x$enable_flock" != xno],
138 [AC_DEFINE(ENABLE_FLOCK, 1, [enable flock by default])])
142 # LC_CONFIG_HEALTH_CHECK_WRITE
144 # Turn off the actual write to the disk
146 AC_DEFUN([LC_CONFIG_HEALTH_CHECK_WRITE], [
147 AC_MSG_CHECKING([whether to enable a write with the health check])
148 AC_ARG_ENABLE([health_write],
149 AC_HELP_STRING([--enable-health_write],
150 [enable disk writes when doing health check]),
151 [], [enable_health_write="no"])
152 AC_MSG_RESULT([$enable_health_write])
153 AS_IF([test "x$enable_health_write" != xno],
154 [AC_DEFINE(USE_HEALTH_CHECK_WRITE, 1, [Write when Checking Health])])
155 ]) # LC_CONFIG_HEALTH_CHECK_WRITE
158 # LC_CONFIG_LRU_RESIZE
160 AC_DEFUN([LC_CONFIG_LRU_RESIZE], [
161 AC_MSG_CHECKING([whether to enable lru self-adjusting])
162 AC_ARG_ENABLE([lru_resize],
163 AC_HELP_STRING([--enable-lru-resize],
164 [enable lru resize support]),
165 [], [enable_lru_resize="yes"])
166 AC_MSG_RESULT([$enable_lru_resize])
167 AS_IF([test "x$enable_lru_resize" != xno],
168 [AC_DEFINE(HAVE_LRU_RESIZE_SUPPORT, 1, [Enable lru resize support])])
169 ]) # LC_CONFIG_LRU_RESIZE
174 # Quota support. The kernel must support CONFIG_QUOTA.
176 AC_DEFUN([LC_QUOTA_CONFIG], [
177 LB_CHECK_CONFIG_IM([QUOTA], [],
180 Lustre quota requires that CONFIG_QUOTA is enabled in your kernel.
185 # LC_EXPORT_TRUNCATE_COMPLETE_PAGE
187 # truncate_complete_page() has never been exported from an upstream kernel
188 # remove_from_page_cache() was exported between 2.6.35 and 2.6.38
189 # delete_from_page_cache() is exported from 2.6.39
191 AC_DEFUN([LC_EXPORT_TRUNCATE_COMPLETE_PAGE], [
192 LB_CHECK_EXPORT([truncate_complete_page], [mm/truncate.c],
193 [AC_DEFINE(HAVE_TRUNCATE_COMPLETE_PAGE, 1,
194 [kernel export truncate_complete_page])])
195 LB_CHECK_EXPORT([remove_from_page_cache], [mm/filemap.c],
196 [AC_DEFINE(HAVE_REMOVE_FROM_PAGE_CACHE, 1,
197 [kernel export remove_from_page_cache])])
198 LB_CHECK_EXPORT([delete_from_page_cache], [mm/filemap.c],
199 [AC_DEFINE(HAVE_DELETE_FROM_PAGE_CACHE, 1,
200 [kernel export delete_from_page_cache])])
201 ]) # LC_EXPORT_TRUNCATE_COMPLETE_PAGE
204 # LC_CONFIG_GSS_KEYRING
206 # default 'auto', tests for dependencies, if found, enables;
207 # only called if gss is enabled
209 AC_DEFUN([LC_CONFIG_GSS_KEYRING], [
210 AC_MSG_CHECKING([whether to enable gss keyring backend])
211 AC_ARG_ENABLE([gss_keyring],
212 [AC_HELP_STRING([--disable-gss-keyring],
213 [disable gss keyring backend])],
214 [], [enable_gss_keyring="auto"])
215 AC_MSG_RESULT([$enable_gss_keyring])
216 AS_IF([test "x$enable_gss_keyring" != xno], [
217 LB_CHECK_CONFIG_IM([KEYS], [], [
218 gss_keyring_conf_test="fail"
219 AC_MSG_WARN([GSS keyring backend requires that CONFIG_KEYS be enabled in your kernel.])])
221 AC_CHECK_LIB([keyutils], [keyctl_search], [], [
222 gss_keyring_conf_test="fail"
223 AC_MSG_WARN([GSS keyring backend requires libkeyutils])])
225 AS_IF([test "x$gss_keyring_conf_test" != xfail], [
226 AC_DEFINE([HAVE_GSS_KEYRING], [1],
227 [Define this if you enable gss keyring backend])
228 enable_gss_keyring="yes"
230 AS_IF([test "x$enable_gss_keyring" = xyes], [
231 AC_MSG_ERROR([Cannot enable gss_keyring. See above for details.])
235 ]) # LC_CONFIG_GSS_KEYRING
238 # LC_HAVE_CRED_TGCRED
240 # rhel7 struct cred has no member tgcred
242 AC_DEFUN([LC_HAVE_CRED_TGCRED], [
243 LB_CHECK_COMPILE([if 'struct cred' has member 'tgcred'],
245 #include <linux/cred.h>
247 ((struct cred *)0)->tgcred = NULL;
249 AC_DEFINE(HAVE_CRED_TGCRED, 1,
250 [struct cred has member tgcred])
252 ]) # LC_HAVE_CRED_TGCRED
255 # LC_KEY_TYPE_INSTANTIATE_2ARGS
257 # rhel7 key_type->instantiate takes 2 args (struct key, struct key_preparsed_payload)
259 AC_DEFUN([LC_KEY_TYPE_INSTANTIATE_2ARGS], [
260 LB_CHECK_COMPILE([if 'key_type->instantiate' has two args],
261 key_type_instantiate_2args, [
262 #include <linux/key-type.h>
264 ((struct key_type *)0)->instantiate(0, NULL);
266 AC_DEFINE(HAVE_KEY_TYPE_INSTANTIATE_2ARGS, 1,
267 [key_type->instantiate has two args])
269 ]) # LC_KEY_TYPE_INSTANTIATE_2ARGS
274 AC_DEFUN([LC_CONFIG_SUNRPC], [
275 LB_CHECK_CONFIG_IM([SUNRPC], [], [
276 AS_IF([test "x$sunrpc_required" = xyes], [
279 kernel SUNRPC support is required by using GSS.
282 ]) # LC_CONFIG_SUNRPC
285 # LC_CONFIG_GSS (default 'auto' (tests for dependencies, if found, enables))
287 # Build gss and related tools of Lustre. Currently both kernel and user space
288 # parts are depend on linux platform.
290 AC_DEFUN([LC_CONFIG_GSS], [
291 AC_MSG_CHECKING([whether to enable gss support])
293 [AC_HELP_STRING([--enable-gss], [enable gss support])],
294 [], [enable_gss="auto"])
295 AC_MSG_RESULT([$enable_gss])
297 AS_IF([test "x$enable_gss" != xno], [
298 LC_CONFIG_GSS_KEYRING
300 LC_KEY_TYPE_INSTANTIATE_2ARGS
301 sunrpc_required=$enable_gss
305 LB_CHECK_CONFIG_IM([CRYPTO_MD5], [],
306 [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
307 LB_CHECK_CONFIG_IM([CRYPTO_SHA1], [],
308 [AC_MSG_WARN([kernel SHA1 support is recommended by using GSS.])])
309 LB_CHECK_CONFIG_IM([CRYPTO_SHA256], [],
310 [AC_MSG_WARN([kernel SHA256 support is recommended by using GSS.])])
311 LB_CHECK_CONFIG_IM([CRYPTO_SHA512], [],
312 [AC_MSG_WARN([kernel SHA512 support is recommended by using GSS.])])
314 require_krb5=$enable_gss
318 AS_IF([test -n "$KRBDIR"], [
319 gss_conf_test="success"
321 gss_conf_test="failure"
324 AS_IF([test "x$gss_conf_test" = xsuccess && test "x$enable_gss" != xno], [
325 AC_DEFINE([HAVE_GSS], [1], [Define this is if you enable gss])
328 enable_gss_keyring="no"
332 enable_ssk=$enable_gss
334 enable_gss_keyring="no"
340 # OpenSSL 1.0+ return int for HMAC functions but older SLES11 versions do not
341 AC_DEFUN([LC_OPENSSL_SSK], [
342 AC_MSG_CHECKING([whether OpenSSL has functions needed for SSK])
343 AS_IF([test "x$enable_ssk" != xno], [
344 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
345 #include <openssl/hmac.h>
346 #include <openssl/evp.h>
350 rc = HMAC_Init_ex(NULL, "test", 4, EVP_md_null(), NULL);
352 ])],[AC_DEFINE(HAVE_OPENSSL_SSK, 1,
353 [OpenSSL HMAC functions needed for SSK])],
356 AC_MSG_RESULT([$enable_ssk])
359 # LC_OPENSSL_GETSEPOL
361 # OpenSSL is needed for l_getsepol
362 AC_DEFUN([LC_OPENSSL_GETSEPOL], [
363 AC_MSG_CHECKING([whether openssl-devel is present])
364 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
365 #include <openssl/evp.h>
368 EVP_MD_CTX *mdctx = EVP_MD_CTX_create();
371 AC_DEFINE(HAVE_OPENSSL_GETSEPOL, 1, [openssl-devel is present])
372 enable_getsepol="yes"
378 No openssk-devel headers found, unable to build l_getsepol and SELinux status checking
381 AC_MSG_RESULT([$enable_getsepol])
382 ]) # LC_OPENSSL_GETSEPOL
384 # LC_INODE_PERMISION_2ARGS
386 # up to v2.6.27 had a 3 arg version (inode, mask, nameidata)
387 # v2.6.27->v2.6.37 had a 2 arg version (inode, mask)
388 # v2.6.37->v3.0 had a 3 arg version (inode, mask, nameidata)
389 # v3.1 onward have a 2 arg version (inode, mask)
391 AC_DEFUN([LC_INODE_PERMISION_2ARGS], [
392 LB_CHECK_COMPILE([if 'inode_operations->permission' has two args],
393 inode_ops_permission_2args, [
394 #include <linux/fs.h>
396 struct inode *inode __attribute__ ((unused));
399 inode->i_op->permission(NULL, 0);
401 AC_DEFINE(HAVE_INODE_PERMISION_2ARGS, 1,
402 [inode_operations->permission has two args])
404 ]) # LC_INODE_PERMISION_2ARGS
407 # LC_HAVE_FSTYPE_MOUNT
409 # 2.6.39 replace get_sb with mount in struct file_system_type
411 AC_DEFUN([LC_HAVE_FSTYPE_MOUNT], [
412 LB_CHECK_COMPILE([if 'file_system_type' has 'mount' field],
413 file_system_type_mount, [
414 #include <linux/fs.h>
416 struct file_system_type fst = { };
419 mount = (void *)fst.mount;
421 AC_DEFINE(HAVE_FSTYPE_MOUNT, 1,
422 [struct file_system_type has mount field])
424 ]) # LC_HAVE_FSTYPE_MOUNT
427 # LC_HAVE_FHANDLE_SYSCALLS
429 # 2.6.39 The open_by_handle_at() and name_to_handle_at() system calls were
430 # added to Linux kernel 2.6.39.
431 # Check if client supports these functions
433 AC_DEFUN([LC_HAVE_FHANDLE_SYSCALLS], [
434 LB_CHECK_CONFIG_IM([FHANDLE],[
435 AC_DEFINE(HAVE_FHANDLE_SYSCALLS, 1,
436 [kernel supports fhandles and related syscalls])
438 ]) # LC_HAVE_FHANDLE_SYSCALLS
441 # LC_HAVE_INODE_OWNER_OR_CAPABLE
443 # 2.6.39 renames is_owner_or_cap to inode_owner_or_capable
445 AC_DEFUN([LC_HAVE_INODE_OWNER_OR_CAPABLE], [
446 LB_CHECK_COMPILE([if 'inode_owner_or_capable' exist],
447 inode_owner_or_capable, [
448 #include <linux/fs.h>
450 inode_owner_or_capable(NULL);
452 AC_DEFINE(HAVE_INODE_OWNER_OR_CAPABLE, 1,
453 [inode_owner_or_capable exist])
455 ]) # LC_HAVE_INODE_OWNER_OR_CAPABLE
458 # LC_DIRTY_INODE_WITH_FLAG
460 # 3.0 dirty_inode() has a flag parameter
461 # see kernel commit aa38572954ade525817fe88c54faebf85e5a61c0
463 AC_DEFUN([LC_DIRTY_INODE_WITH_FLAG], [
464 LB_CHECK_COMPILE([if 'dirty_inode' super_operation takes flag],
465 dirty_inode_super_operation_flag, [
466 #include <linux/fs.h>
468 struct inode *inode = NULL;
469 inode->i_sb->s_op->dirty_inode(NULL, 0);
471 AC_DEFINE(HAVE_DIRTY_INODE_HAS_FLAG, 1,
472 [dirty_inode super_operation takes flag])
474 ]) # LC_DIRTY_INODE_WITH_FLAG
479 # 3.0 introduced setns
481 AC_DEFUN([LC_SETNS], [
482 AC_CHECK_HEADERS([sched.h], [], [],
485 AC_CHECK_FUNCS([setns])
489 # LC_LM_XXX_LOCK_MANAGER_OPS
491 # 3.1 renames lock-manager ops(lock_manager_operations) from fl_xxx to lm_xxx
492 # see kernel commit 8fb47a4fbf858a164e973b8ea8ef5e83e61f2e50
494 AC_DEFUN([LC_LM_XXX_LOCK_MANAGER_OPS], [
495 LB_CHECK_COMPILE([if 'lock-manager' ops renamed to 'lm_xxx'],
496 lock_manager_ops_lm_xxx, [
497 #include <linux/fs.h>
499 struct lock_manager_operations lm_ops;
500 lm_ops.lm_compare_owner = NULL;
502 AC_DEFINE(HAVE_LM_XXX_LOCK_MANAGER_OPS, 1,
503 [lock-manager ops renamed to lm_xxx])
505 ]) # LC_LM_XXX_LOCK_MANAGER_OPS
510 # 3.1 kills inode->i_alloc_sem, use i_dio_count and inode_dio_wait
512 # see kernel commit bd5fe6c5eb9c548d7f07fe8f89a150bb6705e8e3
514 AC_DEFUN([LC_INODE_DIO_WAIT], [
515 LB_CHECK_COMPILE([if 'inode->i_alloc_sem' is killed and use inode_dio_wait],
517 #include <linux/fs.h>
519 inode_dio_wait((struct inode *)0);
521 AC_DEFINE(HAVE_INODE_DIO_WAIT, 1,
522 [inode->i_alloc_sem is killed and use inode_dio_wait])
524 ]) # LC_INODE_DIO_WAIT
529 # 3.1 adds get_acl method to inode_operations to read ACL from disk.
530 # see kernel commit 4e34e719e457f2e031297175410fc0bd4016a085
532 AC_DEFUN([LC_IOP_GET_ACL], [
533 LB_CHECK_COMPILE([if 'inode_operations' has '.get_acl' member function],
535 #include <linux/fs.h>
537 struct inode_operations iop;
540 AC_DEFINE(HAVE_IOP_GET_ACL, 1,
541 [inode_operations has .get_acl member function])
546 # LC_FILE_LLSEEK_SIZE
548 # 3.1 introduced generic_file_llseek_size()
550 AC_DEFUN([LC_FILE_LLSEEK_SIZE], [
551 LB_CHECK_EXPORT([generic_file_llseek_size], [fs/read_write.c],
552 [AC_DEFINE(HAVE_FILE_LLSEEK_SIZE, 1,
553 [generic_file_llseek_size is exported by the kernel])])
554 ]) # LC_FILE_LLSEEK_SIZE
557 # LC_RADIX_EXCEPTION_ENTRY
558 # 3.1 adds radix_tree_exception_entry.
560 AC_DEFUN([LC_RADIX_EXCEPTION_ENTRY], [
561 LB_CHECK_COMPILE([radix_tree_exceptional_entry exist],
562 radix_tree_exceptional_entry, [
563 #include <linux/radix-tree.h>
565 radix_tree_exceptional_entry(NULL);
567 AC_DEFINE(HAVE_RADIX_EXCEPTION_ENTRY, 1,
568 [radix_tree_exceptional_entry exist])
570 ]) # LC_RADIX_EXCEPTION_ENTRY
573 # LC_HAVE_PROTECT_I_NLINK
575 # 3.2 protects inode->i_nlink from direct modification
576 # see kernel commit a78ef704a8dd430225955f0709b22d4a6ba21deb
577 # at the same time adds set_nlink(), so checks set_nlink() for it.
579 AC_DEFUN([LC_HAVE_PROTECT_I_NLINK], [
580 LB_CHECK_COMPILE([if 'inode->i_nlink' is protected from direct modification],
581 inode_i_nlink_protected, [
582 #include <linux/fs.h>
587 AC_DEFINE(HAVE_PROTECT_I_NLINK, 1,
588 [inode->i_nlink is protected from direct modification])
590 ]) # LC_HAVE_PROTECT_I_NLINK
593 # 2.6.39 security_inode_init_security takes a 'struct qstr' parameter
595 # 3.2 security_inode_init_security takes a callback to set xattrs
597 AC_DEFUN([LC_HAVE_SECURITY_IINITSEC], [
598 LB_CHECK_COMPILE([if security_inode_init_security takes a callback],
599 security_inode_init_security_callback, [
600 #include <linux/security.h>
602 security_inode_init_security(NULL, NULL, NULL, (const initxattrs)NULL, NULL);
604 AC_DEFINE(HAVE_SECURITY_IINITSEC_CALLBACK, 1,
605 [security_inode_init_security takes a callback to set xattrs])
607 LB_CHECK_COMPILE([if security_inode_init_security takes a 'struct qstr' parameter],
608 security_inode_init_security_qstr, [
609 #include <linux/security.h>
611 security_inode_init_security(NULL, NULL, (struct qstr *)NULL, NULL, NULL, NULL);
613 AC_DEFINE(HAVE_SECURITY_IINITSEC_QSTR, 1,
614 [security_inode_init_security takes a 'struct qstr' parameter])
617 ]) # LC_HAVE_SECURITY_IINITSEC
620 # 2.6.39 vfs_create takes a 'struct nameidata' parameter
622 AC_DEFUN([LC_VFS_CREATE_USE_NAMEIDATA], [
623 LB_CHECK_COMPILE([if vfs_create takes a struct nameidata parameter],
625 #include <linux/namei.h>
626 #include <linux/fs.h>
628 struct nameidata *nd;
629 vfs_create(NULL, NULL, 0, nd);
631 AC_DEFINE(HAVE_VFS_CREATE_USE_NAMEIDATA, 1,
632 [vfs_create use nameidata as parameter])
634 ]) # LC_VFS_CREATE_USE_NAMEIDATA
637 # LC_HAVE_MIGRATE_HEADER
639 # 3.3 introduces migrate_mode.h and migratepage has 4 args
641 AC_DEFUN([LC_HAVE_MIGRATE_HEADER], [
642 LB_CHECK_FILE([$LINUX/include/linux/migrate.h], [
643 AC_DEFINE(HAVE_MIGRATE_H, 1,
644 [kernel has include/linux/migrate.h])
646 LB_CHECK_FILE([$LINUX/include/linux/migrate_mode.h], [
647 AC_DEFINE(HAVE_MIGRATE_MODE_H, 1,
648 [kernel has include/linux/migrate_mode.h])
651 ]) # LC_HAVE_MIGRATE_HEADER
654 # LC_MIGRATEPAGE_4ARGS
656 AC_DEFUN([LC_MIGRATEPAGE_4ARGS], [
657 LB_CHECK_COMPILE([if 'address_space_operations.migratepage' has 4 args],
658 address_space_ops_migratepage_4args, [
659 #include <linux/fs.h>
660 #ifdef HAVE_MIGRATE_H
661 #include <linux/migrate.h>
662 #elif defined(HAVE_MIGRATE_MODE_H)
663 #include <linux/migrate_mode.h>
666 struct address_space_operations aops = { };
667 aops.migratepage(NULL, NULL, NULL, MIGRATE_ASYNC);
669 AC_DEFINE(HAVE_MIGRATEPAGE_4ARGS, 1,
670 [address_space_operations.migratepage has 4 args])
672 ]) # LC_MIGRATEPAGE_4ARGS
675 # LC_SUPEROPS_USE_DENTRY
677 # 3.3 switchs super_operations to use dentry as parameter (but not vfsmount)
678 # see kernel commit 34c80b1d93e6e20ca9dea0baf583a5b5510d92d4
680 AC_DEFUN([LC_SUPEROPS_USE_DENTRY], [
681 tmp_flags="$EXTRA_KCFLAGS"
682 EXTRA_KCFLAGS="-Werror"
683 LB_CHECK_COMPILE([if 'super_operations' use 'dentry' as parameter],
685 #include <linux/fs.h>
686 int show_options(struct seq_file *seq, struct dentry *root) {
690 struct super_operations ops;
691 ops.show_options = show_options;
693 AC_DEFINE(HAVE_SUPEROPS_USE_DENTRY, 1,
694 [super_operations use dentry as parameter])
696 EXTRA_KCFLAGS="$tmp_flags"
697 ]) # LC_SUPEROPS_USE_DENTRY
700 # LC_INODEOPS_USE_UMODE_T
702 # 3.3 switchs inode_operations to use umode_t as parameter (but not int)
703 # see kernel commit 1a67aafb5f72a436ca044293309fa7e6351d6a35
705 AC_DEFUN([LC_INODEOPS_USE_UMODE_T], [
706 tmp_flags="$EXTRA_KCFLAGS"
707 EXTRA_KCFLAGS="-Werror"
708 LB_CHECK_COMPILE([if 'inode_operations' use 'umode_t' as parameter],
710 #include <linux/fs.h>
711 #include <linux/types.h>
712 int my_mknod(struct inode *dir, struct dentry *dchild,
713 umode_t mode, dev_t dev)
718 struct inode_operations ops;
719 ops.mknod = my_mknod;
721 AC_DEFINE(HAVE_INODEOPS_USE_UMODE_T, 1,
722 [inode_operations use umode_t as parameter])
724 EXTRA_KCFLAGS="$tmp_flags"
725 ]) # LC_INODEOPS_USE_UMODE_T
728 # LC_KMAP_ATOMIC_HAS_1ARG
730 # 3.4 kmap_atomic removes second argument
731 # see kernel commit 1ec9c5ddc17aa398f05646abfcbaf315b544e62f
733 AC_DEFUN([LC_KMAP_ATOMIC_HAS_1ARG], [
734 LB_CHECK_COMPILE([if 'kmap_atomic' has only 1 argument],
736 #include <linux/highmem.h>
740 AC_DEFINE(HAVE_KMAP_ATOMIC_HAS_1ARG, 1,
741 [have kmap_atomic has only 1 argument])
743 ]) # LC_KMAP_ATOMIC_HAS_1ARG
746 # LC_HAVE_D_MAKE_ROOT
748 # 3.4 converts d_alloc_root to d_make_root
749 # see kernel commit 32991ab305ace7017c62f8eecbe5eb36dc32e13b
751 AC_DEFUN([LC_HAVE_D_MAKE_ROOT], [
752 LB_CHECK_COMPILE([if have 'd_make_root'],
754 #include <linux/fs.h>
756 d_make_root((struct inode *)NULL);
758 AC_DEFINE(HAVE_D_MAKE_ROOT, 1,
761 ]) # LC_HAVE_D_MAKE_ROOT
764 # LC_HAVE_CACHE_REGISTER
766 # 3.4 cache_register/cache_unregister are removed
767 # see kernel commit 2c5f846747526e2b83c5f1b8e69016be0e2e87c0
768 # Note, since 2.6.37 cache_register_net/cache_unregister_net
769 # are defined, but not exported.
770 # 3.3 cache_register_net/cache_unregister_net are
771 # exported and replacing cache_register/cache_unregister in 3.4
773 AC_DEFUN([LC_HAVE_CACHE_REGISTER], [
774 LB_CHECK_COMPILE([if have 'cache_register'],
776 #include <linux/sunrpc/cache.h>
778 cache_register(NULL);
780 AC_DEFINE(HAVE_CACHE_REGISTER, 1,
781 [have cache_register])
783 ]) # LC_HAVE_CACHE_REGISTER
786 # LC_HAVE_CLEAR_INODE
788 # 3.5 renames end_writeback() back to clear_inode()...
789 # see kernel commit dbd5768f87ff6fb0a4fe09c4d7b6c4a24de99430
791 AC_DEFUN([LC_HAVE_CLEAR_INODE], [
792 LB_CHECK_COMPILE([if have 'clear_inode'],
794 #include <linux/fs.h>
796 clear_inode((struct inode *)NULL);
798 AC_DEFINE(HAVE_CLEAR_INODE, 1,
801 ]) # LC_HAVE_CLEAR_INODE
804 # LC_HAVE_ENCODE_FH_PARENT
806 # 3.5 encode_fh has parent inode passed in directly
807 # see kernel commit b0b0382b
809 AC_DEFUN([LC_HAVE_ENCODE_FH_PARENT], [
810 tmp_flags="$EXTRA_KCFLAGS"
811 EXTRA_KCFLAGS="-Werror"
812 LB_CHECK_COMPILE([if 'encode_fh' have parent inode as parameter],
813 encode_fh_parent_inode, [
814 #include <linux/exportfs.h>
815 #include <linux/fs.h>
816 #include <linux/types.h>
817 int ll_encode_fh(struct inode *i, __u32 *a, int *b, struct inode *p)
822 struct export_operations exp_op;
823 exp_op.encode_fh = ll_encode_fh;
825 AC_DEFINE(HAVE_ENCODE_FH_PARENT, 1,
826 [have parent inode as parameter])
828 EXTRA_KCFLAGS="$tmp_flags"
829 ]) # LC_HAVE_ENCODE_FH_PARENT
832 # LC_FILE_LLSEEK_SIZE_5ARG
834 # 3.5 has generic_file_llseek_size with 5 args
836 AC_DEFUN([LC_FILE_LLSEEK_SIZE_5ARG], [
837 LB_CHECK_COMPILE([if Linux kernel has 'generic_file_llseek_size' with 5 args],
838 generic_file_llseek_size_5args, [
839 #include <linux/fs.h>
841 generic_file_llseek_size(NULL, 0, 0, 0, 0);
843 AC_DEFINE(HAVE_FILE_LLSEEK_SIZE_5ARGS, 1,
844 [kernel has generic_file_llseek_size with 5 args])
846 ]) # LC_FILE_LLSEEK_SIZE_5ARG
849 # LC_LLITE_DATA_IS_LIST
851 # 3.6 switch i_dentry/d_alias from list to hlist
853 # In the upstream kernels d_alias first changes
854 # to a hlist and then in later version, 3.11, gets
855 # moved to the union d_u. Due to some distros having
856 # d_alias in the d_u union as a struct list, which
857 # has never existed upstream stream, we can't test
858 # if d_alias is a list or hlist directly. If ever
859 # i_dentry and d_alias even up different combos then
860 # the build will fail. In that case then we will need
861 # to separate out the i_dentry and d_alias test below.
863 AC_DEFUN([LC_DATA_FOR_LLITE_IS_LIST], [
864 tmp_flags="$EXTRA_KCFLAGS"
865 EXTRA_KCFLAGS="-Werror"
866 LB_CHECK_COMPILE([if 'i_dentry/d_alias' uses 'list'],
867 i_dentry_d_alias_list, [
868 #include <linux/fs.h>
871 INIT_LIST_HEAD(&inode.i_dentry);
873 AC_DEFINE(DATA_FOR_LLITE_IS_LIST, 1,
874 [both i_dentry/d_alias uses list])
876 EXTRA_KCFLAGS="$tmp_flags"
877 ]) # LC_DATA_FOR_LLITE_IS_LIST
880 # LC_DENTRY_OPEN_USE_PATH
882 # 3.6 dentry_open uses struct path as first argument
883 # see kernel commit 765927b2
885 AC_DEFUN([LC_DENTRY_OPEN_USE_PATH], [
886 tmp_flags="$EXTRA_KCFLAGS"
887 EXTRA_KCFLAGS="-Werror"
888 LB_CHECK_COMPILE([if 'dentry_open' uses 'struct path' as first argument],
890 #include <linux/fs.h>
891 #include <linux/path.h>
894 dentry_open(&path, 0, NULL);
896 AC_DEFINE(HAVE_DENTRY_OPEN_USE_PATH, 1,
897 [dentry_open uses struct path as first argument])
899 EXTRA_KCFLAGS="$tmp_flags"
900 ]) # LC_DENTRY_OPEN_USE_PATH
903 # LC_HAVE_IOP_ATOMIC_OPEN
905 # 3.6 vfs adds iop->atomic_open
907 AC_DEFUN([LC_HAVE_IOP_ATOMIC_OPEN], [
908 LB_CHECK_COMPILE([if 'iop' has 'atomic_open'],
909 inode_ops_atomic_open, [
910 #include <linux/fs.h>
912 struct inode_operations iop;
913 iop.atomic_open = NULL;
915 AC_DEFINE(HAVE_IOP_ATOMIC_OPEN, 1,
916 [have iop atomic_open])
918 ]) # LC_HAVE_IOP_ATOMIC_OPEN
921 # LC_HAVE_SB_START_WRITE
923 # RHEL6 2.6.32, 3.6 or newer support wrapped FS freeze functions
925 AC_DEFUN([LC_HAVE_SB_START_WRITE], [
926 LB_CHECK_COMPILE([if kernel supports wrapped FS freeze functions],
928 #include <linux/fs.h>
930 sb_start_write(NULL);
932 AC_DEFINE(HAVE_SB_START_WRITE, 1,
933 [kernel supports wrapped FS freeze functions])
935 ]) # LC_HAVE_SB_START_WRITE
938 # LC_HAVE_POSIXACL_USER_NS
940 # 3.7 posix_acl_{to,from}_xattr take struct user_namespace
942 AC_DEFUN([LC_HAVE_POSIXACL_USER_NS], [
943 LB_CHECK_COMPILE([if 'posix_acl_to_xattr' takes 'struct user_namespace'],
944 posix_acl_to_xattr_user_namespace, [
945 #include <linux/fs.h>
946 #include <linux/posix_acl_xattr.h>
948 posix_acl_to_xattr((struct user_namespace *)NULL, NULL, NULL, 0);
950 AC_DEFINE(HAVE_POSIXACL_USER_NS, 1,
951 [posix_acl_to_xattr takes struct user_namespace])
953 ]) # LC_HAVE_POSIXACL_USER_NS
956 # LC_HAVE_FILE_F_INODE
958 # 3.8 struct file has new member f_inode
960 AC_DEFUN([LC_HAVE_FILE_F_INODE], [
961 LB_CHECK_COMPILE([if 'struct file' has member 'f_inode'],
963 #include <linux/fs.h>
965 ((struct file *)0)->f_inode = NULL;
967 AC_DEFINE(HAVE_FILE_F_INODE, 1,
968 [struct file has member f_inode])
970 ]) # LC_HAVE_FILE_F_INODE
975 # 3.8 has introduced inline function file_inode
977 AC_DEFUN([LC_HAVE_FILE_INODE], [
978 LB_CHECK_COMPILE([if file_inode() exists],
980 #include <linux/fs.h>
984 AC_DEFINE(HAVE_FILE_INODE, 1,
985 [file_inode() has been defined])
987 ]) # LC_HAVE_FILE_INODE
990 # LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS
992 AC_DEFUN([LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS], [
993 LB_CHECK_COMPILE([if 'sunrpc_cache_pipe_upcall' takes 3 args],
994 sunrpc_cache_pipe_upcall_3args, [
995 #include <linux/sunrpc/cache.h>
997 sunrpc_cache_pipe_upcall(NULL, NULL, NULL);
999 AC_DEFINE(HAVE_SUNRPC_UPCALL_HAS_3ARGS, 1,
1000 [sunrpc_cache_pipe_upcall takes 3 args])
1002 ]) # LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS
1005 # LC_HAVE_HLIST_FOR_EACH_3ARG
1007 # 3.9 uses hlist_for_each_entry with 3 args
1008 # b67bfe0d42cac56c512dd5da4b1b347a23f4b70a
1010 AC_DEFUN([LC_HAVE_HLIST_FOR_EACH_3ARG], [
1011 LB_CHECK_COMPILE([if 'hlist_for_each_entry' has 3 args],
1012 hlist_for_each_entry_3args, [
1013 #include <linux/list.h>
1014 #include <linux/fs.h>
1016 struct hlist_head *head = NULL;
1017 struct inode *inode;
1019 hlist_for_each_entry(inode, head, i_hash) {
1023 AC_DEFINE(HAVE_HLIST_FOR_EACH_3ARG, 1,
1024 [hlist_for_each_entry has 3 args])
1026 ]) # LC_HAVE_HLIST_FOR_EACH_3ARG
1029 # LC_HAVE_BIO_END_SECTOR
1031 # 3.9 introduces bio_end_sector macro
1032 # f73a1c7d117d07a96d89475066188a2b79e53c48
1034 AC_DEFUN([LC_HAVE_BIO_END_SECTOR], [
1035 LB_CHECK_COMPILE([if 'bio_end_sector' is defined],
1037 #include <linux/bio.h>
1039 struct bio bio = { };
1040 unsigned long long end;
1042 end = bio_end_sector(&bio);
1044 AC_DEFINE(HAVE_BIO_END_SECTOR, 1,
1045 [bio_end_sector is defined])
1047 ]) # LC_HAVE_BIO_END_SECTOR
1050 # 3.9 created is_sxid
1052 AC_DEFUN([LC_HAVE_IS_SXID], [
1053 LB_CHECK_COMPILE([if 'is_sxid' is defined],
1055 #include <linux/fs.h>
1057 struct inode inode = { };
1059 is_sxid(inode.i_mode);
1061 AC_DEFINE(HAVE_IS_SXID, 1, [is_sxid is defined])
1063 ]) # LC_HAVE_IS_SXID
1066 # LC_HAVE_VFS_GETATTR_2ARGS
1068 AC_DEFUN([LC_HAVE_VFS_GETATTR_2ARGS], [
1069 LB_CHECK_COMPILE([if vfs_getattr takes 2 args],
1071 #include <linux/fs.h>
1075 vfs_getattr(&path, NULL);
1077 AC_DEFINE(HAVE_VFS_GETATTR_2ARGS, 1,
1078 [vfs_getattr takes 2 args])
1080 ]) # LC_HAVE_VFS_GETATTR_2ARGS
1083 # LC_HAVE_REMOVE_PROC_SUBTREE
1085 # 3.10 introduced remove_proc_subtree
1087 AC_DEFUN([LC_HAVE_REMOVE_PROC_SUBTREE], [
1088 LB_CHECK_COMPILE([if 'remove_proc_subtree' is defined],
1089 remove_proc_subtree, [
1090 #include <linux/proc_fs.h>
1092 remove_proc_subtree(NULL, NULL);
1094 AC_DEFINE(HAVE_REMOVE_PROC_SUBTREE, 1,
1095 [remove_proc_subtree is defined])
1097 ]) # LC_HAVE_REMOVE_PROC_SUBTREE
1100 # LC_HAVE_PROC_REMOVE
1102 # 3.10 introduced proc_remove
1104 AC_DEFUN([LC_HAVE_PROC_REMOVE], [
1105 LB_CHECK_COMPILE([if 'proc_remove' is defined],
1107 #include <linux/proc_fs.h>
1111 AC_DEFINE(HAVE_PROC_REMOVE, 1,
1112 [proc_remove is defined])
1114 ]) # LC_HAVE_PROC_REMOVE
1116 AC_DEFUN([LC_HAVE_PROJECT_QUOTA], [
1117 LB_CHECK_COMPILE([if get_projid exists],
1120 #include <linux/quota.h>
1122 struct dquot_operations ops = { };
1124 ops.get_projid(NULL, NULL);
1126 AC_DEFINE(HAVE_PROJECT_QUOTA, 1,
1127 [get_projid function exists])
1129 ]) # LC_HAVE_PROJECT_QUOTA
1133 # LC_HAVE_SECURITY_DENTRY_INIT_SECURITY
1135 # 3.10 introduced security_dentry_init_security()
1137 AC_DEFUN([LC_HAVE_SECURITY_DENTRY_INIT_SECURITY], [
1138 LB_CHECK_COMPILE([if 'security_dentry_init_security' is defined],
1139 security_dentry_init_security, [
1140 #include <linux/security.h>
1142 security_dentry_init_security(NULL, 0, NULL, NULL, NULL);
1144 AC_DEFINE(HAVE_SECURITY_DENTRY_INIT_SECURITY, 1,
1145 [security_dentry_init_security' is defined])
1147 ]) # LC_HAVE_SECURITY_DENTRY_INIT_SECURITY
1150 # 3.10 exports security_inode_listsecurity
1152 AC_DEFUN([LC_HAVE_SECURITY_INODE_LISTSECURITY], [
1153 LB_CHECK_COMPILE([if security_inode_listsecurity() is available/exported],
1154 security_inode_listsecurity, [
1155 #include <linux/security.h>
1157 security_inode_listsecurity(NULL, NULL, 0);
1159 AC_DEFINE(HAVE_SECURITY_INODE_LISTSECURITY, 1,
1160 [security_inode_listsecurity() is available/exported])
1162 ]) # LC_HAVE_SECURITY_INODE_LISTSECURITY
1165 # LC_INVALIDATE_RANGE
1167 # 3.11 invalidatepage requires the length of the range to invalidate
1169 AC_DEFUN([LC_INVALIDATE_RANGE], [
1170 LB_CHECK_COMPILE([if 'address_space_operations.invalidatepage' requires 3 arguments],
1171 address_space_ops_invalidatepage_3args, [
1172 #include <linux/fs.h>
1174 struct address_space_operations a_ops;
1175 a_ops.invalidatepage(NULL, 0, 0);
1177 AC_DEFINE(HAVE_INVALIDATE_RANGE, 1,
1178 [address_space_operations.invalidatepage needs 3 arguments])
1180 ]) # LC_INVALIDATE_RANGE
1183 # LC_HAVE_DIR_CONTEXT
1185 # 3.11 readdir now takes the new struct dir_context
1187 AC_DEFUN([LC_HAVE_DIR_CONTEXT], [
1188 LB_CHECK_COMPILE([if 'dir_context' exist],
1190 #include <linux/fs.h>
1192 #ifdef FMODE_KABI_ITERATE
1193 #error "back to use readdir in kabi_extand mode"
1195 struct dir_context ctx;
1200 AC_DEFINE(HAVE_DIR_CONTEXT, 1,
1201 [dir_context exist])
1203 ]) # LC_HAVE_DIR_CONTEXT
1206 # LC_D_COMPARE_5ARGS
1208 # 3.11 dentry_operations.d_compare() taken 5 arguments.
1210 AC_DEFUN([LC_D_COMPARE_5ARGS], [
1211 LB_CHECK_COMPILE([if 'd_compare' taken 5 arguments],
1213 #include <linux/dcache.h>
1215 ((struct dentry_operations*)0)->d_compare(NULL,NULL,0,NULL,NULL);
1217 AC_DEFINE(HAVE_D_COMPARE_5ARGS, 1,
1218 [d_compare need 5 arguments])
1220 ]) # LC_D_COMPARE_5ARGS
1225 # 3.11 need to access d_count to get dentry reference count
1227 AC_DEFUN([LC_HAVE_DCOUNT], [
1228 LB_CHECK_COMPILE([if 'd_count' exists],
1230 #include <linux/dcache.h>
1232 struct dentry de = { };
1235 count = d_count(&de);
1237 AC_DEFINE(HAVE_D_COUNT, 1,
1243 # LC_PID_NS_FOR_CHILDREN
1245 # 3.11 replaces pid_ns by pid_ns_for_children in struct nsproxy
1247 AC_DEFUN([LC_PID_NS_FOR_CHILDREN], [
1248 LB_CHECK_COMPILE([if 'struct nsproxy' has 'pid_ns_for_children'],
1249 pid_ns_for_children, [
1250 #include <linux/nsproxy.h>
1253 ns.pid_ns_for_children = NULL;
1255 AC_DEFINE(HAVE_PID_NS_FOR_CHILDREN, 1,
1256 ['struct nsproxy' has 'pid_ns_for_children'])
1258 ]) # LC_PID_NS_FOR_CHILDREN
1261 # LC_OLDSIZE_TRUNCATE_PAGECACHE
1263 # 3.12 truncate_pagecache without oldsize parameter
1265 AC_DEFUN([LC_OLDSIZE_TRUNCATE_PAGECACHE], [
1266 LB_CHECK_COMPILE([if 'truncate_pagecache' with 'old_size' parameter],
1267 truncate_pagecache_old_size, [
1268 #include <linux/mm.h>
1270 truncate_pagecache(NULL, 0, 0);
1272 AC_DEFINE(HAVE_OLDSIZE_TRUNCATE_PAGECACHE, 1,
1275 ]) # LC_OLDSIZE_TRUNCATE_PAGECACHE
1278 # LC_PTR_ERR_OR_ZERO
1280 # For some reason SLES11SP4 is missing the PTR_ERR_OR_ZERO macro
1281 # It was added to linux kernel 3.12
1283 AC_DEFUN([LC_PTR_ERR_OR_ZERO_MISSING], [
1284 LB_CHECK_COMPILE([if 'PTR_ERR_OR_ZERO' is missing],
1286 #include <linux/err.h>
1288 if (PTR_ERR_OR_ZERO(NULL)) return 0;
1290 AC_DEFINE(HAVE_PTR_ERR_OR_ZERO, 1,
1291 ['PTR_ERR_OR_ZERO' exist])
1293 ]) # LC_PTR_ERR_OR_ZERO_MISSING
1296 # LC_HAVE_DENTRY_D_U_D_ALIAS
1298 # 3.11 kernel moved d_alias to the union d_u in struct dentry
1300 # Some distros move d_alias to d_u but it is still a struct list
1302 AC_DEFUN([LC_HAVE_DENTRY_D_U_D_ALIAS], [
1303 AS_IF([test "x$lb_cv_compile_i_dentry_d_alias_list" = xyes], [
1304 LB_CHECK_COMPILE([if list 'dentry.d_u.d_alias' exist],
1306 #include <linux/list.h>
1307 #include <linux/dcache.h>
1310 INIT_LIST_HEAD(&de.d_u.d_alias);
1312 AC_DEFINE(HAVE_DENTRY_D_U_D_ALIAS, 1,
1313 [list dentry.d_u.d_alias exist])
1316 LB_CHECK_COMPILE([if hlist 'dentry.d_u.d_alias' exist],
1318 #include <linux/list.h>
1319 #include <linux/dcache.h>
1322 INIT_HLIST_NODE(&de.d_u.d_alias);
1324 AC_DEFINE(HAVE_DENTRY_D_U_D_ALIAS, 1,
1325 [hlist dentry.d_u.d_alias exist])
1328 ]) # LC_HAVE_DENTRY_D_U_D_ALIAS
1331 # LC_HAVE_DENTRY_D_CHILD
1333 # 3.11 kernel d_child has been moved out of the union d_u
1336 AC_DEFUN([LC_HAVE_DENTRY_D_CHILD], [
1337 LB_CHECK_COMPILE([if 'dentry.d_child' exist],
1339 #include <linux/list.h>
1340 #include <linux/dcache.h>
1343 INIT_LIST_HEAD(&de.d_child);
1345 AC_DEFINE(HAVE_DENTRY_D_CHILD, 1,
1346 [dentry.d_child exist])
1348 ]) # LC_HAVE_DENTRY_D_CHILD
1353 # 3.12 ki_left removed from struct kiocb
1355 AC_DEFUN([LC_KIOCB_KI_LEFT], [
1356 LB_CHECK_COMPILE([if 'struct kiocb' with 'ki_left' member],
1358 #include <linux/aio.h>
1360 ((struct kiocb*)0)->ki_left = 0;
1362 AC_DEFINE(HAVE_KIOCB_KI_LEFT, 1,
1365 ]) # LC_KIOCB_KI_LEFT
1368 # LC_INIT_LIST_HEAD_RCU
1370 # 3.12 added INIT_LIST_HEAD_RCU in commit 2a855b644c310d5db5
1371 # which is unfortunately an inline function and not a macro
1372 # that can be tested directly, so it needs a configure check.
1374 AC_DEFUN([LC_INIT_LIST_HEAD_RCU], [
1375 LB_CHECK_COMPILE([if 'INIT_LIST_HEAD_RCU' exists],
1376 init_list_head_rcu, [
1377 #include <linux/list.h>
1378 #include <linux/rculist.h>
1380 struct list_head list;
1381 INIT_LIST_HEAD_RCU(&list);
1383 AC_DEFINE(HAVE_INIT_LIST_HEAD_RCU, 1,
1384 [INIT_LIST_HEAD_RCU exists])
1386 ]) # LC_INIT_LIST_HEAD_RCU
1389 # LC_VFS_RENAME_5ARGS
1391 # 3.13 has vfs_rename with 5 args
1393 AC_DEFUN([LC_VFS_RENAME_5ARGS], [
1394 LB_CHECK_COMPILE([if Linux kernel has 'vfs_rename' with 5 args],
1396 #include <linux/fs.h>
1398 vfs_rename(NULL, NULL, NULL, NULL, NULL);
1400 AC_DEFINE(HAVE_VFS_RENAME_5ARGS, 1,
1401 [kernel has vfs_rename with 5 args])
1403 ]) # LC_VFS_RENAME_5ARGS
1406 # LC_VFS_UNLINK_3ARGS
1408 # 3.13 has vfs_unlink with 3 args
1410 AC_DEFUN([LC_VFS_UNLINK_3ARGS], [
1411 LB_CHECK_COMPILE([if Linux kernel has 'vfs_unlink' with 3 args],
1413 #include <linux/fs.h>
1415 vfs_unlink(NULL, NULL, NULL);
1417 AC_DEFINE(HAVE_VFS_UNLINK_3ARGS, 1,
1418 [kernel has vfs_unlink with 3 args])
1420 ]) # LC_VFS_UNLINK_3ARGS
1422 # LC_HAVE_D_IS_POSITIVE
1424 # Kernel version 3.13 b18825a7c8e37a7cf6abb97a12a6ad71af160de7
1425 # d_is_positive is added
1427 AC_DEFUN([LC_HAVE_D_IS_POSITIVE], [
1428 LB_CHECK_COMPILE([if 'd_is_positive' exist],
1430 #include <linux/dcache.h>
1432 d_is_positive(NULL);
1434 AC_DEFINE(HAVE_D_IS_POSITIVE, 1,
1435 ['d_is_positive' is available])
1437 ]) # LC_HAVE_D_IS_POSITIVE
1442 # 3.14 move some of its data in struct bio into the new
1445 AC_DEFUN([LC_HAVE_BVEC_ITER], [
1446 LB_CHECK_COMPILE([if Linux kernel has struct bvec_iter],
1448 #include <linux/bio.h>
1450 struct bvec_iter iter;
1452 iter.bi_bvec_done = 0;
1454 AC_DEFINE(HAVE_BVEC_ITER, 1,
1455 [kernel has struct bvec_iter])
1457 ]) # LC_HAVE_BVEC_ITER
1462 # 3.14 adds set_acl method to inode_operations
1463 # see kernel commit 893d46e443346370cd4ea81d9d35f72952c62a37
1465 AC_DEFUN([LC_IOP_SET_ACL], [
1466 LB_CHECK_COMPILE([if 'inode_operations' has '.set_acl' member function],
1467 inode_ops_set_acl, [
1468 #include <linux/fs.h>
1470 struct inode_operations iop;
1473 AC_DEFINE(HAVE_IOP_SET_ACL, 1,
1474 [inode_operations has .set_acl member function])
1479 # LC_HAVE_TRUNCATE_IPAGE_FINAL
1481 # 3.14 bring truncate_inode_pages_final for evict_inode
1483 AC_DEFUN([LC_HAVE_TRUNCATE_IPAGES_FINAL], [
1484 LB_CHECK_COMPILE([if Linux kernel has truncate_inode_pages_final],
1485 truncate_ipages_final, [
1486 #include <linux/mm.h>
1488 truncate_inode_pages_final(NULL);
1490 AC_DEFINE(HAVE_TRUNCATE_INODE_PAGES_FINAL, 1,
1491 [kernel has truncate_inode_pages_final])
1493 ]) # LC_HAVE_TRUNCATE_IPAGES_FINAL
1496 # LC_IOPS_RENAME_WITH_FLAGS
1498 # 3.14 has inode_operations->rename with 5 args
1499 # commit 520c8b16505236fc82daa352e6c5e73cd9870cff
1501 AC_DEFUN([LC_IOPS_RENAME_WITH_FLAGS], [
1502 LB_CHECK_COMPILE([if 'inode_operations->rename' taken flags as argument],
1503 iops_rename_with_flags, [
1504 #include <linux/fs.h>
1506 struct inode *i1 = NULL, *i2 = NULL;
1507 struct dentry *d1 = NULL, *d2 = NULL;
1509 rc = ((struct inode_operations *)0)->rename(i1, d1, i2, d2, 0);
1511 AC_DEFINE(HAVE_IOPS_RENAME_WITH_FLAGS, 1,
1512 [inode_operations->rename need flags as argument])
1514 ]) # LC_IOPS_RENAME_WITH_FLAGS
1517 # LC_VFS_RENAME_6ARGS
1519 # 3.15 has vfs_rename with 6 args
1521 AC_DEFUN([LC_VFS_RENAME_6ARGS], [
1522 LB_CHECK_COMPILE([if Linux kernel has 'vfs_rename' with 6 args],
1524 #include <linux/fs.h>
1526 vfs_rename(NULL, NULL, NULL, NULL, NULL, NULL);
1528 AC_DEFINE(HAVE_VFS_RENAME_6ARGS, 1,
1529 [kernel has vfs_rename with 6 args])
1531 ]) # LC_VFS_RENAME_6ARGS
1534 # LC_DIRECTIO_USE_ITER
1536 # 3.16 kernel changes direct IO to use iov_iter
1538 AC_DEFUN([LC_DIRECTIO_USE_ITER], [
1539 LB_CHECK_COMPILE([if direct IO uses iov_iter],
1541 #include <linux/fs.h>
1543 struct address_space_operations ops = { };
1544 struct iov_iter *iter = NULL;
1547 ops.direct_IO(0, NULL, iter, offset);
1549 AC_DEFINE(HAVE_DIRECTIO_ITER, 1,
1550 [direct IO uses iov_iter])
1552 ]) # LC_DIRECTIO_USE_ITER
1555 # LC_HAVE_IOV_ITER_INIT_DIRECTION
1558 # 3.16 linux commit 71d8e532b1549a478e6a6a8a44f309d050294d00
1559 # changed iov_iter_init api to start accepting a tag
1560 # that defines if its a read or write operation
1562 AC_DEFUN([LC_HAVE_IOV_ITER_INIT_DIRECTION], [
1563 tmp_flags="$EXTRA_KCFLAGS"
1564 EXTRA_KCFLAGS="-Werror"
1565 LB_CHECK_COMPILE([if 'iov_iter_init' takes a tag],
1567 #include <linux/uio.h>
1568 #include <linux/fs.h>
1570 const struct iovec *iov = NULL;
1572 iov_iter_init(NULL, READ, iov, 1, 0);
1574 AC_DEFINE(HAVE_IOV_ITER_INIT_DIRECTION, 1,
1575 [iov_iter_init handles directional tag])
1577 EXTRA_KCFLAGS="$tmp_flags"
1578 ]) # LC_HAVE_IOV_ITER_INIT_DIRECTION
1581 # LC_HAVE_IOV_ITER_TRUNCATE
1584 # 3.16 introduces a new API iov_iter_truncate()
1586 AC_DEFUN([LC_HAVE_IOV_ITER_TRUNCATE], [
1587 tmp_flags="$EXTRA_KCFLAGS"
1588 EXTRA_KCFLAGS="-Werror"
1589 LB_CHECK_COMPILE([if 'iov_iter_truncate' exists ],
1591 #include <linux/uio.h>
1592 #include <linux/fs.h>
1594 struct iov_iter *i = NULL;
1596 iov_iter_truncate(i, 0);
1598 AC_DEFINE(HAVE_IOV_ITER_TRUNCATE, 1, [iov_iter_truncate exists])
1600 EXTRA_KCFLAGS="$tmp_flags"
1601 ]) # LC_HAVE_IOV_ITER_TRUNCATE
1604 # LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
1606 # 3.16 introduces [read|write]_iter to struct file_operations
1608 AC_DEFUN([LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER], [
1609 LB_CHECK_COMPILE([if 'file_operations.[read|write]_iter' exist],
1610 file_function_iter, [
1611 #include <linux/fs.h>
1613 ((struct file_operations *)NULL)->read_iter(NULL, NULL);
1614 ((struct file_operations *)NULL)->write_iter(NULL, NULL);
1616 AC_DEFINE(HAVE_FILE_OPERATIONS_READ_WRITE_ITER, 1,
1617 [file_operations.[read|write]_iter functions exist])
1619 ]) # LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
1622 # LC_HAVE_INTERVAL_BLK_INTEGRITY
1624 # 3.17 replace sector_size with interval in struct blk_integrity
1626 AC_DEFUN([LC_HAVE_INTERVAL_BLK_INTEGRITY], [
1627 LB_CHECK_COMPILE([if 'blk_integrity.interval' exist],
1628 interval_blk_integrity, [
1629 #include <linux/blkdev.h>
1631 ((struct blk_integrity *)0)->interval = 0;
1633 AC_DEFINE(HAVE_INTERVAL_BLK_INTEGRITY, 1,
1634 [blk_integrity.interval exist])
1636 ]) # LC_HAVE_INTERVAL_BLK_INTEGRITY
1641 # 3.17 replaces key_type::match with match_preparse
1642 # and has new struct key_match_data
1644 AC_DEFUN([LC_KEY_MATCH_DATA], [
1645 LB_CHECK_COMPILE([if struct key_match field exist],
1647 #include <linux/key-type.h>
1649 struct key_match_data data;
1651 data.raw_data = NULL;
1653 AC_DEFINE(HAVE_KEY_MATCH_DATA, 1,
1654 [struct key_match_data exist])
1656 ]) # LC_KEY_MATCH_DATA
1659 # LC_NFS_FILLDIR_USE_CTX
1661 # 3.18 kernel moved from void cookie to struct dir_context
1663 AC_DEFUN([LC_NFS_FILLDIR_USE_CTX], [
1664 tmp_flags="$EXTRA_KCFLAGS"
1665 EXTRA_KCFLAGS="-Werror"
1666 LB_CHECK_COMPILE([if filldir_t uses struct dir_context],
1668 #include <linux/fs.h>
1670 int filldir(struct dir_context *ctx, const char* name,
1671 int i, loff_t off, u64 tmp, unsigned temp)
1676 struct dir_context ctx = {
1680 ctx.actor(NULL, "test", 0, (loff_t) 0, 0, 0);
1682 AC_DEFINE(HAVE_FILLDIR_USE_CTX, 1,
1683 [filldir_t needs struct dir_context as argument])
1685 EXTRA_KCFLAGS="$tmp_flags"
1686 ]) # LC_NFS_FILLDIR_USE_CTX
1689 # LC_PERCPU_COUNTER_INIT
1691 # 3.18 For kernels 3.18 and after percpu_counter_init starts
1692 # to pass a GFP_* memory allocation flag for internal
1693 # memory allocation purposes.
1695 AC_DEFUN([LC_PERCPU_COUNTER_INIT], [
1696 LB_CHECK_COMPILE([if percpu_counter_init uses GFP_* flag as argument],
1697 percpu_counter_init, [
1698 #include <linux/percpu_counter.h>
1700 percpu_counter_init(NULL, 0, GFP_KERNEL);
1702 AC_DEFINE(HAVE_PERCPU_COUNTER_INIT_GFP_FLAG, 1,
1703 [percpu_counter_init uses GFP_* flag])
1705 ]) # LC_PERCPU_COUNTER_INIT
1708 # LC_KIOCB_HAS_NBYTES
1710 # 3.19 kernel removed ki_nbytes from struct kiocb
1712 AC_DEFUN([LC_KIOCB_HAS_NBYTES], [
1713 LB_CHECK_COMPILE([if struct kiocb has ki_nbytes field],
1715 #include <linux/fs.h>
1717 struct kiocb iocb = { };
1721 AC_DEFINE(HAVE_KI_NBYTES, 1, [ki_nbytes field exist])
1723 ]) # LC_KIOCB_HAS_NBYTES
1726 # LC_HAVE_DQUOT_QC_DQBLK
1728 # 3.19 has quotactl_ops->[sg]et_dqblk that take struct kqid and qc_dqblk
1729 # Added in commit 14bf61ffe
1731 AC_DEFUN([LC_HAVE_DQUOT_QC_DQBLK], [
1732 tmp_flags="$EXTRA_KCFLAGS"
1733 EXTRA_KCFLAGS="-Werror"
1734 LB_CHECK_COMPILE([if 'quotactl_ops.set_dqblk' takes struct qc_dqblk],
1736 #include <linux/fs.h>
1737 #include <linux/quota.h>
1739 ((struct quotactl_ops *)0)->set_dqblk(NULL, *((struct kqid*)0), (struct qc_dqblk*)0);
1741 AC_DEFINE(HAVE_DQUOT_QC_DQBLK, 1,
1742 [quotactl_ops.set_dqblk takes struct qc_dqblk])
1743 AC_DEFINE(HAVE_DQUOT_KQID, 1,
1744 [quotactl_ops.set_dqblk takes struct kqid])
1746 EXTRA_KCFLAGS="$tmp_flags"
1747 ]) # LC_HAVE_DQUOT_QC_DQBLK
1750 # LC_BACKING_DEV_INFO_REMOVAL
1752 # 3.20 kernel removed backing_dev_info from address_space
1754 AC_DEFUN([LC_BACKING_DEV_INFO_REMOVAL], [
1755 LB_CHECK_COMPILE([if struct address_space has backing_dev_info],
1757 #include <linux/fs.h>
1759 struct address_space mapping;
1761 mapping.backing_dev_info = NULL;
1763 AC_DEFINE(HAVE_BACKING_DEV_INFO, 1, [backing_dev_info exist])
1765 ]) # LC_BACKING_DEV_INFO_REMOVAL
1768 # LC_HAVE_BDI_CAP_MAP_COPY
1770 # 3.20 removed mmap handling for backing devices since
1771 # it breaks on non-MMU systems. See kernel commit
1772 # b4caecd48005fbed3949dde6c1cb233142fd69e9
1774 AC_DEFUN([LC_HAVE_BDI_CAP_MAP_COPY], [
1775 LB_CHECK_COMPILE([if have 'BDI_CAP_MAP_COPY'],
1777 #include <linux/backing-dev.h>
1779 struct backing_dev_info info;
1781 info.capabilities = BDI_CAP_MAP_COPY;
1783 AC_DEFINE(HAVE_BDI_CAP_MAP_COPY, 1,
1784 [BDI_CAP_MAP_COPY exist])
1786 ]) # LC_HAVE_BDI_CAP_MAP_COPY
1789 # LC_CANCEL_DIRTY_PAGE
1791 # 4.0.0 kernel removed cancel_dirty_page
1793 AC_DEFUN([LC_CANCEL_DIRTY_PAGE], [
1794 LB_CHECK_COMPILE([if cancel_dirty_page still exist],
1795 cancel_dirty_page, [
1796 #include <linux/mm.h>
1798 cancel_dirty_page(NULL, PAGE_SIZE);
1800 AC_DEFINE(HAVE_CANCEL_DIRTY_PAGE, 1,
1801 [cancel_dirty_page is still available])
1803 ]) # LC_CANCEL_DIRTY_PAGE
1808 # 4.1 kernel has iov_iter_rw
1810 AC_DEFUN([LC_IOV_ITER_RW], [
1811 LB_CHECK_COMPILE([if iov_iter_rw exist],
1813 #include <linux/fs.h>
1814 #include <linux/uio.h>
1816 struct iov_iter *iter = NULL;
1820 AC_DEFINE(HAVE_IOV_ITER_RW, 1,
1821 [iov_iter_rw exist])
1826 # LC_HAVE_SYNC_READ_WRITE
1828 # 4.1 new_sync_[read|write] no longer exported
1830 AC_DEFUN([LC_HAVE_SYNC_READ_WRITE], [
1831 LB_CHECK_EXPORT([new_sync_read], [fs/read_write.c],
1832 [AC_DEFINE(HAVE_SYNC_READ_WRITE, 1,
1833 [new_sync_[read|write] is exported by the kernel])])
1834 ]) # LC_HAVE_SYNC_READ_WRITE
1839 # 4.1 redefined bi_cnt as __bi_cnt in commit dac56212e8127dbc0
1841 AC_DEFUN([LC_HAVE___BI_CNT], [
1842 LB_CHECK_COMPILE([if Linux kernel has __bi_cnt in struct bio],
1844 #include <asm/atomic.h>
1845 #include <linux/bio.h>
1846 #include <linux/blk_types.h>
1848 struct bio bio = { };
1850 cnt = atomic_read(&bio.__bi_cnt);
1852 AC_DEFINE(HAVE___BI_CNT, 1,
1853 [struct bio has __bi_cnt])
1855 ]) # LC_HAVE___BI_CNT
1858 # LC_NEW_CANCEL_DIRTY_PAGE
1860 # 4.2 kernel has new cancel_dirty_page
1862 AC_DEFUN([LC_NEW_CANCEL_DIRTY_PAGE], [
1863 LB_CHECK_COMPILE([if cancel_dirty_page with one argument exist],
1864 new_cancel_dirty_page, [
1865 #include <linux/mm.h>
1867 cancel_dirty_page(NULL);
1869 AC_DEFINE(HAVE_NEW_CANCEL_DIRTY_PAGE, 1,
1870 [cancel_dirty_page with one arguement is available])
1872 ]) # LC_NEW_CANCEL_DIRTY_PAGE
1875 # LC_SYMLINK_OPS_USE_NAMEIDATA
1877 # For the 4.2+ kernels the file system internal symlink api no
1878 # longer uses struct nameidata as a argument
1880 AC_DEFUN([LC_SYMLINK_OPS_USE_NAMEIDATA], [
1881 LB_CHECK_COMPILE([if symlink inode operations have struct nameidata argument],
1882 symlink_use_nameidata, [
1883 #include <linux/namei.h>
1884 #include <linux/fs.h>
1886 struct nameidata *nd = NULL;
1888 ((struct inode_operations *)0)->follow_link(NULL, nd);
1889 ((struct inode_operations *)0)->put_link(NULL, nd, NULL);
1891 AC_DEFINE(HAVE_SYMLINK_OPS_USE_NAMEIDATA, 1,
1892 [symlink inode operations need struct nameidata argument])
1894 ]) # LC_SYMLINK_OPS_USE_NAMEIDATA
1897 # LC_BIO_ENDIO_USES_ONE_ARG
1899 # 4.2 kernel bio_endio now only takes one argument
1901 AC_DEFUN([LC_BIO_ENDIO_USES_ONE_ARG], [
1902 LB_CHECK_COMPILE([if 'bio_endio' with one argument exist],
1904 #include <linux/bio.h>
1908 AC_DEFINE(HAVE_BIO_ENDIO_USES_ONE_ARG, 1,
1909 [bio_endio takes only one argument])
1911 ]) # LC_BIO_ENDIO_USES_ONE_ARG
1914 # LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
1916 # 4.3 replace interval with interval_exp in 'struct blk_integrity'
1917 # 'struct blk_integrity_profile' is also added in this version,
1918 # thus use this to determine whether 'struct blk_integrity' has profile
1920 AC_DEFUN([LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY], [
1921 LB_CHECK_COMPILE([if 'blk_integrity.interval_exp' exist],
1922 blk_integrity_interval_exp, [
1923 #include <linux/blkdev.h>
1925 ((struct blk_integrity *)0)->interval_exp = 0;
1927 AC_DEFINE(HAVE_INTERVAL_EXP_BLK_INTEGRITY, 1,
1928 [blk_integrity.interval_exp exist])
1930 ]) # LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
1933 # LC_HAVE_LOOP_CTL_GET_FREE
1935 # 4.x kernel have moved userspace APIs to
1936 # the separate directory and all of them
1937 # support LOOP_CTL_GET_FREE
1939 AC_DEFUN([LC_HAVE_LOOP_CTL_GET_FREE], [
1940 LB_CHECK_FILE([$LINUX/include/linux/loop.h], [
1941 LB_CHECK_COMPILE([if have 'HAVE_LOOP_CTL_GET_FREE'],
1942 LOOP_CTL_GET_FREE, [
1943 #include <linux/loop.h>
1947 i = LOOP_CTL_GET_FREE;
1949 AC_DEFINE(HAVE_LOOP_CTL_GET_FREE, 1,
1950 [LOOP_CTL_GET_FREE exist])
1953 AC_DEFINE(HAVE_LOOP_CTL_GET_FREE, 1,
1954 [kernel has LOOP_CTL_GET_FREE])
1956 ]) # LC_HAVE_LOOP_CTL_GET_FREE
1959 # LC_HAVE_CACHE_HEAD_HLIST
1961 # 4.3 kernel swiched to hlist for cache_head
1963 AC_DEFUN([LC_HAVE_CACHE_HEAD_HLIST], [
1964 LB_CHECK_COMPILE([if 'struct cache_head' has 'cache_list' field],
1965 cache_head_has_hlist, [
1966 #include <linux/sunrpc/cache.h>
1968 do {} while(sizeof(((struct cache_head *)0)->cache_list));
1970 AC_DEFINE(HAVE_CACHE_HEAD_HLIST, 1,
1971 [cache_head has hlist cache_list])
1973 ]) # LC_HAVE_CACHE_HEAD_HLIST
1976 # LC_HAVE_XATTR_HANDLER_SIMPLIFIED
1978 # Kernel version 4.3 commit e409de992e3ea3674393465f07cc71c948edd87a
1979 # simplified xattr_handler handling by passing in the handler pointer
1981 AC_DEFUN([LC_HAVE_XATTR_HANDLER_SIMPLIFIED], [
1982 tmp_flags="$EXTRA_KCFLAGS"
1983 EXTRA_KCFLAGS="-Werror"
1984 LB_CHECK_COMPILE([if 'struct xattr_handler' functions pass in handler pointer],
1985 xattr_handler_simplified, [
1986 #include <linux/xattr.h>
1988 struct xattr_handler handler;
1990 ((struct xattr_handler *)0)->get(&handler, NULL, NULL, NULL, 0);
1991 ((struct xattr_handler *)0)->set(&handler, NULL, NULL, NULL, 0, 0);
1993 AC_DEFINE(HAVE_XATTR_HANDLER_SIMPLIFIED, 1, [handler pointer is parameter])
1995 EXTRA_KCFLAGS="$tmp_flags"
1996 ]) # LC_HAVE_XATTR_HANDLER_SIMPLIFIED
1999 # LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
2001 # 4.3 replace interval with interval_exp in 'struct blk_integrity'.
2003 AC_DEFUN([LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD], [
2004 LB_CHECK_COMPILE([if 'bio_integrity_payload.bip_iter' exist],
2005 bio_integrity_payload_bip_iter, [
2006 #include <linux/bio.h>
2008 ((struct bio_integrity_payload *)0)->bip_iter.bi_size = 0;
2010 AC_DEFINE(HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD, 1,
2011 [bio_integrity_payload.bip_iter exist])
2013 ]) # LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
2016 # LC_BIO_INTEGRITY_PREP_FN
2018 # Lustre kernel patch extents bio_integrity_prep to accept optional
2019 # generate/verify_fn as extra args.
2021 AC_DEFUN([LC_BIO_INTEGRITY_PREP_FN], [
2022 LB_CHECK_COMPILE([if 'bio_integrity_prep_fn' exists],
2023 bio_integrity_prep_fn, [
2024 #include <linux/bio.h>
2026 bio_integrity_prep_fn(NULL, NULL, NULL);
2028 AC_DEFINE(HAVE_BIO_INTEGRITY_PREP_FN, 1,
2029 [kernel has bio_integrity_prep_fn])
2030 AC_SUBST(PATCHED_INTEGRITY_INTF)
2032 AC_SUBST(PATCHED_INTEGRITY_INTF, [#])
2034 ]) # LC_BIO_INTEGRITY_PREP_FN
2039 # 4.4/4.8 redefined bi_rw as bi_opf (SLES12/kernel commit 4382e33ad37486)
2041 AC_DEFUN([LC_HAVE_BI_OPF], [
2042 LB_CHECK_COMPILE([if Linux kernel has bi_opf in struct bio],
2044 #include <linux/bio.h>
2050 AC_DEFINE(HAVE_BI_OPF, 1,
2051 [struct bio has bi_opf])
2056 # LC_HAVE_SUBMIT_BIO_2ARGS
2058 # 4.4 removed an argument from submit_bio
2060 AC_DEFUN([LC_HAVE_SUBMIT_BIO_2ARGS], [
2061 LB_CHECK_COMPILE([if submit_bio takes two arguments],
2062 have_submit_bio_2args, [
2063 #include <linux/bio.h>
2066 submit_bio(READ, &bio);
2068 AC_DEFINE(HAVE_SUBMIT_BIO_2ARGS, 1,
2069 [submit_bio takes two arguments])
2071 ]) # LC_HAVE_SUBMIT_BIO_2_ARGS
2074 # LC_HAVE_CLEAN_BDEV_ALIASES
2076 # 4.4/4.9 unmap_underlying_metadata was replaced by clean_bdev_aliases
2077 # (SLES12/kernel commit 29f3ad7d8380364c)
2079 AC_DEFUN([LC_HAVE_CLEAN_BDEV_ALIASES], [
2080 LB_CHECK_COMPILE([if kernel has clean_bdev_aliases],
2081 have_clean_bdev_aliases, [
2082 #include <linux/buffer_head.h>
2084 struct block_device bdev;
2085 clean_bdev_aliases(&bdev,1,1);
2087 AC_DEFINE(HAVE_CLEAN_BDEV_ALIASES, 1,
2088 [kernel has clean_bdev_aliases])
2090 ]) # LC_HAVE_CLEAN_BDEV_ALIASES
2093 # LC_HAVE_LOCKS_LOCK_FILE_WAIT
2095 # 4.4 kernel have moved locks API users to
2096 # locks_lock_inode_wait()
2098 AC_DEFUN([LC_HAVE_LOCKS_LOCK_FILE_WAIT], [
2099 LB_CHECK_COMPILE([if 'locks_lock_file_wait' exists],
2100 locks_lock_file_wait, [
2101 #include <linux/fs.h>
2103 locks_lock_file_wait(NULL, NULL);
2105 AC_DEFINE(HAVE_LOCKS_LOCK_FILE_WAIT, 1,
2106 [kernel has locks_lock_file_wait])
2108 ]) # LC_HAVE_LOCKS_LOCK_FILE_WAIT
2111 # LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
2113 # 4.4 kernel merged type-specific data with the payload data for keys
2115 AC_DEFUN([LC_HAVE_KEY_PAYLOAD_DATA_ARRAY], [
2116 LB_CHECK_COMPILE([if 'struct key' has 'payload.data' as an array],
2117 key_payload_data_array, [
2118 #include <linux/key.h>
2120 struct key key = { };
2122 key.payload.data[0] = NULL;
2124 AC_DEFINE(HAVE_KEY_PAYLOAD_DATA_ARRAY, 1, [payload.data is an array])
2126 ]) #LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
2129 # LC_HAVE_XATTR_HANDLER_NAME
2131 # Kernel version 4.4 commit 98e9cb5711c68223f0e4d5201b9a6add255ec550
2132 # add a name member to struct xattr_handler
2134 AC_DEFUN([LC_HAVE_XATTR_HANDLER_NAME], [
2135 tmp_flags="$EXTRA_KCFLAGS"
2136 EXTRA_KCFLAGS="-Werror"
2137 LB_CHECK_COMPILE([if 'struct xattr_handler' has a name member],
2138 xattr_handler_name, [
2139 #include <linux/xattr.h>
2141 ((struct xattr_handler *)NULL)->name = NULL;
2143 AC_DEFINE(HAVE_XATTR_HANDLER_NAME, 1, [xattr_handler has a name member])
2145 EXTRA_KCFLAGS="$tmp_flags"
2146 ]) # LC_HAVE_XATTR_HANDLER_NAME
2149 # LC_HAVE_FILE_DENTRY
2151 # 4.5 adds wrapper file_dentry
2153 AC_DEFUN([LC_HAVE_FILE_DENTRY], [
2154 LB_CHECK_COMPILE([if Linux kernel has 'file_dentry'],
2156 #include <linux/fs.h>
2160 AC_DEFINE(HAVE_FILE_DENTRY, 1,
2161 [kernel has file_dentry])
2163 ]) # LC_HAVE_FILE_DENTRY
2166 # LC_HAVE_INODE_LOCK
2168 # 4.5 introduced inode_lock
2170 AC_DEFUN([LC_HAVE_INODE_LOCK], [
2171 LB_CHECK_COMPILE([if 'inode_lock' is defined],
2173 #include <linux/fs.h>
2177 AC_DEFINE(HAVE_INODE_LOCK, 1,
2178 [inode_lock is defined])
2180 ]) # LC_HAVE_INODE_LOCK
2183 # LC_HAVE_IOP_GET_LINK
2185 # 4.5 vfs replaced iop->follow_link with
2188 AC_DEFUN([LC_HAVE_IOP_GET_LINK], [
2189 LB_CHECK_COMPILE([if 'iop' has 'get_link'],
2190 inode_ops_get_link, [
2191 #include <linux/fs.h>
2193 struct inode_operations iop;
2194 iop.get_link = NULL;
2196 AC_DEFINE(HAVE_IOP_GET_LINK, 1,
2197 [have iop get_link])
2199 ]) # LC_HAVE_IOP_GET_LINK
2202 # LC_HAVE_IN_COMPAT_SYSCALL
2204 # 4.6 renamed is_compat_task to in_compat_syscall
2206 AC_DEFUN([LC_HAVE_IN_COMPAT_SYSCALL], [
2207 LB_CHECK_COMPILE([if 'in_compat_syscall' is defined],
2208 in_compat_syscall, [
2209 #include <linux/compat.h>
2211 in_compat_syscall();
2213 AC_DEFINE(HAVE_IN_COMPAT_SYSCALL, 1,
2214 [have in_compat_syscall])
2216 ]) # LC_HAVE_IN_COMPAT_SYSCALL
2219 # LC_HAVE_XATTR_HANDLER_INODE_PARAM
2221 # Kernel version 4.6 commit b296821a7c42fa58baa17513b2b7b30ae66f3336
2222 # and commit 5930122683dff58f0846b0f0405b4bd598a3ba6a added inode parameter
2223 # to xattr_handler functions
2225 AC_DEFUN([LC_HAVE_XATTR_HANDLER_INODE_PARAM], [
2226 tmp_flags="$EXTRA_KCFLAGS"
2227 EXTRA_KCFLAGS="-Werror"
2228 LB_CHECK_COMPILE([if 'struct xattr_handler' functions have inode parameter],
2229 xattr_handler_inode_param, [
2230 #include <linux/xattr.h>
2232 const struct xattr_handler handler;
2234 ((struct xattr_handler *)0)->get(&handler, NULL, NULL, NULL, NULL, 0);
2235 ((struct xattr_handler *)0)->set(&handler, NULL, NULL, NULL, NULL, 0, 0);
2237 AC_DEFINE(HAVE_XATTR_HANDLER_INODE_PARAM, 1, [needs inode parameter])
2239 EXTRA_KCFLAGS="$tmp_flags"
2240 ]) # LC_HAVE_XATTR_HANDLER_INODE_PARAM
2245 # Kernel version 4.6 commit 85c7f81041d57cfe9dc97f4680d5586b54534a39
2246 # introduced parallel lookups in the VFS layer. The inline function
2247 # d_in_lookup was added to notify when the same item was being queried
2250 AC_DEFUN([LC_D_IN_LOOKUP], [
2251 tmp_flags="$EXTRA_KCFLAGS"
2252 EXTRA_KCFLAGS="-Werror"
2253 LB_CHECK_COMPILE([if 'd_in_lookup' is defined],
2255 #include <linux/dcache.h>
2259 AC_DEFINE(HAVE_D_IN_LOOKUP, 1, [d_in_lookup is defined])
2261 EXTRA_KCFLAGS="$tmp_flags"
2267 # Kernel version 4.7 commit c8b8e32d700fe943a935e435ae251364d016c497
2268 # direct-io: eliminate the offset argument to ->direct_IO
2270 AC_DEFUN([LC_DIRECTIO_2ARGS], [
2271 LB_CHECK_COMPILE([if '->direct_IO()' taken 2 arguments],
2273 #include <linux/fs.h>
2275 struct address_space_operations ops = { };
2276 struct iov_iter *iter = NULL;
2277 struct kiocb *iocb = NULL;
2280 rc = ops.direct_IO(iocb, iter);
2282 AC_DEFINE(HAVE_DIRECTIO_2ARGS, 1,
2283 [direct_IO need 2 arguments])
2285 ]) # LC_DIRECTIO_2ARGS
2288 # LC_GENERIC_WRITE_SYNC_2ARGS
2290 # Kernel version 4.7 commit dde0c2e79848298cc25621ad080d47f94dbd7cce
2291 # fs: add IOCB_SYNC and IOCB_DSYNC
2293 AC_DEFUN([LC_GENERIC_WRITE_SYNC_2ARGS], [
2294 LB_CHECK_COMPILE([if 'generic_write_sync()' taken 2 arguments],
2295 generic_write_sync_2args, [
2296 #include <linux/fs.h>
2298 struct kiocb *iocb = NULL;
2301 rc = generic_write_sync(iocb, 0);
2303 AC_DEFINE(HAVE_GENERIC_WRITE_SYNC_2ARGS, 1,
2304 [generic_write_sync need 2 arguments])
2306 ]) # LC_GENERIC_WRITE_SYNC_2ARGS
2309 # LC_FOP_ITERATE_SHARED
2311 # Kernel version 4.7 adds iterate_shared method to file_operations
2313 AC_DEFUN([LC_FOP_ITERATE_SHARED], [
2314 LB_CHECK_COMPILE([if 'file_operations' has 'iterate_shared'],
2315 fop_iterate_shared, [
2316 #include <linux/fs.h>
2318 struct file_operations fop;
2319 fop.iterate_shared = NULL;
2321 AC_DEFINE(HAVE_FOP_ITERATE_SHARED, 1,
2322 [file_operations has iterate_shared])
2324 ]) # LC_FOP_ITERATE_SHARED
2327 # LC_FOPS_ITERATE_SHARED
2329 # 4.7 commit ae05327a00fd47c34dfe25294b359a3f3fef96e8
2330 # ext4: switch to ->iterate_shared()
2331 # this replaces ext4_dir_operations iterate with iterate_shared.
2332 # dir_relaxed_shared() was also added in this commit, so we can
2333 # use that function to verify that the ext4_dir_operations is using
2336 AC_DEFUN([LC_FOPS_ITERATE_SHARED], [
2337 LB_CHECK_COMPILE([if ext4_dir_operations uses iterate_shared],
2339 #include <linux/fs.h>
2341 ((struct file_operations *)0)->iterate_shared(NULL, NULL);
2342 dir_relax_shared(NULL);
2344 AC_DEFINE(HAVE_ITERATE_SHARED, 1,
2345 ['iterate_shared' is available])
2347 ]) # LC_FOPS_ITERATE_SHARED
2350 # LC_HAVE_POSIX_ACL_VALID_USER_NS
2352 # 4.8 posix_acl_valid takes struct user_namespace
2354 AC_DEFUN([LC_HAVE_POSIX_ACL_VALID_USER_NS], [
2355 LB_CHECK_COMPILE([if 'posix_acl_valid' takes 'struct user_namespace'],
2357 #include <linux/fs.h>
2358 #include <linux/posix_acl.h>
2360 posix_acl_valid((struct user_namespace*)NULL, (const struct posix_acl*)NULL);
2362 AC_DEFINE(HAVE_POSIX_ACL_VALID_USER_NS, 1,
2363 [posix_acl_valid takes struct user_namespace])
2365 ]) # LC_HAVE_POSIX_ACL_VALID_USER_NS
2368 # LC_D_COMPARE_4ARGS
2370 # Kernel version 4.8 commit 6fa67e707559303e086303aeecc9e8b91ef497d5
2371 # get rid of 'parent' argument of ->d_compare()
2373 AC_DEFUN([LC_D_COMPARE_4ARGS], [
2374 LB_CHECK_COMPILE([if 'd_compare' taken 4 arguments],
2376 #include <linux/dcache.h>
2378 ((struct dentry_operations*)0)->d_compare(NULL,0,NULL,NULL);
2380 AC_DEFINE(HAVE_D_COMPARE_4ARGS, 1,
2381 [d_compare need 4 arguments])
2383 ]) # LC_D_COMPARE_4ARGS
2386 # LC_FULL_NAME_HASH_3ARGS
2388 # Kernel version 4.8 commit 8387ff2577eb9ed245df9a39947f66976c6bcd02
2389 # vfs: make the string hashes salt the hash
2391 AC_DEFUN([LC_FULL_NAME_HASH_3ARGS], [
2392 LB_CHECK_COMPILE([if 'full_name_hash' taken 3 arguments],
2393 full_name_hash_3args, [
2394 #include <linux/stringhash.h>
2397 hash = full_name_hash(NULL,NULL,0);
2399 AC_DEFINE(HAVE_FULL_NAME_HASH_3ARGS, 1,
2400 [full_name_hash need 3 arguments])
2402 ]) # LC_FULL_NAME_HASH_3ARGS
2405 # LC_STRUCT_POSIX_ACL_XATTR
2407 # Kernel version 4.8 commit 2211d5ba5c6c4e972ba6dbc912b2897425ea6621
2408 # posix_acl: xattr representation cleanups
2410 AC_DEFUN([LC_STRUCT_POSIX_ACL_XATTR], [
2411 LB_CHECK_COMPILE([if 'struct posix_acl_xattr_{header,entry}' defined],
2412 struct_posix_acl_xattr, [
2413 #include <linux/fs.h>
2414 #include <linux/posix_acl_xattr.h>
2416 struct posix_acl_xattr_header *h = NULL;
2417 struct posix_acl_xattr_entry *e;
2418 e = (void *)(h + 1);
2420 AC_DEFINE(HAVE_STRUCT_POSIX_ACL_XATTR, 1,
2421 [struct posix_acl_xattr_{header,entry} defined])
2423 ]) # LC_STRUCT_POSIX_ACL_XATTR
2428 # Kernel version 4.8 commit fd50ecaddf8372a1d96e0daeaac0f93cf04e4d42
2429 # removed {get,set,remove}xattr inode operations
2431 AC_DEFUN([LC_IOP_XATTR], [
2432 LB_CHECK_COMPILE([if 'inode_operations' has {get,set,remove}xattr members],
2434 #include <linux/fs.h>
2436 struct inode_operations iop;
2437 iop.setxattr = NULL;
2438 iop.getxattr = NULL;
2439 iop.removexattr = NULL;
2441 AC_DEFINE(HAVE_IOP_XATTR, 1,
2442 [inode_operations has {get,set,remove}xattr members])
2449 # Kernel version 4.9 commit 81243eacfa400f5f7b89f4c2323d0de9982bb0fb
2450 # cred: simpler, 1D supplementary groups
2452 AC_DEFUN([LC_GROUP_INFO_GID], [
2453 LB_CHECK_COMPILE([if 'struct group_info' has member 'gid'],
2455 #include <linux/cred.h>
2458 p = ((struct group_info *)0)->gid;
2460 AC_DEFINE(HAVE_GROUP_INFO_GID, 1,
2461 [struct group_info has member gid])
2463 ]) # LC_GROUP_INFO_GID
2468 # Kernel version 4.9 commit 5d6c31910bc0713e37628dc0ce677dcb13c8ccf4
2469 # added __vfs_{get,set,remove}xattr helpers
2471 AC_DEFUN([LC_VFS_SETXATTR], [
2472 LB_CHECK_COMPILE([if '__vfs_setxattr' helper is available],
2474 #include <linux/xattr.h>
2476 __vfs_setxattr(NULL, NULL, NULL, NULL, 0, 0);
2478 AC_DEFINE(HAVE_VFS_SETXATTR, 1,
2479 ['__vfs_setxattr is available])
2481 ]) # LC_VFS_SETXATTR
2484 # LC_POSIX_ACL_UPDATE_MODE
2486 # Kernel version 4.9 commit 073931017b49d9458aa351605b43a7e34598caef
2487 # posix_acl: Clear SGID bit when setting file permissions
2489 AC_DEFUN([LC_POSIX_ACL_UPDATE_MODE], [
2490 LB_CHECK_COMPILE([if 'posix_acl_update_mode' exists],
2491 posix_acl_update_mode, [
2492 #include <linux/fs.h>
2493 #include <linux/posix_acl.h>
2495 posix_acl_update_mode(NULL, NULL, NULL);
2497 AC_DEFINE(HAVE_POSIX_ACL_UPDATE_MODE, 1,
2498 ['posix_acl_update_mode' is available])
2500 ]) # LC_POSIX_ACL_UPDATE_MODE
2503 # LC_IOP_GENERIC_READLINK
2505 # Kernel version 4.10 commit dfeef68862edd7d4bafe68ef7aeb5f658ef24bb5
2506 # removed generic_readlink from individual file systems
2508 AC_DEFUN([LC_IOP_GENERIC_READLINK], [
2509 LB_CHECK_COMPILE([if 'generic_readlink' still exist],
2510 inode_ops_readlink, [
2511 #include <linux/fs.h>
2513 struct inode_operations iop;
2514 iop.readlink = generic_readlink;
2516 AC_DEFINE(HAVE_IOP_GENERIC_READLINK, 1,
2517 [generic_readlink has been removed])
2519 ]) # LC_IOP_GENERIC_READLINK
2522 # LC_HAVE_VM_FAULT_ADDRESS
2524 # Kernel version 4.10 commit 1a29d85eb0f19b7d8271923d8917d7b4f5540b3e
2525 # removed virtual_address field. Need to use address field instead
2527 AC_DEFUN([LC_HAVE_VM_FAULT_ADDRESS], [
2528 LB_CHECK_COMPILE([if 'struct vm_fault' replaced virtual_address with address field],
2530 #include <linux/mm.h>
2532 struct vm_fault vmf;
2535 AC_DEFINE(HAVE_VM_FAULT_ADDRESS, 1,
2536 [virtual_address has been replaced by address field])
2538 ]) # LC_HAVE_VM_FAULT_ADDRESS
2541 # LC_INODEOPS_ENHANCED_GETATTR
2543 # Kernel version 4.11 commit a528d35e8bfcc521d7cb70aaf03e1bd296c8493f
2544 # expanded getattr to be able to get more stat information.
2546 AC_DEFUN([LC_INODEOPS_ENHANCED_GETATTR], [
2547 LB_CHECK_COMPILE([if 'inode_operations' getattr member can gather advance stats],
2549 #include <linux/fs.h>
2553 ((struct inode_operations *)1)->getattr(&path, NULL, 0, 0);
2555 AC_DEFINE(HAVE_INODEOPS_ENHANCED_GETATTR, 1,
2556 [inode_operations .getattr member function can gather advance stats])
2558 ]) # LC_INODEOPS_ENHANCED_GETATTR
2561 # LC_VM_OPERATIONS_REMOVE_VMF_ARG
2563 # Kernel version 4.11 commit 11bac80004499ea59f361ef2a5516c84b6eab675
2564 # removed struct vm_area_struct as an argument for vm_operations since
2565 # in the same kernel version struct vma_area_struct was folded into
2568 AC_DEFUN([LC_VM_OPERATIONS_REMOVE_VMF_ARG], [
2569 LB_CHECK_COMPILE([if 'struct vm_operations' removed struct vm_area_struct],
2570 vm_operations_no_vm_area_struct, [
2571 #include <linux/mm.h>
2573 struct vm_fault vmf;
2575 ((struct vm_operations_struct *)0)->fault(&vmf);
2576 ((struct vm_operations_struct *)0)->page_mkwrite(&vmf);
2578 AC_DEFINE(HAVE_VM_OPS_USE_VM_FAULT_ONLY, 1,
2579 ['struct vm_operations' remove struct vm_area_struct argument])
2581 ]) # LC_VM_OPERATIONS_REMOVE_VMF_ARG
2584 # LC_HAVE_KEY_USAGE_REFCOUNT
2586 # Kernel version 4.11 commit fff292914d3a2f1efd05ca71c2ba72a3c663201e
2587 # converted key.usage from atomic_t to refcount_t.
2589 AC_DEFUN([LC_HAVE_KEY_USAGE_REFCOUNT], [
2590 LB_CHECK_COMPILE([if 'key.usage' is refcount_t],
2591 key_usage_refcount, [
2592 #include <linux/key.h>
2594 struct key key = { };
2596 refcount_read(&key.usage);
2598 AC_DEFINE(HAVE_KEY_USAGE_REFCOUNT, 1, [key.usage is of type refcount_t])
2600 ]) #LC_HAVE_KEY_USAGE_REFCOUNT
2603 # LC_HAVE_CRYPTO_MAX_ALG_NAME_128
2605 # Kernel version 4.11 commit f437a3f477cce402dbec6537b29e9e33962c9f73
2606 # switched CRYPTO_MAX_ALG_NAME from 64 to 128.
2608 AC_DEFUN([LC_HAVE_CRYPTO_MAX_ALG_NAME_128], [
2609 LB_CHECK_COMPILE([if 'CRYPTO_MAX_ALG_NAME' is 128],
2610 crypto_max_alg_name, [
2611 #include <linux/crypto.h>
2613 #if CRYPTO_MAX_ALG_NAME != 128
2617 AC_DEFINE(HAVE_CRYPTO_MAX_ALG_NAME_128, 1,
2618 ['CRYPTO_MAX_ALG_NAME' is 128])
2620 ]) # LC_HAVE_CRYPTO_MAX_ALG_NAME_128
2623 # Kernel version 4.12 commit 47f38c539e9a42344ff5a664942075bd4df93876
2624 # CURRENT_TIME is not 64 bit time safe so it was replaced with
2627 AC_DEFUN([LC_CURRENT_TIME], [
2628 LB_CHECK_COMPILE([if CURRENT_TIME has been replaced with current_time],
2630 #include <linux/fs.h>
2634 attr.ia_atime = current_time(NULL);
2636 AC_DEFINE(HAVE_CURRENT_TIME, 1,
2637 [current_time() has replaced CURRENT_TIME])
2639 ]) # LIBCFS_CURRENT_TIME
2642 # Kernel version 4.12-rc3 85787090a21eb749d8b347eaf9ff1a455637473c
2643 # changed struct super_block s_uuid into a proper uuid_t
2645 AC_DEFUN([LC_SUPER_BLOCK_S_UUID], [
2646 LB_CHECK_COMPILE([if 'struct super_block' s_uuid is uuid_t],
2647 super_block_s_uuid, [
2648 #include <linux/fs.h>
2650 struct super_block sb;
2652 uuid_parse(NULL, &sb.s_uuid);
2654 AC_DEFINE(HAVE_S_UUID_AS_UUID_T, 1, ['s_uuid' is an uuid_t])
2656 ]) # LC_SUPER_BLOCK_S_UUID
2659 # LC_SUPER_SETUP_BDI_NAME
2661 # Kernel version 4.12 commit 9594caf216dc0fe3e318b34af0127276db661241
2662 # unified bdi handling
2664 AC_DEFUN([LC_SUPER_SETUP_BDI_NAME], [
2665 LB_CHECK_COMPILE([if 'super_setup_bdi_name' exist],
2666 super_setup_bdi_name, [
2667 #include <linux/fs.h>
2669 super_setup_bdi_name(NULL, "lustre");
2671 AC_DEFINE(HAVE_SUPER_SETUP_BDI_NAME, 1,
2672 ['super_setup_bdi_name' is available])
2674 ]) # LC_SUPER_SETUP_BDI_NAME
2679 # 4.12 replace bi_error to bi_status
2681 AC_DEFUN([LC_BI_STATUS], [
2682 LB_CHECK_COMPILE([if 'bi_status' exist],
2684 #include <linux/blk_types.h>
2686 ((struct bio *)0)->bi_status = 0;
2688 AC_DEFINE(HAVE_BI_STATUS, 1,
2689 ['bi_status' is available])
2694 # LC_UAPI_LINUX_MOUNT_H
2696 # kernel 4.20 commit e262e32d6bde0f77fb0c95d977482fc872c51996
2697 # vfs: Suppress MS_* flag defs within the kernel ...
2699 AC_DEFUN([LC_UAPI_LINUX_MOUNT_H], [
2700 tmp_flags="$EXTRA_KCFLAGS"
2701 EXTRA_KCFLAGS="-Werror"
2702 LB_CHECK_COMPILE([if MS_RDONLY was moved to uapi/linux/mount.h],
2704 #include <uapi/linux/mount.h>
2709 AC_DEFINE(HAVE_UAPI_LINUX_MOUNT_H, 1,
2710 [if MS_RDONLY was moved to uapi/linux/mount.h])
2712 EXTRA_KCFLAGS="$tmp_flags"
2713 ]) # LC_UAPI_LINUX_MOUNT_H
2716 # LC_BIO_INTEGRITY_ENABLED
2718 # 4.13 removed bio_integrity_enabled
2720 AC_DEFUN([LC_BIO_INTEGRITY_ENABLED], [
2721 LB_CHECK_COMPILE([if 'bio_integrity_enabled' exist],
2722 bio_integrity_enabled, [
2723 #include <linux/bio.h>
2725 bio_integrity_enabled(NULL);
2727 AC_DEFINE(HAVE_BIO_INTEGRITY_ENABLED, 1,
2728 ['bio_integrity_enabled' is available])
2730 ]) # LC_BIO_INTEGRITY_ENABLED
2733 # LC_PAGEVEC_INIT_ONE_PARAM
2735 # 4.14 pagevec_init takes one parameter
2737 AC_DEFUN([LC_PAGEVEC_INIT_ONE_PARAM], [
2738 LB_CHECK_COMPILE([if 'pagevec_init' takes one parameter],
2740 #include <linux/pagevec.h>
2744 AC_DEFINE(HAVE_PAGEVEC_INIT_ONE_PARAM, 1,
2745 ['pagevec_init' takes one parameter])
2747 ]) # LC_PAGEVEC_INIT_ONE_PARAM
2752 # 4.14 replaced bi_bdev to bi_disk
2754 AC_DEFUN([LC_BI_BDEV], [
2755 LB_CHECK_COMPILE([if 'bi_bdev' exist],
2757 #include <linux/bio.h>
2759 ((struct bio *)0)->bi_bdev = NULL;
2761 AC_DEFINE(HAVE_BI_BDEV, 1,
2762 ['bi_bdev' is available])
2769 # kernel 4.17 commit b93b016313b3ba8003c3b8bb71f569af91f19fc7
2771 AC_DEFUN([LC_I_PAGES], [
2772 LB_CHECK_COMPILE([if struct address_space has i_pages],
2774 #include <linux/fs.h>
2776 struct address_space mapping = {};
2779 i_pages = &mapping.i_pages;
2781 AC_DEFINE(HAVE_I_PAGES, 1,
2782 [struct address_space has i_pages])
2789 # kernel 4.17 commit 3d3539018d2cbd12e5af4a132636ee7fd8d43ef0
2790 # mm: create the new vm_fault_t type
2792 AC_DEFUN([LC_VM_FAULT_T], [
2793 LB_CHECK_COMPILE([if vm_fault_t type exists],
2795 #include <linux/mm_types.h>
2797 vm_fault_t x = VM_FAULT_SIGBUS;
2800 AC_DEFINE(HAVE_VM_FAULT_T, 1,
2801 [if vm_fault_t type exists])
2806 # LC_INODE_TIMESPEC64
2808 # kernel 4.17-rc7 commit 8efd6894ff089adeeac7cb9f32125b85d963d1bc
2809 # fs: add timespec64_truncate()
2810 # kernel 4.18 commit 95582b00838837fc07e042979320caf917ce3fe6
2811 # inode timestamps switched to timespec64
2812 # kernel 4.19-rc2 commit 976516404ff3fab2a8caa8bd6f5efc1437fed0b8
2813 # y2038: remove unused time interfaces
2817 # When inode times are timespec64 stop using the deprecated
2820 AC_DEFUN([LC_INODE_TIMESPEC64], [
2821 tmp_flags="$EXTRA_KCFLAGS"
2822 EXTRA_KCFLAGS="-Werror"
2823 LB_CHECK_COMPILE([if inode timestamps are struct timespec64],
2825 #include <linux/fs.h>
2827 struct inode inode = {};
2828 struct timespec64 ts = {};
2830 inode.i_atime = timespec64_trunc(ts, 1);
2833 AC_DEFINE(HAVE_INODE_TIMESPEC64, 1,
2834 [inode times are using timespec64])
2836 EXTRA_KCFLAGS="$tmp_flags"
2837 ]) # LC_INODE_TIMESPEC64
2842 # Lustre linux kernel checks
2844 AC_DEFUN([LC_PROG_LINUX], [
2845 AC_MSG_NOTICE([Lustre kernel checks
2846 ==============================================================================])
2851 LC_CONFIG_HEALTH_CHECK_WRITE
2852 LC_CONFIG_LRU_RESIZE
2854 LC_GLIBC_SUPPORT_FHANDLES
2860 LC_EXPORT_TRUNCATE_COMPLETE_PAGE
2863 LC_HAVE_FHANDLE_SYSCALLS
2864 LC_HAVE_FSTYPE_MOUNT
2865 LC_HAVE_INODE_OWNER_OR_CAPABLE
2866 LC_HAVE_SECURITY_IINITSEC
2867 LC_VFS_CREATE_USE_NAMEIDATA
2870 LC_DIRTY_INODE_WITH_FLAG
2874 LC_LM_XXX_LOCK_MANAGER_OPS
2878 LC_INODE_PERMISION_2ARGS
2879 LC_RADIX_EXCEPTION_ENTRY
2880 LC_HAVE_LOOP_CTL_GET_FREE
2883 LC_HAVE_PROTECT_I_NLINK
2886 LC_HAVE_MIGRATE_HEADER
2887 LC_MIGRATEPAGE_4ARGS
2888 LC_SUPEROPS_USE_DENTRY
2889 LC_INODEOPS_USE_UMODE_T
2890 LC_HAVE_CACHE_REGISTER
2894 LC_KMAP_ATOMIC_HAS_1ARG
2898 LC_HAVE_ENCODE_FH_PARENT
2899 LC_FILE_LLSEEK_SIZE_5ARG
2902 LC_DATA_FOR_LLITE_IS_LIST
2903 LC_DENTRY_OPEN_USE_PATH
2904 LC_HAVE_IOP_ATOMIC_OPEN
2905 LC_HAVE_SB_START_WRITE
2908 LC_HAVE_POSIXACL_USER_NS
2911 LC_HAVE_FILE_F_INODE
2913 LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS
2916 LC_HAVE_HLIST_FOR_EACH_3ARG
2917 LC_HAVE_BIO_END_SECTOR
2919 LC_HAVE_VFS_GETATTR_2ARGS
2922 LC_HAVE_REMOVE_PROC_SUBTREE
2924 LC_HAVE_PROJECT_QUOTA
2925 LC_HAVE_SECURITY_DENTRY_INIT_SECURITY
2926 LC_HAVE_SECURITY_INODE_LISTSECURITY
2933 LC_HAVE_DENTRY_D_U_D_ALIAS
2934 LC_HAVE_DENTRY_D_CHILD
2935 LC_PID_NS_FOR_CHILDREN
2938 LC_OLDSIZE_TRUNCATE_PAGECACHE
2939 LC_PTR_ERR_OR_ZERO_MISSING
2941 LC_INIT_LIST_HEAD_RCU
2946 LC_HAVE_D_IS_POSITIVE
2950 LC_HAVE_TRUNCATE_IPAGES_FINAL
2951 LC_IOPS_RENAME_WITH_FLAGS
2958 LC_DIRECTIO_USE_ITER
2959 LC_HAVE_IOV_ITER_INIT_DIRECTION
2960 LC_HAVE_IOV_ITER_TRUNCATE
2961 LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
2964 LC_HAVE_INTERVAL_BLK_INTEGRITY
2968 LC_PERCPU_COUNTER_INIT
2969 LC_NFS_FILLDIR_USE_CTX
2973 LC_HAVE_DQUOT_QC_DQBLK
2976 LC_BACKING_DEV_INFO_REMOVAL
2977 LC_HAVE_BDI_CAP_MAP_COPY
2980 LC_CANCEL_DIRTY_PAGE
2984 LC_HAVE_SYNC_READ_WRITE
2988 LC_NEW_CANCEL_DIRTY_PAGE
2989 LC_BIO_ENDIO_USES_ONE_ARG
2990 LC_SYMLINK_OPS_USE_NAMEIDATA
2993 LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
2994 LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
2995 LC_HAVE_CACHE_HEAD_HLIST
2996 LC_HAVE_XATTR_HANDLER_SIMPLIFIED
2999 LC_HAVE_LOCKS_LOCK_FILE_WAIT
3000 LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
3001 LC_HAVE_XATTR_HANDLER_NAME
3003 LC_HAVE_SUBMIT_BIO_2ARGS
3004 LC_HAVE_CLEAN_BDEV_ALIASES
3011 LC_HAVE_IOP_GET_LINK
3014 LC_HAVE_IN_COMPAT_SYSCALL
3015 LC_HAVE_XATTR_HANDLER_INODE_PARAM
3020 LC_GENERIC_WRITE_SYNC_2ARGS
3021 LC_FOPS_ITERATE_SHARED
3024 LC_HAVE_POSIX_ACL_VALID_USER_NS
3026 LC_FULL_NAME_HASH_3ARGS
3027 LC_STRUCT_POSIX_ACL_XATTR
3033 LC_POSIX_ACL_UPDATE_MODE
3036 LC_IOP_GENERIC_READLINK
3037 LC_HAVE_VM_FAULT_ADDRESS
3040 LC_INODEOPS_ENHANCED_GETATTR
3041 LC_VM_OPERATIONS_REMOVE_VMF_ARG
3042 LC_HAVE_KEY_USAGE_REFCOUNT
3043 LC_HAVE_CRYPTO_MAX_ALG_NAME_128
3047 LC_SUPER_BLOCK_S_UUID
3048 LC_SUPER_SETUP_BDI_NAME
3052 LC_BIO_INTEGRITY_ENABLED
3055 LC_PAGEVEC_INIT_ONE_PARAM
3066 LC_UAPI_LINUX_MOUNT_H
3068 # kernel patch to extend integrity interface
3069 LC_BIO_INTEGRITY_PREP_FN
3072 AS_IF([test "x$enable_server" != xno], [
3082 # Check whether to build the client side of Lustre
3084 AC_DEFUN([LC_CONFIG_CLIENT], [
3085 AC_MSG_CHECKING([whether to build Lustre client support])
3086 AC_ARG_ENABLE([client],
3087 AC_HELP_STRING([--disable-client],
3088 [disable Lustre client support]),
3089 [], [enable_client="yes"])
3090 AC_MSG_RESULT([$enable_client])
3091 ]) # LC_CONFIG_CLIENT
3096 AC_DEFUN([LB_CONFIG_MPITESTS], [
3097 AC_ARG_ENABLE([mpitests],
3098 AC_HELP_STRING([--enable-mpitests=<yes|no|mpicc wrapper>],
3099 [include mpi tests]), [
3100 enable_mpitests="yes"
3103 MPICC_WRAPPER="mpicc"
3104 MPI_BIN=$(eval which $MPICC_WRAPPER | xargs dirname)
3107 enable_mpitests="no"
3111 MPICC_WRAPPER=$enableval
3112 MPI_BIN=$(eval echo $MPICC_WRAPPER | xargs dirname)
3116 enable_mpitests="yes"
3117 MPICC_WRAPPER="mpicc"
3118 MPI_BIN=$(eval which $MPICC_WRAPPER | xargs dirname)
3121 if test "x$enable_mpitests" != "xno"; then
3124 AC_CACHE_CHECK([whether mpitests can be built],
3125 lb_cv_mpi_tests, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([
3129 MPI_Initialized(&flag);
3132 ])], [lb_cv_mpi_tests="yes"], [lb_cv_mpi_tests="no"])
3134 enable_mpitests=$lb_cv_mpi_tests
3138 AC_SUBST(MPICC_WRAPPER)
3139 ]) # LB_CONFIG_MPITESTS
3144 # whether to enable quota support global control
3146 AC_DEFUN([LC_CONFIG_QUOTA], [
3147 AC_MSG_CHECKING([whether to enable quota support global control])
3148 AC_ARG_ENABLE([quota],
3149 AC_HELP_STRING([--enable-quota],
3150 [enable quota support]),
3151 [], [enable_quota="yes"])
3152 AS_IF([test "x$enable_quota" = xyes],
3153 [AC_MSG_RESULT([yes])],
3154 [AC_MSG_RESULT([no])])
3155 ]) # LC_CONFIG_QUOTA
3160 AC_DEFUN([LC_QUOTA], [
3164 AS_IF([test "x$enable_quota" != xno -a "x$enable_utils" != xno], [
3165 AC_CHECK_HEADER([sys/quota.h],
3166 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1,
3167 [Define to 1 if you have <sys/quota.h>.])],
3168 [AC_MSG_ERROR([don't find <sys/quota.h> in your system])])
3175 # configure support for optional OSD implementation
3177 AC_DEFUN([LC_OSD_ADDON], [
3178 AC_MSG_CHECKING([whether to use OSD addon])
3180 AC_HELP_STRING([--with-osd=path],
3181 [set path to optional osd]),
3188 OSDADDON="$with_osd"
3195 AS_IF([test $ENABLEOSDADDON -eq 0], [
3199 OSDMODNAME=$(basename $OSDADDON)
3200 AS_IF([test -e $LUSTRE/$OSDMODNAME], [
3201 AC_MSG_RESULT([can't link])
3203 ], [ln -s $OSDADDON $LUSTRE/$OSDMODNAME], [
3204 AC_MSG_RESULT([$OSDMODNAME])
3205 OSDADDON="subdir-m += $OSDMODNAME"
3207 AC_MSG_RESULT([can't link])
3217 # other configure checks
3219 AC_DEFUN([LC_CONFIGURE], [
3220 AC_MSG_NOTICE([Lustre core checks
3221 ==============================================================================])
3223 AS_IF([test $target_cpu == "i686" -o $target_cpu == "x86_64"],
3224 [CFLAGS="$CFLAGS -Wall -Werror"])
3226 # maximum MDS thread count
3229 # lustre/utils/gss/gss_util.c
3230 # lustre/utils/gss/gssd_proc.c
3231 # lustre/utils/gss/krb5_util.c
3232 # lustre/utils/llog_reader.c
3233 # lustre/utils/create_iam.c
3234 # lustre/utils/libiam.c
3235 AC_CHECK_HEADERS([netdb.h endian.h])
3236 AC_CHECK_FUNCS([gethostbyname])
3238 # lustre/utils/llverdev.c
3239 AC_CHECK_HEADERS([blkid/blkid.h])
3241 # lustre/utils/llverfs.c
3242 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
3244 # lustre/utils/lfs.c
3245 AS_IF([test "$enable_dist" = "no"], [
3246 AC_CHECK_LIB([z], [crc32], [
3247 AC_CHECK_HEADER([zlib.h], [], [
3248 AC_MSG_ERROR([zlib.h not found.])])
3251 zlib library not found. Please install zlib development package.])
3256 AC_CHECK_LIB([selinux], [is_selinux_enabled],
3257 [AC_CHECK_HEADERS([selinux/selinux.h],
3258 [SELINUX="-lselinux"
3259 AC_DEFINE([HAVE_SELINUX], 1,
3260 [support for selinux ])],
3263 No libselinux-devel package found, unable to build selinux enabled tools
3268 No selinux package found, unable to build selinux enabled tools
3274 AC_MSG_CHECKING([whether to report minimum OST free space])
3275 AC_ARG_ENABLE([mindf],
3276 AC_HELP_STRING([--enable-mindf],
3277 [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
3278 [], [enable_mindf="no"])
3279 AC_MSG_RESULT([$enable_mindf])
3280 AS_IF([test "$enable_mindf" = "yes"],
3281 [AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])])
3283 AC_MSG_CHECKING([whether to randomly failing memory alloc])
3284 AC_ARG_ENABLE([fail_alloc],
3285 AC_HELP_STRING([--disable-fail-alloc],
3286 [disable randomly alloc failure]),
3287 [], [enable_fail_alloc="yes"])
3288 AC_MSG_RESULT([$enable_fail_alloc])
3289 AS_IF([test "x$enable_fail_alloc" != xno],
3290 [AC_DEFINE([RANDOM_FAIL_ALLOC], 1,
3291 [enable randomly alloc failure])])
3293 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
3294 AC_ARG_ENABLE([invariants],
3295 AC_HELP_STRING([--enable-invariants],
3296 [enable invariant checking (cpu intensive)]),
3297 [], [enable_invariants="no"])
3298 AC_MSG_RESULT([$enable_invariants])
3299 AS_IF([test "x$enable_invariants" = xyes],
3300 [AC_DEFINE([CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK], 1,
3301 [enable invariant checking])])
3303 AC_MSG_CHECKING([whether to track references with lu_ref])
3304 AC_ARG_ENABLE([lu_ref],
3305 AC_HELP_STRING([--enable-lu_ref],
3306 [enable lu_ref reference tracking code]),
3307 [], [enable_lu_ref="no"])
3308 AC_MSG_RESULT([$enable_lu_ref])
3309 AS_IF([test "x$enable_lu_ref" = xyes],
3310 [AC_DEFINE([USE_LU_REF], 1,
3311 [enable lu_ref reference tracking code])])
3313 AC_MSG_CHECKING([whether to enable page state tracking])
3314 AC_ARG_ENABLE([pgstate-track],
3315 AC_HELP_STRING([--enable-pgstate-track],
3316 [enable page state tracking]),
3317 [], [enable_pgstat_track="no"])
3318 AC_MSG_RESULT([$enable_pgstat_track])
3319 AS_IF([test "x$enable_pgstat_track" = xyes],
3320 [AC_DEFINE([CONFIG_DEBUG_PAGESTATE_TRACKING], 1,
3321 [enable page state tracking code])])
3324 AC_MSG_CHECKING([systemd unit file directory])
3325 AC_ARG_WITH([systemdsystemunitdir],
3326 [AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
3327 [Directory for systemd service files])],
3328 [], [with_systemdsystemunitdir=auto])
3329 AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"],
3330 [def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
3331 AS_IF([test "x$def_systemdsystemunitdir" = "x"],
3332 [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
3333 [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
3334 with_systemdsystemunitdir=no],
3335 [with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
3336 AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
3337 [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
3338 AC_MSG_RESULT([$with_systemdsystemunitdir])
3344 # AM_CONDITIONALS for lustre
3346 AC_DEFUN([LC_CONDITIONALS], [
3347 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
3348 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
3349 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
3350 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
3351 AM_CONDITIONAL(BLKID, test x$ac_cv_header_blkid_blkid_h = xyes)
3352 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
3353 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
3354 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
3355 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
3356 AM_CONDITIONAL(GSS_SSK, test x$enable_ssk = xyes)
3357 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
3358 AM_CONDITIONAL(HAVE_SYSTEMD, test "x$with_systemdsystemunitdir" != "xno")
3359 AM_CONDITIONAL(XATTR_HANDLER, test "x$lb_cv_compile_xattr_handler_flags" = xyes)
3360 AM_CONDITIONAL(SELINUX, test "$SELINUX" = "-lselinux")
3361 AM_CONDITIONAL(GETSEPOL, test x$enable_getsepol = xyes)
3362 ]) # LC_CONDITIONALS
3367 # files that should be generated with AC_OUTPUT
3369 AC_DEFUN([LC_CONFIG_FILES],
3373 lustre/autoconf/Makefile
3374 lustre/conf/Makefile
3375 lustre/conf/resource/Makefile
3376 lustre/contrib/Makefile
3378 lustre/include/Makefile
3379 lustre/include/lustre/Makefile
3380 lustre/include/uapi/linux/lustre/Makefile
3381 lustre/kernel_patches/targets/4.18-rhel8.target
3382 lustre/kernel_patches/targets/3.10-rhel7.6.target
3383 lustre/kernel_patches/targets/3.10-rhel7.5.target
3384 lustre/kernel_patches/targets/4.14-rhel7.5.target
3385 lustre/kernel_patches/targets/4.14-rhel7.6.target
3386 lustre/kernel_patches/targets/3.0-sles11.target
3387 lustre/kernel_patches/targets/3.0-sles11sp3.target
3388 lustre/kernel_patches/targets/3.0-sles11sp4.target
3389 lustre/kernel_patches/targets/3.12-sles12.target
3390 lustre/kernel_patches/targets/4.4-sles12.target
3391 lustre/kernel_patches/targets/4.4-sles12sp3.target
3392 lustre/kernel_patches/targets/4.12-sles12sp4.target
3393 lustre/kernel_patches/targets/3.x-fc18.target
3394 lustre/ldlm/Makefile
3396 lustre/fid/autoMakefile
3397 lustre/llite/Makefile
3398 lustre/llite/autoMakefile
3400 lustre/lov/autoMakefile
3402 lustre/mdc/autoMakefile
3404 lustre/lmv/autoMakefile
3405 lustre/lfsck/Makefile
3406 lustre/lfsck/autoMakefile
3408 lustre/mdt/autoMakefile
3410 lustre/mdd/autoMakefile
3412 lustre/fld/autoMakefile
3413 lustre/obdclass/Makefile
3414 lustre/obdclass/autoMakefile
3415 lustre/obdecho/Makefile
3416 lustre/obdecho/autoMakefile
3418 lustre/ofd/autoMakefile
3420 lustre/osc/autoMakefile
3422 lustre/ost/autoMakefile
3423 lustre/osd-ldiskfs/Makefile
3424 lustre/osd-ldiskfs/autoMakefile
3425 lustre/osd-zfs/Makefile
3426 lustre/osd-zfs/autoMakefile
3428 lustre/mgc/autoMakefile
3430 lustre/mgs/autoMakefile
3431 lustre/target/Makefile
3432 lustre/ptlrpc/Makefile
3433 lustre/ptlrpc/autoMakefile
3434 lustre/ptlrpc/gss/Makefile
3435 lustre/ptlrpc/gss/autoMakefile
3436 lustre/quota/Makefile
3437 lustre/quota/autoMakefile
3438 lustre/scripts/Makefile
3439 lustre/scripts/systemd/Makefile
3440 lustre/tests/Makefile
3441 lustre/tests/mpi/Makefile
3442 lustre/tests/kernel/Makefile
3443 lustre/tests/kernel/autoMakefile
3444 lustre/utils/Makefile
3445 lustre/utils/gss/Makefile
3447 lustre/osp/autoMakefile
3449 lustre/lod/autoMakefile
3451 ]) # LC_CONFIG_FILES