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_KEY_TYPE_INSTANTIATE_2ARGS
240 # rhel7 key_type->instantiate takes 2 args (struct key, struct key_preparsed_payload)
242 AC_DEFUN([LC_KEY_TYPE_INSTANTIATE_2ARGS], [
243 LB_CHECK_COMPILE([if 'key_type->instantiate' has two args],
244 key_type_instantiate_2args, [
245 #include <linux/key-type.h>
247 ((struct key_type *)0)->instantiate(0, NULL);
249 AC_DEFINE(HAVE_KEY_TYPE_INSTANTIATE_2ARGS, 1,
250 [key_type->instantiate has two args])
252 ]) # LC_KEY_TYPE_INSTANTIATE_2ARGS
257 AC_DEFUN([LC_CONFIG_SUNRPC], [
258 LB_CHECK_CONFIG_IM([SUNRPC], [], [
259 AS_IF([test "x$sunrpc_required" = xyes], [
262 kernel SUNRPC support is required by using GSS.
265 ]) # LC_CONFIG_SUNRPC
268 # LC_CONFIG_GSS (default 'auto' (tests for dependencies, if found, enables))
270 # Build gss and related tools of Lustre. Currently both kernel and user space
271 # parts are depend on linux platform.
273 AC_DEFUN([LC_CONFIG_GSS], [
274 AC_MSG_CHECKING([whether to enable gss support])
276 [AC_HELP_STRING([--enable-gss], [enable gss support])],
277 [], [enable_gss="auto"])
278 AC_MSG_RESULT([$enable_gss])
280 AS_IF([test "x$enable_gss" != xno], [
281 LC_CONFIG_GSS_KEYRING
282 LC_KEY_TYPE_INSTANTIATE_2ARGS
283 sunrpc_required=$enable_gss
287 LB_CHECK_CONFIG_IM([CRYPTO_MD5], [],
288 [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
289 LB_CHECK_CONFIG_IM([CRYPTO_SHA1], [],
290 [AC_MSG_WARN([kernel SHA1 support is recommended by using GSS.])])
291 LB_CHECK_CONFIG_IM([CRYPTO_SHA256], [],
292 [AC_MSG_WARN([kernel SHA256 support is recommended by using GSS.])])
293 LB_CHECK_CONFIG_IM([CRYPTO_SHA512], [],
294 [AC_MSG_WARN([kernel SHA512 support is recommended by using GSS.])])
296 require_krb5=$enable_gss
300 AS_IF([test -n "$KRBDIR"], [
301 gss_conf_test="success"
303 gss_conf_test="failure"
306 AS_IF([test "x$gss_conf_test" = xsuccess && test "x$enable_gss" != xno], [
307 AC_DEFINE([HAVE_GSS], [1], [Define this is if you enable gss])
310 enable_gss_keyring="no"
314 enable_ssk=$enable_gss
316 enable_gss_keyring="no"
322 # OpenSSL 1.0+ return int for HMAC functions but older SLES11 versions do not
323 AC_DEFUN([LC_OPENSSL_SSK], [
324 AC_MSG_CHECKING([whether OpenSSL has functions needed for SSK])
325 AS_IF([test "x$enable_ssk" != xno], [
326 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
327 #include <openssl/hmac.h>
328 #include <openssl/evp.h>
332 rc = HMAC_Init_ex(NULL, "test", 4, EVP_md_null(), NULL);
334 ])],[AC_DEFINE(HAVE_OPENSSL_SSK, 1,
335 [OpenSSL HMAC functions needed for SSK])],
338 AC_MSG_RESULT([$enable_ssk])
341 # LC_OPENSSL_GETSEPOL
343 # OpenSSL is needed for l_getsepol
344 AC_DEFUN([LC_OPENSSL_GETSEPOL], [
345 AC_MSG_CHECKING([whether openssl-devel is present])
346 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
347 #include <openssl/evp.h>
350 EVP_MD_CTX *mdctx = EVP_MD_CTX_create();
353 AC_DEFINE(HAVE_OPENSSL_GETSEPOL, 1, [openssl-devel is present])
354 enable_getsepol="yes"
360 No openssk-devel headers found, unable to build l_getsepol and SELinux status checking
363 AC_MSG_RESULT([$enable_getsepol])
364 ]) # LC_OPENSSL_GETSEPOL
366 # LC_INODE_PERMISION_2ARGS
368 # up to v2.6.27 had a 3 arg version (inode, mask, nameidata)
369 # v2.6.27->v2.6.37 had a 2 arg version (inode, mask)
370 # v2.6.37->v3.0 had a 3 arg version (inode, mask, nameidata)
371 # v3.1 onward have a 2 arg version (inode, mask)
373 AC_DEFUN([LC_INODE_PERMISION_2ARGS], [
374 LB_CHECK_COMPILE([if 'inode_operations->permission' has two args],
375 inode_ops_permission_2args, [
376 #include <linux/fs.h>
378 struct inode *inode __attribute__ ((unused));
381 inode->i_op->permission(NULL, 0);
383 AC_DEFINE(HAVE_INODE_PERMISION_2ARGS, 1,
384 [inode_operations->permission has two args])
386 ]) # LC_INODE_PERMISION_2ARGS
389 # LC_BLK_QUEUE_MAX_SEGMENTS
391 # 2.6.32 replaces 2 functions blk_queue_max_phys_segments and blk_queue_max_hw_segments by blk_queue_max_segments
393 AC_DEFUN([LC_BLK_QUEUE_MAX_SEGMENTS], [
394 LB_CHECK_COMPILE([if 'blk_queue_max_segments' is defined],
395 blk_queue_max_segments, [
396 #include <linux/blkdev.h>
398 blk_queue_max_segments(NULL, 0);
400 AC_DEFINE(HAVE_BLK_QUEUE_MAX_SEGMENTS, 1,
401 [blk_queue_max_segments is defined])
403 ]) # LC_BLK_QUEUE_MAX_SEGMENTS
406 # LC_HAVE_XATTR_HANDLER_FLAGS
408 # 2.6.33 added a private flag to xattr_handler
410 AC_DEFUN([LC_HAVE_XATTR_HANDLER_FLAGS], [
411 LB_CHECK_COMPILE([if 'struct xattr_handler' has flags field],
412 xattr_handler_flags, [
413 #include <linux/xattr.h>
415 struct xattr_handler handler;
419 AC_DEFINE(HAVE_XATTR_HANDLER_FLAGS, 1, [flags field exist])
421 ]) # LC_HAVE_XATTR_HANDLER_FLAGS
424 # LC_HAVE_DQUOT_FS_DISK_QUOTA
426 # 2.6.34 has quotactl_ops->[sg]et_dqblk that take struct fs_disk_quota
428 AC_DEFUN([LC_HAVE_DQUOT_FS_DISK_QUOTA], [
429 tmp_flags="$EXTRA_KCFLAGS"
430 EXTRA_KCFLAGS="-Werror"
431 LB_CHECK_COMPILE([if 'quotactl_ops.set_dqblk' takes struct fs_disk_quota],
433 #include <linux/fs.h>
434 #include <linux/quota.h>
436 ((struct quotactl_ops *)0)->set_dqblk(NULL, 0, 0, (struct fs_disk_quota*)0);
438 AC_DEFINE(HAVE_DQUOT_FS_DISK_QUOTA, 1,
439 [quotactl_ops.set_dqblk takes struct fs_disk_quota])
441 LB_CHECK_COMPILE([if 'quotactl_ops.set_dqblk' takes struct kqid & fs_disk_quota],
442 kqid_fs_disk_quota, [
443 #include <linux/fs.h>
444 #include <linux/quota.h>
446 ((struct quotactl_ops *)0)->set_dqblk((struct super_block*)0, *((struct kqid*)0), (struct fs_disk_quota*)0);
448 AC_DEFINE(HAVE_DQUOT_FS_DISK_QUOTA, 1,
449 [quotactl_ops.set_dqblk takes struct fs_disk_quota])
450 AC_DEFINE(HAVE_DQUOT_KQID, 1,
451 [quotactl_ops.set_dqblk takes struct kqid])
454 EXTRA_KCFLAGS="$tmp_flags"
455 ]) # LC_HAVE_DQUOT_FS_DISK_QUOTA
458 # LC_HAVE_DQUOT_SUSPEND
460 # 2.6.34 has renamed dquot options to dquot_*, check for dquot_suspend
462 AC_DEFUN([LC_HAVE_DQUOT_SUSPEND], [
463 LB_CHECK_COMPILE([if 'dquot_suspend' is defined],
465 #include <linux/quotaops.h>
467 dquot_suspend(NULL, -1);
469 AC_DEFINE(HAVE_DQUOT_SUSPEND, 1, [dquot_suspend is defined])
471 ]) # LC_HAVE_DQUOT_SUSPEND
476 # Check if kernel has been patched for 64-bit quota limits support.
477 # The upstream version of this patch in RHEL6 2.6.32 kernels introduces
478 # the constant QFMT_VFS_V1 in include/linux/quota.h, so we can check for
479 # that in the absence of quotaio_v1.h in the kernel headers.
481 AC_DEFUN([LC_QUOTA64], [
482 tmp_flags="$EXTRA_KCFLAGS"
483 EXTRA_KCFLAGS="-I$LINUX/fs"
484 LB_CHECK_COMPILE([if kernel has 64-bit quota limits support],
486 #include <linux/kernel.h>
487 #include <linux/fs.h>
488 #if defined(HAVE_FS_QUOTA_QUOTAIO_H)
489 #include <quota/quotaio_v2.h>
490 struct v2r1_disk_dqblk dqblk_r1;
492 #include <linux/quota.h>
493 int ver = QFMT_VFS_V1;
496 AC_DEFINE(HAVE_QUOTA64, 1, [have quota64])
498 LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],
499 [AC_MSG_ERROR([You have got no 64-bit kernel quota support.])])
501 EXTRA_KCFLAGS=$tmp_flags
505 # LC_HAVE_ADD_WAIT_QUEUE_EXCLUSIVE
507 # 2.6.34 adds __add_wait_queue_exclusive
509 AC_DEFUN([LC_HAVE_ADD_WAIT_QUEUE_EXCLUSIVE], [
510 LB_CHECK_COMPILE([if '__add_wait_queue_exclusive' exists],
511 __add_wait_queue_exclusive, [
512 #include <linux/wait.h>
514 wait_queue_head_t queue = { };
515 wait_queue_t wait = { };
517 __add_wait_queue_exclusive(&queue, &wait);
519 AC_DEFINE(HAVE___ADD_WAIT_QUEUE_EXCLUSIVE, 1,
520 [__add_wait_queue_exclusive exists])
522 ]) # LC_HAVE_ADD_WAIT_QUEUE_EXCLUSIVE
525 # LC_FS_STRUCT_RWLOCK
527 # 2.6.36 fs_struct.lock use spinlock instead of rwlock.
529 AC_DEFUN([LC_FS_STRUCT_RWLOCK], [
530 LB_CHECK_COMPILE([if 'fs_struct.lock' use rwlock],
532 #include <asm/atomic.h>
533 #include <linux/spinlock.h>
534 #include <linux/fs_struct.h>
536 struct fs_struct fss = { };
541 AC_DEFINE(HAVE_FS_STRUCT_RWLOCK, 1, [fs_struct.lock use rwlock])
543 ]) # LC_FS_STRUCT_RWLOCK
546 # LC_SBOPS_EVICT_INODE
548 # 2.6.36 super_operations add evict_inode method. it hybird of
549 # delete_inode & clear_inode.
551 AC_DEFUN([LC_SBOPS_EVICT_INODE], [
552 LB_CHECK_COMPILE([if 'super_operations.evict_inode' exist],
553 super_ops_evict_inode, [
554 #include <linux/fs.h>
556 ((struct super_operations *)0)->evict_inode(NULL);
558 AC_DEFINE(HAVE_SBOPS_EVICT_INODE, 1,
559 [super_operations.evict_inode() is exist in kernel])
561 ]) # LC_SBOPS_EVICT_INODE
566 # 2.6.35 file_operations.fsync taken 2 arguments.
567 # 3.0.0 file_operations.fsync takes 4 arguments.
569 AC_DEFUN([LC_FILE_FSYNC], [
570 LB_CHECK_COMPILE([if 'file_operations.fsync' takes 4 arguments],
571 file_ops_fsync_4args, [
572 #include <linux/fs.h>
574 ((struct file_operations *)0)->fsync(NULL, 0, 0, 0);
576 AC_DEFINE(HAVE_FILE_FSYNC_4ARGS, 1,
577 [file_operations.fsync takes 4 arguments])
579 LB_CHECK_COMPILE([if 'file_operations.fsync' takes 2 arguments],
580 file_ops_fsync_2args, [
581 #include <linux/fs.h>
583 ((struct file_operations *)0)->fsync(NULL, 0);
585 AC_DEFINE(HAVE_FILE_FSYNC_2ARGS, 1,
586 [file_operations.fsync takes 2 arguments])
594 # 2.6.37 remove kernel_locked
596 AC_DEFUN([LC_KERNEL_LOCKED], [
597 LB_CHECK_COMPILE([if 'kernel_locked' is defined],
599 #include <linux/smp_lock.h>
603 AC_DEFINE(HAVE_KERNEL_LOCKED, 1, [kernel_locked is defined])
605 ]) # LC_KERNEL_LOCKED
608 # LC_FS_STRUCT_SEQCOUNT
610 # 2.6.37 uses seqlock in fs_struct
612 AC_DEFUN([LC_FS_STRUCT_SEQCOUNT], [
613 LB_CHECK_COMPILE([if fs_struct use seqcount],
614 fs_struct_seqcount, [
615 #include <linux/fs_struct.h>
617 ((struct fs_struct *)0)->seq = (struct seqcount){ 0 };
619 AC_DEFINE(HAVE_FS_STRUCT_SEQCOUNT, 1, [fs_struct use seqcount])
621 ]) # LC_FS_STRUCT_SEQCOUNT
626 # 2.6.38 dentry_operations.d_compare() taken 7 arguments.
628 AC_DEFUN([LC_D_COMPARE_7ARGS], [
629 LB_CHECK_COMPILE([if 'dentry_operations.d_compare()' taken 7 arguments],
630 dentry_ops_d_compare_7arg, [
631 #include <linux/dcache.h>
633 ((struct dentry_operations*)0)->d_compare(NULL,NULL,NULL,NULL,0,NULL,NULL);
635 AC_DEFINE(HAVE_D_COMPARE_7ARGS, 1, [d_compare need 7 arguments])
637 ]) # LC_D_COMPARE_7ARGS
642 # 2.6.38 dentry_operations.d_delete() defined 'const' for 1st parameter.
644 AC_DEFUN([LC_D_DELETE_CONST], [
645 tmp_flags="$EXTRA_KCFLAGS"
646 EXTRA_KCFLAGS="-Werror"
647 LB_CHECK_COMPILE([if 'dentry_operations.d_delete()' has const declare on first parameter],
648 dentry_ops_d_delete_1st_const, [
649 #include <linux/dcache.h>
651 const struct dentry *d = NULL;
652 ((struct dentry_operations*)0)->d_delete(d);
654 AC_DEFINE(HAVE_D_DELETE_CONST, const,
655 [d_delete first parameter declared const])
657 AC_DEFINE(HAVE_D_DELETE_CONST, [],
658 [d_delete first parameter declared is not const])
660 EXTRA_KCFLAGS="$tmp_flags"
661 ]) # LC_D_DELETE_CONST
666 # 2.6.38 dcache_lock removed. rcu-walk committed.
668 AC_DEFUN([LC_DCACHE_LOCK], [
669 LB_CHECK_COMPILE([if 'dcache_lock' is exist],
671 #include <linux/dcache.h>
673 spin_lock(&dcache_lock);
675 AC_DEFINE(HAVE_DCACHE_LOCK, 1,
676 [dcache_lock is exist])
683 # 2.6.38 inode.i_rcu added.
685 AC_DEFUN([LC_INODE_I_RCU], [
686 LB_CHECK_COMPILE([if 'inode.i_rcu' exists],
688 #include <linux/fs.h>
691 struct rcu_head rcu = {};
694 AC_DEFINE(HAVE_INODE_I_RCU, 1,
695 [inode.i_rcu exists])
700 # LC_BLKDEV_GET_BY_DEV
702 # 2.6.38 export blkdev_get_by_dev
704 AC_DEFUN([LC_BLKDEV_GET_BY_DEV], [
705 LB_CHECK_EXPORT([blkdev_get_by_dev], [fs/block_dev.c],
706 [AC_DEFINE(HAVE_BLKDEV_GET_BY_DEV, 1,
707 [blkdev_get_by_dev is exported by the kernel])])
708 ]) # LC_BLKDEV_GET_BY_DEV
711 # LC_EXPORT_SIMPLE_SETATTR
713 # 2.6.38 export simple_setattr
715 AC_DEFUN([LC_EXPORT_SIMPLE_SETATTR], [
716 LB_CHECK_EXPORT([simple_setattr], [fs/libfs.c],
717 [AC_DEFINE(HAVE_SIMPLE_SETATTR, 1,
718 [simple_setattr is exported by the kernel])])
719 ]) # LC_EXPORT_SIMPLE_SETATTR
724 # 2.6.38 add struct blk_plug
726 AC_DEFUN([LC_HAVE_BLK_PLUG], [
727 LB_CHECK_COMPILE([if 'struct blk_plug' exists],
729 #include <linux/blkdev.h>
731 struct blk_plug plug;
733 blk_start_plug(&plug);
734 blk_finish_plug(&plug);
736 AC_DEFINE(HAVE_BLK_PLUG, 1,
737 [blk_plug struct exists])
739 ]) # LC_HAVE_BLK_PLUG
744 # truncate callback removed since 2.6.39
746 AC_DEFUN([LC_IOP_TRUNCATE], [
747 LB_CHECK_COMPILE([if 'inode_operations' has '.truncate' member function],
748 inode_ops_truncate, [
749 #include <linux/fs.h>
751 ((struct inode_operations *)0)->truncate(NULL);
753 AC_DEFINE(HAVE_INODEOPS_TRUNCATE, 1,
754 [inode_operations has .truncate member function])
759 # LC_HAVE_FSTYPE_MOUNT
761 # 2.6.39 replace get_sb with mount in struct file_system_type
763 AC_DEFUN([LC_HAVE_FSTYPE_MOUNT], [
764 LB_CHECK_COMPILE([if 'file_system_type' has 'mount' field],
765 file_system_type_mount, [
766 #include <linux/fs.h>
768 struct file_system_type fst = { };
771 mount = (void *)fst.mount;
773 AC_DEFINE(HAVE_FSTYPE_MOUNT, 1,
774 [struct file_system_type has mount field])
776 ]) # LC_HAVE_FSTYPE_MOUNT
779 # LC_HAVE_FHANDLE_SYSCALLS
781 # 2.6.39 The open_by_handle_at() and name_to_handle_at() system calls were
782 # added to Linux kernel 2.6.39.
783 # Check if client supports these functions
785 AC_DEFUN([LC_HAVE_FHANDLE_SYSCALLS], [
786 LB_CHECK_CONFIG_IM([FHANDLE],[
787 AC_DEFINE(HAVE_FHANDLE_SYSCALLS, 1,
788 [kernel supports fhandles and related syscalls])
790 ]) # LC_HAVE_FHANDLE_SYSCALLS
793 # LC_HAVE_INODE_OWNER_OR_CAPABLE
795 # 2.6.39 renames is_owner_or_cap to inode_owner_or_capable
797 AC_DEFUN([LC_HAVE_INODE_OWNER_OR_CAPABLE], [
798 LB_CHECK_COMPILE([if 'inode_owner_or_capable' exist],
799 inode_owner_or_capable, [
800 #include <linux/fs.h>
802 inode_owner_or_capable(NULL);
804 AC_DEFINE(HAVE_INODE_OWNER_OR_CAPABLE, 1,
805 [inode_owner_or_capable exist])
807 ]) # LC_HAVE_INODE_OWNER_OR_CAPABLE
810 # LC_DIRTY_INODE_WITH_FLAG
812 # 3.0 dirty_inode() has a flag parameter
813 # see kernel commit aa38572954ade525817fe88c54faebf85e5a61c0
815 AC_DEFUN([LC_DIRTY_INODE_WITH_FLAG], [
816 LB_CHECK_COMPILE([if 'dirty_inode' super_operation takes flag],
817 dirty_inode_super_operation_flag, [
818 #include <linux/fs.h>
820 struct inode *inode = NULL;
821 inode->i_sb->s_op->dirty_inode(NULL, 0);
823 AC_DEFINE(HAVE_DIRTY_INODE_HAS_FLAG, 1,
824 [dirty_inode super_operation takes flag])
826 ]) # LC_DIRTY_INODE_WITH_FLAG
831 # 3.0 introduced setns
833 AC_DEFUN([LC_SETNS], [
834 AC_CHECK_HEADERS([sched.h], [], [],
837 AC_CHECK_FUNCS([setns])
841 # LC_GENERIC_PERMISSION
843 # 2.6.38 generic_permission taken 4 parameters.
844 # in fact, it means rcu-walk aware permission bring.
846 # 3.1 generic_permission taken 2 parameters.
847 # see kernel commit 2830ba7f34ebb27c4e5b8b6ef408cd6d74860890
849 AC_DEFUN([LC_GENERIC_PERMISSION], [
850 LB_CHECK_COMPILE([if 'generic_permission' take 2 arguments],
851 generic_permission_2args, [
852 #include <linux/fs.h>
854 generic_permission(NULL, 0);
856 AC_DEFINE(HAVE_GENERIC_PERMISSION_2ARGS, 1,
857 [generic_permission taken 2 arguments])
859 LB_CHECK_COMPILE([if 'generic_permission' take 4 arguments],
860 generic_permission_4args, [
861 #include <linux/fs.h>
863 generic_permission(NULL, 0, 0, NULL);
865 AC_DEFINE(HAVE_GENERIC_PERMISSION_4ARGS, 1,
866 [generic_permission taken 4 arguments])
869 ]) # LC_GENERIC_PERMISSION
872 # LC_LM_XXX_LOCK_MANAGER_OPS
874 # 3.1 renames lock-manager ops(lock_manager_operations) from fl_xxx to lm_xxx
875 # see kernel commit 8fb47a4fbf858a164e973b8ea8ef5e83e61f2e50
877 AC_DEFUN([LC_LM_XXX_LOCK_MANAGER_OPS], [
878 LB_CHECK_COMPILE([if 'lock-manager' ops renamed to 'lm_xxx'],
879 lock_manager_ops_lm_xxx, [
880 #include <linux/fs.h>
882 struct lock_manager_operations lm_ops;
883 lm_ops.lm_compare_owner = NULL;
885 AC_DEFINE(HAVE_LM_XXX_LOCK_MANAGER_OPS, 1,
886 [lock-manager ops renamed to lm_xxx])
888 ]) # LC_LM_XXX_LOCK_MANAGER_OPS
893 # 3.1 kills inode->i_alloc_sem, use i_dio_count and inode_dio_wait
895 # see kernel commit bd5fe6c5eb9c548d7f07fe8f89a150bb6705e8e3
897 AC_DEFUN([LC_INODE_DIO_WAIT], [
898 LB_CHECK_COMPILE([if 'inode->i_alloc_sem' is killed and use inode_dio_wait],
900 #include <linux/fs.h>
902 inode_dio_wait((struct inode *)0);
904 AC_DEFINE(HAVE_INODE_DIO_WAIT, 1,
905 [inode->i_alloc_sem is killed and use inode_dio_wait])
907 ]) # LC_INODE_DIO_WAIT
912 # 3.1 adds get_acl method to inode_operations to read ACL from disk.
913 # see kernel commit 4e34e719e457f2e031297175410fc0bd4016a085
915 AC_DEFUN([LC_IOP_GET_ACL], [
916 LB_CHECK_COMPILE([if 'inode_operations' has '.get_acl' member function],
918 #include <linux/fs.h>
920 struct inode_operations iop;
923 AC_DEFINE(HAVE_IOP_GET_ACL, 1,
924 [inode_operations has .get_acl member function])
929 # LC_FILE_LLSEEK_SIZE
931 # 3.1 introduced generic_file_llseek_size()
933 AC_DEFUN([LC_FILE_LLSEEK_SIZE], [
934 LB_CHECK_EXPORT([generic_file_llseek_size], [fs/read_write.c],
935 [AC_DEFINE(HAVE_FILE_LLSEEK_SIZE, 1,
936 [generic_file_llseek_size is exported by the kernel])])
937 ]) # LC_FILE_LLSEEK_SIZE
940 # LC_RADIX_EXCEPTION_ENTRY
941 # 3.1 adds radix_tree_exception_entry.
943 AC_DEFUN([LC_RADIX_EXCEPTION_ENTRY], [
944 LB_CHECK_COMPILE([radix_tree_exceptional_entry exist],
945 radix_tree_exceptional_entry, [
946 #include <linux/radix-tree.h>
948 radix_tree_exceptional_entry(NULL);
950 AC_DEFINE(HAVE_RADIX_EXCEPTION_ENTRY, 1,
951 [radix_tree_exceptional_entry exist])
953 ]) # LC_RADIX_EXCEPTION_ENTRY
956 # LC_HAVE_PROTECT_I_NLINK
958 # 3.2 protects inode->i_nlink from direct modification
959 # see kernel commit a78ef704a8dd430225955f0709b22d4a6ba21deb
960 # at the same time adds set_nlink(), so checks set_nlink() for it.
962 AC_DEFUN([LC_HAVE_PROTECT_I_NLINK], [
963 LB_CHECK_COMPILE([if 'inode->i_nlink' is protected from direct modification],
964 inode_i_nlink_protected, [
965 #include <linux/fs.h>
970 AC_DEFINE(HAVE_PROTECT_I_NLINK, 1,
971 [inode->i_nlink is protected from direct modification])
973 ]) # LC_HAVE_PROTECT_I_NLINK
976 # 2.6.39 security_inode_init_security takes a 'struct qstr' parameter
978 # 3.2 security_inode_init_security takes a callback to set xattrs
980 AC_DEFUN([LC_HAVE_SECURITY_IINITSEC], [
981 LB_CHECK_COMPILE([if security_inode_init_security takes a callback],
982 security_inode_init_security_callback, [
983 #include <linux/security.h>
985 security_inode_init_security(NULL, NULL, NULL, (const initxattrs)NULL, NULL);
987 AC_DEFINE(HAVE_SECURITY_IINITSEC_CALLBACK, 1,
988 [security_inode_init_security takes a callback to set xattrs])
990 LB_CHECK_COMPILE([if security_inode_init_security takes a 'struct qstr' parameter],
991 security_inode_init_security_qstr, [
992 #include <linux/security.h>
994 security_inode_init_security(NULL, NULL, (struct qstr *)NULL, NULL, NULL, NULL);
996 AC_DEFINE(HAVE_SECURITY_IINITSEC_QSTR, 1,
997 [security_inode_init_security takes a 'struct qstr' parameter])
1000 ]) # LC_HAVE_SECURITY_IINITSEC
1003 # LC_HAVE_MIGRATE_HEADER
1005 # 3.3 introduces migrate_mode.h and migratepage has 4 args
1007 AC_DEFUN([LC_HAVE_MIGRATE_HEADER], [
1008 LB_CHECK_FILE([$LINUX/include/linux/migrate.h], [
1009 AC_DEFINE(HAVE_MIGRATE_H, 1,
1010 [kernel has include/linux/migrate.h])
1012 LB_CHECK_FILE([$LINUX/include/linux/migrate_mode.h], [
1013 AC_DEFINE(HAVE_MIGRATE_MODE_H, 1,
1014 [kernel has include/linux/migrate_mode.h])
1017 ]) # LC_HAVE_MIGRATE_HEADER
1020 # LC_MIGRATEPAGE_4ARGS
1022 AC_DEFUN([LC_MIGRATEPAGE_4ARGS], [
1023 LB_CHECK_COMPILE([if 'address_space_operations.migratepage' has 4 args],
1024 address_space_ops_migratepage_4args, [
1025 #include <linux/fs.h>
1026 #ifdef HAVE_MIGRATE_H
1027 #include <linux/migrate.h>
1028 #elif defined(HAVE_MIGRATE_MODE_H)
1029 #include <linux/migrate_mode.h>
1032 struct address_space_operations aops = { };
1033 aops.migratepage(NULL, NULL, NULL, MIGRATE_ASYNC);
1035 AC_DEFINE(HAVE_MIGRATEPAGE_4ARGS, 1,
1036 [address_space_operations.migratepage has 4 args])
1038 ]) # LC_MIGRATEPAGE_4ARGS
1041 # LC_SUPEROPS_USE_DENTRY
1043 # 3.3 switchs super_operations to use dentry as parameter (but not vfsmount)
1044 # see kernel commit 34c80b1d93e6e20ca9dea0baf583a5b5510d92d4
1046 AC_DEFUN([LC_SUPEROPS_USE_DENTRY], [
1047 tmp_flags="$EXTRA_KCFLAGS"
1048 EXTRA_KCFLAGS="-Werror"
1049 LB_CHECK_COMPILE([if 'super_operations' use 'dentry' as parameter],
1051 #include <linux/fs.h>
1052 int show_options(struct seq_file *seq, struct dentry *root) {
1056 struct super_operations ops;
1057 ops.show_options = show_options;
1059 AC_DEFINE(HAVE_SUPEROPS_USE_DENTRY, 1,
1060 [super_operations use dentry as parameter])
1062 EXTRA_KCFLAGS="$tmp_flags"
1063 ]) # LC_SUPEROPS_USE_DENTRY
1066 # LC_INODEOPS_USE_UMODE_T
1068 # 3.3 switchs inode_operations to use umode_t as parameter (but not int)
1069 # see kernel commit 1a67aafb5f72a436ca044293309fa7e6351d6a35
1071 AC_DEFUN([LC_INODEOPS_USE_UMODE_T], [
1072 tmp_flags="$EXTRA_KCFLAGS"
1073 EXTRA_KCFLAGS="-Werror"
1074 LB_CHECK_COMPILE([if 'inode_operations' use 'umode_t' as parameter],
1075 inode_ops_umode_t, [
1076 #include <linux/fs.h>
1077 #include <linux/types.h>
1078 int my_mknod(struct inode *dir, struct dentry *dchild,
1079 umode_t mode, dev_t dev)
1084 struct inode_operations ops;
1085 ops.mknod = my_mknod;
1087 AC_DEFINE(HAVE_INODEOPS_USE_UMODE_T, 1,
1088 [inode_operations use umode_t as parameter])
1090 EXTRA_KCFLAGS="$tmp_flags"
1091 ]) # LC_INODEOPS_USE_UMODE_T
1094 # LC_KMAP_ATOMIC_HAS_1ARG
1096 # 3.4 kmap_atomic removes second argument
1097 # see kernel commit 1ec9c5ddc17aa398f05646abfcbaf315b544e62f
1099 AC_DEFUN([LC_KMAP_ATOMIC_HAS_1ARG], [
1100 LB_CHECK_COMPILE([if 'kmap_atomic' has only 1 argument],
1102 #include <linux/highmem.h>
1106 AC_DEFINE(HAVE_KMAP_ATOMIC_HAS_1ARG, 1,
1107 [have kmap_atomic has only 1 argument])
1109 ]) # LC_KMAP_ATOMIC_HAS_1ARG
1112 # LC_HAVE_D_MAKE_ROOT
1114 # 3.4 converts d_alloc_root to d_make_root
1115 # see kernel commit 32991ab305ace7017c62f8eecbe5eb36dc32e13b
1117 AC_DEFUN([LC_HAVE_D_MAKE_ROOT], [
1118 LB_CHECK_COMPILE([if have 'd_make_root'],
1120 #include <linux/fs.h>
1122 d_make_root((struct inode *)NULL);
1124 AC_DEFINE(HAVE_D_MAKE_ROOT, 1,
1127 ]) # LC_HAVE_D_MAKE_ROOT
1130 # LC_HAVE_CACHE_REGISTER
1132 # 3.4 cache_register/cache_unregister are removed
1133 # see kernel commit 2c5f846747526e2b83c5f1b8e69016be0e2e87c0
1134 # Note, since 2.6.37 cache_register_net/cache_unregister_net
1135 # are defined, but not exported.
1136 # 3.3 cache_register_net/cache_unregister_net are
1137 # exported and replacing cache_register/cache_unregister in 3.4
1139 AC_DEFUN([LC_HAVE_CACHE_REGISTER], [
1140 LB_CHECK_COMPILE([if have 'cache_register'],
1142 #include <linux/sunrpc/cache.h>
1144 cache_register(NULL);
1146 AC_DEFINE(HAVE_CACHE_REGISTER, 1,
1147 [have cache_register])
1149 ]) # LC_HAVE_CACHE_REGISTER
1152 # LC_HAVE_CLEAR_INODE
1154 # 3.5 renames end_writeback() back to clear_inode()...
1155 # see kernel commit dbd5768f87ff6fb0a4fe09c4d7b6c4a24de99430
1157 AC_DEFUN([LC_HAVE_CLEAR_INODE], [
1158 LB_CHECK_COMPILE([if have 'clear_inode'],
1160 #include <linux/fs.h>
1162 clear_inode((struct inode *)NULL);
1164 AC_DEFINE(HAVE_CLEAR_INODE, 1,
1167 ]) # LC_HAVE_CLEAR_INODE
1170 # LC_HAVE_ENCODE_FH_PARENT
1172 # 3.5 encode_fh has parent inode passed in directly
1173 # see kernel commit b0b0382b
1175 AC_DEFUN([LC_HAVE_ENCODE_FH_PARENT], [
1176 tmp_flags="$EXTRA_KCFLAGS"
1177 EXTRA_KCFLAGS="-Werror"
1178 LB_CHECK_COMPILE([if 'encode_fh' have parent inode as parameter],
1179 encode_fh_parent_inode, [
1180 #include <linux/exportfs.h>
1181 #include <linux/fs.h>
1182 #include <linux/types.h>
1183 int ll_encode_fh(struct inode *i, __u32 *a, int *b, struct inode *p)
1188 struct export_operations exp_op;
1189 exp_op.encode_fh = ll_encode_fh;
1191 AC_DEFINE(HAVE_ENCODE_FH_PARENT, 1,
1192 [have parent inode as parameter])
1194 EXTRA_KCFLAGS="$tmp_flags"
1195 ]) # LC_HAVE_ENCODE_FH_PARENT
1198 # LC_FILE_LLSEEK_SIZE_5ARG
1200 # 3.5 has generic_file_llseek_size with 5 args
1202 AC_DEFUN([LC_FILE_LLSEEK_SIZE_5ARG], [
1203 LB_CHECK_COMPILE([if Linux kernel has 'generic_file_llseek_size' with 5 args],
1204 generic_file_llseek_size_5args, [
1205 #include <linux/fs.h>
1207 generic_file_llseek_size(NULL, 0, 0, 0, 0);
1209 AC_DEFINE(HAVE_FILE_LLSEEK_SIZE_5ARGS, 1,
1210 [kernel has generic_file_llseek_size with 5 args])
1212 ]) # LC_FILE_LLSEEK_SIZE_5ARG
1215 # LC_LLITE_DATA_IS_LIST
1217 # 3.6 switch i_dentry/d_alias from list to hlist
1219 # In the upstream kernels d_alias first changes
1220 # to a hlist and then in later version, 3.11, gets
1221 # moved to the union d_u. Due to some distros having
1222 # d_alias in the d_u union as a struct list, which
1223 # has never existed upstream stream, we can't test
1224 # if d_alias is a list or hlist directly. If ever
1225 # i_dentry and d_alias even up different combos then
1226 # the build will fail. In that case then we will need
1227 # to separate out the i_dentry and d_alias test below.
1229 AC_DEFUN([LC_DATA_FOR_LLITE_IS_LIST], [
1230 tmp_flags="$EXTRA_KCFLAGS"
1231 EXTRA_KCFLAGS="-Werror"
1232 LB_CHECK_COMPILE([if 'i_dentry/d_alias' uses 'list'],
1233 i_dentry_d_alias_list, [
1234 #include <linux/fs.h>
1237 INIT_LIST_HEAD(&inode.i_dentry);
1239 AC_DEFINE(DATA_FOR_LLITE_IS_LIST, 1,
1240 [both i_dentry/d_alias uses list])
1242 EXTRA_KCFLAGS="$tmp_flags"
1243 ]) # LC_DATA_FOR_LLITE_IS_LIST
1246 # LC_DENTRY_OPEN_USE_PATH
1248 # 3.6 dentry_open uses struct path as first argument
1249 # see kernel commit 765927b2
1251 AC_DEFUN([LC_DENTRY_OPEN_USE_PATH], [
1252 tmp_flags="$EXTRA_KCFLAGS"
1253 EXTRA_KCFLAGS="-Werror"
1254 LB_CHECK_COMPILE([if 'dentry_open' uses 'struct path' as first argument],
1256 #include <linux/fs.h>
1257 #include <linux/path.h>
1260 dentry_open(&path, 0, NULL);
1262 AC_DEFINE(HAVE_DENTRY_OPEN_USE_PATH, 1,
1263 [dentry_open uses struct path as first argument])
1265 EXTRA_KCFLAGS="$tmp_flags"
1266 ]) # LC_DENTRY_OPEN_USE_PATH
1269 # LC_HAVE_IOP_ATOMIC_OPEN
1271 # 3.6 vfs adds iop->atomic_open
1273 AC_DEFUN([LC_HAVE_IOP_ATOMIC_OPEN], [
1274 LB_CHECK_COMPILE([if 'iop' has 'atomic_open'],
1275 inode_ops_atomic_open, [
1276 #include <linux/fs.h>
1278 struct inode_operations iop;
1279 iop.atomic_open = NULL;
1281 AC_DEFINE(HAVE_IOP_ATOMIC_OPEN, 1,
1282 [have iop atomic_open])
1284 ]) # LC_HAVE_IOP_ATOMIC_OPEN
1287 # LC_HAVE_SB_START_WRITE
1289 # RHEL6 2.6.32, 3.6 or newer support wrapped FS freeze functions
1291 AC_DEFUN([LC_HAVE_SB_START_WRITE], [
1292 LB_CHECK_COMPILE([if kernel supports wrapped FS freeze functions],
1294 #include <linux/fs.h>
1296 sb_start_write(NULL);
1298 AC_DEFINE(HAVE_SB_START_WRITE, 1,
1299 [kernel supports wrapped FS freeze functions])
1301 ]) # LC_HAVE_SB_START_WRITE
1304 # LC_HAVE_POSIXACL_USER_NS
1306 # 3.7 posix_acl_{to,from}_xattr take struct user_namespace
1308 AC_DEFUN([LC_HAVE_POSIXACL_USER_NS], [
1309 LB_CHECK_COMPILE([if 'posix_acl_to_xattr' takes 'struct user_namespace'],
1310 posix_acl_to_xattr_user_namespace, [
1311 #include <linux/fs.h>
1312 #include <linux/posix_acl_xattr.h>
1314 posix_acl_to_xattr((struct user_namespace *)NULL, NULL, NULL, 0);
1316 AC_DEFINE(HAVE_POSIXACL_USER_NS, 1,
1317 [posix_acl_to_xattr takes struct user_namespace])
1319 ]) # LC_HAVE_POSIXACL_USER_NS
1322 # LC_HAVE_FILE_F_INODE
1324 # 3.8 struct file has new member f_inode
1326 AC_DEFUN([LC_HAVE_FILE_F_INODE], [
1327 LB_CHECK_COMPILE([if 'struct file' has member 'f_inode'],
1329 #include <linux/fs.h>
1331 ((struct file *)0)->f_inode = NULL;
1333 AC_DEFINE(HAVE_FILE_F_INODE, 1,
1334 [struct file has member f_inode])
1336 ]) # LC_HAVE_FILE_F_INODE
1339 # LC_HAVE_FILE_INODE
1341 # 3.8 has introduced inline function file_inode
1343 AC_DEFUN([LC_HAVE_FILE_INODE], [
1344 LB_CHECK_COMPILE([if file_inode() exists],
1346 #include <linux/fs.h>
1350 AC_DEFINE(HAVE_FILE_INODE, 1,
1351 [file_inode() has been defined])
1353 ]) # LC_HAVE_FILE_INODE
1356 # LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS
1358 AC_DEFUN([LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS], [
1359 LB_CHECK_COMPILE([if 'sunrpc_cache_pipe_upcall' takes 3 args],
1360 sunrpc_cache_pipe_upcall_3args, [
1361 #include <linux/sunrpc/cache.h>
1363 sunrpc_cache_pipe_upcall(NULL, NULL, NULL);
1365 AC_DEFINE(HAVE_SUNRPC_UPCALL_HAS_3ARGS, 1,
1366 [sunrpc_cache_pipe_upcall takes 3 args])
1368 ]) # LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS
1371 # LC_HAVE_HLIST_FOR_EACH_3ARG
1373 # 3.9 uses hlist_for_each_entry with 3 args
1374 # b67bfe0d42cac56c512dd5da4b1b347a23f4b70a
1376 AC_DEFUN([LC_HAVE_HLIST_FOR_EACH_3ARG], [
1377 LB_CHECK_COMPILE([if 'hlist_for_each_entry' has 3 args],
1378 hlist_for_each_entry_3args, [
1379 #include <linux/list.h>
1380 #include <linux/fs.h>
1382 struct hlist_head *head = NULL;
1383 struct inode *inode;
1385 hlist_for_each_entry(inode, head, i_hash) {
1389 AC_DEFINE(HAVE_HLIST_FOR_EACH_3ARG, 1,
1390 [hlist_for_each_entry has 3 args])
1392 ]) # LC_HAVE_HLIST_FOR_EACH_3ARG
1395 # LC_HAVE_BIO_END_SECTOR
1397 # 3.9 introduces bio_end_sector macro
1398 # f73a1c7d117d07a96d89475066188a2b79e53c48
1400 AC_DEFUN([LC_HAVE_BIO_END_SECTOR], [
1401 LB_CHECK_COMPILE([if 'bio_end_sector' is defined],
1403 #include <linux/bio.h>
1405 struct bio bio = { };
1406 unsigned long long end;
1408 end = bio_end_sector(&bio);
1410 AC_DEFINE(HAVE_BIO_END_SECTOR, 1,
1411 [bio_end_sector is defined])
1413 ]) # LC_HAVE_BIO_END_SECTOR
1416 # 3.9 created is_sxid
1418 AC_DEFUN([LC_HAVE_IS_SXID], [
1419 LB_CHECK_COMPILE([if 'is_sxid' is defined],
1421 #include <linux/fs.h>
1423 struct inode inode = { };
1425 is_sxid(inode.i_mode);
1427 AC_DEFINE(HAVE_IS_SXID, 1, [is_sxid is defined])
1429 ]) # LC_HAVE_IS_SXID
1432 # LC_HAVE_REMOVE_PROC_SUBTREE
1434 # 3.10 introduced remove_proc_subtree
1436 AC_DEFUN([LC_HAVE_REMOVE_PROC_SUBTREE], [
1437 LB_CHECK_COMPILE([if 'remove_proc_subtree' is defined],
1438 remove_proc_subtree, [
1439 #include <linux/proc_fs.h>
1441 remove_proc_subtree(NULL, NULL);
1443 AC_DEFINE(HAVE_REMOVE_PROC_SUBTREE, 1,
1444 [remove_proc_subtree is defined])
1446 ]) # LC_HAVE_REMOVE_PROC_SUBTREE
1449 # LC_HAVE_PROC_REMOVE
1451 # 3.10 introduced proc_remove
1453 AC_DEFUN([LC_HAVE_PROC_REMOVE], [
1454 LB_CHECK_COMPILE([if 'proc_remove' is defined],
1456 #include <linux/proc_fs.h>
1460 AC_DEFINE(HAVE_PROC_REMOVE, 1,
1461 [proc_remove is defined])
1463 ]) # LC_HAVE_PROC_REMOVE
1465 AC_DEFUN([LC_HAVE_PROJECT_QUOTA], [
1466 LB_CHECK_COMPILE([if get_projid exists],
1469 #include <linux/quota.h>
1471 struct dquot_operations ops = { };
1473 ops.get_projid(NULL, NULL);
1475 AC_DEFINE(HAVE_PROJECT_QUOTA, 1,
1476 [get_projid function exists])
1478 ]) # LC_HAVE_PROJECT_QUOTA
1482 # LC_HAVE_SECURITY_DENTRY_INIT_SECURITY
1484 # 3.10 introduced security_dentry_init_security()
1486 AC_DEFUN([LC_HAVE_SECURITY_DENTRY_INIT_SECURITY], [
1487 LB_CHECK_COMPILE([if 'security_dentry_init_security' is defined],
1488 security_dentry_init_security, [
1489 #include <linux/security.h>
1491 security_dentry_init_security(NULL, 0, NULL, NULL, NULL);
1493 AC_DEFINE(HAVE_SECURITY_DENTRY_INIT_SECURITY, 1,
1494 [security_dentry_init_security' is defined])
1496 ]) # LC_HAVE_SECURITY_DENTRY_INIT_SECURITY
1499 # 3.10 exports security_inode_listsecurity
1501 AC_DEFUN([LC_HAVE_SECURITY_INODE_LISTSECURITY], [
1502 LB_CHECK_COMPILE([if security_inode_listsecurity() is available/exported],
1503 security_inode_listsecurity, [
1504 #include <linux/security.h>
1506 security_inode_listsecurity(NULL, NULL, 0);
1508 AC_DEFINE(HAVE_SECURITY_INODE_LISTSECURITY, 1,
1509 [security_inode_listsecurity() is available/exported])
1511 ]) # LC_HAVE_SECURITY_INODE_LISTSECURITY
1514 # LC_INVALIDATE_RANGE
1516 # 3.11 invalidatepage requires the length of the range to invalidate
1518 AC_DEFUN([LC_INVALIDATE_RANGE], [
1519 LB_CHECK_COMPILE([if 'address_space_operations.invalidatepage' requires 3 arguments],
1520 address_space_ops_invalidatepage_3args, [
1521 #include <linux/fs.h>
1523 struct address_space_operations a_ops;
1524 a_ops.invalidatepage(NULL, 0, 0);
1526 AC_DEFINE(HAVE_INVALIDATE_RANGE, 1,
1527 [address_space_operations.invalidatepage needs 3 arguments])
1529 ]) # LC_INVALIDATE_RANGE
1532 # LC_HAVE_DIR_CONTEXT
1534 # 3.11 readdir now takes the new struct dir_context
1536 AC_DEFUN([LC_HAVE_DIR_CONTEXT], [
1537 LB_CHECK_COMPILE([if 'dir_context' exist],
1539 #include <linux/fs.h>
1541 #ifdef FMODE_KABI_ITERATE
1542 #error "back to use readdir in kabi_extand mode"
1544 struct dir_context ctx;
1549 AC_DEFINE(HAVE_DIR_CONTEXT, 1,
1550 [dir_context exist])
1552 ]) # LC_HAVE_DIR_CONTEXT
1555 # LC_D_COMPARE_5ARGS
1557 # 3.11 dentry_operations.d_compare() taken 5 arguments.
1559 AC_DEFUN([LC_D_COMPARE_5ARGS], [
1560 LB_CHECK_COMPILE([if 'd_compare' taken 5 arguments],
1562 #include <linux/dcache.h>
1564 ((struct dentry_operations*)0)->d_compare(NULL,NULL,0,NULL,NULL);
1566 AC_DEFINE(HAVE_D_COMPARE_5ARGS, 1,
1567 [d_compare need 5 arguments])
1569 ]) # LC_D_COMPARE_5ARGS
1574 # 3.11 need to access d_count to get dentry reference count
1576 AC_DEFUN([LC_HAVE_DCOUNT], [
1577 LB_CHECK_COMPILE([if 'd_count' exists],
1579 #include <linux/dcache.h>
1581 struct dentry de = { };
1584 count = d_count(&de);
1586 AC_DEFINE(HAVE_D_COUNT, 1,
1592 # LC_PID_NS_FOR_CHILDREN
1594 # 3.11 replaces pid_ns by pid_ns_for_children in struct nsproxy
1596 AC_DEFUN([LC_PID_NS_FOR_CHILDREN], [
1597 LB_CHECK_COMPILE([if 'struct nsproxy' has 'pid_ns_for_children'],
1598 pid_ns_for_children, [
1599 #include <linux/nsproxy.h>
1602 ns.pid_ns_for_children = NULL;
1604 AC_DEFINE(HAVE_PID_NS_FOR_CHILDREN, 1,
1605 ['struct nsproxy' has 'pid_ns_for_children'])
1607 ]) # LC_PID_NS_FOR_CHILDREN
1610 # LC_OLDSIZE_TRUNCATE_PAGECACHE
1612 # 3.12 truncate_pagecache without oldsize parameter
1614 AC_DEFUN([LC_OLDSIZE_TRUNCATE_PAGECACHE], [
1615 LB_CHECK_COMPILE([if 'truncate_pagecache' with 'old_size' parameter],
1616 truncate_pagecache_old_size, [
1617 #include <linux/mm.h>
1619 truncate_pagecache(NULL, 0, 0);
1621 AC_DEFINE(HAVE_OLDSIZE_TRUNCATE_PAGECACHE, 1,
1624 ]) # LC_OLDSIZE_TRUNCATE_PAGECACHE
1627 # LC_PTR_ERR_OR_ZERO
1629 # For some reason SLES11SP4 is missing the PTR_ERR_OR_ZERO macro
1630 # It was added to linux kernel 3.12
1632 AC_DEFUN([LC_PTR_ERR_OR_ZERO_MISSING], [
1633 LB_CHECK_COMPILE([if 'PTR_ERR_OR_ZERO' is missing],
1635 #include <linux/err.h>
1637 if (PTR_ERR_OR_ZERO(NULL)) return 0;
1639 AC_DEFINE(HAVE_PTR_ERR_OR_ZERO, 1,
1640 ['PTR_ERR_OR_ZERO' exist])
1642 ]) # LC_PTR_ERR_OR_ZERO_MISSING
1645 # LC_HAVE_DENTRY_D_U_D_ALIAS
1647 # 3.11 kernel moved d_alias to the union d_u in struct dentry
1649 # Some distros move d_alias to d_u but it is still a struct list
1651 AC_DEFUN([LC_HAVE_DENTRY_D_U_D_ALIAS], [
1652 AS_IF([test "x$lb_cv_compile_i_dentry_d_alias_list" = xyes], [
1653 LB_CHECK_COMPILE([if list 'dentry.d_u.d_alias' exist],
1655 #include <linux/list.h>
1656 #include <linux/dcache.h>
1659 INIT_LIST_HEAD(&de.d_u.d_alias);
1661 AC_DEFINE(HAVE_DENTRY_D_U_D_ALIAS, 1,
1662 [list dentry.d_u.d_alias exist])
1665 LB_CHECK_COMPILE([if hlist 'dentry.d_u.d_alias' exist],
1667 #include <linux/list.h>
1668 #include <linux/dcache.h>
1671 INIT_HLIST_NODE(&de.d_u.d_alias);
1673 AC_DEFINE(HAVE_DENTRY_D_U_D_ALIAS, 1,
1674 [hlist dentry.d_u.d_alias exist])
1677 ]) # LC_HAVE_DENTRY_D_U_D_ALIAS
1680 # LC_HAVE_DENTRY_D_CHILD
1682 # 3.11 kernel d_child has been moved out of the union d_u
1685 AC_DEFUN([LC_HAVE_DENTRY_D_CHILD], [
1686 LB_CHECK_COMPILE([if 'dentry.d_child' exist],
1688 #include <linux/list.h>
1689 #include <linux/dcache.h>
1692 INIT_LIST_HEAD(&de.d_child);
1694 AC_DEFINE(HAVE_DENTRY_D_CHILD, 1,
1695 [dentry.d_child exist])
1697 ]) # LC_HAVE_DENTRY_D_CHILD
1702 # 3.12 ki_left removed from struct kiocb
1704 AC_DEFUN([LC_KIOCB_KI_LEFT], [
1705 LB_CHECK_COMPILE([if 'struct kiocb' with 'ki_left' member],
1707 #include <linux/aio.h>
1709 ((struct kiocb*)0)->ki_left = 0;
1711 AC_DEFINE(HAVE_KIOCB_KI_LEFT, 1,
1714 ]) # LC_KIOCB_KI_LEFT
1717 # LC_INIT_LIST_HEAD_RCU
1719 # 3.12 added INIT_LIST_HEAD_RCU in commit 2a855b644c310d5db5
1720 # which is unfortunately an inline function and not a macro
1721 # that can be tested directly, so it needs a configure check.
1723 AC_DEFUN([LC_INIT_LIST_HEAD_RCU], [
1724 LB_CHECK_COMPILE([if 'INIT_LIST_HEAD_RCU' exists],
1725 init_list_head_rcu, [
1726 #include <linux/list.h>
1727 #include <linux/rculist.h>
1729 struct list_head list;
1730 INIT_LIST_HEAD_RCU(&list);
1732 AC_DEFINE(HAVE_INIT_LIST_HEAD_RCU, 1,
1733 [INIT_LIST_HEAD_RCU exists])
1735 ]) # LC_INIT_LIST_HEAD_RCU
1738 # LC_VFS_RENAME_5ARGS
1740 # 3.13 has vfs_rename with 5 args
1742 AC_DEFUN([LC_VFS_RENAME_5ARGS], [
1743 LB_CHECK_COMPILE([if Linux kernel has 'vfs_rename' with 5 args],
1745 #include <linux/fs.h>
1747 vfs_rename(NULL, NULL, NULL, NULL, NULL);
1749 AC_DEFINE(HAVE_VFS_RENAME_5ARGS, 1,
1750 [kernel has vfs_rename with 5 args])
1752 ]) # LC_VFS_RENAME_5ARGS
1755 # LC_VFS_UNLINK_3ARGS
1757 # 3.13 has vfs_unlink with 3 args
1759 AC_DEFUN([LC_VFS_UNLINK_3ARGS], [
1760 LB_CHECK_COMPILE([if Linux kernel has 'vfs_unlink' with 3 args],
1762 #include <linux/fs.h>
1764 vfs_unlink(NULL, NULL, NULL);
1766 AC_DEFINE(HAVE_VFS_UNLINK_3ARGS, 1,
1767 [kernel has vfs_unlink with 3 args])
1769 ]) # LC_VFS_UNLINK_3ARGS
1774 # 3.14 move some of its data in struct bio into the new
1777 AC_DEFUN([LC_HAVE_BVEC_ITER], [
1778 LB_CHECK_COMPILE([if Linux kernel has struct bvec_iter],
1780 #include <linux/bio.h>
1782 struct bvec_iter iter;
1784 iter.bi_bvec_done = 0;
1786 AC_DEFINE(HAVE_BVEC_ITER, 1,
1787 [kernel has struct bvec_iter])
1789 ]) # LC_HAVE_BVEC_ITER
1794 # 3.14 adds set_acl method to inode_operations
1795 # see kernel commit 893d46e443346370cd4ea81d9d35f72952c62a37
1797 AC_DEFUN([LC_IOP_SET_ACL], [
1798 LB_CHECK_COMPILE([if 'inode_operations' has '.set_acl' member function],
1799 inode_ops_set_acl, [
1800 #include <linux/fs.h>
1802 struct inode_operations iop;
1805 AC_DEFINE(HAVE_IOP_SET_ACL, 1,
1806 [inode_operations has .set_acl member function])
1813 # 4.4 redefined bi_cnt as __bi_cnt
1815 AC_DEFUN([LC_HAVE_BI_CNT], [
1816 LB_CHECK_COMPILE([if Linux kernel has bi_cnt in struct bio],
1818 #include <asm/atomic.h>
1819 #include <linux/bio.h>
1821 struct bio bio = { };
1823 cnt = atomic_read(&bio.bi_cnt);
1825 AC_DEFINE(HAVE_BI_CNT, 1,
1826 [struct bio has bi_cnt])
1833 # 4.4 redefined bi_rw as bi_opf
1835 AC_DEFUN([LC_HAVE_BI_RW], [
1836 LB_CHECK_COMPILE([if Linux kernel has bi_rw in struct bio],
1838 #include <linux/bio.h>
1844 AC_DEFINE(HAVE_BI_RW, 1,
1845 [struct bio has bi_rw])
1850 # LC_HAVE_SUBMIT_BIO_2ARGS
1852 # 4.4 removed an argument from submit_bio
1854 AC_DEFUN([LC_HAVE_SUBMIT_BIO_2ARGS], [
1855 LB_CHECK_COMPILE([if submit_bio takes two arguments],
1856 have_submit_bio_2args, [
1857 #include <linux/bio.h>
1860 submit_bio(READ, &bio);
1862 AC_DEFINE(HAVE_SUBMIT_BIO_2ARGS, 1,
1863 [submit_bio takes two arguments])
1865 ]) # LC_HAVE_SUBMIT_BIO_2_ARGS
1868 # LC_HAVE_CLEAN_BDEV_ALIASES
1870 # 4.4 unmap_underlying_metadata was replaced by clean_bdev_aliases
1872 AC_DEFUN([LC_HAVE_CLEAN_BDEV_ALIASES], [
1873 LB_CHECK_COMPILE([if kernel has clean_bdev_aliases],
1874 have_clean_bdev_aliases, [
1875 #include <linux/buffer_head.h>
1877 struct block_device bdev;
1878 clean_bdev_aliases(&bdev,1,1);
1880 AC_DEFINE(HAVE_CLEAN_BDEV_ALIASES, 1,
1881 [kernel has clean_bdev_aliases])
1883 ]) # LC_HAVE_CLEAN_BDEV_ALIASES
1886 # LC_HAVE_TRUNCATE_IPAGE_FINAL
1888 # 3.14 bring truncate_inode_pages_final for evict_inode
1890 AC_DEFUN([LC_HAVE_TRUNCATE_IPAGES_FINAL], [
1891 LB_CHECK_COMPILE([if Linux kernel has truncate_inode_pages_final],
1892 truncate_ipages_final, [
1893 #include <linux/mm.h>
1895 truncate_inode_pages_final(NULL);
1897 AC_DEFINE(HAVE_TRUNCATE_INODE_PAGES_FINAL, 1,
1898 [kernel has truncate_inode_pages_final])
1900 ]) # LC_HAVE_TRUNCATE_IPAGES_FINAL
1903 # LC_IOPS_RENAME_WITH_FLAGS
1905 # 3.14 has inode_operations->rename with 5 args
1906 # commit 520c8b16505236fc82daa352e6c5e73cd9870cff
1908 AC_DEFUN([LC_IOPS_RENAME_WITH_FLAGS], [
1909 LB_CHECK_COMPILE([if 'inode_operations->rename' taken flags as argument],
1910 iops_rename_with_flags, [
1911 #include <linux/fs.h>
1913 struct inode *i1 = NULL, *i2 = NULL;
1914 struct dentry *d1 = NULL, *d2 = NULL;
1916 rc = ((struct inode_operations *)0)->rename(i1, d1, i2, d2, 0);
1918 AC_DEFINE(HAVE_IOPS_RENAME_WITH_FLAGS, 1,
1919 [inode_operations->rename need flags as argument])
1921 ]) # LC_IOPS_RENAME_WITH_FLAGS
1924 # LC_VFS_RENAME_6ARGS
1926 # 3.15 has vfs_rename with 6 args
1928 AC_DEFUN([LC_VFS_RENAME_6ARGS], [
1929 LB_CHECK_COMPILE([if Linux kernel has 'vfs_rename' with 6 args],
1931 #include <linux/fs.h>
1933 vfs_rename(NULL, NULL, NULL, NULL, NULL, NULL);
1935 AC_DEFINE(HAVE_VFS_RENAME_6ARGS, 1,
1936 [kernel has vfs_rename with 6 args])
1938 ]) # LC_VFS_RENAME_6ARGS
1941 # LC_DIRECTIO_USE_ITER
1943 # 3.16 kernel changes direct IO to use iov_iter
1945 AC_DEFUN([LC_DIRECTIO_USE_ITER], [
1946 LB_CHECK_COMPILE([if direct IO uses iov_iter],
1948 #include <linux/fs.h>
1950 struct address_space_operations ops = { };
1951 struct iov_iter *iter = NULL;
1954 ops.direct_IO(0, NULL, iter, offset);
1956 AC_DEFINE(HAVE_DIRECTIO_ITER, 1,
1957 [direct IO uses iov_iter])
1959 ]) # LC_DIRECTIO_USE_ITER
1962 # LC_HAVE_IOV_ITER_INIT_DIRECTION
1965 # 3.16 linux commit 71d8e532b1549a478e6a6a8a44f309d050294d00
1966 # changed iov_iter_init api to start accepting a tag
1967 # that defines if its a read or write operation
1969 AC_DEFUN([LC_HAVE_IOV_ITER_INIT_DIRECTION], [
1970 tmp_flags="$EXTRA_KCFLAGS"
1971 EXTRA_KCFLAGS="-Werror"
1972 LB_CHECK_COMPILE([if 'iov_iter_init' takes a tag],
1974 #include <linux/uio.h>
1975 #include <linux/fs.h>
1977 const struct iovec *iov = NULL;
1979 iov_iter_init(NULL, READ, iov, 1, 0);
1981 AC_DEFINE(HAVE_IOV_ITER_INIT_DIRECTION, 1,
1982 [iov_iter_init handles directional tag])
1984 EXTRA_KCFLAGS="$tmp_flags"
1985 ]) # LC_HAVE_IOV_ITER_INIT_DIRECTION
1988 # LC_HAVE_IOV_ITER_TRUNCATE
1991 # 3.16 introduces a new API iov_iter_truncate()
1993 AC_DEFUN([LC_HAVE_IOV_ITER_TRUNCATE], [
1994 tmp_flags="$EXTRA_KCFLAGS"
1995 EXTRA_KCFLAGS="-Werror"
1996 LB_CHECK_COMPILE([if 'iov_iter_truncate' exists ],
1998 #include <linux/uio.h>
1999 #include <linux/fs.h>
2001 struct iov_iter *i = NULL;
2003 iov_iter_truncate(i, 0);
2005 AC_DEFINE(HAVE_IOV_ITER_TRUNCATE, 1, [iov_iter_truncate exists])
2007 EXTRA_KCFLAGS="$tmp_flags"
2008 ]) # LC_HAVE_IOV_ITER_TRUNCATE
2011 # LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
2013 # 3.16 introduces [read|write]_iter to struct file_operations
2015 AC_DEFUN([LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER], [
2016 LB_CHECK_COMPILE([if 'file_operations.[read|write]_iter' exist],
2017 file_function_iter, [
2018 #include <linux/fs.h>
2020 ((struct file_operations *)NULL)->read_iter(NULL, NULL);
2021 ((struct file_operations *)NULL)->write_iter(NULL, NULL);
2023 AC_DEFINE(HAVE_FILE_OPERATIONS_READ_WRITE_ITER, 1,
2024 [file_operations.[read|write]_iter functions exist])
2026 ]) # LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
2029 # LC_HAVE_INTERVAL_BLK_INTEGRITY
2031 # 3.17 replace sector_size with interval in struct blk_integrity
2033 AC_DEFUN([LC_HAVE_INTERVAL_BLK_INTEGRITY], [
2034 LB_CHECK_COMPILE([if 'blk_integrity.interval' exist],
2035 interval_blk_integrity, [
2036 #include <linux/blkdev.h>
2038 ((struct blk_integrity *)0)->interval = 0;
2040 AC_DEFINE(HAVE_INTERVAL_BLK_INTEGRITY, 1,
2041 [blk_integrity.interval exist])
2043 ]) # LC_HAVE_INTERVAL_BLK_INTEGRITY
2048 # 3.17 replaces key_type::match with match_preparse
2049 # and has new struct key_match_data
2051 AC_DEFUN([LC_KEY_MATCH_DATA], [
2052 LB_CHECK_COMPILE([if struct key_match field exist],
2054 #include <linux/key-type.h>
2056 struct key_match_data data;
2058 data.raw_data = NULL;
2060 AC_DEFINE(HAVE_KEY_MATCH_DATA, 1,
2061 [struct key_match_data exist])
2063 ]) # LC_KEY_MATCH_DATA
2066 # LC_NFS_FILLDIR_USE_CTX
2068 # 3.18 kernel moved from void cookie to struct dir_context
2070 AC_DEFUN([LC_NFS_FILLDIR_USE_CTX], [
2071 tmp_flags="$EXTRA_KCFLAGS"
2072 EXTRA_KCFLAGS="-Werror"
2073 LB_CHECK_COMPILE([if filldir_t uses struct dir_context],
2075 #include <linux/fs.h>
2077 int filldir(struct dir_context *ctx, const char* name,
2078 int i, loff_t off, u64 tmp, unsigned temp)
2083 struct dir_context ctx = {
2087 ctx.actor(NULL, "test", 0, (loff_t) 0, 0, 0);
2089 AC_DEFINE(HAVE_FILLDIR_USE_CTX, 1,
2090 [filldir_t needs struct dir_context as argument])
2092 EXTRA_KCFLAGS="$tmp_flags"
2093 ]) # LC_NFS_FILLDIR_USE_CTX
2096 # LC_PERCPU_COUNTER_INIT
2098 # 3.18 For kernels 3.18 and after percpu_counter_init starts
2099 # to pass a GFP_* memory allocation flag for internal
2100 # memory allocation purposes.
2102 AC_DEFUN([LC_PERCPU_COUNTER_INIT], [
2103 LB_CHECK_COMPILE([if percpu_counter_init uses GFP_* flag as argument],
2104 percpu_counter_init, [
2105 #include <linux/percpu_counter.h>
2107 percpu_counter_init(NULL, 0, GFP_KERNEL);
2109 AC_DEFINE(HAVE_PERCPU_COUNTER_INIT_GFP_FLAG, 1,
2110 [percpu_counter_init uses GFP_* flag])
2112 ]) # LC_PERCPU_COUNTER_INIT
2115 # LC_KIOCB_HAS_NBYTES
2117 # 3.19 kernel removed ki_nbytes from struct kiocb
2119 AC_DEFUN([LC_KIOCB_HAS_NBYTES], [
2120 LB_CHECK_COMPILE([if struct kiocb has ki_nbytes field],
2122 #include <linux/fs.h>
2124 struct kiocb iocb = { };
2128 AC_DEFINE(HAVE_KI_NBYTES, 1, [ki_nbytes field exist])
2130 ]) # LC_KIOCB_HAS_NBYTES
2133 # LC_HAVE_DQUOT_QC_DQBLK
2135 # 3.19 has quotactl_ops->[sg]et_dqblk that take struct kqid and qc_dqblk
2136 # Added in commit 14bf61ffe
2138 AC_DEFUN([LC_HAVE_DQUOT_QC_DQBLK], [
2139 tmp_flags="$EXTRA_KCFLAGS"
2140 EXTRA_KCFLAGS="-Werror"
2141 LB_CHECK_COMPILE([if 'quotactl_ops.set_dqblk' takes struct qc_dqblk],
2143 #include <linux/fs.h>
2144 #include <linux/quota.h>
2146 ((struct quotactl_ops *)0)->set_dqblk(NULL, *((struct kqid*)0), (struct qc_dqblk*)0);
2148 AC_DEFINE(HAVE_DQUOT_QC_DQBLK, 1,
2149 [quotactl_ops.set_dqblk takes struct qc_dqblk])
2150 AC_DEFINE(HAVE_DQUOT_KQID, 1,
2151 [quotactl_ops.set_dqblk takes struct kqid])
2153 EXTRA_KCFLAGS="$tmp_flags"
2154 ]) # LC_HAVE_DQUOT_QC_DQBLK
2157 # LC_BACKING_DEV_INFO_REMOVAL
2159 # 3.20 kernel removed backing_dev_info from address_space
2161 AC_DEFUN([LC_BACKING_DEV_INFO_REMOVAL], [
2162 LB_CHECK_COMPILE([if struct address_space has backing_dev_info],
2164 #include <linux/fs.h>
2166 struct address_space mapping;
2168 mapping.backing_dev_info = NULL;
2170 AC_DEFINE(HAVE_BACKING_DEV_INFO, 1, [backing_dev_info exist])
2172 ]) # LC_BACKING_DEV_INFO_REMOVAL
2175 # LC_HAVE_BDI_CAP_MAP_COPY
2177 # 3.20 removed mmap handling for backing devices since
2178 # it breaks on non-MMU systems. See kernel commit
2179 # b4caecd48005fbed3949dde6c1cb233142fd69e9
2181 AC_DEFUN([LC_HAVE_BDI_CAP_MAP_COPY], [
2182 LB_CHECK_COMPILE([if have 'BDI_CAP_MAP_COPY'],
2184 #include <linux/backing-dev.h>
2186 struct backing_dev_info info;
2188 info.capabilities = BDI_CAP_MAP_COPY;
2190 AC_DEFINE(HAVE_BDI_CAP_MAP_COPY, 1,
2191 [BDI_CAP_MAP_COPY exist])
2193 ]) # LC_HAVE_BDI_CAP_MAP_COPY
2196 # LC_CANCEL_DIRTY_PAGE
2198 # 4.0.0 kernel removed cancel_dirty_page
2200 AC_DEFUN([LC_CANCEL_DIRTY_PAGE], [
2201 LB_CHECK_COMPILE([if cancel_dirty_page still exist],
2202 cancel_dirty_page, [
2203 #include <linux/mm.h>
2205 cancel_dirty_page(NULL, PAGE_SIZE);
2207 AC_DEFINE(HAVE_CANCEL_DIRTY_PAGE, 1,
2208 [cancel_dirty_page is still available])
2210 ]) # LC_CANCEL_DIRTY_PAGE
2215 # 4.1 kernel has iov_iter_rw
2217 AC_DEFUN([LC_IOV_ITER_RW], [
2218 LB_CHECK_COMPILE([if iov_iter_rw exist],
2220 #include <linux/fs.h>
2221 #include <linux/uio.h>
2223 struct iov_iter *iter = NULL;
2227 AC_DEFINE(HAVE_IOV_ITER_RW, 1,
2228 [iov_iter_rw exist])
2233 # LC_HAVE_SYNC_READ_WRITE
2235 # 4.1 new_sync_[read|write] no longer exported
2237 AC_DEFUN([LC_HAVE_SYNC_READ_WRITE], [
2238 LB_CHECK_EXPORT([new_sync_read], [fs/read_write.c],
2239 [AC_DEFINE(HAVE_SYNC_READ_WRITE, 1,
2240 [new_sync_[read|write] is exported by the kernel])])
2241 ]) # LC_HAVE_SYNC_READ_WRITE
2244 # LC_NEW_CANCEL_DIRTY_PAGE
2246 # 4.2 kernel has new cancel_dirty_page
2248 AC_DEFUN([LC_NEW_CANCEL_DIRTY_PAGE], [
2249 LB_CHECK_COMPILE([if cancel_dirty_page with one argument exist],
2250 new_cancel_dirty_page, [
2251 #include <linux/mm.h>
2253 cancel_dirty_page(NULL);
2255 AC_DEFINE(HAVE_NEW_CANCEL_DIRTY_PAGE, 1,
2256 [cancel_dirty_page with one arguement is available])
2258 ]) # LC_NEW_CANCEL_DIRTY_PAGE
2261 # LC_SYMLINK_OPS_USE_NAMEIDATA
2263 # For the 4.2+ kernels the file system internal symlink api no
2264 # longer uses struct nameidata as a argument
2266 AC_DEFUN([LC_SYMLINK_OPS_USE_NAMEIDATA], [
2267 LB_CHECK_COMPILE([if symlink inode operations have struct nameidata argument],
2268 symlink_use_nameidata, [
2269 #include <linux/namei.h>
2270 #include <linux/fs.h>
2272 struct nameidata *nd = NULL;
2274 ((struct inode_operations *)0)->follow_link(NULL, nd);
2275 ((struct inode_operations *)0)->put_link(NULL, nd, NULL);
2277 AC_DEFINE(HAVE_SYMLINK_OPS_USE_NAMEIDATA, 1,
2278 [symlink inode operations need struct nameidata argument])
2280 ]) # LC_SYMLINK_OPS_USE_NAMEIDATA
2283 # LC_BIO_ENDIO_USES_ONE_ARG
2285 # 4.2 kernel bio_endio now only takes one argument
2287 AC_DEFUN([LC_BIO_ENDIO_USES_ONE_ARG], [
2288 LB_CHECK_COMPILE([if 'bio_endio' with one argument exist],
2290 #include <linux/bio.h>
2294 AC_DEFINE(HAVE_BIO_ENDIO_USES_ONE_ARG, 1,
2295 [bio_endio takes only one argument])
2297 ]) # LC_BIO_ENDIO_USES_ONE_ARG
2300 # LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
2302 # 4.3 replace interval with interval_exp in 'struct blk_integrity'
2303 # 'struct blk_integrity_profile' is also added in this version,
2304 # thus use this to determine whether 'struct blk_integrity' has profile
2306 AC_DEFUN([LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY], [
2307 LB_CHECK_COMPILE([if 'blk_integrity.interval_exp' exist],
2308 blk_integrity_interval_exp, [
2309 #include <linux/blkdev.h>
2311 ((struct blk_integrity *)0)->interval_exp = 0;
2313 AC_DEFINE(HAVE_INTERVAL_EXP_BLK_INTEGRITY, 1,
2314 [blk_integrity.interval_exp exist])
2316 ]) # LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
2319 # LC_HAVE_LOOP_CTL_GET_FREE
2321 # 4.x kernel have moved userspace APIs to
2322 # the separate directory and all of them
2323 # support LOOP_CTL_GET_FREE
2325 AC_DEFUN([LC_HAVE_LOOP_CTL_GET_FREE], [
2326 LB_CHECK_FILE([$LINUX/include/linux/loop.h], [
2327 LB_CHECK_COMPILE([if have 'HAVE_LOOP_CTL_GET_FREE'],
2328 LOOP_CTL_GET_FREE, [
2329 #include <linux/loop.h>
2333 i = LOOP_CTL_GET_FREE;
2335 AC_DEFINE(HAVE_LOOP_CTL_GET_FREE, 1,
2336 [LOOP_CTL_GET_FREE exist])
2339 AC_DEFINE(HAVE_LOOP_CTL_GET_FREE, 1,
2340 [kernel has LOOP_CTL_GET_FREE])
2342 ]) # LC_HAVE_LOOP_CTL_GET_FREE
2345 # LC_HAVE_CACHE_HEAD_HLIST
2347 # 4.3 kernel swiched to hlist for cache_head
2349 AC_DEFUN([LC_HAVE_CACHE_HEAD_HLIST], [
2350 LB_CHECK_COMPILE([if 'struct cache_head' has 'cache_list' field],
2351 cache_head_has_hlist, [
2352 #include <linux/sunrpc/cache.h>
2354 do {} while(sizeof(((struct cache_head *)0)->cache_list));
2356 AC_DEFINE(HAVE_CACHE_HEAD_HLIST, 1,
2357 [cache_head has hlist cache_list])
2359 ]) # LC_HAVE_CACHE_HEAD_HLIST
2362 # LC_HAVE_XATTR_HANDLER_SIMPLIFIED
2364 # Kernel version 4.3 commit e409de992e3ea3674393465f07cc71c948edd87a
2365 # simplified xattr_handler handling by passing in the handler pointer
2367 AC_DEFUN([LC_HAVE_XATTR_HANDLER_SIMPLIFIED], [
2368 tmp_flags="$EXTRA_KCFLAGS"
2369 EXTRA_KCFLAGS="-Werror"
2370 LB_CHECK_COMPILE([if 'struct xattr_handler' functions pass in handler pointer],
2371 xattr_handler_simplified, [
2372 #include <linux/xattr.h>
2374 struct xattr_handler handler;
2376 ((struct xattr_handler *)0)->get(&handler, NULL, NULL, NULL, 0);
2377 ((struct xattr_handler *)0)->set(&handler, NULL, NULL, NULL, 0, 0);
2379 AC_DEFINE(HAVE_XATTR_HANDLER_SIMPLIFIED, 1, [handler pointer is parameter])
2381 EXTRA_KCFLAGS="$tmp_flags"
2382 ]) # LC_HAVE_XATTR_HANDLER_SIMPLIFIED
2385 # LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
2387 # 4.3 replace interval with interval_exp in 'struct blk_integrity'.
2389 AC_DEFUN([LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD], [
2390 LB_CHECK_COMPILE([if 'bio_integrity_payload.bip_iter' exist],
2391 bio_integrity_payload_bip_iter, [
2392 #include <linux/bio.h>
2394 ((struct bio_integrity_payload *)0)->bip_iter.bi_size = 0;
2396 AC_DEFINE(HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD, 1,
2397 [bio_integrity_payload.bip_iter exist])
2399 ]) # LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
2402 # LC_BIO_INTEGRITY_PREP_FN
2404 # Lustre kernel patch extents bio_integrity_prep to accept optional
2405 # generate/verify_fn as extra args.
2407 AC_DEFUN([LC_BIO_INTEGRITY_PREP_FN], [
2408 LB_CHECK_COMPILE([if 'bio_integrity_prep_fn' exists],
2409 bio_integrity_prep_fn, [
2410 #include <linux/bio.h>
2412 bio_integrity_prep_fn(NULL, NULL, NULL);
2414 AC_DEFINE(HAVE_BIO_INTEGRITY_PREP_FN, 1,
2415 [kernel has bio_integrity_prep_fn])
2416 AC_SUBST(PATCHED_INTEGRITY_INTF)
2418 AC_SUBST(PATCHED_INTEGRITY_INTF, [#])
2420 ]) # LC_BIO_INTEGRITY_PREP_FN
2423 # LC_HAVE_LOCKS_LOCK_FILE_WAIT
2425 # 4.4 kernel have moved locks API users to
2426 # locks_lock_inode_wait()
2428 AC_DEFUN([LC_HAVE_LOCKS_LOCK_FILE_WAIT], [
2429 LB_CHECK_COMPILE([if 'locks_lock_file_wait' exists],
2430 locks_lock_file_wait, [
2431 #include <linux/fs.h>
2433 locks_lock_file_wait(NULL, NULL);
2435 AC_DEFINE(HAVE_LOCKS_LOCK_FILE_WAIT, 1,
2436 [kernel has locks_lock_file_wait])
2438 ]) # LC_HAVE_LOCKS_LOCK_FILE_WAIT
2441 # LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
2443 # 4.4 kernel merged type-specific data with the payload data for keys
2445 AC_DEFUN([LC_HAVE_KEY_PAYLOAD_DATA_ARRAY], [
2446 LB_CHECK_COMPILE([if 'struct key' has 'payload.data' as an array],
2447 key_payload_data_array, [
2448 #include <linux/key.h>
2450 struct key key = { };
2452 key.payload.data[0] = NULL;
2454 AC_DEFINE(HAVE_KEY_PAYLOAD_DATA_ARRAY, 1, [payload.data is an array])
2456 ]) #LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
2459 # LC_HAVE_XATTR_HANDLER_NAME
2461 # Kernel version 4.4 commit 98e9cb5711c68223f0e4d5201b9a6add255ec550
2462 # add a name member to struct xattr_handler
2464 AC_DEFUN([LC_HAVE_XATTR_HANDLER_NAME], [
2465 tmp_flags="$EXTRA_KCFLAGS"
2466 EXTRA_KCFLAGS="-Werror"
2467 LB_CHECK_COMPILE([if 'struct xattr_handler' has a name member],
2468 xattr_handler_name, [
2469 #include <linux/xattr.h>
2471 ((struct xattr_handler *)NULL)->name = NULL;
2473 AC_DEFINE(HAVE_XATTR_HANDLER_NAME, 1, [xattr_handler has a name member])
2475 EXTRA_KCFLAGS="$tmp_flags"
2476 ]) # LC_HAVE_XATTR_HANDLER_NAME
2479 # LC_HAVE_FILE_DENTRY
2481 # 4.5 adds wrapper file_dentry
2483 AC_DEFUN([LC_HAVE_FILE_DENTRY], [
2484 LB_CHECK_COMPILE([if Linux kernel has 'file_dentry'],
2486 #include <linux/fs.h>
2490 AC_DEFINE(HAVE_FILE_DENTRY, 1,
2491 [kernel has file_dentry])
2493 ]) # LC_HAVE_FILE_DENTRY
2496 # LC_HAVE_INODE_LOCK
2498 # 4.5 introduced inode_lock
2500 AC_DEFUN([LC_HAVE_INODE_LOCK], [
2501 LB_CHECK_COMPILE([if 'inode_lock' is defined],
2503 #include <linux/fs.h>
2507 AC_DEFINE(HAVE_INODE_LOCK, 1,
2508 [inode_lock is defined])
2510 ]) # LC_HAVE_INODE_LOCK
2513 # LC_HAVE_IOP_GET_LINK
2515 # 4.5 vfs replaced iop->follow_link with
2518 AC_DEFUN([LC_HAVE_IOP_GET_LINK], [
2519 LB_CHECK_COMPILE([if 'iop' has 'get_link'],
2520 inode_ops_get_link, [
2521 #include <linux/fs.h>
2523 struct inode_operations iop;
2524 iop.get_link = NULL;
2526 AC_DEFINE(HAVE_IOP_GET_LINK, 1,
2527 [have iop get_link])
2529 ]) # LC_HAVE_IOP_GET_LINK
2532 # LC_HAVE_IN_COMPAT_SYSCALL
2534 # 4.6 renamed is_compat_task to in_compat_syscall
2536 AC_DEFUN([LC_HAVE_IN_COMPAT_SYSCALL], [
2537 LB_CHECK_COMPILE([if 'in_compat_syscall' is defined],
2538 in_compat_syscall, [
2539 #include <linux/compat.h>
2541 in_compat_syscall();
2543 AC_DEFINE(HAVE_IN_COMPAT_SYSCALL, 1,
2544 [have in_compat_syscall])
2546 ]) # LC_HAVE_IN_COMPAT_SYSCALL
2549 # LC_HAVE_XATTR_HANDLER_INODE_PARAM
2551 # Kernel version 4.6 commit b296821a7c42fa58baa17513b2b7b30ae66f3336
2552 # and commit 5930122683dff58f0846b0f0405b4bd598a3ba6a added inode parameter
2553 # to xattr_handler functions
2555 AC_DEFUN([LC_HAVE_XATTR_HANDLER_INODE_PARAM], [
2556 tmp_flags="$EXTRA_KCFLAGS"
2557 EXTRA_KCFLAGS="-Werror"
2558 LB_CHECK_COMPILE([if 'struct xattr_handler' functions have inode parameter],
2559 xattr_handler_inode_param, [
2560 #include <linux/xattr.h>
2562 const struct xattr_handler handler;
2564 ((struct xattr_handler *)0)->get(&handler, NULL, NULL, NULL, NULL, 0);
2565 ((struct xattr_handler *)0)->set(&handler, NULL, NULL, NULL, NULL, 0, 0);
2567 AC_DEFINE(HAVE_XATTR_HANDLER_INODE_PARAM, 1, [needs inode parameter])
2569 EXTRA_KCFLAGS="$tmp_flags"
2570 ]) # LC_HAVE_XATTR_HANDLER_INODE_PARAM
2575 # Kernel version 4.7 commit c8b8e32d700fe943a935e435ae251364d016c497
2576 # direct-io: eliminate the offset argument to ->direct_IO
2578 AC_DEFUN([LC_DIRECTIO_2ARGS], [
2579 LB_CHECK_COMPILE([if '->direct_IO()' taken 2 arguments],
2581 #include <linux/fs.h>
2583 struct address_space_operations ops = { };
2584 struct iov_iter *iter = NULL;
2585 struct kiocb *iocb = NULL;
2588 rc = ops.direct_IO(iocb, iter);
2590 AC_DEFINE(HAVE_DIRECTIO_2ARGS, 1,
2591 [direct_IO need 2 arguments])
2593 ]) # LC_DIRECTIO_2ARGS
2596 # LC_GENERIC_WRITE_SYNC_2ARGS
2598 # Kernel version 4.7 commit c8b8e32d700fe943a935e435ae251364d016c497
2599 # direct-io: eliminate the offset argument to ->direct_IO
2601 AC_DEFUN([LC_GENERIC_WRITE_SYNC_2ARGS], [
2602 LB_CHECK_COMPILE([if 'generic_write_sync()' taken 2 arguments],
2603 generic_write_sync_2args, [
2604 #include <linux/fs.h>
2606 struct kiocb *iocb = NULL;
2609 rc = generic_write_sync(iocb, 0);
2611 AC_DEFINE(HAVE_GENERIC_WRITE_SYNC_2ARGS, 1,
2612 [generic_write_sync need 2 arguments])
2614 ]) # LC_GENERIC_WRITE_SYNC_2ARGS
2617 # LC_FOP_ITERATE_SHARED
2619 # Kernel version 4.7 adds iterate_shared method to file_operations
2621 AC_DEFUN([LC_FOP_ITERATE_SHARED], [
2622 LB_CHECK_COMPILE([if 'file_operations' has 'iterate_shared'],
2623 fop_iterate_shared, [
2624 #include <linux/fs.h>
2626 struct file_operations fop;
2627 fop.iterate_shared = NULL;
2629 AC_DEFINE(HAVE_FOP_ITERATE_SHARED, 1,
2630 [file_operations has iterate_shared])
2632 ]) # LC_FOP_ITERATE_SHARED
2635 # LC_FOPS_ITERATE_SHARED
2637 # 4.7 commit ae05327a00fd47c34dfe25294b359a3f3fef96e8
2638 # ext4: switch to ->iterate_shared()
2639 # this replaces ext4_dir_operations iterate with iterate_shared.
2640 # dir_relaxed_shared() was also added in this commit, so we can
2641 # use that function to verify that the ext4_dir_operations is using
2644 AC_DEFUN([LC_FOPS_ITERATE_SHARED], [
2645 LB_CHECK_COMPILE([if ext4_dir_operations uses iterate_shared],
2647 #include <linux/fs.h>
2649 ((struct file_operations *)0)->iterate_shared(NULL, NULL);
2650 dir_relax_shared(NULL);
2652 AC_DEFINE(HAVE_ITERATE_SHARED, 1,
2653 ['iterate_shared' is available])
2655 ]) # LC_FOPS_ITERATE_SHARED
2658 # LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
2660 # kernel 4.20 commit 1863d77f15da0addcd293a1719fa5d3ef8cde3ca
2661 # SUNRPC: Replace the cache_detail->hash_lock with a regular spinlock
2663 # Now that the reader functions are all RCU protected, use a regular
2664 # spinlock rather than a reader/writer lock.
2666 AC_DEFUN([LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK], [
2667 tmp_flags="$EXTRA_KCFLAGS"
2668 EXTRA_KCFLAGS="-Werror"
2669 LB_CHECK_COMPILE([if cache_detail->hash_lock is a spinlock],
2670 hash_lock_isa_spinlock_t, [
2671 #include <linux/sunrpc/cache.h>
2673 spinlock_t *lock = &(((struct cache_detail *)0)->hash_lock);
2676 AC_DEFINE(HAVE_CACHE_HASH_SPINLOCK, 1,
2677 [if cache_detail->hash_lock is a spinlock])
2679 EXTRA_KCFLAGS="$tmp_flags"
2680 ]) # LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
2683 # LC_HAVE_POSIX_ACL_VALID_USER_NS
2685 # 4.8 posix_acl_valid takes struct user_namespace
2687 AC_DEFUN([LC_HAVE_POSIX_ACL_VALID_USER_NS], [
2688 LB_CHECK_COMPILE([if 'posix_acl_valid' takes 'struct user_namespace'],
2690 #include <linux/fs.h>
2691 #include <linux/posix_acl.h>
2693 posix_acl_valid((struct user_namespace*)NULL, (const struct posix_acl*)NULL);
2695 AC_DEFINE(HAVE_POSIX_ACL_VALID_USER_NS, 1,
2696 [posix_acl_valid takes struct user_namespace])
2698 ]) # LC_HAVE_POSIX_ACL_VALID_USER_NS
2701 # LC_D_COMPARE_4ARGS
2703 # Kernel version 4.8 commit 6fa67e707559303e086303aeecc9e8b91ef497d5
2704 # get rid of 'parent' argument of ->d_compare()
2706 AC_DEFUN([LC_D_COMPARE_4ARGS], [
2707 LB_CHECK_COMPILE([if 'd_compare' taken 4 arguments],
2709 #include <linux/dcache.h>
2711 ((struct dentry_operations*)0)->d_compare(NULL,0,NULL,NULL);
2713 AC_DEFINE(HAVE_D_COMPARE_4ARGS, 1,
2714 [d_compare need 4 arguments])
2716 ]) # LC_D_COMPARE_4ARGS
2719 # LC_FULL_NAME_HASH_3ARGS
2721 # Kernel version 4.8 commit 8387ff2577eb9ed245df9a39947f66976c6bcd02
2722 # vfs: make the string hashes salt the hash
2724 AC_DEFUN([LC_FULL_NAME_HASH_3ARGS], [
2725 LB_CHECK_COMPILE([if 'full_name_hash' taken 3 arguments],
2726 full_name_hash_3args, [
2727 #include <linux/stringhash.h>
2730 hash = full_name_hash(NULL,NULL,0);
2732 AC_DEFINE(HAVE_FULL_NAME_HASH_3ARGS, 1,
2733 [full_name_hash need 3 arguments])
2735 ]) # LC_FULL_NAME_HASH_3ARGS
2738 # LC_STRUCT_POSIX_ACL_XATTR
2740 # Kernel version 4.8 commit 2211d5ba5c6c4e972ba6dbc912b2897425ea6621
2741 # posix_acl: xattr representation cleanups
2743 AC_DEFUN([LC_STRUCT_POSIX_ACL_XATTR], [
2744 LB_CHECK_COMPILE([if 'struct posix_acl_xattr_{header,entry}' defined],
2745 struct_posix_acl_xattr, [
2746 #include <linux/fs.h>
2747 #include <linux/posix_acl_xattr.h>
2749 struct posix_acl_xattr_header *h = NULL;
2750 struct posix_acl_xattr_entry *e;
2751 e = (void *)(h + 1);
2753 AC_DEFINE(HAVE_STRUCT_POSIX_ACL_XATTR, 1,
2754 [struct posix_acl_xattr_{header,entry} defined])
2756 ]) # LC_STRUCT_POSIX_ACL_XATTR
2761 # Kernel version 4.8 commit fd50ecaddf8372a1d96e0daeaac0f93cf04e4d42
2762 # removed {get,set,remove}xattr inode operations
2764 AC_DEFUN([LC_IOP_XATTR], [
2765 LB_CHECK_COMPILE([if 'inode_operations' has {get,set,remove}xattr members],
2767 #include <linux/fs.h>
2769 struct inode_operations iop;
2770 iop.setxattr = NULL;
2771 iop.getxattr = NULL;
2772 iop.removexattr = NULL;
2774 AC_DEFINE(HAVE_IOP_XATTR, 1,
2775 [inode_operations has {get,set,remove}xattr members])
2782 # Kernel version 4.9 commit 81243eacfa400f5f7b89f4c2323d0de9982bb0fb
2783 # cred: simpler, 1D supplementary groups
2785 AC_DEFUN([LC_GROUP_INFO_GID], [
2786 LB_CHECK_COMPILE([if 'struct group_info' has member 'gid'],
2788 #include <linux/cred.h>
2791 p = ((struct group_info *)0)->gid;
2793 AC_DEFINE(HAVE_GROUP_INFO_GID, 1,
2794 [struct group_info has member gid])
2796 ]) # LC_GROUP_INFO_GID
2800 # kernel 4.19-rc6 commit 3159f943aafdbacb2f94c38fdaadabf2bbde2a14
2801 # xarray: Replace exceptional entries
2804 AC_DEFUN([LC_XA_IS_VALUE], [
2805 LB_CHECK_COMPILE([xa_is_value exist],
2807 #include <linux/xarray.h>
2811 AC_DEFINE(HAVE_XA_IS_VALUE, 1, [xa_is_value exist])
2818 # Kernel version 4.9 commit 5d6c31910bc0713e37628dc0ce677dcb13c8ccf4
2819 # added __vfs_{get,set,remove}xattr helpers
2821 AC_DEFUN([LC_VFS_SETXATTR], [
2822 LB_CHECK_COMPILE([if '__vfs_setxattr' helper is available],
2824 #include <linux/xattr.h>
2826 __vfs_setxattr(NULL, NULL, NULL, NULL, 0, 0);
2828 AC_DEFINE(HAVE_VFS_SETXATTR, 1,
2829 ['__vfs_setxattr is available])
2831 ]) # LC_VFS_SETXATTR
2834 # LC_POSIX_ACL_UPDATE_MODE
2836 # Kernel version 4.9 commit 073931017b49d9458aa351605b43a7e34598caef
2837 # posix_acl: Clear SGID bit when setting file permissions
2839 AC_DEFUN([LC_POSIX_ACL_UPDATE_MODE], [
2840 LB_CHECK_COMPILE([if 'posix_acl_update_mode' exists],
2841 posix_acl_update_mode, [
2842 #include <linux/fs.h>
2843 #include <linux/posix_acl.h>
2845 posix_acl_update_mode(NULL, NULL, NULL);
2847 AC_DEFINE(HAVE_POSIX_ACL_UPDATE_MODE, 1,
2848 ['posix_acl_update_mode' is available])
2850 ]) # LC_POSIX_ACL_UPDATE_MODE
2853 # LC_IOP_GENERIC_READLINK
2855 # Kernel version 4.10 commit dfeef68862edd7d4bafe68ef7aeb5f658ef24bb5
2856 # removed generic_readlink from individual file systems
2858 AC_DEFUN([LC_IOP_GENERIC_READLINK], [
2859 LB_CHECK_COMPILE([if 'generic_readlink' still exist],
2860 inode_ops_readlink, [
2861 #include <linux/fs.h>
2863 struct inode_operations iop;
2864 iop.readlink = generic_readlink;
2866 AC_DEFINE(HAVE_IOP_GENERIC_READLINK, 1,
2867 [generic_readlink has been removed])
2869 ]) # LC_IOP_GENERIC_READLINK
2872 # LC_HAVE_VM_FAULT_ADDRESS
2874 # Kernel version 4.10 commit 1a29d85eb0f19b7d8271923d8917d7b4f5540b3e
2875 # removed virtual_address field. Need to use address field instead
2877 AC_DEFUN([LC_HAVE_VM_FAULT_ADDRESS], [
2878 LB_CHECK_COMPILE([if 'struct vm_fault' replaced virtual_address with address field],
2880 #include <linux/mm.h>
2882 struct vm_fault vmf;
2885 AC_DEFINE(HAVE_VM_FAULT_ADDRESS, 1,
2886 [virtual_address has been replaced by address field])
2888 ]) # LC_HAVE_VM_FAULT_ADDRESS
2891 # LC_INODEOPS_ENHANCED_GETATTR
2893 # Kernel version 4.11 commit a528d35e8bfcc521d7cb70aaf03e1bd296c8493f
2894 # expanded getattr to be able to get more stat information.
2896 AC_DEFUN([LC_INODEOPS_ENHANCED_GETATTR], [
2897 LB_CHECK_COMPILE([if 'inode_operations' getattr member can gather advance stats],
2899 #include <linux/fs.h>
2903 ((struct inode_operations *)1)->getattr(&path, NULL, 0, 0);
2905 AC_DEFINE(HAVE_INODEOPS_ENHANCED_GETATTR, 1,
2906 [inode_operations .getattr member function can gather advance stats])
2908 ]) # LC_INODEOPS_ENHANCED_GETATTR
2911 # LC_VM_OPERATIONS_REMOVE_VMF_ARG
2913 # Kernel version 4.11 commit 11bac80004499ea59f361ef2a5516c84b6eab675
2914 # removed struct vm_area_struct as an argument for vm_operations since
2915 # in the same kernel version struct vma_area_struct was folded into
2918 AC_DEFUN([LC_VM_OPERATIONS_REMOVE_VMF_ARG], [
2919 LB_CHECK_COMPILE([if 'struct vm_operations' removed struct vm_area_struct],
2920 vm_operations_no_vm_area_struct, [
2921 #include <linux/mm.h>
2923 struct vm_fault vmf;
2925 ((struct vm_operations_struct *)0)->fault(&vmf);
2926 ((struct vm_operations_struct *)0)->page_mkwrite(&vmf);
2928 AC_DEFINE(HAVE_VM_OPS_USE_VM_FAULT_ONLY, 1,
2929 ['struct vm_operations' remove struct vm_area_struct argument])
2931 ]) # LC_VM_OPERATIONS_REMOVE_VMF_ARG
2934 # LC_HAVE_KEY_USAGE_REFCOUNT
2936 # Kernel version 4.11 commit fff292914d3a2f1efd05ca71c2ba72a3c663201e
2937 # converted key.usage from atomic_t to refcount_t.
2939 AC_DEFUN([LC_HAVE_KEY_USAGE_REFCOUNT], [
2940 LB_CHECK_COMPILE([if 'key.usage' is refcount_t],
2941 key_usage_refcount, [
2942 #include <linux/key.h>
2944 struct key key = { };
2946 refcount_read(&key.usage);
2948 AC_DEFINE(HAVE_KEY_USAGE_REFCOUNT, 1, [key.usage is of type refcount_t])
2950 ]) #LC_HAVE_KEY_USAGE_REFCOUNT
2953 # LC_HAVE_CRYPTO_MAX_ALG_NAME_128
2955 # Kernel version 4.11 commit f437a3f477cce402dbec6537b29e9e33962c9f73
2956 # switched CRYPTO_MAX_ALG_NAME from 64 to 128.
2958 AC_DEFUN([LC_HAVE_CRYPTO_MAX_ALG_NAME_128], [
2959 LB_CHECK_COMPILE([if 'CRYPTO_MAX_ALG_NAME' is 128],
2960 crypto_max_alg_name, [
2961 #include <linux/crypto.h>
2963 #if CRYPTO_MAX_ALG_NAME != 128
2967 AC_DEFINE(HAVE_CRYPTO_MAX_ALG_NAME_128, 1,
2968 ['CRYPTO_MAX_ALG_NAME' is 128])
2970 ]) # LC_HAVE_CRYPTO_MAX_ALG_NAME_128
2973 # Kernel version 4.12 commit 47f38c539e9a42344ff5a664942075bd4df93876
2974 # CURRENT_TIME is not 64 bit time safe so it was replaced with
2977 AC_DEFUN([LC_CURRENT_TIME], [
2978 LB_CHECK_COMPILE([if CURRENT_TIME has been replaced with current_time],
2980 #include <linux/fs.h>
2984 attr.ia_atime = current_time(NULL);
2986 AC_DEFINE(HAVE_CURRENT_TIME, 1,
2987 [current_time() has replaced CURRENT_TIME])
2989 ]) # LIBCFS_CURRENT_TIME
2992 # LC_SUPER_SETUP_BDI_NAME
2994 # Kernel version 4.12 commit 9594caf216dc0fe3e318b34af0127276db661241
2995 # unified bdi handling
2997 AC_DEFUN([LC_SUPER_SETUP_BDI_NAME], [
2998 LB_CHECK_COMPILE([if 'super_setup_bdi_name' exist],
2999 super_setup_bdi_name, [
3000 #include <linux/fs.h>
3002 super_setup_bdi_name(NULL, "lustre");
3004 AC_DEFINE(HAVE_SUPER_SETUP_BDI_NAME, 1,
3005 ['super_setup_bdi_name' is available])
3007 ]) # LC_SUPER_SETUP_BDI_NAME
3012 # 4.12 replace bi_error to bi_status
3014 AC_DEFUN([LC_BI_STATUS], [
3015 LB_CHECK_COMPILE([if 'bi_status' exist],
3017 #include <linux/blk_types.h>
3019 ((struct bio *)0)->bi_status = 0;
3021 AC_DEFINE(HAVE_BI_STATUS, 1,
3022 ['bi_status' is available])
3027 # LC_UAPI_LINUX_MOUNT_H
3029 # kernel 4.20 commit e262e32d6bde0f77fb0c95d977482fc872c51996
3030 # vfs: Suppress MS_* flag defs within the kernel ...
3032 AC_DEFUN([LC_UAPI_LINUX_MOUNT_H], [
3033 tmp_flags="$EXTRA_KCFLAGS"
3034 EXTRA_KCFLAGS="-Werror"
3035 LB_CHECK_COMPILE([if MS_RDONLY was moved to uapi/linux/mount.h],
3037 #include <uapi/linux/mount.h>
3042 AC_DEFINE(HAVE_UAPI_LINUX_MOUNT_H, 1,
3043 [if MS_RDONLY was moved to uapi/linux/mount.h])
3045 EXTRA_KCFLAGS="$tmp_flags"
3046 ]) # LC_UAPI_LINUX_MOUNT_H
3049 # LC_BIO_INTEGRITY_ENABLED
3051 # 4.13 removed bio_integrity_enabled
3053 AC_DEFUN([LC_BIO_INTEGRITY_ENABLED], [
3054 LB_CHECK_COMPILE([if 'bio_integrity_enabled' exist],
3055 bio_integrity_enabled, [
3056 #include <linux/bio.h>
3058 bio_integrity_enabled(NULL);
3060 AC_DEFINE(HAVE_BIO_INTEGRITY_ENABLED, 1,
3061 ['bio_integrity_enabled' is available])
3063 ]) # LC_BIO_INTEGRITY_ENABLED
3066 # LC_PAGEVEC_INIT_ONE_PARAM
3068 # 4.14 pagevec_init takes one parameter
3070 AC_DEFUN([LC_PAGEVEC_INIT_ONE_PARAM], [
3071 LB_CHECK_COMPILE([if 'pagevec_init' takes one parameter],
3073 #include <linux/pagevec.h>
3077 AC_DEFINE(HAVE_PAGEVEC_INIT_ONE_PARAM, 1,
3078 ['pagevec_init' takes one parameter])
3080 ]) # LC_PAGEVEC_INIT_ONE_PARAM
3085 # 4.14 replaced bi_bdev to bi_disk
3087 AC_DEFUN([LC_BI_BDEV], [
3088 LB_CHECK_COMPILE([if 'bi_bdev' exist],
3090 #include <linux/bio.h>
3092 ((struct bio *)0)->bi_bdev = NULL;
3094 AC_DEFINE(HAVE_BI_BDEV, 1,
3095 ['bi_bdev' is available])
3102 # kernel 4.17 commit b93b016313b3ba8003c3b8bb71f569af91f19fc7
3104 AC_DEFUN([LC_I_PAGES], [
3105 LB_CHECK_COMPILE([if struct address_space has i_pages],
3107 #include <linux/fs.h>
3109 struct address_space mapping = {};
3112 i_pages = &mapping.i_pages;
3114 AC_DEFINE(HAVE_I_PAGES, 1,
3115 [struct address_space has i_pages])
3122 # kernel 4.17 commit 3d3539018d2cbd12e5af4a132636ee7fd8d43ef0
3123 # mm: create the new vm_fault_t type
3125 AC_DEFUN([LC_VM_FAULT_T], [
3126 LB_CHECK_COMPILE([if vm_fault_t type exists],
3128 #include <linux/mm_types.h>
3130 vm_fault_t x = VM_FAULT_SIGBUS;
3133 AC_DEFINE(HAVE_VM_FAULT_T, 1,
3134 [if vm_fault_t type exists])
3141 # kernel 4.17 commit 3d3539018d2cbd12e5af4a132636ee7fd8d43ef0
3142 # mm: VM_FAULT_RETRY is defined in enum vm_fault_reason
3144 AC_DEFUN([LC_VM_FAULT_RETRY], [
3145 LB_CHECK_COMPILE([if VM_FAULT_RETRY is defined],
3147 #include <linux/mm.h>
3149 #ifndef VM_FAULT_RETRY
3154 AC_DEFINE(HAVE_VM_FAULT_RETRY, 1,
3155 [if VM_FAULT_RETRY is defined])
3157 ]) # LC_VM_FAULT_RETRY
3160 # LC_INODE_TIMESPEC64
3162 # kernel 4.18 commit 95582b00838837fc07e042979320caf917ce3fe6
3163 # inode timestamps switched to timespec64
3165 AC_DEFUN([LC_INODE_TIMESPEC64], [
3166 LB_CHECK_COMPILE([if inode timestamps are struct timespec64],
3168 #include <linux/fs.h>
3170 struct inode inode = {};
3171 struct timespec64 ts = {};
3175 AC_DEFINE(HAVE_INODE_TIMESPEC64, 1,
3176 [inode times are using timespec64])
3178 ]) # LC_INODE_TIMESPEC64
3181 # LC_HAS_LINUX_SELINUX_ENABLED
3183 # kernel 5.1 commit 3d252529480c68bfd6a6774652df7c8968b28e41
3184 # SELinux: Remove unused selinux_is_enabled
3186 AC_DEFUN([LC_HAS_LINUX_SELINUX_ENABLED], [
3187 tmp_flags="$EXTRA_KCFLAGS"
3188 EXTRA_KCFLAGS="-Werror"
3189 LB_CHECK_COMPILE([if linux/selinux.h exists],
3190 selinux_is_enabled, [
3191 #include <linux/selinux.h>
3193 bool has_selinux = selinux_is_enabled();
3196 AC_DEFINE(HAVE_LINUX_SELINUX_IS_ENABLED, 1,
3197 [if linux/selinux.h exists])
3199 EXTRA_KCFLAGS="$tmp_flags"
3200 ]) # LC_HAS_LINUX_SELINUX_ENABLED
3205 # Lustre linux kernel checks
3207 AC_DEFUN([LC_PROG_LINUX], [
3208 AC_MSG_NOTICE([Lustre kernel checks
3209 ==============================================================================])
3214 LC_CONFIG_HEALTH_CHECK_WRITE
3215 LC_CONFIG_LRU_RESIZE
3217 LC_GLIBC_SUPPORT_FHANDLES
3223 LC_BLK_QUEUE_MAX_SEGMENTS
3226 LC_HAVE_XATTR_HANDLER_FLAGS
3229 LC_HAVE_DQUOT_FS_DISK_QUOTA
3230 LC_HAVE_DQUOT_SUSPEND
3231 LC_HAVE_ADD_WAIT_QUEUE_EXCLUSIVE
3235 LC_EXPORT_SIMPLE_SETATTR
3236 LC_EXPORT_TRUNCATE_COMPLETE_PAGE
3240 LC_SBOPS_EVICT_INODE
3244 LC_FS_STRUCT_SEQCOUNT
3247 LC_BLKDEV_GET_BY_DEV
3248 LC_GENERIC_PERMISSION
3256 LC_HAVE_FHANDLE_SYSCALLS
3257 LC_HAVE_FSTYPE_MOUNT
3259 LC_HAVE_INODE_OWNER_OR_CAPABLE
3260 LC_HAVE_SECURITY_IINITSEC
3263 LC_DIRTY_INODE_WITH_FLAG
3267 LC_LM_XXX_LOCK_MANAGER_OPS
3271 LC_INODE_PERMISION_2ARGS
3272 LC_RADIX_EXCEPTION_ENTRY
3273 LC_HAVE_LOOP_CTL_GET_FREE
3276 LC_HAVE_PROTECT_I_NLINK
3279 LC_HAVE_MIGRATE_HEADER
3280 LC_MIGRATEPAGE_4ARGS
3281 LC_SUPEROPS_USE_DENTRY
3282 LC_INODEOPS_USE_UMODE_T
3283 LC_HAVE_CACHE_REGISTER
3287 LC_KMAP_ATOMIC_HAS_1ARG
3291 LC_HAVE_ENCODE_FH_PARENT
3292 LC_FILE_LLSEEK_SIZE_5ARG
3295 LC_DATA_FOR_LLITE_IS_LIST
3296 LC_DENTRY_OPEN_USE_PATH
3297 LC_HAVE_IOP_ATOMIC_OPEN
3298 LC_HAVE_SB_START_WRITE
3301 LC_HAVE_POSIXACL_USER_NS
3304 LC_HAVE_FILE_F_INODE
3306 LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS
3309 LC_HAVE_HLIST_FOR_EACH_3ARG
3310 LC_HAVE_BIO_END_SECTOR
3314 LC_HAVE_REMOVE_PROC_SUBTREE
3316 LC_HAVE_PROJECT_QUOTA
3317 LC_HAVE_SECURITY_DENTRY_INIT_SECURITY
3318 LC_HAVE_SECURITY_INODE_LISTSECURITY
3325 LC_HAVE_DENTRY_D_U_D_ALIAS
3326 LC_HAVE_DENTRY_D_CHILD
3327 LC_PID_NS_FOR_CHILDREN
3330 LC_OLDSIZE_TRUNCATE_PAGECACHE
3331 LC_PTR_ERR_OR_ZERO_MISSING
3333 LC_INIT_LIST_HEAD_RCU
3341 LC_HAVE_TRUNCATE_IPAGES_FINAL
3342 LC_IOPS_RENAME_WITH_FLAGS
3349 LC_DIRECTIO_USE_ITER
3350 LC_HAVE_IOV_ITER_INIT_DIRECTION
3351 LC_HAVE_IOV_ITER_TRUNCATE
3352 LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
3355 LC_HAVE_INTERVAL_BLK_INTEGRITY
3359 LC_PERCPU_COUNTER_INIT
3360 LC_NFS_FILLDIR_USE_CTX
3364 LC_HAVE_DQUOT_QC_DQBLK
3367 LC_BACKING_DEV_INFO_REMOVAL
3368 LC_HAVE_BDI_CAP_MAP_COPY
3371 LC_CANCEL_DIRTY_PAGE
3375 LC_HAVE_SYNC_READ_WRITE
3378 LC_NEW_CANCEL_DIRTY_PAGE
3379 LC_BIO_ENDIO_USES_ONE_ARG
3380 LC_SYMLINK_OPS_USE_NAMEIDATA
3383 LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
3384 LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
3385 LC_HAVE_CACHE_HEAD_HLIST
3386 LC_HAVE_XATTR_HANDLER_SIMPLIFIED
3389 LC_HAVE_LOCKS_LOCK_FILE_WAIT
3390 LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
3391 LC_HAVE_XATTR_HANDLER_NAME
3394 LC_HAVE_SUBMIT_BIO_2ARGS
3395 LC_HAVE_CLEAN_BDEV_ALIASES
3402 LC_HAVE_IOP_GET_LINK
3405 LC_HAVE_IN_COMPAT_SYSCALL
3406 LC_HAVE_XATTR_HANDLER_INODE_PARAM
3410 LC_GENERIC_WRITE_SYNC_2ARGS
3411 LC_FOPS_ITERATE_SHARED
3414 LC_HAVE_POSIX_ACL_VALID_USER_NS
3416 LC_FULL_NAME_HASH_3ARGS
3417 LC_STRUCT_POSIX_ACL_XATTR
3423 LC_POSIX_ACL_UPDATE_MODE
3426 LC_IOP_GENERIC_READLINK
3427 LC_HAVE_VM_FAULT_ADDRESS
3430 LC_INODEOPS_ENHANCED_GETATTR
3431 LC_VM_OPERATIONS_REMOVE_VMF_ARG
3432 LC_HAVE_KEY_USAGE_REFCOUNT
3433 LC_HAVE_CRYPTO_MAX_ALG_NAME_128
3437 LC_SUPER_SETUP_BDI_NAME
3441 LC_BIO_INTEGRITY_ENABLED
3444 LC_PAGEVEC_INIT_ONE_PARAM
3457 LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
3460 LC_HAS_LINUX_SELINUX_ENABLED
3463 LC_UAPI_LINUX_MOUNT_H
3465 # kernel patch to extend integrity interface
3466 LC_BIO_INTEGRITY_PREP_FN
3469 AS_IF([test "x$enable_server" != xno], [
3479 # Check whether to build the client side of Lustre
3481 AC_DEFUN([LC_CONFIG_CLIENT], [
3482 AC_MSG_CHECKING([whether to build Lustre client support])
3483 AC_ARG_ENABLE([client],
3484 AC_HELP_STRING([--disable-client],
3485 [disable Lustre client support]),
3486 [], [enable_client="yes"])
3487 AC_MSG_RESULT([$enable_client])
3488 ]) # LC_CONFIG_CLIENT
3493 AC_DEFUN([LB_CONFIG_MPITESTS], [
3494 AC_ARG_ENABLE([mpitests],
3495 AC_HELP_STRING([--enable-mpitests=<yes|no|mpicc wrapper>],
3496 [include mpi tests]), [
3497 enable_mpitests="yes"
3500 MPICC_WRAPPER="mpicc"
3501 MPI_BIN=$(eval which $MPICC_WRAPPER | xargs dirname)
3504 enable_mpitests="no"
3508 MPICC_WRAPPER=$enableval
3509 MPI_BIN=$(eval echo $MPICC_WRAPPER | xargs dirname)
3513 enable_mpitests="yes"
3514 MPICC_WRAPPER="mpicc"
3515 MPI_BIN=$(eval which $MPICC_WRAPPER | xargs dirname)
3518 if test "x$enable_mpitests" != "xno"; then
3521 AC_CACHE_CHECK([whether mpitests can be built],
3522 lb_cv_mpi_tests, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([
3526 MPI_Initialized(&flag);
3529 ])], [lb_cv_mpi_tests="yes"], [lb_cv_mpi_tests="no"])
3531 enable_mpitests=$lb_cv_mpi_tests
3535 AC_SUBST(MPICC_WRAPPER)
3536 ]) # LB_CONFIG_MPITESTS
3541 # whether to enable quota support global control
3543 AC_DEFUN([LC_CONFIG_QUOTA], [
3544 AC_MSG_CHECKING([whether to enable quota support global control])
3545 AC_ARG_ENABLE([quota],
3546 AC_HELP_STRING([--enable-quota],
3547 [enable quota support]),
3548 [], [enable_quota="yes"])
3549 AS_IF([test "x$enable_quota" = xyes],
3550 [AC_MSG_RESULT([yes])],
3551 [AC_MSG_RESULT([no])])
3552 ]) # LC_CONFIG_QUOTA
3557 AC_DEFUN([LC_QUOTA], [
3561 AS_IF([test "x$enable_quota" != xno -a "x$enable_utils" != xno], [
3562 AC_CHECK_HEADER([sys/quota.h],
3563 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1,
3564 [Define to 1 if you have <sys/quota.h>.])],
3565 [AC_MSG_ERROR([don't find <sys/quota.h> in your system])])
3570 # LC_CONFIG_NODEMAP_PROC_DEBUG
3572 # enable nodemap proc file debugging
3574 AC_DEFUN([LC_NODEMAP_PROC_DEBUG], [
3575 AC_MSG_CHECKING([whether to enable nodemap proc debug])
3576 AC_ARG_ENABLE([nodemap_proc_debug],
3577 AC_HELP_STRING([--enable-nodemap-proc-debug],
3578 [enable nodemap proc debug]),
3579 [], [enable_nodemap_proc_debug="no"])
3580 AC_MSG_RESULT([$enable_nodemap_proc_debug])
3581 AS_IF([test "x$enable_nodemap_proc_debug" != xno],
3582 [AC_DEFINE(NODEMAP_PROC_DEBUG, 1,
3583 [enable nodemap proc debug support])])
3584 ]) # LC_NODEMAP_PROC_DEBUG
3589 # configure support for optional OSD implementation
3591 AC_DEFUN([LC_OSD_ADDON], [
3592 AC_MSG_CHECKING([whether to use OSD addon])
3594 AC_HELP_STRING([--with-osd=path],
3595 [set path to optional osd]),
3602 OSDADDON="$with_osd"
3609 AS_IF([test $ENABLEOSDADDON -eq 0], [
3613 OSDMODNAME=$(basename $OSDADDON)
3614 AS_IF([test -e $LUSTRE/$OSDMODNAME], [
3615 AC_MSG_RESULT([can't link])
3617 ], [ln -s $OSDADDON $LUSTRE/$OSDMODNAME], [
3618 AC_MSG_RESULT([$OSDMODNAME])
3619 OSDADDON="subdir-m += $OSDMODNAME"
3621 AC_MSG_RESULT([can't link])
3631 # other configure checks
3633 AC_DEFUN([LC_CONFIGURE], [
3634 AC_MSG_NOTICE([Lustre core checks
3635 ==============================================================================])
3637 AS_IF([test $target_cpu == "i686" -o $target_cpu == "x86_64"],
3638 [CFLAGS="$CFLAGS -Wall -Werror"])
3640 # maximum MDS thread count
3643 # lustre/utils/gss/gss_util.c
3644 # lustre/utils/gss/gssd_proc.c
3645 # lustre/utils/gss/krb5_util.c
3646 # lustre/utils/llog_reader.c
3647 # lustre/utils/create_iam.c
3648 # lustre/utils/libiam.c
3649 AC_CHECK_HEADERS([netdb.h endian.h])
3650 AC_CHECK_FUNCS([gethostbyname])
3652 # lustre/utils/llverdev.c
3653 AC_CHECK_HEADERS([blkid/blkid.h])
3655 # lustre/utils/llverfs.c
3656 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
3658 # lustre/utils/lfs.c
3659 AS_IF([test "$enable_dist" = "no"], [
3660 AC_CHECK_LIB([z], [crc32], [
3661 AC_CHECK_HEADER([zlib.h], [], [
3662 AC_MSG_ERROR([zlib.h not found.])])
3665 zlib library not found. Please install zlib development package.])
3670 AC_CHECK_LIB([selinux], [is_selinux_enabled],
3671 [AC_CHECK_HEADERS([selinux/selinux.h],
3672 [SELINUX="-lselinux"
3673 AC_DEFINE([HAVE_SELINUX], 1,
3674 [support for selinux ])],
3677 No libselinux-devel package found, unable to build selinux enabled tools
3682 No selinux package found, unable to build selinux enabled tools
3688 AC_MSG_CHECKING([whether to report minimum OST free space])
3689 AC_ARG_ENABLE([mindf],
3690 AC_HELP_STRING([--enable-mindf],
3691 [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
3692 [], [enable_mindf="no"])
3693 AC_MSG_RESULT([$enable_mindf])
3694 AS_IF([test "$enable_mindf" = "yes"],
3695 [AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])])
3697 AC_MSG_CHECKING([whether to randomly failing memory alloc])
3698 AC_ARG_ENABLE([fail_alloc],
3699 AC_HELP_STRING([--disable-fail-alloc],
3700 [disable randomly alloc failure]),
3701 [], [enable_fail_alloc="yes"])
3702 AC_MSG_RESULT([$enable_fail_alloc])
3703 AS_IF([test "x$enable_fail_alloc" != xno],
3704 [AC_DEFINE([RANDOM_FAIL_ALLOC], 1,
3705 [enable randomly alloc failure])])
3707 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
3708 AC_ARG_ENABLE([invariants],
3709 AC_HELP_STRING([--enable-invariants],
3710 [enable invariant checking (cpu intensive)]),
3711 [], [enable_invariants="no"])
3712 AC_MSG_RESULT([$enable_invariants])
3713 AS_IF([test "x$enable_invariants" = xyes],
3714 [AC_DEFINE([CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK], 1,
3715 [enable invariant checking])])
3717 AC_MSG_CHECKING([whether to track references with lu_ref])
3718 AC_ARG_ENABLE([lu_ref],
3719 AC_HELP_STRING([--enable-lu_ref],
3720 [enable lu_ref reference tracking code]),
3721 [], [enable_lu_ref="no"])
3722 AC_MSG_RESULT([$enable_lu_ref])
3723 AS_IF([test "x$enable_lu_ref" = xyes],
3724 [AC_DEFINE([USE_LU_REF], 1,
3725 [enable lu_ref reference tracking code])])
3727 AC_MSG_CHECKING([whether to enable page state tracking])
3728 AC_ARG_ENABLE([pgstate-track],
3729 AC_HELP_STRING([--enable-pgstate-track],
3730 [enable page state tracking]),
3731 [], [enable_pgstat_track="no"])
3732 AC_MSG_RESULT([$enable_pgstat_track])
3733 AS_IF([test "x$enable_pgstat_track" = xyes],
3734 [AC_DEFINE([CONFIG_DEBUG_PAGESTATE_TRACKING], 1,
3735 [enable page state tracking code])])
3738 AC_MSG_CHECKING([systemd unit file directory])
3739 AC_ARG_WITH([systemdsystemunitdir],
3740 [AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
3741 [Directory for systemd service files])],
3742 [], [with_systemdsystemunitdir=auto])
3743 AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"],
3744 [def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
3745 AS_IF([test "x$def_systemdsystemunitdir" = "x"],
3746 [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
3747 [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
3748 with_systemdsystemunitdir=no],
3749 [with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
3750 AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
3751 [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
3752 AC_MSG_RESULT([$with_systemdsystemunitdir])
3754 AC_MSG_CHECKING([bash-completion directory])
3755 AC_ARG_WITH([bash-completion-dir],
3756 AS_HELP_STRING([--with-bash-completion-dir[=PATH]],
3757 [Install the bash auto-completion script in this directory.]),
3759 [with_bash_completion_dir=yes])
3760 AS_IF([test "x$with_bash_completion_dir" = "xyes"], [
3761 BASH_COMPLETION_DIR="`pkg-config --variable=completionsdir bash-completion`"
3762 AS_IF([test "x$BASH_COMPLETION_DIR" = "x"], [
3763 [BASH_COMPLETION_DIR="/usr/share/bash-completion/completions"]
3766 BASH_COMPLETION_DIR="$with_bash_completion_dir"
3768 AC_SUBST([BASH_COMPLETION_DIR])
3769 AC_MSG_RESULT([$BASH_COMPLETION_DIR])
3775 # AM_CONDITIONALS for lustre
3777 AC_DEFUN([LC_CONDITIONALS], [
3778 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
3779 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
3780 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
3781 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
3782 AM_CONDITIONAL(BLKID, test x$ac_cv_header_blkid_blkid_h = xyes)
3783 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
3784 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
3785 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
3786 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
3787 AM_CONDITIONAL(GSS_SSK, test x$enable_ssk = xyes)
3788 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
3789 AM_CONDITIONAL(HAVE_SYSTEMD, test "x$with_systemdsystemunitdir" != "xno")
3790 AM_CONDITIONAL(ENABLE_BASH_COMPLETION, test "x$with_bash_completion_dir" != "xno")
3791 AM_CONDITIONAL(XATTR_HANDLER, test "x$lb_cv_compile_xattr_handler_flags" = xyes)
3792 AM_CONDITIONAL(SELINUX, test "$SELINUX" = "-lselinux")
3793 AM_CONDITIONAL(GETSEPOL, test x$enable_getsepol = xyes)
3794 ]) # LC_CONDITIONALS
3799 # files that should be generated with AC_OUTPUT
3801 AC_DEFUN([LC_CONFIG_FILES],
3805 lustre/autoconf/Makefile
3806 lustre/conf/Makefile
3807 lustre/conf/resource/Makefile
3808 lustre/contrib/Makefile
3810 lustre/include/Makefile
3811 lustre/include/lustre/Makefile
3812 lustre/include/uapi/linux/lustre/Makefile
3813 lustre/kernel_patches/targets/4.18-rhel8.4.target
3814 lustre/kernel_patches/targets/4.18-rhel8.3.target
3815 lustre/kernel_patches/targets/4.18-rhel8.2.target
3816 lustre/kernel_patches/targets/4.18-rhel8.1.target
3817 lustre/kernel_patches/targets/4.18-rhel8.target
3818 lustre/kernel_patches/targets/3.10-rhel7.9.target
3819 lustre/kernel_patches/targets/3.10-rhel7.8.target
3820 lustre/kernel_patches/targets/3.10-rhel7.7.target
3821 lustre/kernel_patches/targets/3.10-rhel7.6.target
3822 lustre/kernel_patches/targets/3.10-rhel7.5.target
3823 lustre/kernel_patches/targets/4.14-rhel7.5.target
3824 lustre/kernel_patches/targets/4.14-rhel7.6.target
3825 lustre/kernel_patches/targets/2.6-rhel6.9.target
3826 lustre/kernel_patches/targets/2.6-rhel6.8.target
3827 lustre/kernel_patches/targets/2.6-rhel6.7.target
3828 lustre/kernel_patches/targets/2.6-rhel6.6.target
3829 lustre/kernel_patches/targets/2.6-rhel6.target
3830 lustre/kernel_patches/targets/2.6-rhel5.target
3831 lustre/kernel_patches/targets/2.6-sles11.target
3832 lustre/kernel_patches/targets/3.0-sles11.target
3833 lustre/kernel_patches/targets/3.0-sles11sp3.target
3834 lustre/kernel_patches/targets/3.0-sles11sp4.target
3835 lustre/kernel_patches/targets/3.12-sles12.target
3836 lustre/kernel_patches/targets/4.4-sles12.target
3837 lustre/kernel_patches/targets/4.4-sles12sp3.target
3838 lustre/kernel_patches/targets/4.12-sles12sp4.target
3839 lustre/kernel_patches/targets/4.12-sles12sp5.target
3840 lustre/kernel_patches/targets/2.6-fc11.target
3841 lustre/kernel_patches/targets/2.6-fc12.target
3842 lustre/kernel_patches/targets/2.6-fc15.target
3843 lustre/kernel_patches/targets/3.x-fc18.target
3844 lustre/ldlm/Makefile
3846 lustre/fid/autoMakefile
3847 lustre/llite/Makefile
3848 lustre/llite/autoMakefile
3850 lustre/lov/autoMakefile
3852 lustre/mdc/autoMakefile
3854 lustre/lmv/autoMakefile
3855 lustre/lfsck/Makefile
3856 lustre/lfsck/autoMakefile
3858 lustre/mdt/autoMakefile
3860 lustre/mdd/autoMakefile
3862 lustre/fld/autoMakefile
3863 lustre/obdclass/Makefile
3864 lustre/obdclass/autoMakefile
3865 lustre/obdecho/Makefile
3866 lustre/obdecho/autoMakefile
3868 lustre/ofd/autoMakefile
3870 lustre/osc/autoMakefile
3872 lustre/ost/autoMakefile
3873 lustre/osd-ldiskfs/Makefile
3874 lustre/osd-ldiskfs/autoMakefile
3875 lustre/osd-zfs/Makefile
3876 lustre/osd-zfs/autoMakefile
3878 lustre/mgc/autoMakefile
3880 lustre/mgs/autoMakefile
3881 lustre/target/Makefile
3882 lustre/ptlrpc/Makefile
3883 lustre/ptlrpc/autoMakefile
3884 lustre/ptlrpc/gss/Makefile
3885 lustre/ptlrpc/gss/autoMakefile
3886 lustre/quota/Makefile
3887 lustre/quota/autoMakefile
3888 lustre/scripts/Makefile
3889 lustre/scripts/systemd/Makefile
3890 lustre/tests/Makefile
3891 lustre/tests/mpi/Makefile
3892 lustre/tests/kernel/Makefile
3893 lustre/tests/kernel/autoMakefile
3894 lustre/utils/Makefile
3895 lustre/utils/gss/Makefile
3897 lustre/osp/autoMakefile
3899 lustre/lod/autoMakefile
3901 ]) # LC_CONFIG_FILES