4 # Wrapper for AC_CONFIG_SUBDIR
6 AC_DEFUN([LC_CONFIG_SRCDIR], [
7 AC_CONFIG_SRCDIR([lustre/obdclass/obdo.c])
15 # lustre specific paths
17 AC_DEFUN([LC_PATH_DEFAULTS], [
18 # ptlrpc kernel build requires this
26 demodir='$(docdir)/demo'
29 pkgexampledir='${pkgdatadir}/examples'
30 AC_SUBST(pkgexampledir)
36 # is the target os supported?
38 AC_DEFUN([LC_TARGET_SUPPORTED], [
47 ]) # LC_TARGET_SUPPORTED
50 # LC_GLIBC_SUPPORT_FHANDLES
52 AC_DEFUN([LC_GLIBC_SUPPORT_FHANDLES], [
53 AC_CHECK_FUNCS([name_to_handle_at],
54 [AC_DEFINE(HAVE_FHANDLE_GLIBC_SUPPORT, 1,
55 [file handle and related syscalls are supported])],
56 [AC_MSG_WARN([file handle and related syscalls are not supported])])
57 ]) # LC_GLIBC_SUPPORT_FHANDLES
62 # Ensure the stack size is at least 8k in Lustre server (all kernels)
64 AC_DEFUN([LC_STACK_SIZE], [
65 LB_CHECK_COMPILE([if stack size is at least 8k],
67 #include <linux/thread_info.h>
69 #if THREAD_SIZE < 8192
70 #error "stack size < 8192"
72 ], [], [AC_MSG_ERROR([
74 Lustre requires that Linux is configured with at least a 8KB stack.
81 # Allow the user to set the MDS thread upper limit
83 AC_DEFUN([LC_MDS_MAX_THREADS], [
84 AC_MSG_CHECKING([for maximum number of MDS threads])
85 AC_ARG_WITH([mds_max_threads],
86 AC_HELP_STRING([--with-mds-max-threads=count],
87 [maximum threads available on the MDS: (default=512)]),
88 [AC_DEFINE_UNQUOTED(MDS_MAX_THREADS, $with_mds_max_threads,
89 [maximum number of MDS threads])])
90 AC_MSG_RESULT([$with_mds_max_threads])
91 ]) # LC_MDS_MAX_THREADS
96 # the pinger is temporary, until we have the recovery node in place
98 AC_DEFUN([LC_CONFIG_PINGER], [
99 AC_MSG_CHECKING([whether to enable Lustre pinger support])
100 AC_ARG_ENABLE([pinger],
101 AC_HELP_STRING([--disable-pinger],
102 [disable recovery pinger support]),
103 [], [enable_pinger="yes"])
104 AC_MSG_RESULT([$enable_pinger])
105 AS_IF([test "x$enable_pinger" != xno],
106 [AC_DEFINE(ENABLE_PINGER, 1,[Use the Pinger])])
107 ]) # LC_CONFIG_PINGER
112 # do checksum of bulk data between client and OST
114 AC_DEFUN([LC_CONFIG_CHECKSUM], [
115 AC_MSG_CHECKING([whether to enable data checksum support])
116 AC_ARG_ENABLE([checksum],
117 AC_HELP_STRING([--disable-checksum],
118 [disable data checksum support]),
119 [], [enable_checksum="yes"])
120 AC_MSG_RESULT([$enable_checksum])
121 AS_IF([test "x$enable_checksum" != xno],
122 [AC_DEFINE(ENABLE_CHECKSUM, 1, [do data checksums])])
123 ]) # LC_CONFIG_CHECKSUM
128 # enable distributed flock by default
130 AC_DEFUN([LC_CONFIG_FLOCK], [
131 AC_MSG_CHECKING([whether to enable flock by default])
132 AC_ARG_ENABLE([flock],
133 AC_HELP_STRING([--disable-flock],
134 [disable flock by default]),
135 [], [enable_flock="yes"])
136 AC_MSG_RESULT([$enable_flock])
137 AS_IF([test "x$enable_flock" != xno],
138 [AC_DEFINE(ENABLE_FLOCK, 1, [enable flock by default])])
142 # LC_CONFIG_HEALTH_CHECK_WRITE
144 # Turn off the actual write to the disk
146 AC_DEFUN([LC_CONFIG_HEALTH_CHECK_WRITE], [
147 AC_MSG_CHECKING([whether to enable a write with the health check])
148 AC_ARG_ENABLE([health_write],
149 AC_HELP_STRING([--enable-health_write],
150 [enable disk writes when doing health check]),
151 [], [enable_health_write="no"])
152 AC_MSG_RESULT([$enable_health_write])
153 AS_IF([test "x$enable_health_write" != xno],
154 [AC_DEFINE(USE_HEALTH_CHECK_WRITE, 1, [Write when Checking Health])])
155 ]) # LC_CONFIG_HEALTH_CHECK_WRITE
158 # LC_CONFIG_LRU_RESIZE
160 AC_DEFUN([LC_CONFIG_LRU_RESIZE], [
161 AC_MSG_CHECKING([whether to enable lru self-adjusting])
162 AC_ARG_ENABLE([lru_resize],
163 AC_HELP_STRING([--enable-lru-resize],
164 [enable lru resize support]),
165 [], [enable_lru_resize="yes"])
166 AC_MSG_RESULT([$enable_lru_resize])
167 AS_IF([test "x$enable_lru_resize" != xno],
168 [AC_DEFINE(HAVE_LRU_RESIZE_SUPPORT, 1, [Enable lru resize support])])
169 ]) # LC_CONFIG_LRU_RESIZE
174 # Quota support. The kernel must support CONFIG_QUOTA.
176 AC_DEFUN([LC_QUOTA_CONFIG], [
177 LB_CHECK_CONFIG_IM([QUOTA], [],
180 Lustre quota requires that CONFIG_QUOTA is enabled in your kernel.
185 # LC_EXPORT_TRUNCATE_COMPLETE_PAGE
187 # truncate_complete_page() has never been exported from an upstream kernel
188 # remove_from_page_cache() was exported between 2.6.35 and 2.6.38
189 # delete_from_page_cache() is exported from 2.6.39
191 AC_DEFUN([LC_EXPORT_TRUNCATE_COMPLETE_PAGE], [
192 LB_CHECK_EXPORT([truncate_complete_page], [mm/truncate.c],
193 [AC_DEFINE(HAVE_TRUNCATE_COMPLETE_PAGE, 1,
194 [kernel export truncate_complete_page])])
195 LB_CHECK_EXPORT([remove_from_page_cache], [mm/filemap.c],
196 [AC_DEFINE(HAVE_REMOVE_FROM_PAGE_CACHE, 1,
197 [kernel export remove_from_page_cache])])
198 LB_CHECK_EXPORT([delete_from_page_cache], [mm/filemap.c],
199 [AC_DEFINE(HAVE_DELETE_FROM_PAGE_CACHE, 1,
200 [kernel export delete_from_page_cache])])
201 ]) # LC_EXPORT_TRUNCATE_COMPLETE_PAGE
204 # LC_CONFIG_GSS_KEYRING
206 # default 'auto', tests for dependencies, if found, enables;
207 # only called if gss is enabled
209 AC_DEFUN([LC_CONFIG_GSS_KEYRING], [
210 AC_MSG_CHECKING([whether to enable gss keyring backend])
211 AC_ARG_ENABLE([gss_keyring],
212 [AC_HELP_STRING([--disable-gss-keyring],
213 [disable gss keyring backend])],
214 [], [enable_gss_keyring="auto"])
215 AC_MSG_RESULT([$enable_gss_keyring])
216 AS_IF([test "x$enable_gss_keyring" != xno], [
217 LB_CHECK_CONFIG_IM([KEYS], [], [
218 gss_keyring_conf_test="fail"
219 AC_MSG_WARN([GSS keyring backend requires that CONFIG_KEYS be enabled in your kernel.])])
221 AC_CHECK_LIB([keyutils], [keyctl_search], [], [
222 gss_keyring_conf_test="fail"
223 AC_MSG_WARN([GSS keyring backend requires libkeyutils])])
225 AS_IF([test "x$gss_keyring_conf_test" != xfail], [
226 AC_DEFINE([HAVE_GSS_KEYRING], [1],
227 [Define this if you enable gss keyring backend])
228 enable_gss_keyring="yes"
230 AS_IF([test "x$enable_gss_keyring" = xyes], [
231 AC_MSG_ERROR([Cannot enable gss_keyring. See above for details.])
235 ]) # LC_CONFIG_GSS_KEYRING
238 # LC_HAVE_CRED_TGCRED
240 # rhel7 struct cred has no member tgcred
242 AC_DEFUN([LC_HAVE_CRED_TGCRED], [
243 LB_CHECK_COMPILE([if 'struct cred' has member 'tgcred'],
245 #include <linux/cred.h>
247 ((struct cred *)0)->tgcred = NULL;
249 AC_DEFINE(HAVE_CRED_TGCRED, 1,
250 [struct cred has member tgcred])
252 ]) # LC_HAVE_CRED_TGCRED
255 # LC_KEY_TYPE_INSTANTIATE_2ARGS
257 # rhel7 key_type->instantiate takes 2 args (struct key, struct key_preparsed_payload)
259 AC_DEFUN([LC_KEY_TYPE_INSTANTIATE_2ARGS], [
260 LB_CHECK_COMPILE([if 'key_type->instantiate' has two args],
261 key_type_instantiate_2args, [
262 #include <linux/key-type.h>
264 ((struct key_type *)0)->instantiate(0, NULL);
266 AC_DEFINE(HAVE_KEY_TYPE_INSTANTIATE_2ARGS, 1,
267 [key_type->instantiate has two args])
269 ]) # LC_KEY_TYPE_INSTANTIATE_2ARGS
274 AC_DEFUN([LC_CONFIG_SUNRPC], [
275 LB_CHECK_CONFIG_IM([SUNRPC], [], [
276 AS_IF([test "x$sunrpc_required" = xyes], [
279 kernel SUNRPC support is required by using GSS.
282 ]) # LC_CONFIG_SUNRPC
285 # LC_CONFIG_GSS (default 'auto' (tests for dependencies, if found, enables))
287 # Build gss and related tools of Lustre. Currently both kernel and user space
288 # parts are depend on linux platform.
290 AC_DEFUN([LC_CONFIG_GSS], [
291 AC_MSG_CHECKING([whether to enable gss support])
293 [AC_HELP_STRING([--enable-gss], [enable gss support])],
294 [], [enable_gss="auto"])
295 AC_MSG_RESULT([$enable_gss])
297 AS_IF([test "x$enable_gss" != xno], [
298 LC_CONFIG_GSS_KEYRING
300 LC_KEY_TYPE_INSTANTIATE_2ARGS
301 sunrpc_required=$enable_gss
305 LB_CHECK_CONFIG_IM([CRYPTO_MD5], [],
306 [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
307 LB_CHECK_CONFIG_IM([CRYPTO_SHA1], [],
308 [AC_MSG_WARN([kernel SHA1 support is recommended by using GSS.])])
309 LB_CHECK_CONFIG_IM([CRYPTO_SHA256], [],
310 [AC_MSG_WARN([kernel SHA256 support is recommended by using GSS.])])
311 LB_CHECK_CONFIG_IM([CRYPTO_SHA512], [],
312 [AC_MSG_WARN([kernel SHA512 support is recommended by using GSS.])])
314 require_krb5=$enable_gss
318 AS_IF([test -n "$KRBDIR"], [
319 gss_conf_test="success"
321 gss_conf_test="failure"
324 AS_IF([test "x$gss_conf_test" = xsuccess && test "x$enable_gss" != xno], [
325 AC_DEFINE([HAVE_GSS], [1], [Define this is if you enable gss])
328 enable_gss_keyring="no"
332 enable_ssk=$enable_gss
334 enable_gss_keyring="no"
340 # OpenSSL 1.0+ return int for HMAC functions but older SLES11 versions do not
341 AC_DEFUN([LC_OPENSSL_SSK], [
342 AC_MSG_CHECKING([whether OpenSSL has functions needed for SSK])
343 AS_IF([test "x$enable_ssk" != xno], [
344 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
345 #include <openssl/hmac.h>
346 #include <openssl/evp.h>
350 rc = HMAC_Init_ex(NULL, "test", 4, EVP_md_null(), NULL);
352 ])],[AC_DEFINE(HAVE_OPENSSL_SSK, 1,
353 [OpenSSL HMAC functions needed for SSK])],
356 AC_MSG_RESULT([$enable_ssk])
359 # LC_INODE_PERMISION_2ARGS
361 # up to v2.6.27 had a 3 arg version (inode, mask, nameidata)
362 # v2.6.27->v2.6.37 had a 2 arg version (inode, mask)
363 # v2.6.37->v3.0 had a 3 arg version (inode, mask, nameidata)
364 # v3.1 onward have a 2 arg version (inode, mask)
366 AC_DEFUN([LC_INODE_PERMISION_2ARGS], [
367 LB_CHECK_COMPILE([if 'inode_operations->permission' has two args],
368 inode_ops_permission_2args, [
369 #include <linux/fs.h>
371 struct inode *inode __attribute__ ((unused));
374 inode->i_op->permission(NULL, 0);
376 AC_DEFINE(HAVE_INODE_PERMISION_2ARGS, 1,
377 [inode_operations->permission has two args])
379 ]) # LC_INODE_PERMISION_2ARGS
382 # LC_BLK_QUEUE_MAX_SEGMENTS
384 # 2.6.32 replaces 2 functions blk_queue_max_phys_segments and blk_queue_max_hw_segments by blk_queue_max_segments
386 AC_DEFUN([LC_BLK_QUEUE_MAX_SEGMENTS], [
387 LB_CHECK_COMPILE([if 'blk_queue_max_segments' is defined],
388 blk_queue_max_segments, [
389 #include <linux/blkdev.h>
391 blk_queue_max_segments(NULL, 0);
393 AC_DEFINE(HAVE_BLK_QUEUE_MAX_SEGMENTS, 1,
394 [blk_queue_max_segments is defined])
396 ]) # LC_BLK_QUEUE_MAX_SEGMENTS
399 # LC_HAVE_XATTR_HANDLER_FLAGS
401 # 2.6.33 added a private flag to xattr_handler
403 AC_DEFUN([LC_HAVE_XATTR_HANDLER_FLAGS], [
404 LB_CHECK_COMPILE([if 'struct xattr_handler' has flags field],
405 xattr_handler_flags, [
406 #include <linux/xattr.h>
408 struct xattr_handler handler;
412 AC_DEFINE(HAVE_XATTR_HANDLER_FLAGS, 1, [flags field exist])
414 ]) # LC_HAVE_XATTR_HANDLER_FLAGS
417 # LC_HAVE_DQUOT_FS_DISK_QUOTA
419 # 2.6.34 has quotactl_ops->[sg]et_dqblk that take struct fs_disk_quota
421 AC_DEFUN([LC_HAVE_DQUOT_FS_DISK_QUOTA], [
422 tmp_flags="$EXTRA_KCFLAGS"
423 EXTRA_KCFLAGS="-Werror"
424 LB_CHECK_COMPILE([if 'quotactl_ops.set_dqblk' takes struct fs_disk_quota],
426 #include <linux/fs.h>
427 #include <linux/quota.h>
429 ((struct quotactl_ops *)0)->set_dqblk(NULL, 0, 0, (struct fs_disk_quota*)0);
431 AC_DEFINE(HAVE_DQUOT_FS_DISK_QUOTA, 1,
432 [quotactl_ops.set_dqblk takes struct fs_disk_quota])
434 LB_CHECK_COMPILE([if 'quotactl_ops.set_dqblk' takes struct kqid & fs_disk_quota],
435 kqid_fs_disk_quota, [
436 #include <linux/fs.h>
437 #include <linux/quota.h>
439 ((struct quotactl_ops *)0)->set_dqblk((struct super_block*)0, *((struct kqid*)0), (struct fs_disk_quota*)0);
441 AC_DEFINE(HAVE_DQUOT_FS_DISK_QUOTA, 1,
442 [quotactl_ops.set_dqblk takes struct fs_disk_quota])
443 AC_DEFINE(HAVE_DQUOT_KQID, 1,
444 [quotactl_ops.set_dqblk takes struct kqid])
447 EXTRA_KCFLAGS="$tmp_flags"
448 ]) # LC_HAVE_DQUOT_FS_DISK_QUOTA
451 # LC_HAVE_DQUOT_SUSPEND
453 # 2.6.34 has renamed dquot options to dquot_*, check for dquot_suspend
455 AC_DEFUN([LC_HAVE_DQUOT_SUSPEND], [
456 LB_CHECK_COMPILE([if 'dquot_suspend' is defined],
458 #include <linux/quotaops.h>
460 dquot_suspend(NULL, -1);
462 AC_DEFINE(HAVE_DQUOT_SUSPEND, 1, [dquot_suspend is defined])
464 ]) # LC_HAVE_DQUOT_SUSPEND
469 # Check if kernel has been patched for 64-bit quota limits support.
470 # The upstream version of this patch in RHEL6 2.6.32 kernels introduces
471 # the constant QFMT_VFS_V1 in include/linux/quota.h, so we can check for
472 # that in the absence of quotaio_v1.h in the kernel headers.
474 AC_DEFUN([LC_QUOTA64], [
475 tmp_flags="$EXTRA_KCFLAGS"
476 EXTRA_KCFLAGS="-I$LINUX/fs"
477 LB_CHECK_COMPILE([if kernel has 64-bit quota limits support],
479 #include <linux/kernel.h>
480 #include <linux/fs.h>
481 #if defined(HAVE_FS_QUOTA_QUOTAIO_H)
482 #include <quota/quotaio_v2.h>
483 struct v2r1_disk_dqblk dqblk_r1;
485 #include <linux/quota.h>
486 int ver = QFMT_VFS_V1;
489 AC_DEFINE(HAVE_QUOTA64, 1, [have quota64])
491 LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],
492 [AC_MSG_ERROR([You have got no 64-bit kernel quota support.])])
494 EXTRA_KCFLAGS=$tmp_flags
498 # LC_HAVE_ADD_WAIT_QUEUE_EXCLUSIVE
500 # 2.6.34 adds __add_wait_queue_exclusive
502 AC_DEFUN([LC_HAVE_ADD_WAIT_QUEUE_EXCLUSIVE], [
503 LB_CHECK_COMPILE([if '__add_wait_queue_exclusive' exists],
504 __add_wait_queue_exclusive, [
505 #include <linux/wait.h>
507 wait_queue_head_t queue = { };
508 wait_queue_t wait = { };
510 __add_wait_queue_exclusive(&queue, &wait);
512 AC_DEFINE(HAVE___ADD_WAIT_QUEUE_EXCLUSIVE, 1,
513 [__add_wait_queue_exclusive exists])
515 ]) # LC_HAVE_ADD_WAIT_QUEUE_EXCLUSIVE
518 # LC_FS_STRUCT_RWLOCK
520 # 2.6.36 fs_struct.lock use spinlock instead of rwlock.
522 AC_DEFUN([LC_FS_STRUCT_RWLOCK], [
523 LB_CHECK_COMPILE([if 'fs_struct.lock' use rwlock],
525 #include <asm/atomic.h>
526 #include <linux/spinlock.h>
527 #include <linux/fs_struct.h>
529 struct fs_struct fss = { };
534 AC_DEFINE(HAVE_FS_STRUCT_RWLOCK, 1, [fs_struct.lock use rwlock])
536 ]) # LC_FS_STRUCT_RWLOCK
539 # LC_SBOPS_EVICT_INODE
541 # 2.6.36 super_operations add evict_inode method. it hybird of
542 # delete_inode & clear_inode.
544 AC_DEFUN([LC_SBOPS_EVICT_INODE], [
545 LB_CHECK_COMPILE([if 'super_operations.evict_inode' exist],
546 super_ops_evict_inode, [
547 #include <linux/fs.h>
549 ((struct super_operations *)0)->evict_inode(NULL);
551 AC_DEFINE(HAVE_SBOPS_EVICT_INODE, 1,
552 [super_operations.evict_inode() is exist in kernel])
554 ]) # LC_SBOPS_EVICT_INODE
559 # 2.6.35 file_operations.fsync taken 2 arguments.
560 # 3.0.0 file_operations.fsync takes 4 arguments.
562 AC_DEFUN([LC_FILE_FSYNC], [
563 LB_CHECK_COMPILE([if 'file_operations.fsync' takes 4 arguments],
564 file_ops_fsync_4args, [
565 #include <linux/fs.h>
567 ((struct file_operations *)0)->fsync(NULL, 0, 0, 0);
569 AC_DEFINE(HAVE_FILE_FSYNC_4ARGS, 1,
570 [file_operations.fsync takes 4 arguments])
572 LB_CHECK_COMPILE([if 'file_operations.fsync' takes 2 arguments],
573 file_ops_fsync_2args, [
574 #include <linux/fs.h>
576 ((struct file_operations *)0)->fsync(NULL, 0);
578 AC_DEFINE(HAVE_FILE_FSYNC_2ARGS, 1,
579 [file_operations.fsync takes 2 arguments])
587 # 2.6.37 remove kernel_locked
589 AC_DEFUN([LC_KERNEL_LOCKED], [
590 LB_CHECK_COMPILE([if 'kernel_locked' is defined],
592 #include <linux/smp_lock.h>
596 AC_DEFINE(HAVE_KERNEL_LOCKED, 1, [kernel_locked is defined])
598 ]) # LC_KERNEL_LOCKED
601 # LC_FS_STRUCT_SEQCOUNT
603 # 2.6.37 uses seqlock in fs_struct
605 AC_DEFUN([LC_FS_STRUCT_SEQCOUNT], [
606 LB_CHECK_COMPILE([if fs_struct use seqcount],
607 fs_struct_seqcount, [
608 #include <linux/fs_struct.h>
610 ((struct fs_struct *)0)->seq = (struct seqcount){ 0 };
612 AC_DEFINE(HAVE_FS_STRUCT_SEQCOUNT, 1, [fs_struct use seqcount])
614 ]) # LC_FS_STRUCT_SEQCOUNT
619 # 2.6.38 dentry_operations.d_compare() taken 7 arguments.
621 AC_DEFUN([LC_D_COMPARE_7ARGS], [
622 LB_CHECK_COMPILE([if 'dentry_operations.d_compare()' taken 7 arguments],
623 dentry_ops_d_compare_7arg, [
624 #include <linux/dcache.h>
626 ((struct dentry_operations*)0)->d_compare(NULL,NULL,NULL,NULL,0,NULL,NULL);
628 AC_DEFINE(HAVE_D_COMPARE_7ARGS, 1, [d_compare need 7 arguments])
630 ]) # LC_D_COMPARE_7ARGS
635 # 2.6.38 dentry_operations.d_delete() defined 'const' for 1st parameter.
637 AC_DEFUN([LC_D_DELETE_CONST], [
638 tmp_flags="$EXTRA_KCFLAGS"
639 EXTRA_KCFLAGS="-Werror"
640 LB_CHECK_COMPILE([if 'dentry_operations.d_delete()' has const declare on first parameter],
641 dentry_ops_d_delete_1st_const, [
642 #include <linux/dcache.h>
644 const struct dentry *d = NULL;
645 ((struct dentry_operations*)0)->d_delete(d);
647 AC_DEFINE(HAVE_D_DELETE_CONST, const,
648 [d_delete first parameter declared const])
650 AC_DEFINE(HAVE_D_DELETE_CONST, [],
651 [d_delete first parameter declared is not const])
653 EXTRA_KCFLAGS="$tmp_flags"
654 ]) # LC_D_DELETE_CONST
659 # 2.6.38 dcache_lock removed. rcu-walk committed.
661 AC_DEFUN([LC_DCACHE_LOCK], [
662 LB_CHECK_COMPILE([if 'dcache_lock' is exist],
664 #include <linux/dcache.h>
666 spin_lock(&dcache_lock);
668 AC_DEFINE(HAVE_DCACHE_LOCK, 1,
669 [dcache_lock is exist])
676 # 2.6.38 inode.i_rcu added.
678 AC_DEFUN([LC_INODE_I_RCU], [
679 LB_CHECK_COMPILE([if 'inode.i_rcu' exists],
681 #include <linux/fs.h>
684 struct rcu_head rcu = {};
687 AC_DEFINE(HAVE_INODE_I_RCU, 1,
688 [inode.i_rcu exists])
693 # LC_BLKDEV_GET_BY_DEV
695 # 2.6.38 export blkdev_get_by_dev
697 AC_DEFUN([LC_BLKDEV_GET_BY_DEV], [
698 LB_CHECK_EXPORT([blkdev_get_by_dev], [fs/block_dev.c],
699 [AC_DEFINE(HAVE_BLKDEV_GET_BY_DEV, 1,
700 [blkdev_get_by_dev is exported by the kernel])])
701 ]) # LC_BLKDEV_GET_BY_DEV
704 # LC_EXPORT_SIMPLE_SETATTR
706 # 2.6.38 export simple_setattr
708 AC_DEFUN([LC_EXPORT_SIMPLE_SETATTR], [
709 LB_CHECK_EXPORT([simple_setattr], [fs/libfs.c],
710 [AC_DEFINE(HAVE_SIMPLE_SETATTR, 1,
711 [simple_setattr is exported by the kernel])])
712 ]) # LC_EXPORT_SIMPLE_SETATTR
717 # 2.6.38 add struct blk_plug
719 AC_DEFUN([LC_HAVE_BLK_PLUG], [
720 LB_CHECK_COMPILE([if 'struct blk_plug' exists],
722 #include <linux/blkdev.h>
724 struct blk_plug plug;
726 blk_start_plug(&plug);
727 blk_finish_plug(&plug);
729 AC_DEFINE(HAVE_BLK_PLUG, 1,
730 [blk_plug struct exists])
732 ]) # LC_HAVE_BLK_PLUG
735 # LC_HAVE_FSTYPE_MOUNT
737 # 2.6.39 replace get_sb with mount in struct file_system_type
739 AC_DEFUN([LC_HAVE_FSTYPE_MOUNT], [
740 LB_CHECK_COMPILE([if 'file_system_type' has 'mount' field],
741 file_system_type_mount, [
742 #include <linux/fs.h>
744 struct file_system_type fst = { };
747 mount = (void *)fst.mount;
749 AC_DEFINE(HAVE_FSTYPE_MOUNT, 1,
750 [struct file_system_type has mount field])
752 ]) # LC_HAVE_FSTYPE_MOUNT
755 # LC_HAVE_FHANDLE_SYSCALLS
757 # 2.6.39 The open_by_handle_at() and name_to_handle_at() system calls were
758 # added to Linux kernel 2.6.39.
759 # Check if client supports these functions
761 AC_DEFUN([LC_HAVE_FHANDLE_SYSCALLS], [
762 LB_CHECK_CONFIG_IM([FHANDLE],[
763 AC_DEFINE(HAVE_FHANDLE_SYSCALLS, 1,
764 [kernel supports fhandles and related syscalls])
766 ]) # LC_HAVE_FHANDLE_SYSCALLS
769 # LC_HAVE_INODE_OWNER_OR_CAPABLE
771 # 2.6.39 renames is_owner_or_cap to inode_owner_or_capable
773 AC_DEFUN([LC_HAVE_INODE_OWNER_OR_CAPABLE], [
774 LB_CHECK_COMPILE([if 'inode_owner_or_capable' exist],
775 inode_owner_or_capable, [
776 #include <linux/fs.h>
778 inode_owner_or_capable(NULL);
780 AC_DEFINE(HAVE_INODE_OWNER_OR_CAPABLE, 1,
781 [inode_owner_or_capable exist])
783 ]) # LC_HAVE_INODE_OWNER_OR_CAPABLE
786 # LC_DIRTY_INODE_WITH_FLAG
788 # 3.0 dirty_inode() has a flag parameter
789 # see kernel commit aa38572954ade525817fe88c54faebf85e5a61c0
791 AC_DEFUN([LC_DIRTY_INODE_WITH_FLAG], [
792 LB_CHECK_COMPILE([if 'dirty_inode' super_operation takes flag],
793 dirty_inode_super_operation_flag, [
794 #include <linux/fs.h>
796 struct inode *inode = NULL;
797 inode->i_sb->s_op->dirty_inode(NULL, 0);
799 AC_DEFINE(HAVE_DIRTY_INODE_HAS_FLAG, 1,
800 [dirty_inode super_operation takes flag])
802 ]) # LC_DIRTY_INODE_WITH_FLAG
807 # 3.0 introduced setns
809 AC_DEFUN([LC_SETNS], [
810 AC_CHECK_HEADERS([sched.h], [], [],
813 AC_CHECK_FUNCS([setns])
817 # LC_GENERIC_PERMISSION
819 # 2.6.38 generic_permission taken 4 parameters.
820 # in fact, it means rcu-walk aware permission bring.
822 # 3.1 generic_permission taken 2 parameters.
823 # see kernel commit 2830ba7f34ebb27c4e5b8b6ef408cd6d74860890
825 AC_DEFUN([LC_GENERIC_PERMISSION], [
826 LB_CHECK_COMPILE([if 'generic_permission' take 2 arguments],
827 generic_permission_2args, [
828 #include <linux/fs.h>
830 generic_permission(NULL, 0);
832 AC_DEFINE(HAVE_GENERIC_PERMISSION_2ARGS, 1,
833 [generic_permission taken 2 arguments])
835 LB_CHECK_COMPILE([if 'generic_permission' take 4 arguments],
836 generic_permission_4args, [
837 #include <linux/fs.h>
839 generic_permission(NULL, 0, 0, NULL);
841 AC_DEFINE(HAVE_GENERIC_PERMISSION_4ARGS, 1,
842 [generic_permission taken 4 arguments])
845 ]) # LC_GENERIC_PERMISSION
848 # LC_LM_XXX_LOCK_MANAGER_OPS
850 # 3.1 renames lock-manager ops(lock_manager_operations) from fl_xxx to lm_xxx
851 # see kernel commit 8fb47a4fbf858a164e973b8ea8ef5e83e61f2e50
853 AC_DEFUN([LC_LM_XXX_LOCK_MANAGER_OPS], [
854 LB_CHECK_COMPILE([if 'lock-manager' ops renamed to 'lm_xxx'],
855 lock_manager_ops_lm_xxx, [
856 #include <linux/fs.h>
858 struct lock_manager_operations lm_ops;
859 lm_ops.lm_compare_owner = NULL;
861 AC_DEFINE(HAVE_LM_XXX_LOCK_MANAGER_OPS, 1,
862 [lock-manager ops renamed to lm_xxx])
864 ]) # LC_LM_XXX_LOCK_MANAGER_OPS
869 # 3.1 kills inode->i_alloc_sem, use i_dio_count and inode_dio_wait
871 # see kernel commit bd5fe6c5eb9c548d7f07fe8f89a150bb6705e8e3
873 AC_DEFUN([LC_INODE_DIO_WAIT], [
874 LB_CHECK_COMPILE([if 'inode->i_alloc_sem' is killed and use inode_dio_wait],
876 #include <linux/fs.h>
878 inode_dio_wait((struct inode *)0);
880 AC_DEFINE(HAVE_INODE_DIO_WAIT, 1,
881 [inode->i_alloc_sem is killed and use inode_dio_wait])
883 ]) # LC_INODE_DIO_WAIT
888 # 3.1 adds get_acl method to inode_operations to read ACL from disk.
889 # see kernel commit 4e34e719e457f2e031297175410fc0bd4016a085
891 AC_DEFUN([LC_IOP_GET_ACL], [
892 LB_CHECK_COMPILE([if 'inode_operations' has '.get_acl' member function],
894 #include <linux/fs.h>
896 struct inode_operations iop;
899 AC_DEFINE(HAVE_IOP_GET_ACL, 1,
900 [inode_operations has .get_acl member function])
905 # LC_FILE_LLSEEK_SIZE
907 # 3.1 introduced generic_file_llseek_size()
909 AC_DEFUN([LC_FILE_LLSEEK_SIZE], [
910 LB_CHECK_EXPORT([generic_file_llseek_size], [fs/read_write.c],
911 [AC_DEFINE(HAVE_FILE_LLSEEK_SIZE, 1,
912 [generic_file_llseek_size is exported by the kernel])])
913 ]) # LC_FILE_LLSEEK_SIZE
916 # LC_RADIX_EXCEPTION_ENTRY
917 # 3.1 adds radix_tree_exception_entry.
919 AC_DEFUN([LC_RADIX_EXCEPTION_ENTRY], [
920 LB_CHECK_COMPILE([radix_tree_exceptional_entry exist],
921 radix_tree_exceptional_entry, [
922 #include <linux/radix-tree.h>
924 radix_tree_exceptional_entry(NULL);
926 AC_DEFINE(HAVE_RADIX_EXCEPTION_ENTRY, 1,
927 [radix_tree_exceptional_entry exist])
929 ]) # LC_RADIX_EXCEPTION_ENTRY
932 # LC_HAVE_PROTECT_I_NLINK
934 # 3.2 protects inode->i_nlink from direct modification
935 # see kernel commit a78ef704a8dd430225955f0709b22d4a6ba21deb
936 # at the same time adds set_nlink(), so checks set_nlink() for it.
938 AC_DEFUN([LC_HAVE_PROTECT_I_NLINK], [
939 LB_CHECK_COMPILE([if 'inode->i_nlink' is protected from direct modification],
940 inode_i_nlink_protected, [
941 #include <linux/fs.h>
946 AC_DEFINE(HAVE_PROTECT_I_NLINK, 1,
947 [inode->i_nlink is protected from direct modification])
949 ]) # LC_HAVE_PROTECT_I_NLINK
952 # 2.6.39 security_inode_init_security takes a 'struct qstr' parameter
954 # 3.2 security_inode_init_security takes a callback to set xattrs
956 AC_DEFUN([LC_HAVE_SECURITY_IINITSEC], [
957 LB_CHECK_COMPILE([if security_inode_init_security takes a callback],
958 security_inode_init_security_callback, [
959 #include <linux/security.h>
961 security_inode_init_security(NULL, NULL, NULL, (const initxattrs)NULL, NULL);
963 AC_DEFINE(HAVE_SECURITY_IINITSEC_CALLBACK, 1,
964 [security_inode_init_security takes a callback to set xattrs])
966 LB_CHECK_COMPILE([if security_inode_init_security takes a 'struct qstr' parameter],
967 security_inode_init_security_qstr, [
968 #include <linux/security.h>
970 security_inode_init_security(NULL, NULL, (struct qstr *)NULL, NULL, NULL, NULL);
972 AC_DEFINE(HAVE_SECURITY_IINITSEC_QSTR, 1,
973 [security_inode_init_security takes a 'struct qstr' parameter])
976 ]) # LC_HAVE_SECURITY_IINITSEC
979 # LC_HAVE_MIGRATE_HEADER
981 # 3.3 introduces migrate_mode.h and migratepage has 4 args
983 AC_DEFUN([LC_HAVE_MIGRATE_HEADER], [
984 LB_CHECK_FILE([$LINUX/include/linux/migrate.h], [
985 AC_DEFINE(HAVE_MIGRATE_H, 1,
986 [kernel has include/linux/migrate.h])
988 LB_CHECK_FILE([$LINUX/include/linux/migrate_mode.h], [
989 AC_DEFINE(HAVE_MIGRATE_MODE_H, 1,
990 [kernel has include/linux/migrate_mode.h])
993 ]) # LC_HAVE_MIGRATE_HEADER
996 # LC_MIGRATEPAGE_4ARGS
998 AC_DEFUN([LC_MIGRATEPAGE_4ARGS], [
999 LB_CHECK_COMPILE([if 'address_space_operations.migratepage' has 4 args],
1000 address_space_ops_migratepage_4args, [
1001 #include <linux/fs.h>
1002 #ifdef HAVE_MIGRATE_H
1003 #include <linux/migrate.h>
1004 #elif defined(HAVE_MIGRATE_MODE_H)
1005 #include <linux/migrate_mode.h>
1008 struct address_space_operations aops = { };
1009 aops.migratepage(NULL, NULL, NULL, MIGRATE_ASYNC);
1011 AC_DEFINE(HAVE_MIGRATEPAGE_4ARGS, 1,
1012 [address_space_operations.migratepage has 4 args])
1014 ]) # LC_MIGRATEPAGE_4ARGS
1017 # LC_SUPEROPS_USE_DENTRY
1019 # 3.3 switchs super_operations to use dentry as parameter (but not vfsmount)
1020 # see kernel commit 34c80b1d93e6e20ca9dea0baf583a5b5510d92d4
1022 AC_DEFUN([LC_SUPEROPS_USE_DENTRY], [
1023 tmp_flags="$EXTRA_KCFLAGS"
1024 EXTRA_KCFLAGS="-Werror"
1025 LB_CHECK_COMPILE([if 'super_operations' use 'dentry' as parameter],
1027 #include <linux/fs.h>
1028 int show_options(struct seq_file *seq, struct dentry *root) {
1032 struct super_operations ops;
1033 ops.show_options = show_options;
1035 AC_DEFINE(HAVE_SUPEROPS_USE_DENTRY, 1,
1036 [super_operations use dentry as parameter])
1038 EXTRA_KCFLAGS="$tmp_flags"
1039 ]) # LC_SUPEROPS_USE_DENTRY
1042 # LC_INODEOPS_USE_UMODE_T
1044 # 3.3 switchs inode_operations to use umode_t as parameter (but not int)
1045 # see kernel commit 1a67aafb5f72a436ca044293309fa7e6351d6a35
1047 AC_DEFUN([LC_INODEOPS_USE_UMODE_T], [
1048 tmp_flags="$EXTRA_KCFLAGS"
1049 EXTRA_KCFLAGS="-Werror"
1050 LB_CHECK_COMPILE([if 'inode_operations' use 'umode_t' as parameter],
1051 inode_ops_umode_t, [
1052 #include <linux/fs.h>
1053 #include <linux/types.h>
1054 int my_mknod(struct inode *dir, struct dentry *dchild,
1055 umode_t mode, dev_t dev)
1060 struct inode_operations ops;
1061 ops.mknod = my_mknod;
1063 AC_DEFINE(HAVE_INODEOPS_USE_UMODE_T, 1,
1064 [inode_operations use umode_t as parameter])
1066 EXTRA_KCFLAGS="$tmp_flags"
1067 ]) # LC_INODEOPS_USE_UMODE_T
1070 # LC_KMAP_ATOMIC_HAS_1ARG
1072 # 3.4 kmap_atomic removes second argument
1073 # see kernel commit 1ec9c5ddc17aa398f05646abfcbaf315b544e62f
1075 AC_DEFUN([LC_KMAP_ATOMIC_HAS_1ARG], [
1076 LB_CHECK_COMPILE([if 'kmap_atomic' has only 1 argument],
1078 #include <linux/highmem.h>
1082 AC_DEFINE(HAVE_KMAP_ATOMIC_HAS_1ARG, 1,
1083 [have kmap_atomic has only 1 argument])
1085 ]) # LC_KMAP_ATOMIC_HAS_1ARG
1088 # LC_HAVE_D_MAKE_ROOT
1090 # 3.4 converts d_alloc_root to d_make_root
1091 # see kernel commit 32991ab305ace7017c62f8eecbe5eb36dc32e13b
1093 AC_DEFUN([LC_HAVE_D_MAKE_ROOT], [
1094 LB_CHECK_COMPILE([if have 'd_make_root'],
1096 #include <linux/fs.h>
1098 d_make_root((struct inode *)NULL);
1100 AC_DEFINE(HAVE_D_MAKE_ROOT, 1,
1103 ]) # LC_HAVE_D_MAKE_ROOT
1106 # LC_HAVE_CACHE_REGISTER
1108 # 3.4 cache_register/cache_unregister are removed
1109 # see kernel commit 2c5f846747526e2b83c5f1b8e69016be0e2e87c0
1110 # Note, since 2.6.37 cache_register_net/cache_unregister_net
1111 # are defined, but not exported.
1112 # 3.3 cache_register_net/cache_unregister_net are
1113 # exported and replacing cache_register/cache_unregister in 3.4
1115 AC_DEFUN([LC_HAVE_CACHE_REGISTER], [
1116 LB_CHECK_COMPILE([if have 'cache_register'],
1118 #include <linux/sunrpc/cache.h>
1120 cache_register(NULL);
1122 AC_DEFINE(HAVE_CACHE_REGISTER, 1,
1123 [have cache_register])
1125 ]) # LC_HAVE_CACHE_REGISTER
1128 # LC_HAVE_CLEAR_INODE
1130 # 3.5 renames end_writeback() back to clear_inode()...
1131 # see kernel commit dbd5768f87ff6fb0a4fe09c4d7b6c4a24de99430
1133 AC_DEFUN([LC_HAVE_CLEAR_INODE], [
1134 LB_CHECK_COMPILE([if have 'clear_inode'],
1136 #include <linux/fs.h>
1138 clear_inode((struct inode *)NULL);
1140 AC_DEFINE(HAVE_CLEAR_INODE, 1,
1143 ]) # LC_HAVE_CLEAR_INODE
1146 # LC_HAVE_ENCODE_FH_PARENT
1148 # 3.5 encode_fh has parent inode passed in directly
1149 # see kernel commit b0b0382b
1151 AC_DEFUN([LC_HAVE_ENCODE_FH_PARENT], [
1152 tmp_flags="$EXTRA_KCFLAGS"
1153 EXTRA_KCFLAGS="-Werror"
1154 LB_CHECK_COMPILE([if 'encode_fh' have parent inode as parameter],
1155 encode_fh_parent_inode, [
1156 #include <linux/exportfs.h>
1157 #include <linux/fs.h>
1158 #include <linux/types.h>
1159 int ll_encode_fh(struct inode *i, __u32 *a, int *b, struct inode *p)
1164 struct export_operations exp_op;
1165 exp_op.encode_fh = ll_encode_fh;
1167 AC_DEFINE(HAVE_ENCODE_FH_PARENT, 1,
1168 [have parent inode as parameter])
1170 EXTRA_KCFLAGS="$tmp_flags"
1171 ]) # LC_HAVE_ENCODE_FH_PARENT
1174 # LC_FILE_LLSEEK_SIZE_5ARG
1176 # 3.5 has generic_file_llseek_size with 5 args
1178 AC_DEFUN([LC_FILE_LLSEEK_SIZE_5ARG], [
1179 LB_CHECK_COMPILE([if Linux kernel has 'generic_file_llseek_size' with 5 args],
1180 generic_file_llseek_size_5args, [
1181 #include <linux/fs.h>
1183 generic_file_llseek_size(NULL, 0, 0, 0, 0);
1185 AC_DEFINE(HAVE_FILE_LLSEEK_SIZE_5ARGS, 1,
1186 [kernel has generic_file_llseek_size with 5 args])
1188 ]) # LC_FILE_LLSEEK_SIZE_5ARG
1191 # LC_LLITE_DATA_IS_LIST
1193 # 3.6 switch i_dentry/d_alias from list to hlist
1195 # In the upstream kernels d_alias first changes
1196 # to a hlist and then in later version, 3.11, gets
1197 # moved to the union d_u. Due to some distros having
1198 # d_alias in the d_u union as a struct list, which
1199 # has never existed upstream stream, we can't test
1200 # if d_alias is a list or hlist directly. If ever
1201 # i_dentry and d_alias even up different combos then
1202 # the build will fail. In that case then we will need
1203 # to separate out the i_dentry and d_alias test below.
1205 AC_DEFUN([LC_DATA_FOR_LLITE_IS_LIST], [
1206 tmp_flags="$EXTRA_KCFLAGS"
1207 EXTRA_KCFLAGS="-Werror"
1208 LB_CHECK_COMPILE([if 'i_dentry/d_alias' uses 'list'],
1209 i_dentry_d_alias_list, [
1210 #include <linux/fs.h>
1213 INIT_LIST_HEAD(&inode.i_dentry);
1215 AC_DEFINE(DATA_FOR_LLITE_IS_LIST, 1,
1216 [both i_dentry/d_alias uses list])
1218 EXTRA_KCFLAGS="$tmp_flags"
1219 ]) # LC_DATA_FOR_LLITE_IS_LIST
1222 # LC_DENTRY_OPEN_USE_PATH
1224 # 3.6 dentry_open uses struct path as first argument
1225 # see kernel commit 765927b2
1227 AC_DEFUN([LC_DENTRY_OPEN_USE_PATH], [
1228 tmp_flags="$EXTRA_KCFLAGS"
1229 EXTRA_KCFLAGS="-Werror"
1230 LB_CHECK_COMPILE([if 'dentry_open' uses 'struct path' as first argument],
1232 #include <linux/fs.h>
1233 #include <linux/path.h>
1236 dentry_open(&path, 0, NULL);
1238 AC_DEFINE(HAVE_DENTRY_OPEN_USE_PATH, 1,
1239 [dentry_open uses struct path as first argument])
1241 EXTRA_KCFLAGS="$tmp_flags"
1242 ]) # LC_DENTRY_OPEN_USE_PATH
1245 # LC_HAVE_IOP_ATOMIC_OPEN
1247 # 3.6 vfs adds iop->atomic_open
1249 AC_DEFUN([LC_HAVE_IOP_ATOMIC_OPEN], [
1250 LB_CHECK_COMPILE([if 'iop' has 'atomic_open'],
1251 inode_ops_atomic_open, [
1252 #include <linux/fs.h>
1254 struct inode_operations iop;
1255 iop.atomic_open = NULL;
1257 AC_DEFINE(HAVE_IOP_ATOMIC_OPEN, 1,
1258 [have iop atomic_open])
1260 ]) # LC_HAVE_IOP_ATOMIC_OPEN
1263 # LC_HAVE_SB_START_WRITE
1265 # RHEL6 2.6.32, 3.6 or newer support wrapped FS freeze functions
1267 AC_DEFUN([LC_HAVE_SB_START_WRITE], [
1268 LB_CHECK_COMPILE([if kernel supports wrapped FS freeze functions],
1270 #include <linux/fs.h>
1272 sb_start_write(NULL);
1274 AC_DEFINE(HAVE_SB_START_WRITE, 1,
1275 [kernel supports wrapped FS freeze functions])
1277 ]) # LC_HAVE_SB_START_WRITE
1280 # LC_HAVE_POSIXACL_USER_NS
1282 # 3.7 posix_acl_{to,from}_xattr take struct user_namespace
1284 AC_DEFUN([LC_HAVE_POSIXACL_USER_NS], [
1285 LB_CHECK_COMPILE([if 'posix_acl_to_xattr' takes 'struct user_namespace'],
1286 posix_acl_to_xattr_user_namespace, [
1287 #include <linux/fs.h>
1288 #include <linux/posix_acl_xattr.h>
1290 posix_acl_to_xattr((struct user_namespace *)NULL, NULL, NULL, 0);
1292 AC_DEFINE(HAVE_POSIXACL_USER_NS, 1,
1293 [posix_acl_to_xattr takes struct user_namespace])
1295 ]) # LC_HAVE_POSIXACL_USER_NS
1298 # LC_HAVE_FILE_F_INODE
1300 # 3.8 struct file has new member f_inode
1302 AC_DEFUN([LC_HAVE_FILE_F_INODE], [
1303 LB_CHECK_COMPILE([if 'struct file' has member 'f_inode'],
1305 #include <linux/fs.h>
1307 ((struct file *)0)->f_inode = NULL;
1309 AC_DEFINE(HAVE_FILE_F_INODE, 1,
1310 [struct file has member f_inode])
1312 ]) # LC_HAVE_FILE_F_INODE
1315 # LC_HAVE_FILE_INODE
1317 # 3.8 has introduced inline function file_inode
1319 AC_DEFUN([LC_HAVE_FILE_INODE], [
1320 LB_CHECK_COMPILE([if file_inode() exists],
1322 #include <linux/fs.h>
1326 AC_DEFINE(HAVE_FILE_INODE, 1,
1327 [file_inode() has been defined])
1329 ]) # LC_HAVE_FILE_INODE
1332 # LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS
1334 AC_DEFUN([LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS], [
1335 LB_CHECK_COMPILE([if 'sunrpc_cache_pipe_upcall' takes 3 args],
1336 sunrpc_cache_pipe_upcall_3args, [
1337 #include <linux/sunrpc/cache.h>
1339 sunrpc_cache_pipe_upcall(NULL, NULL, NULL);
1341 AC_DEFINE(HAVE_SUNRPC_UPCALL_HAS_3ARGS, 1,
1342 [sunrpc_cache_pipe_upcall takes 3 args])
1344 ]) # LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS
1347 # LC_HAVE_HLIST_FOR_EACH_3ARG
1349 # 3.9 uses hlist_for_each_entry with 3 args
1350 # b67bfe0d42cac56c512dd5da4b1b347a23f4b70a
1352 AC_DEFUN([LC_HAVE_HLIST_FOR_EACH_3ARG], [
1353 LB_CHECK_COMPILE([if 'hlist_for_each_entry' has 3 args],
1354 hlist_for_each_entry_3args, [
1355 #include <linux/list.h>
1356 #include <linux/fs.h>
1358 struct hlist_head *head = NULL;
1359 struct inode *inode;
1361 hlist_for_each_entry(inode, head, i_hash) {
1365 AC_DEFINE(HAVE_HLIST_FOR_EACH_3ARG, 1,
1366 [hlist_for_each_entry has 3 args])
1368 ]) # LC_HAVE_HLIST_FOR_EACH_3ARG
1371 # LC_HAVE_BIO_END_SECTOR
1373 # 3.9 introduces bio_end_sector macro
1374 # f73a1c7d117d07a96d89475066188a2b79e53c48
1376 AC_DEFUN([LC_HAVE_BIO_END_SECTOR], [
1377 LB_CHECK_COMPILE([if 'bio_end_sector' is defined],
1379 #include <linux/bio.h>
1381 struct bio bio = { };
1382 unsigned long long end;
1384 end = bio_end_sector(&bio);
1386 AC_DEFINE(HAVE_BIO_END_SECTOR, 1,
1387 [bio_end_sector is defined])
1389 ]) # LC_HAVE_BIO_END_SECTOR
1392 # 3.9 created is_sxid
1394 AC_DEFUN([LC_HAVE_IS_SXID], [
1395 LB_CHECK_COMPILE([if 'is_sxid' is defined],
1397 #include <linux/fs.h>
1399 struct inode inode = { };
1401 is_sxid(inode.i_mode);
1403 AC_DEFINE(HAVE_IS_SXID, 1, [is_sxid is defined])
1405 ]) # LC_HAVE_IS_SXID
1408 # LC_HAVE_REMOVE_PROC_SUBTREE
1410 # 3.10 introduced remove_proc_subtree
1412 AC_DEFUN([LC_HAVE_REMOVE_PROC_SUBTREE], [
1413 LB_CHECK_COMPILE([if 'remove_proc_subtree' is defined],
1414 remove_proc_subtree, [
1415 #include <linux/proc_fs.h>
1417 remove_proc_subtree(NULL, NULL);
1419 AC_DEFINE(HAVE_REMOVE_PROC_SUBTREE, 1,
1420 [remove_proc_subtree is defined])
1422 ]) # LC_HAVE_REMOVE_PROC_SUBTREE
1425 # LC_HAVE_PROC_REMOVE
1427 # 3.10 introduced proc_remove
1429 AC_DEFUN([LC_HAVE_PROC_REMOVE], [
1430 LB_CHECK_COMPILE([if 'proc_remove' is defined],
1432 #include <linux/proc_fs.h>
1436 AC_DEFINE(HAVE_PROC_REMOVE, 1,
1437 [proc_remove is defined])
1439 ]) # LC_HAVE_PROC_REMOVE
1441 AC_DEFUN([LC_HAVE_PROJECT_QUOTA], [
1442 LB_CHECK_COMPILE([if get_projid exists],
1445 #include <linux/quota.h>
1447 struct dquot_operations ops = { };
1449 ops.get_projid(NULL, NULL);
1451 AC_DEFINE(HAVE_PROJECT_QUOTA, 1,
1452 [get_projid function exists])
1454 ]) # LC_HAVE_PROJECT_QUOTA
1458 # LC_HAVE_SECURITY_DENTRY_INIT_SECURITY
1460 # 3.10 introduced security_dentry_init_security()
1462 AC_DEFUN([LC_HAVE_SECURITY_DENTRY_INIT_SECURITY], [
1463 LB_CHECK_COMPILE([if 'security_dentry_init_security' is defined],
1464 security_dentry_init_security, [
1465 #include <linux/security.h>
1467 security_dentry_init_security(NULL, 0, NULL, NULL, NULL);
1469 AC_DEFINE(HAVE_SECURITY_DENTRY_INIT_SECURITY, 1,
1470 [security_dentry_init_security' is defined])
1472 ]) # LC_HAVE_SECURITY_DENTRY_INIT_SECURITY
1475 # LC_INVALIDATE_RANGE
1477 # 3.11 invalidatepage requires the length of the range to invalidate
1479 AC_DEFUN([LC_INVALIDATE_RANGE], [
1480 LB_CHECK_COMPILE([if 'address_space_operations.invalidatepage' requires 3 arguments],
1481 address_space_ops_invalidatepage_3args, [
1482 #include <linux/fs.h>
1484 struct address_space_operations a_ops;
1485 a_ops.invalidatepage(NULL, 0, 0);
1487 AC_DEFINE(HAVE_INVALIDATE_RANGE, 1,
1488 [address_space_operations.invalidatepage needs 3 arguments])
1490 ]) # LC_INVALIDATE_RANGE
1493 # LC_HAVE_DIR_CONTEXT
1495 # 3.11 readdir now takes the new struct dir_context
1497 AC_DEFUN([LC_HAVE_DIR_CONTEXT], [
1498 LB_CHECK_COMPILE([if 'dir_context' exist],
1500 #include <linux/fs.h>
1502 #ifdef FMODE_KABI_ITERATE
1503 #error "back to use readdir in kabi_extand mode"
1505 struct dir_context ctx;
1510 AC_DEFINE(HAVE_DIR_CONTEXT, 1,
1511 [dir_context exist])
1513 ]) # LC_HAVE_DIR_CONTEXT
1516 # LC_D_COMPARE_5ARGS
1518 # 3.11 dentry_operations.d_compare() taken 5 arguments.
1520 AC_DEFUN([LC_D_COMPARE_5ARGS], [
1521 LB_CHECK_COMPILE([if 'd_compare' taken 5 arguments],
1523 #include <linux/dcache.h>
1525 ((struct dentry_operations*)0)->d_compare(NULL,NULL,0,NULL,NULL);
1527 AC_DEFINE(HAVE_D_COMPARE_5ARGS, 1,
1528 [d_compare need 5 arguments])
1530 ]) # LC_D_COMPARE_5ARGS
1535 # 3.11 need to access d_count to get dentry reference count
1537 AC_DEFUN([LC_HAVE_DCOUNT], [
1538 LB_CHECK_COMPILE([if 'd_count' exists],
1540 #include <linux/dcache.h>
1542 struct dentry de = { };
1545 count = d_count(&de);
1547 AC_DEFINE(HAVE_D_COUNT, 1,
1553 # LC_PID_NS_FOR_CHILDREN
1555 # 3.11 replaces pid_ns by pid_ns_for_children in struct nsproxy
1557 AC_DEFUN([LC_PID_NS_FOR_CHILDREN], [
1558 LB_CHECK_COMPILE([if 'struct nsproxy' has 'pid_ns_for_children'],
1559 pid_ns_for_children, [
1560 #include <linux/nsproxy.h>
1563 ns.pid_ns_for_children = NULL;
1565 AC_DEFINE(HAVE_PID_NS_FOR_CHILDREN, 1,
1566 ['struct nsproxy' has 'pid_ns_for_children'])
1568 ]) # LC_PID_NS_FOR_CHILDREN
1571 # LC_OLDSIZE_TRUNCATE_PAGECACHE
1573 # 3.12 truncate_pagecache without oldsize parameter
1575 AC_DEFUN([LC_OLDSIZE_TRUNCATE_PAGECACHE], [
1576 LB_CHECK_COMPILE([if 'truncate_pagecache' with 'old_size' parameter],
1577 truncate_pagecache_old_size, [
1578 #include <linux/mm.h>
1580 truncate_pagecache(NULL, 0, 0);
1582 AC_DEFINE(HAVE_OLDSIZE_TRUNCATE_PAGECACHE, 1,
1585 ]) # LC_OLDSIZE_TRUNCATE_PAGECACHE
1588 # LC_PTR_ERR_OR_ZERO
1590 # For some reason SLES11SP4 is missing the PTR_ERR_OR_ZERO macro
1591 # It was added to linux kernel 3.12
1593 AC_DEFUN([LC_PTR_ERR_OR_ZERO_MISSING], [
1594 LB_CHECK_COMPILE([if 'PTR_ERR_OR_ZERO' is missing],
1596 #include <linux/err.h>
1598 if (PTR_ERR_OR_ZERO(NULL)) return 0;
1600 AC_DEFINE(HAVE_PTR_ERR_OR_ZERO, 1,
1601 ['PTR_ERR_OR_ZERO' exist])
1603 ]) # LC_PTR_ERR_OR_ZERO_MISSING
1606 # LC_HAVE_DENTRY_D_U_D_ALIAS
1608 # 3.11 kernel moved d_alias to the union d_u in struct dentry
1610 # Some distros move d_alias to d_u but it is still a struct list
1612 AC_DEFUN([LC_HAVE_DENTRY_D_U_D_ALIAS], [
1613 AS_IF([test "x$lb_cv_compile_i_dentry_d_alias_list" = xyes], [
1614 LB_CHECK_COMPILE([if list 'dentry.d_u.d_alias' exist],
1616 #include <linux/list.h>
1617 #include <linux/dcache.h>
1620 INIT_LIST_HEAD(&de.d_u.d_alias);
1622 AC_DEFINE(HAVE_DENTRY_D_U_D_ALIAS, 1,
1623 [list dentry.d_u.d_alias exist])
1626 LB_CHECK_COMPILE([if hlist 'dentry.d_u.d_alias' exist],
1628 #include <linux/list.h>
1629 #include <linux/dcache.h>
1632 INIT_HLIST_NODE(&de.d_u.d_alias);
1634 AC_DEFINE(HAVE_DENTRY_D_U_D_ALIAS, 1,
1635 [hlist dentry.d_u.d_alias exist])
1638 ]) # LC_HAVE_DENTRY_D_U_D_ALIAS
1641 # LC_HAVE_DENTRY_D_CHILD
1643 # 3.11 kernel d_child has been moved out of the union d_u
1646 AC_DEFUN([LC_HAVE_DENTRY_D_CHILD], [
1647 LB_CHECK_COMPILE([if 'dentry.d_child' exist],
1649 #include <linux/list.h>
1650 #include <linux/dcache.h>
1653 INIT_LIST_HEAD(&de.d_child);
1655 AC_DEFINE(HAVE_DENTRY_D_CHILD, 1,
1656 [dentry.d_child exist])
1658 ]) # LC_HAVE_DENTRY_D_CHILD
1663 # 3.12 ki_left removed from struct kiocb
1665 AC_DEFUN([LC_KIOCB_KI_LEFT], [
1666 LB_CHECK_COMPILE([if 'struct kiocb' with 'ki_left' member],
1668 #include <linux/aio.h>
1670 ((struct kiocb*)0)->ki_left = 0;
1672 AC_DEFINE(HAVE_KIOCB_KI_LEFT, 1,
1675 ]) # LC_KIOCB_KI_LEFT
1678 # LC_INIT_LIST_HEAD_RCU
1680 # 3.12 added INIT_LIST_HEAD_RCU in commit 2a855b644c310d5db5
1681 # which is unfortunately an inline function and not a macro
1682 # that can be tested directly, so it needs a configure check.
1684 AC_DEFUN([LC_INIT_LIST_HEAD_RCU], [
1685 LB_CHECK_COMPILE([if 'INIT_LIST_HEAD_RCU' exists],
1686 init_list_head_rcu, [
1687 #include <linux/list.h>
1688 #include <linux/rculist.h>
1690 struct list_head list;
1691 INIT_LIST_HEAD_RCU(&list);
1693 AC_DEFINE(HAVE_INIT_LIST_HEAD_RCU, 1,
1694 [INIT_LIST_HEAD_RCU exists])
1696 ]) # LC_INIT_LIST_HEAD_RCU
1699 # LC_VFS_RENAME_5ARGS
1701 # 3.13 has vfs_rename with 5 args
1703 AC_DEFUN([LC_VFS_RENAME_5ARGS], [
1704 LB_CHECK_COMPILE([if Linux kernel has 'vfs_rename' with 5 args],
1706 #include <linux/fs.h>
1708 vfs_rename(NULL, NULL, NULL, NULL, NULL);
1710 AC_DEFINE(HAVE_VFS_RENAME_5ARGS, 1,
1711 [kernel has vfs_rename with 5 args])
1713 ]) # LC_VFS_RENAME_5ARGS
1716 # LC_VFS_UNLINK_3ARGS
1718 # 3.13 has vfs_unlink with 3 args
1720 AC_DEFUN([LC_VFS_UNLINK_3ARGS], [
1721 LB_CHECK_COMPILE([if Linux kernel has 'vfs_unlink' with 3 args],
1723 #include <linux/fs.h>
1725 vfs_unlink(NULL, NULL, NULL);
1727 AC_DEFINE(HAVE_VFS_UNLINK_3ARGS, 1,
1728 [kernel has vfs_unlink with 3 args])
1730 ]) # LC_VFS_UNLINK_3ARGS
1735 # 3.14 move some of its data in struct bio into the new
1738 AC_DEFUN([LC_HAVE_BVEC_ITER], [
1739 LB_CHECK_COMPILE([if Linux kernel has struct bvec_iter],
1741 #include <linux/bio.h>
1743 struct bvec_iter iter;
1745 iter.bi_bvec_done = 0;
1747 AC_DEFINE(HAVE_BVEC_ITER, 1,
1748 [kernel has struct bvec_iter])
1750 ]) # LC_HAVE_BVEC_ITER
1755 # 3.14 adds set_acl method to inode_operations
1756 # see kernel commit 893d46e443346370cd4ea81d9d35f72952c62a37
1758 AC_DEFUN([LC_IOP_SET_ACL], [
1759 LB_CHECK_COMPILE([if 'inode_operations' has '.set_acl' member function],
1760 inode_ops_set_acl, [
1761 #include <linux/fs.h>
1763 struct inode_operations iop;
1766 AC_DEFINE(HAVE_IOP_SET_ACL, 1,
1767 [inode_operations has .set_acl member function])
1772 # LC_HAVE_TRUNCATE_IPAGE_FINAL
1774 # 3.14 bring truncate_inode_pages_final for evict_inode
1776 AC_DEFUN([LC_HAVE_TRUNCATE_IPAGES_FINAL], [
1777 LB_CHECK_COMPILE([if Linux kernel has truncate_inode_pages_final],
1778 truncate_ipages_final, [
1779 #include <linux/mm.h>
1781 truncate_inode_pages_final(NULL);
1783 AC_DEFINE(HAVE_TRUNCATE_INODE_PAGES_FINAL, 1,
1784 [kernel has truncate_inode_pages_final])
1786 ]) # LC_HAVE_TRUNCATE_IPAGES_FINAL
1789 # LC_IOPS_RENAME_WITH_FLAGS
1791 # 3.14 has inode_operations->rename with 5 args
1792 # commit 520c8b16505236fc82daa352e6c5e73cd9870cff
1794 AC_DEFUN([LC_IOPS_RENAME_WITH_FLAGS], [
1795 LB_CHECK_COMPILE([if 'inode_operations->rename' taken flags as argument],
1796 iops_rename_with_flags, [
1797 #include <linux/fs.h>
1799 struct inode *i1 = NULL, *i2 = NULL;
1800 struct dentry *d1 = NULL, *d2 = NULL;
1802 rc = ((struct inode_operations *)0)->rename(i1, d1, i2, d2, 0);
1804 AC_DEFINE(HAVE_IOPS_RENAME_WITH_FLAGS, 1,
1805 [inode_operations->rename need flags as argument])
1807 ]) # LC_IOPS_RENAME_WITH_FLAGS
1810 # LC_VFS_RENAME_6ARGS
1812 # 3.15 has vfs_rename with 6 args
1814 AC_DEFUN([LC_VFS_RENAME_6ARGS], [
1815 LB_CHECK_COMPILE([if Linux kernel has 'vfs_rename' with 6 args],
1817 #include <linux/fs.h>
1819 vfs_rename(NULL, NULL, NULL, NULL, NULL, NULL);
1821 AC_DEFINE(HAVE_VFS_RENAME_6ARGS, 1,
1822 [kernel has vfs_rename with 6 args])
1824 ]) # LC_VFS_RENAME_6ARGS
1827 # LC_DIRECTIO_USE_ITER
1829 # 3.16 kernel changes direct IO to use iov_iter
1831 AC_DEFUN([LC_DIRECTIO_USE_ITER], [
1832 LB_CHECK_COMPILE([if direct IO uses iov_iter],
1834 #include <linux/fs.h>
1836 struct address_space_operations ops = { };
1837 struct iov_iter *iter = NULL;
1840 ops.direct_IO(0, NULL, iter, offset);
1842 AC_DEFINE(HAVE_DIRECTIO_ITER, 1,
1843 [direct IO uses iov_iter])
1845 ]) # LC_DIRECTIO_USE_ITER
1848 # LC_HAVE_IOV_ITER_INIT_DIRECTION
1851 # 3.16 linux commit 71d8e532b1549a478e6a6a8a44f309d050294d00
1852 # changed iov_iter_init api to start accepting a tag
1853 # that defines if its a read or write operation
1855 AC_DEFUN([LC_HAVE_IOV_ITER_INIT_DIRECTION], [
1856 tmp_flags="$EXTRA_KCFLAGS"
1857 EXTRA_KCFLAGS="-Werror"
1858 LB_CHECK_COMPILE([if 'iov_iter_init' takes a tag],
1860 #include <linux/uio.h>
1861 #include <linux/fs.h>
1863 const struct iovec *iov = NULL;
1865 iov_iter_init(NULL, READ, iov, 1, 0);
1867 AC_DEFINE(HAVE_IOV_ITER_INIT_DIRECTION, 1,
1868 [iov_iter_init handles directional tag])
1870 EXTRA_KCFLAGS="$tmp_flags"
1871 ]) # LC_HAVE_IOV_ITER_INIT_DIRECTION
1874 # LC_HAVE_IOV_ITER_TRUNCATE
1877 # 3.16 introduces a new API iov_iter_truncate()
1879 AC_DEFUN([LC_HAVE_IOV_ITER_TRUNCATE], [
1880 tmp_flags="$EXTRA_KCFLAGS"
1881 EXTRA_KCFLAGS="-Werror"
1882 LB_CHECK_COMPILE([if 'iov_iter_truncate' exists ],
1884 #include <linux/uio.h>
1885 #include <linux/fs.h>
1887 struct iov_iter *i = NULL;
1889 iov_iter_truncate(i, 0);
1891 AC_DEFINE(HAVE_IOV_ITER_TRUNCATE, 1, [iov_iter_truncate exists])
1893 EXTRA_KCFLAGS="$tmp_flags"
1894 ]) # LC_HAVE_IOV_ITER_TRUNCATE
1897 # LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
1899 # 3.16 introduces [read|write]_iter to struct file_operations
1901 AC_DEFUN([LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER], [
1902 LB_CHECK_COMPILE([if 'file_operations.[read|write]_iter' exist],
1903 file_function_iter, [
1904 #include <linux/fs.h>
1906 ((struct file_operations *)NULL)->read_iter(NULL, NULL);
1907 ((struct file_operations *)NULL)->write_iter(NULL, NULL);
1909 AC_DEFINE(HAVE_FILE_OPERATIONS_READ_WRITE_ITER, 1,
1910 [file_operations.[read|write]_iter functions exist])
1912 ]) # LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
1915 # LC_HAVE_INTERVAL_BLK_INTEGRITY
1917 # 3.17 replace sector_size with interval in struct blk_integrity
1919 AC_DEFUN([LC_HAVE_INTERVAL_BLK_INTEGRITY], [
1920 LB_CHECK_COMPILE([if 'blk_integrity.interval' exist],
1921 interval_blk_integrity, [
1922 #include <linux/blkdev.h>
1924 ((struct blk_integrity *)0)->interval = 0;
1926 AC_DEFINE(HAVE_INTERVAL_BLK_INTEGRITY, 1,
1927 [blk_integrity.interval exist])
1929 ]) # LC_HAVE_INTERVAL_BLK_INTEGRITY
1934 # 3.17 replaces key_type::match with match_preparse
1935 # and has new struct key_match_data
1937 AC_DEFUN([LC_KEY_MATCH_DATA], [
1938 LB_CHECK_COMPILE([if struct key_match field exist],
1940 #include <linux/key-type.h>
1942 struct key_match_data data;
1944 data.raw_data = NULL;
1946 AC_DEFINE(HAVE_KEY_MATCH_DATA, 1,
1947 [struct key_match_data exist])
1949 ]) # LC_KEY_MATCH_DATA
1952 # LC_NFS_FILLDIR_USE_CTX
1954 # 3.18 kernel moved from void cookie to struct dir_context
1956 AC_DEFUN([LC_NFS_FILLDIR_USE_CTX], [
1957 tmp_flags="$EXTRA_KCFLAGS"
1958 EXTRA_KCFLAGS="-Werror"
1959 LB_CHECK_COMPILE([if filldir_t uses struct dir_context],
1961 #include <linux/fs.h>
1963 int filldir(struct dir_context *ctx, const char* name,
1964 int i, loff_t off, u64 tmp, unsigned temp)
1969 struct dir_context ctx = {
1973 ctx.actor(NULL, "test", 0, (loff_t) 0, 0, 0);
1975 AC_DEFINE(HAVE_FILLDIR_USE_CTX, 1,
1976 [filldir_t needs struct dir_context as argument])
1978 EXTRA_KCFLAGS="$tmp_flags"
1979 ]) # LC_NFS_FILLDIR_USE_CTX
1982 # LC_PERCPU_COUNTER_INIT
1984 # 3.18 For kernels 3.18 and after percpu_counter_init starts
1985 # to pass a GFP_* memory allocation flag for internal
1986 # memory allocation purposes.
1988 AC_DEFUN([LC_PERCPU_COUNTER_INIT], [
1989 LB_CHECK_COMPILE([if percpu_counter_init uses GFP_* flag as argument],
1990 percpu_counter_init, [
1991 #include <linux/percpu_counter.h>
1993 percpu_counter_init(NULL, 0, GFP_KERNEL);
1995 AC_DEFINE(HAVE_PERCPU_COUNTER_INIT_GFP_FLAG, 1,
1996 [percpu_counter_init uses GFP_* flag])
1998 ]) # LC_PERCPU_COUNTER_INIT
2001 # LC_KIOCB_HAS_NBYTES
2003 # 3.19 kernel removed ki_nbytes from struct kiocb
2005 AC_DEFUN([LC_KIOCB_HAS_NBYTES], [
2006 LB_CHECK_COMPILE([if struct kiocb has ki_nbytes field],
2008 #include <linux/fs.h>
2010 struct kiocb iocb = { };
2014 AC_DEFINE(HAVE_KI_NBYTES, 1, [ki_nbytes field exist])
2016 ]) # LC_KIOCB_HAS_NBYTES
2019 # LC_HAVE_DQUOT_QC_DQBLK
2021 # 3.19 has quotactl_ops->[sg]et_dqblk that take struct kqid and qc_dqblk
2022 # Added in commit 14bf61ffe
2024 AC_DEFUN([LC_HAVE_DQUOT_QC_DQBLK], [
2025 tmp_flags="$EXTRA_KCFLAGS"
2026 EXTRA_KCFLAGS="-Werror"
2027 LB_CHECK_COMPILE([if 'quotactl_ops.set_dqblk' takes struct qc_dqblk],
2029 #include <linux/fs.h>
2030 #include <linux/quota.h>
2032 ((struct quotactl_ops *)0)->set_dqblk(NULL, *((struct kqid*)0), (struct qc_dqblk*)0);
2034 AC_DEFINE(HAVE_DQUOT_QC_DQBLK, 1,
2035 [quotactl_ops.set_dqblk takes struct qc_dqblk])
2036 AC_DEFINE(HAVE_DQUOT_KQID, 1,
2037 [quotactl_ops.set_dqblk takes struct kqid])
2039 EXTRA_KCFLAGS="$tmp_flags"
2040 ]) # LC_HAVE_DQUOT_QC_DQBLK
2043 # LC_BACKING_DEV_INFO_REMOVAL
2045 # 3.20 kernel removed backing_dev_info from address_space
2047 AC_DEFUN([LC_BACKING_DEV_INFO_REMOVAL], [
2048 LB_CHECK_COMPILE([if struct address_space has backing_dev_info],
2050 #include <linux/fs.h>
2052 struct address_space mapping;
2054 mapping.backing_dev_info = NULL;
2056 AC_DEFINE(HAVE_BACKING_DEV_INFO, 1, [backing_dev_info exist])
2058 ]) # LC_BACKING_DEV_INFO_REMOVAL
2061 # LC_HAVE_BDI_CAP_MAP_COPY
2063 # 3.20 removed mmap handling for backing devices since
2064 # it breaks on non-MMU systems. See kernel commit
2065 # b4caecd48005fbed3949dde6c1cb233142fd69e9
2067 AC_DEFUN([LC_HAVE_BDI_CAP_MAP_COPY], [
2068 LB_CHECK_COMPILE([if have 'BDI_CAP_MAP_COPY'],
2070 #include <linux/backing-dev.h>
2072 struct backing_dev_info info;
2074 info.capabilities = BDI_CAP_MAP_COPY;
2076 AC_DEFINE(HAVE_BDI_CAP_MAP_COPY, 1,
2077 [BDI_CAP_MAP_COPY exist])
2079 ]) # LC_HAVE_BDI_CAP_MAP_COPY
2082 # LC_CANCEL_DIRTY_PAGE
2084 # 4.0.0 kernel removed cancel_dirty_page
2086 AC_DEFUN([LC_CANCEL_DIRTY_PAGE], [
2087 LB_CHECK_COMPILE([if cancel_dirty_page still exist],
2088 cancel_dirty_page, [
2089 #include <linux/mm.h>
2091 cancel_dirty_page(NULL, PAGE_SIZE);
2093 AC_DEFINE(HAVE_CANCEL_DIRTY_PAGE, 1,
2094 [cancel_dirty_page is still available])
2096 ]) # LC_CANCEL_DIRTY_PAGE
2101 # 4.1 kernel has iov_iter_rw
2103 AC_DEFUN([LC_IOV_ITER_RW], [
2104 LB_CHECK_COMPILE([if iov_iter_rw exist],
2106 #include <linux/fs.h>
2107 #include <linux/uio.h>
2109 struct iov_iter *iter = NULL;
2113 AC_DEFINE(HAVE_IOV_ITER_RW, 1,
2114 [iov_iter_rw exist])
2119 # LC_HAVE_SYNC_READ_WRITE
2121 # 4.1 new_sync_[read|write] no longer exported
2123 AC_DEFUN([LC_HAVE_SYNC_READ_WRITE], [
2124 LB_CHECK_EXPORT([new_sync_read], [fs/read_write.c],
2125 [AC_DEFINE(HAVE_SYNC_READ_WRITE, 1,
2126 [new_sync_[read|write] is exported by the kernel])])
2127 ]) # LC_HAVE_SYNC_READ_WRITE
2132 # 4.1 redefined bi_cnt as __bi_cnt in commit dac56212e8127dbc0
2134 AC_DEFUN([LC_HAVE___BI_CNT], [
2135 LB_CHECK_COMPILE([if Linux kernel has __bi_cnt in struct bio],
2137 #include <asm/atomic.h>
2138 #include <linux/bio.h>
2139 #include <linux/blk_types.h>
2141 struct bio bio = { };
2143 cnt = atomic_read(&bio.__bi_cnt);
2145 AC_DEFINE(HAVE___BI_CNT, 1,
2146 [struct bio has __bi_cnt])
2148 ]) # LC_HAVE___BI_CNT
2151 # LC_NEW_CANCEL_DIRTY_PAGE
2153 # 4.2 kernel has new cancel_dirty_page
2155 AC_DEFUN([LC_NEW_CANCEL_DIRTY_PAGE], [
2156 LB_CHECK_COMPILE([if cancel_dirty_page with one argument exist],
2157 new_cancel_dirty_page, [
2158 #include <linux/mm.h>
2160 cancel_dirty_page(NULL);
2162 AC_DEFINE(HAVE_NEW_CANCEL_DIRTY_PAGE, 1,
2163 [cancel_dirty_page with one arguement is available])
2165 ]) # LC_NEW_CANCEL_DIRTY_PAGE
2168 # LC_SYMLINK_OPS_USE_NAMEIDATA
2170 # For the 4.2+ kernels the file system internal symlink api no
2171 # longer uses struct nameidata as a argument
2173 AC_DEFUN([LC_SYMLINK_OPS_USE_NAMEIDATA], [
2174 LB_CHECK_COMPILE([if symlink inode operations have struct nameidata argument],
2175 symlink_use_nameidata, [
2176 #include <linux/namei.h>
2177 #include <linux/fs.h>
2179 struct nameidata *nd = NULL;
2181 ((struct inode_operations *)0)->follow_link(NULL, nd);
2182 ((struct inode_operations *)0)->put_link(NULL, nd, NULL);
2184 AC_DEFINE(HAVE_SYMLINK_OPS_USE_NAMEIDATA, 1,
2185 [symlink inode operations need struct nameidata argument])
2187 ]) # LC_SYMLINK_OPS_USE_NAMEIDATA
2190 # LC_BIO_ENDIO_USES_ONE_ARG
2192 # 4.2 kernel bio_endio now only takes one argument
2194 AC_DEFUN([LC_BIO_ENDIO_USES_ONE_ARG], [
2195 LB_CHECK_COMPILE([if 'bio_endio' with one argument exist],
2197 #include <linux/bio.h>
2201 AC_DEFINE(HAVE_BIO_ENDIO_USES_ONE_ARG, 1,
2202 [bio_endio takes only one argument])
2204 ]) # LC_BIO_ENDIO_USES_ONE_ARG
2207 # LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
2209 # 4.3 replace interval with interval_exp in 'struct blk_integrity'
2210 # 'struct blk_integrity_profile' is also added in this version,
2211 # thus use this to determine whether 'struct blk_integrity' has profile
2213 AC_DEFUN([LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY], [
2214 LB_CHECK_COMPILE([if 'blk_integrity.interval_exp' exist],
2215 blk_integrity_interval_exp, [
2216 #include <linux/blkdev.h>
2218 ((struct blk_integrity *)0)->interval_exp = 0;
2220 AC_DEFINE(HAVE_INTERVAL_EXP_BLK_INTEGRITY, 1,
2221 [blk_integrity.interval_exp exist])
2223 ]) # LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
2226 # LC_HAVE_LOOP_CTL_GET_FREE
2228 # 4.x kernel have moved userspace APIs to
2229 # the separate directory and all of them
2230 # support LOOP_CTL_GET_FREE
2232 AC_DEFUN([LC_HAVE_LOOP_CTL_GET_FREE], [
2233 LB_CHECK_FILE([$LINUX/include/linux/loop.h], [
2234 LB_CHECK_COMPILE([if have 'HAVE_LOOP_CTL_GET_FREE'],
2235 LOOP_CTL_GET_FREE, [
2236 #include <linux/loop.h>
2240 i = LOOP_CTL_GET_FREE;
2242 AC_DEFINE(HAVE_LOOP_CTL_GET_FREE, 1,
2243 [LOOP_CTL_GET_FREE exist])
2246 AC_DEFINE(HAVE_LOOP_CTL_GET_FREE, 1,
2247 [kernel has LOOP_CTL_GET_FREE])
2249 ]) # LC_HAVE_LOOP_CTL_GET_FREE
2252 # LC_HAVE_CACHE_HEAD_HLIST
2254 # 4.3 kernel swiched to hlist for cache_head
2256 AC_DEFUN([LC_HAVE_CACHE_HEAD_HLIST], [
2257 LB_CHECK_COMPILE([if 'struct cache_head' has 'cache_list' field],
2258 cache_head_has_hlist, [
2259 #include <linux/sunrpc/cache.h>
2261 do {} while(sizeof(((struct cache_head *)0)->cache_list));
2263 AC_DEFINE(HAVE_CACHE_HEAD_HLIST, 1,
2264 [cache_head has hlist cache_list])
2266 ]) # LC_HAVE_CACHE_HEAD_HLIST
2269 # LC_HAVE_XATTR_HANDLER_SIMPLIFIED
2271 # Kernel version 4.3 commit e409de992e3ea3674393465f07cc71c948edd87a
2272 # simplified xattr_handler handling by passing in the handler pointer
2274 AC_DEFUN([LC_HAVE_XATTR_HANDLER_SIMPLIFIED], [
2275 tmp_flags="$EXTRA_KCFLAGS"
2276 EXTRA_KCFLAGS="-Werror"
2277 LB_CHECK_COMPILE([if 'struct xattr_handler' functions pass in handler pointer],
2278 xattr_handler_simplified, [
2279 #include <linux/xattr.h>
2281 struct xattr_handler handler;
2283 ((struct xattr_handler *)0)->get(&handler, NULL, NULL, NULL, 0);
2284 ((struct xattr_handler *)0)->set(&handler, NULL, NULL, NULL, 0, 0);
2286 AC_DEFINE(HAVE_XATTR_HANDLER_SIMPLIFIED, 1, [handler pointer is parameter])
2288 EXTRA_KCFLAGS="$tmp_flags"
2289 ]) # LC_HAVE_XATTR_HANDLER_SIMPLIFIED
2292 # LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
2294 # 4.3 replace interval with interval_exp in 'struct blk_integrity'.
2296 AC_DEFUN([LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD], [
2297 LB_CHECK_COMPILE([if 'bio_integrity_payload.bip_iter' exist],
2298 bio_integrity_payload_bip_iter, [
2299 #include <linux/bio.h>
2301 ((struct bio_integrity_payload *)0)->bip_iter.bi_size = 0;
2303 AC_DEFINE(HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD, 1,
2304 [bio_integrity_payload.bip_iter exist])
2306 ]) # LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
2309 # LC_BIO_INTEGRITY_PREP_FN
2311 # Lustre kernel patch extents bio_integrity_prep to accept optional
2312 # generate/verify_fn as extra args.
2314 AC_DEFUN([LC_BIO_INTEGRITY_PREP_FN], [
2315 LB_CHECK_COMPILE([if 'bio_integrity_prep_fn' exists],
2316 bio_integrity_prep_fn, [
2317 #include <linux/bio.h>
2319 bio_integrity_prep_fn(NULL, NULL, NULL);
2321 AC_DEFINE(HAVE_BIO_INTEGRITY_PREP_FN, 1,
2322 [kernel has bio_integrity_prep_fn])
2323 AC_SUBST(PATCHED_INTEGRITY_INTF)
2325 AC_SUBST(PATCHED_INTEGRITY_INTF, [#])
2327 ]) # LC_BIO_INTEGRITY_PREP_FN
2332 # 4.4/4.8 redefined bi_rw as bi_opf (SLES12/kernel commit 4382e33ad37486)
2334 AC_DEFUN([LC_HAVE_BI_OPF], [
2335 LB_CHECK_COMPILE([if Linux kernel has bi_opf in struct bio],
2337 #include <linux/bio.h>
2343 AC_DEFINE(HAVE_BI_OPF, 1,
2344 [struct bio has bi_opf])
2349 # LC_HAVE_SUBMIT_BIO_2ARGS
2351 # 4.4 removed an argument from submit_bio
2353 AC_DEFUN([LC_HAVE_SUBMIT_BIO_2ARGS], [
2354 LB_CHECK_COMPILE([if submit_bio takes two arguments],
2355 have_submit_bio_2args, [
2356 #include <linux/bio.h>
2359 submit_bio(READ, &bio);
2361 AC_DEFINE(HAVE_SUBMIT_BIO_2ARGS, 1,
2362 [submit_bio takes two arguments])
2364 ]) # LC_HAVE_SUBMIT_BIO_2_ARGS
2367 # LC_HAVE_CLEAN_BDEV_ALIASES
2369 # 4.4/4.9 unmap_underlying_metadata was replaced by clean_bdev_aliases
2370 # (SLES12/kernel commit 29f3ad7d8380364c)
2372 AC_DEFUN([LC_HAVE_CLEAN_BDEV_ALIASES], [
2373 LB_CHECK_COMPILE([if kernel has clean_bdev_aliases],
2374 have_clean_bdev_aliases, [
2375 #include <linux/buffer_head.h>
2377 struct block_device bdev;
2378 clean_bdev_aliases(&bdev,1,1);
2380 AC_DEFINE(HAVE_CLEAN_BDEV_ALIASES, 1,
2381 [kernel has clean_bdev_aliases])
2383 ]) # LC_HAVE_CLEAN_BDEV_ALIASES
2386 # LC_HAVE_LOCKS_LOCK_FILE_WAIT
2388 # 4.4 kernel have moved locks API users to
2389 # locks_lock_inode_wait()
2391 AC_DEFUN([LC_HAVE_LOCKS_LOCK_FILE_WAIT], [
2392 LB_CHECK_COMPILE([if 'locks_lock_file_wait' exists],
2393 locks_lock_file_wait, [
2394 #include <linux/fs.h>
2396 locks_lock_file_wait(NULL, NULL);
2398 AC_DEFINE(HAVE_LOCKS_LOCK_FILE_WAIT, 1,
2399 [kernel has locks_lock_file_wait])
2401 ]) # LC_HAVE_LOCKS_LOCK_FILE_WAIT
2404 # LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
2406 # 4.4 kernel merged type-specific data with the payload data for keys
2408 AC_DEFUN([LC_HAVE_KEY_PAYLOAD_DATA_ARRAY], [
2409 LB_CHECK_COMPILE([if 'struct key' has 'payload.data' as an array],
2410 key_payload_data_array, [
2411 #include <linux/key.h>
2413 struct key key = { };
2415 key.payload.data[0] = NULL;
2417 AC_DEFINE(HAVE_KEY_PAYLOAD_DATA_ARRAY, 1, [payload.data is an array])
2419 ]) #LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
2422 # LC_HAVE_XATTR_HANDLER_NAME
2424 # Kernel version 4.4 commit 98e9cb5711c68223f0e4d5201b9a6add255ec550
2425 # add a name member to struct xattr_handler
2427 AC_DEFUN([LC_HAVE_XATTR_HANDLER_NAME], [
2428 tmp_flags="$EXTRA_KCFLAGS"
2429 EXTRA_KCFLAGS="-Werror"
2430 LB_CHECK_COMPILE([if 'struct xattr_handler' has a name member],
2431 xattr_handler_name, [
2432 #include <linux/xattr.h>
2434 ((struct xattr_handler *)NULL)->name = NULL;
2436 AC_DEFINE(HAVE_XATTR_HANDLER_NAME, 1, [xattr_handler has a name member])
2438 EXTRA_KCFLAGS="$tmp_flags"
2439 ]) # LC_HAVE_XATTR_HANDLER_NAME
2442 # LC_HAVE_FILE_DENTRY
2444 # 4.5 adds wrapper file_dentry
2446 AC_DEFUN([LC_HAVE_FILE_DENTRY], [
2447 LB_CHECK_COMPILE([if Linux kernel has 'file_dentry'],
2449 #include <linux/fs.h>
2453 AC_DEFINE(HAVE_FILE_DENTRY, 1,
2454 [kernel has file_dentry])
2456 ]) # LC_HAVE_FILE_DENTRY
2459 # LC_HAVE_INODE_LOCK
2461 # 4.5 introduced inode_lock
2463 AC_DEFUN([LC_HAVE_INODE_LOCK], [
2464 LB_CHECK_COMPILE([if 'inode_lock' is defined],
2466 #include <linux/fs.h>
2470 AC_DEFINE(HAVE_INODE_LOCK, 1,
2471 [inode_lock is defined])
2473 ]) # LC_HAVE_INODE_LOCK
2476 # LC_HAVE_IOP_GET_LINK
2478 # 4.5 vfs replaced iop->follow_link with
2481 AC_DEFUN([LC_HAVE_IOP_GET_LINK], [
2482 LB_CHECK_COMPILE([if 'iop' has 'get_link'],
2483 inode_ops_get_link, [
2484 #include <linux/fs.h>
2486 struct inode_operations iop;
2487 iop.get_link = NULL;
2489 AC_DEFINE(HAVE_IOP_GET_LINK, 1,
2490 [have iop get_link])
2492 ]) # LC_HAVE_IOP_GET_LINK
2495 # LC_HAVE_IN_COMPAT_SYSCALL
2497 # 4.6 renamed is_compat_task to in_compat_syscall
2499 AC_DEFUN([LC_HAVE_IN_COMPAT_SYSCALL], [
2500 LB_CHECK_COMPILE([if 'in_compat_syscall' is defined],
2501 in_compat_syscall, [
2502 #include <linux/compat.h>
2504 in_compat_syscall();
2506 AC_DEFINE(HAVE_IN_COMPAT_SYSCALL, 1,
2507 [have in_compat_syscall])
2509 ]) # LC_HAVE_IN_COMPAT_SYSCALL
2512 # LC_HAVE_XATTR_HANDLER_INODE_PARAM
2514 # Kernel version 4.6 commit b296821a7c42fa58baa17513b2b7b30ae66f3336
2515 # and commit 5930122683dff58f0846b0f0405b4bd598a3ba6a added inode parameter
2516 # to xattr_handler functions
2518 AC_DEFUN([LC_HAVE_XATTR_HANDLER_INODE_PARAM], [
2519 tmp_flags="$EXTRA_KCFLAGS"
2520 EXTRA_KCFLAGS="-Werror"
2521 LB_CHECK_COMPILE([if 'struct xattr_handler' functions have inode parameter],
2522 xattr_handler_inode_param, [
2523 #include <linux/xattr.h>
2525 const struct xattr_handler handler;
2527 ((struct xattr_handler *)0)->get(&handler, NULL, NULL, NULL, NULL, 0);
2528 ((struct xattr_handler *)0)->set(&handler, NULL, NULL, NULL, NULL, 0, 0);
2530 AC_DEFINE(HAVE_XATTR_HANDLER_INODE_PARAM, 1, [needs inode parameter])
2532 EXTRA_KCFLAGS="$tmp_flags"
2533 ]) # LC_HAVE_XATTR_HANDLER_INODE_PARAM
2538 # Kernel version 4.6 commit 85c7f81041d57cfe9dc97f4680d5586b54534a39
2539 # introduced parallel lookups in the VFS layer. The inline function
2540 # d_in_lookup was added to notify when the same item was being queried
2543 AC_DEFUN([LC_D_IN_LOOKUP], [
2544 tmp_flags="$EXTRA_KCFLAGS"
2545 EXTRA_KCFLAGS="-Werror"
2546 LB_CHECK_COMPILE([if 'd_in_lookup' is defined],
2548 #include <linux/dcache.h>
2552 AC_DEFINE(HAVE_D_IN_LOOKUP, 1, [d_in_lookup is defined])
2554 EXTRA_KCFLAGS="$tmp_flags"
2560 # Kernel version 4.7 commit c8b8e32d700fe943a935e435ae251364d016c497
2561 # direct-io: eliminate the offset argument to ->direct_IO
2563 AC_DEFUN([LC_DIRECTIO_2ARGS], [
2564 LB_CHECK_COMPILE([if '->direct_IO()' taken 2 arguments],
2566 #include <linux/fs.h>
2568 struct address_space_operations ops = { };
2569 struct iov_iter *iter = NULL;
2570 struct kiocb *iocb = NULL;
2573 rc = ops.direct_IO(iocb, iter);
2575 AC_DEFINE(HAVE_DIRECTIO_2ARGS, 1,
2576 [direct_IO need 2 arguments])
2578 ]) # LC_DIRECTIO_2ARGS
2581 # LC_GENERIC_WRITE_SYNC_2ARGS
2583 # Kernel version 4.7 commit c8b8e32d700fe943a935e435ae251364d016c497
2584 # direct-io: eliminate the offset argument to ->direct_IO
2586 AC_DEFUN([LC_GENERIC_WRITE_SYNC_2ARGS], [
2587 LB_CHECK_COMPILE([if 'generic_write_sync()' taken 2 arguments],
2588 generic_write_sync_2args, [
2589 #include <linux/fs.h>
2591 struct kiocb *iocb = NULL;
2594 rc = generic_write_sync(iocb, 0);
2596 AC_DEFINE(HAVE_GENERIC_WRITE_SYNC_2ARGS, 1,
2597 [generic_write_sync need 2 arguments])
2599 ]) # LC_GENERIC_WRITE_SYNC_2ARGS
2602 # LC_FOP_ITERATE_SHARED
2604 # Kernel version 4.7 adds iterate_shared method to file_operations
2606 AC_DEFUN([LC_FOP_ITERATE_SHARED], [
2607 LB_CHECK_COMPILE([if 'file_operations' has 'iterate_shared'],
2608 fop_iterate_shared, [
2609 #include <linux/fs.h>
2611 struct file_operations fop;
2612 fop.iterate_shared = NULL;
2614 AC_DEFINE(HAVE_FOP_ITERATE_SHARED, 1,
2615 [file_operations has iterate_shared])
2617 ]) # LC_FOP_ITERATE_SHARED
2620 # LC_FOPS_ITERATE_SHARED
2622 # 4.7 commit ae05327a00fd47c34dfe25294b359a3f3fef96e8
2623 # ext4: switch to ->iterate_shared()
2624 # this replaces ext4_dir_operations iterate with iterate_shared.
2625 # dir_relaxed_shared() was also added in this commit, so we can
2626 # use that function to verify that the ext4_dir_operations is using
2629 AC_DEFUN([LC_FOPS_ITERATE_SHARED], [
2630 LB_CHECK_COMPILE([if ext4_dir_operations uses iterate_shared],
2632 #include <linux/fs.h>
2634 ((struct file_operations *)0)->iterate_shared(NULL, NULL);
2635 dir_relax_shared(NULL);
2637 AC_DEFINE(HAVE_ITERATE_SHARED, 1,
2638 ['iterate_shared' is available])
2640 ]) # LC_FOPS_ITERATE_SHARED
2643 # LC_HAVE_POSIX_ACL_VALID_USER_NS
2645 # 4.8 posix_acl_valid takes struct user_namespace
2647 AC_DEFUN([LC_HAVE_POSIX_ACL_VALID_USER_NS], [
2648 LB_CHECK_COMPILE([if 'posix_acl_valid' takes 'struct user_namespace'],
2650 #include <linux/fs.h>
2651 #include <linux/posix_acl.h>
2653 posix_acl_valid((struct user_namespace*)NULL, (const struct posix_acl*)NULL);
2655 AC_DEFINE(HAVE_POSIX_ACL_VALID_USER_NS, 1,
2656 [posix_acl_valid takes struct user_namespace])
2658 ]) # LC_HAVE_POSIX_ACL_VALID_USER_NS
2661 # LC_D_COMPARE_4ARGS
2663 # Kernel version 4.8 commit 6fa67e707559303e086303aeecc9e8b91ef497d5
2664 # get rid of 'parent' argument of ->d_compare()
2666 AC_DEFUN([LC_D_COMPARE_4ARGS], [
2667 LB_CHECK_COMPILE([if 'd_compare' taken 4 arguments],
2669 #include <linux/dcache.h>
2671 ((struct dentry_operations*)0)->d_compare(NULL,0,NULL,NULL);
2673 AC_DEFINE(HAVE_D_COMPARE_4ARGS, 1,
2674 [d_compare need 4 arguments])
2676 ]) # LC_D_COMPARE_4ARGS
2679 # LC_FULL_NAME_HASH_3ARGS
2681 # Kernel version 4.8 commit 8387ff2577eb9ed245df9a39947f66976c6bcd02
2682 # vfs: make the string hashes salt the hash
2684 AC_DEFUN([LC_FULL_NAME_HASH_3ARGS], [
2685 LB_CHECK_COMPILE([if 'full_name_hash' taken 3 arguments],
2686 full_name_hash_3args, [
2687 #include <linux/stringhash.h>
2690 hash = full_name_hash(NULL,NULL,0);
2692 AC_DEFINE(HAVE_FULL_NAME_HASH_3ARGS, 1,
2693 [full_name_hash need 3 arguments])
2695 ]) # LC_FULL_NAME_HASH_3ARGS
2698 # LC_STRUCT_POSIX_ACL_XATTR
2700 # Kernel version 4.8 commit 2211d5ba5c6c4e972ba6dbc912b2897425ea6621
2701 # posix_acl: xattr representation cleanups
2703 AC_DEFUN([LC_STRUCT_POSIX_ACL_XATTR], [
2704 LB_CHECK_COMPILE([if 'struct posix_acl_xattr_{header,entry}' defined],
2705 struct_posix_acl_xattr, [
2706 #include <linux/fs.h>
2707 #include <linux/posix_acl_xattr.h>
2709 struct posix_acl_xattr_header *h = NULL;
2710 struct posix_acl_xattr_entry *e;
2711 e = (void *)(h + 1);
2713 AC_DEFINE(HAVE_STRUCT_POSIX_ACL_XATTR, 1,
2714 [struct posix_acl_xattr_{header,entry} defined])
2716 ]) # LC_STRUCT_POSIX_ACL_XATTR
2721 # Kernel version 4.8 commit fd50ecaddf8372a1d96e0daeaac0f93cf04e4d42
2722 # removed {get,set,remove}xattr inode operations
2724 AC_DEFUN([LC_IOP_XATTR], [
2725 LB_CHECK_COMPILE([if 'inode_operations' has {get,set,remove}xattr members],
2727 #include <linux/fs.h>
2729 struct inode_operations iop;
2730 iop.setxattr = NULL;
2731 iop.getxattr = NULL;
2732 iop.removexattr = NULL;
2734 AC_DEFINE(HAVE_IOP_XATTR, 1,
2735 [inode_operations has {get,set,remove}xattr members])
2742 # Kernel version 4.9 commit 81243eacfa400f5f7b89f4c2323d0de9982bb0fb
2743 # cred: simpler, 1D supplementary groups
2745 AC_DEFUN([LC_GROUP_INFO_GID], [
2746 LB_CHECK_COMPILE([if 'struct group_info' has member 'gid'],
2748 #include <linux/cred.h>
2751 p = ((struct group_info *)0)->gid;
2753 AC_DEFINE(HAVE_GROUP_INFO_GID, 1,
2754 [struct group_info has member gid])
2756 ]) # LC_GROUP_INFO_GID
2761 # Kernel version 4.9 commit 5d6c31910bc0713e37628dc0ce677dcb13c8ccf4
2762 # added __vfs_{get,set,remove}xattr helpers
2764 AC_DEFUN([LC_VFS_SETXATTR], [
2765 LB_CHECK_COMPILE([if '__vfs_setxattr' helper is available],
2767 #include <linux/xattr.h>
2769 __vfs_setxattr(NULL, NULL, NULL, NULL, 0, 0);
2771 AC_DEFINE(HAVE_VFS_SETXATTR, 1,
2772 ['__vfs_setxattr is available])
2774 ]) # LC_VFS_SETXATTR
2777 # LC_POSIX_ACL_UPDATE_MODE
2779 # Kernel version 4.9 commit 073931017b49d9458aa351605b43a7e34598caef
2780 # posix_acl: Clear SGID bit when setting file permissions
2782 AC_DEFUN([LC_POSIX_ACL_UPDATE_MODE], [
2783 LB_CHECK_COMPILE([if 'posix_acl_update_mode' exists],
2784 posix_acl_update_mode, [
2785 #include <linux/fs.h>
2786 #include <linux/posix_acl.h>
2788 posix_acl_update_mode(NULL, NULL, NULL);
2790 AC_DEFINE(HAVE_POSIX_ACL_UPDATE_MODE, 1,
2791 ['posix_acl_update_mode' is available])
2793 ]) # LC_POSIX_ACL_UPDATE_MODE
2796 # LC_IOP_GENERIC_READLINK
2798 # Kernel version 4.10 commit dfeef68862edd7d4bafe68ef7aeb5f658ef24bb5
2799 # removed generic_readlink from individual file systems
2801 AC_DEFUN([LC_IOP_GENERIC_READLINK], [
2802 LB_CHECK_COMPILE([if 'generic_readlink' still exist],
2803 inode_ops_readlink, [
2804 #include <linux/fs.h>
2806 struct inode_operations iop;
2807 iop.readlink = generic_readlink;
2809 AC_DEFINE(HAVE_IOP_GENERIC_READLINK, 1,
2810 [generic_readlink has been removed])
2812 ]) # LC_IOP_GENERIC_READLINK
2815 # LC_HAVE_VM_FAULT_ADDRESS
2817 # Kernel version 4.10 commit 1a29d85eb0f19b7d8271923d8917d7b4f5540b3e
2818 # removed virtual_address field. Need to use address field instead
2820 AC_DEFUN([LC_HAVE_VM_FAULT_ADDRESS], [
2821 LB_CHECK_COMPILE([if 'struct vm_fault' replaced virtual_address with address field],
2823 #include <linux/mm.h>
2825 struct vm_fault vmf;
2828 AC_DEFINE(HAVE_VM_FAULT_ADDRESS, 1,
2829 [virtual_address has been replaced by address field])
2831 ]) # LC_HAVE_VM_FAULT_ADDRESS
2834 # LC_INODEOPS_ENHANCED_GETATTR
2836 # Kernel version 4.11 commit a528d35e8bfcc521d7cb70aaf03e1bd296c8493f
2837 # expanded getattr to be able to get more stat information.
2839 AC_DEFUN([LC_INODEOPS_ENHANCED_GETATTR], [
2840 LB_CHECK_COMPILE([if 'inode_operations' getattr member can gather advance stats],
2842 #include <linux/fs.h>
2846 ((struct inode_operations *)1)->getattr(&path, NULL, 0, 0);
2848 AC_DEFINE(HAVE_INODEOPS_ENHANCED_GETATTR, 1,
2849 [inode_operations .getattr member function can gather advance stats])
2851 ]) # LC_INODEOPS_ENHANCED_GETATTR
2854 # LC_VM_OPERATIONS_REMOVE_VMF_ARG
2856 # Kernel version 4.11 commit 11bac80004499ea59f361ef2a5516c84b6eab675
2857 # removed struct vm_area_struct as an argument for vm_operations since
2858 # in the same kernel version struct vma_area_struct was folded into
2861 AC_DEFUN([LC_VM_OPERATIONS_REMOVE_VMF_ARG], [
2862 LB_CHECK_COMPILE([if 'struct vm_operations' removed struct vm_area_struct],
2863 vm_operations_no_vm_area_struct, [
2864 #include <linux/mm.h>
2866 struct vm_fault vmf;
2868 ((struct vm_operations_struct *)0)->fault(&vmf);
2869 ((struct vm_operations_struct *)0)->page_mkwrite(&vmf);
2871 AC_DEFINE(HAVE_VM_OPS_USE_VM_FAULT_ONLY, 1,
2872 ['struct vm_operations' remove struct vm_area_struct argument])
2874 ]) # LC_VM_OPERATIONS_REMOVE_VMF_ARG
2877 # LC_HAVE_KEY_USAGE_REFCOUNT
2879 # Kernel version 4.11 commit fff292914d3a2f1efd05ca71c2ba72a3c663201e
2880 # converted key.usage from atomic_t to refcount_t.
2882 AC_DEFUN([LC_HAVE_KEY_USAGE_REFCOUNT], [
2883 LB_CHECK_COMPILE([if 'key.usage' is refcount_t],
2884 key_usage_refcount, [
2885 #include <linux/key.h>
2887 struct key key = { };
2889 refcount_read(&key.usage);
2891 AC_DEFINE(HAVE_KEY_USAGE_REFCOUNT, 1, [key.usage is of type refcount_t])
2893 ]) #LC_HAVE_KEY_USAGE_REFCOUNT
2896 # LC_HAVE_CRYPTO_MAX_ALG_NAME_128
2898 # Kernel version 4.11 commit f437a3f477cce402dbec6537b29e9e33962c9f73
2899 # switched CRYPTO_MAX_ALG_NAME from 64 to 128.
2901 AC_DEFUN([LC_HAVE_CRYPTO_MAX_ALG_NAME_128], [
2902 LB_CHECK_COMPILE([if 'CRYPTO_MAX_ALG_NAME' is 128],
2903 crypto_max_alg_name, [
2904 #include <linux/crypto.h>
2906 #if CRYPTO_MAX_ALG_NAME != 128
2910 AC_DEFINE(HAVE_CRYPTO_MAX_ALG_NAME_128, 1,
2911 ['CRYPTO_MAX_ALG_NAME' is 128])
2913 ]) # LC_HAVE_CRYPTO_MAX_ALG_NAME_128
2916 # Kernel version 4.12 commit 47f38c539e9a42344ff5a664942075bd4df93876
2917 # CURRENT_TIME is not 64 bit time safe so it was replaced with
2920 AC_DEFUN([LC_CURRENT_TIME], [
2921 LB_CHECK_COMPILE([if CURRENT_TIME has been replaced with current_time],
2923 #include <linux/fs.h>
2927 attr.ia_atime = current_time(NULL);
2929 AC_DEFINE(HAVE_CURRENT_TIME, 1,
2930 [current_time() has replaced CURRENT_TIME])
2932 ]) # LIBCFS_CURRENT_TIME
2935 # LC_SUPER_SETUP_BDI_NAME
2937 # Kernel version 4.12 commit 9594caf216dc0fe3e318b34af0127276db661241
2938 # unified bdi handling
2940 AC_DEFUN([LC_SUPER_SETUP_BDI_NAME], [
2941 LB_CHECK_COMPILE([if 'super_setup_bdi_name' exist],
2942 super_setup_bdi_name, [
2943 #include <linux/fs.h>
2945 super_setup_bdi_name(NULL, "lustre");
2947 AC_DEFINE(HAVE_SUPER_SETUP_BDI_NAME, 1,
2948 ['super_setup_bdi_name' is available])
2950 ]) # LC_SUPER_SETUP_BDI_NAME
2955 # 4.12 replace bi_error to bi_status
2957 AC_DEFUN([LC_BI_STATUS], [
2958 LB_CHECK_COMPILE([if 'bi_status' exist],
2960 #include <linux/blk_types.h>
2962 ((struct bio *)0)->bi_status = 0;
2964 AC_DEFINE(HAVE_BI_STATUS, 1,
2965 ['bi_status' is available])
2970 # LC_BIO_INTEGRITY_ENABLED
2972 # 4.13 removed bio_integrity_enabled
2974 AC_DEFUN([LC_BIO_INTEGRITY_ENABLED], [
2975 LB_CHECK_COMPILE([if 'bio_integrity_enabled' exist],
2976 bio_integrity_enabled, [
2977 #include <linux/bio.h>
2979 bio_integrity_enabled(NULL);
2981 AC_DEFINE(HAVE_BIO_INTEGRITY_ENABLED, 1,
2982 ['bio_integrity_enabled' is available])
2984 ]) # LC_BIO_INTEGRITY_ENABLED
2987 # LC_PAGEVEC_INIT_ONE_PARAM
2989 # 4.14 pagevec_init takes one parameter
2991 AC_DEFUN([LC_PAGEVEC_INIT_ONE_PARAM], [
2992 LB_CHECK_COMPILE([if 'pagevec_init' takes one parameter],
2994 #include <linux/pagevec.h>
2998 AC_DEFINE(HAVE_PAGEVEC_INIT_ONE_PARAM, 1,
2999 ['pagevec_init' takes one parameter])
3001 ]) # LC_PAGEVEC_INIT_ONE_PARAM
3006 # 4.14 replaced bi_bdev to bi_disk
3008 AC_DEFUN([LC_BI_BDEV], [
3009 LB_CHECK_COMPILE([if 'bi_bdev' exist],
3011 #include <linux/bio.h>
3013 ((struct bio *)0)->bi_bdev = NULL;
3015 AC_DEFINE(HAVE_BI_BDEV, 1,
3016 ['bi_bdev' is available])
3023 # Lustre linux kernel checks
3025 AC_DEFUN([LC_PROG_LINUX], [
3026 AC_MSG_NOTICE([Lustre kernel checks
3027 ==============================================================================])
3032 LC_CONFIG_HEALTH_CHECK_WRITE
3033 LC_CONFIG_LRU_RESIZE
3035 LC_GLIBC_SUPPORT_FHANDLES
3040 LC_BLK_QUEUE_MAX_SEGMENTS
3043 LC_HAVE_XATTR_HANDLER_FLAGS
3046 LC_HAVE_DQUOT_FS_DISK_QUOTA
3047 LC_HAVE_DQUOT_SUSPEND
3048 LC_HAVE_ADD_WAIT_QUEUE_EXCLUSIVE
3052 LC_EXPORT_SIMPLE_SETATTR
3053 LC_EXPORT_TRUNCATE_COMPLETE_PAGE
3057 LC_SBOPS_EVICT_INODE
3061 LC_FS_STRUCT_SEQCOUNT
3064 LC_BLKDEV_GET_BY_DEV
3065 LC_GENERIC_PERMISSION
3073 LC_HAVE_FHANDLE_SYSCALLS
3074 LC_HAVE_FSTYPE_MOUNT
3075 LC_HAVE_INODE_OWNER_OR_CAPABLE
3076 LC_HAVE_SECURITY_IINITSEC
3079 LC_DIRTY_INODE_WITH_FLAG
3083 LC_LM_XXX_LOCK_MANAGER_OPS
3087 LC_INODE_PERMISION_2ARGS
3088 LC_RADIX_EXCEPTION_ENTRY
3089 LC_HAVE_LOOP_CTL_GET_FREE
3092 LC_HAVE_PROTECT_I_NLINK
3095 LC_HAVE_MIGRATE_HEADER
3096 LC_MIGRATEPAGE_4ARGS
3097 LC_SUPEROPS_USE_DENTRY
3098 LC_INODEOPS_USE_UMODE_T
3099 LC_HAVE_CACHE_REGISTER
3103 LC_KMAP_ATOMIC_HAS_1ARG
3107 LC_HAVE_ENCODE_FH_PARENT
3108 LC_FILE_LLSEEK_SIZE_5ARG
3111 LC_DATA_FOR_LLITE_IS_LIST
3112 LC_DENTRY_OPEN_USE_PATH
3113 LC_HAVE_IOP_ATOMIC_OPEN
3114 LC_HAVE_SB_START_WRITE
3117 LC_HAVE_POSIXACL_USER_NS
3120 LC_HAVE_FILE_F_INODE
3122 LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS
3125 LC_HAVE_HLIST_FOR_EACH_3ARG
3126 LC_HAVE_BIO_END_SECTOR
3130 LC_HAVE_REMOVE_PROC_SUBTREE
3132 LC_HAVE_PROJECT_QUOTA
3133 LC_HAVE_SECURITY_DENTRY_INIT_SECURITY
3140 LC_HAVE_DENTRY_D_U_D_ALIAS
3141 LC_HAVE_DENTRY_D_CHILD
3142 LC_PID_NS_FOR_CHILDREN
3145 LC_OLDSIZE_TRUNCATE_PAGECACHE
3146 LC_PTR_ERR_OR_ZERO_MISSING
3148 LC_INIT_LIST_HEAD_RCU
3156 LC_HAVE_TRUNCATE_IPAGES_FINAL
3157 LC_IOPS_RENAME_WITH_FLAGS
3164 LC_DIRECTIO_USE_ITER
3165 LC_HAVE_IOV_ITER_INIT_DIRECTION
3166 LC_HAVE_IOV_ITER_TRUNCATE
3167 LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
3170 LC_HAVE_INTERVAL_BLK_INTEGRITY
3174 LC_PERCPU_COUNTER_INIT
3175 LC_NFS_FILLDIR_USE_CTX
3179 LC_HAVE_DQUOT_QC_DQBLK
3182 LC_BACKING_DEV_INFO_REMOVAL
3183 LC_HAVE_BDI_CAP_MAP_COPY
3186 LC_CANCEL_DIRTY_PAGE
3190 LC_HAVE_SYNC_READ_WRITE
3194 LC_NEW_CANCEL_DIRTY_PAGE
3195 LC_BIO_ENDIO_USES_ONE_ARG
3196 LC_SYMLINK_OPS_USE_NAMEIDATA
3199 LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
3200 LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
3201 LC_HAVE_CACHE_HEAD_HLIST
3202 LC_HAVE_XATTR_HANDLER_SIMPLIFIED
3205 LC_HAVE_LOCKS_LOCK_FILE_WAIT
3206 LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
3207 LC_HAVE_XATTR_HANDLER_NAME
3209 LC_HAVE_SUBMIT_BIO_2ARGS
3210 LC_HAVE_CLEAN_BDEV_ALIASES
3217 LC_HAVE_IOP_GET_LINK
3220 LC_HAVE_IN_COMPAT_SYSCALL
3221 LC_HAVE_XATTR_HANDLER_INODE_PARAM
3226 LC_GENERIC_WRITE_SYNC_2ARGS
3227 LC_FOPS_ITERATE_SHARED
3230 LC_HAVE_POSIX_ACL_VALID_USER_NS
3232 LC_FULL_NAME_HASH_3ARGS
3233 LC_STRUCT_POSIX_ACL_XATTR
3239 LC_POSIX_ACL_UPDATE_MODE
3242 LC_IOP_GENERIC_READLINK
3243 LC_HAVE_VM_FAULT_ADDRESS
3246 LC_INODEOPS_ENHANCED_GETATTR
3247 LC_VM_OPERATIONS_REMOVE_VMF_ARG
3248 LC_HAVE_KEY_USAGE_REFCOUNT
3249 LC_HAVE_CRYPTO_MAX_ALG_NAME_128
3253 LC_SUPER_SETUP_BDI_NAME
3257 LC_BIO_INTEGRITY_ENABLED
3260 LC_PAGEVEC_INIT_ONE_PARAM
3263 # kernel patch to extend integrity interface
3264 LC_BIO_INTEGRITY_PREP_FN
3267 AS_IF([test "x$enable_server" != xno], [
3277 # Check whether to build the client side of Lustre
3279 AC_DEFUN([LC_CONFIG_CLIENT], [
3280 AC_MSG_CHECKING([whether to build Lustre client support])
3281 AC_ARG_ENABLE([client],
3282 AC_HELP_STRING([--disable-client],
3283 [disable Lustre client support]),
3284 [], [enable_client="yes"])
3285 AC_MSG_RESULT([$enable_client])
3286 ]) # LC_CONFIG_CLIENT
3291 AC_DEFUN([LB_CONFIG_MPITESTS], [
3292 AC_ARG_ENABLE([mpitests],
3293 AC_HELP_STRING([--enable-mpitests=<yes|no|mpicc wrapper>],
3294 [include mpi tests]), [
3295 enable_mpitests="yes"
3298 MPICC_WRAPPER="mpicc"
3301 enable_mpitests="no"
3304 MPICC_WRAPPER=$enableval
3308 enable_mpitests="yes"
3309 MPICC_WRAPPER="mpicc"
3312 if test "x$enable_mpitests" != "xno"; then
3315 AC_CACHE_CHECK([whether mpitests can be built],
3316 lb_cv_mpi_tests, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([
3320 MPI_Initialized(&flag);
3323 ])], [lb_cv_mpi_tests="yes"], [lb_cv_mpi_tests="no"])
3325 enable_mpitests=$lb_cv_mpi_tests
3328 AC_SUBST(MPICC_WRAPPER)
3329 ]) # LB_CONFIG_MPITESTS
3334 # whether to enable quota support global control
3336 AC_DEFUN([LC_CONFIG_QUOTA], [
3337 AC_MSG_CHECKING([whether to enable quota support global control])
3338 AC_ARG_ENABLE([quota],
3339 AC_HELP_STRING([--enable-quota],
3340 [enable quota support]),
3341 [], [enable_quota="yes"])
3342 AS_IF([test "x$enable_quota" = xyes],
3343 [AC_MSG_RESULT([yes])],
3344 [AC_MSG_RESULT([no])])
3345 ]) # LC_CONFIG_QUOTA
3350 AC_DEFUN([LC_QUOTA], [
3354 AS_IF([test "x$enable_quota" != xno -a "x$enable_utils" != xno], [
3355 AC_CHECK_HEADER([sys/quota.h],
3356 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1,
3357 [Define to 1 if you have <sys/quota.h>.])],
3358 [AC_MSG_ERROR([don't find <sys/quota.h> in your system])])
3365 # configure support for optional OSD implementation
3367 AC_DEFUN([LC_OSD_ADDON], [
3368 AC_MSG_CHECKING([whether to use OSD addon])
3370 AC_HELP_STRING([--with-osd=path],
3371 [set path to optional osd]),
3378 OSDADDON="$with_osd"
3385 AS_IF([test $ENABLEOSDADDON -eq 0], [
3389 OSDMODNAME=$(basename $OSDADDON)
3390 AS_IF([test -e $LUSTRE/$OSDMODNAME], [
3391 AC_MSG_RESULT([can't link])
3393 ], [ln -s $OSDADDON $LUSTRE/$OSDMODNAME], [
3394 AC_MSG_RESULT([$OSDMODNAME])
3395 OSDADDON="subdir-m += $OSDMODNAME"
3397 AC_MSG_RESULT([can't link])
3407 # other configure checks
3409 AC_DEFUN([LC_CONFIGURE], [
3410 AC_MSG_NOTICE([Lustre core checks
3411 ==============================================================================])
3413 AS_IF([test $target_cpu == "i686" -o $target_cpu == "x86_64"],
3414 [CFLAGS="$CFLAGS -Wall -Werror"])
3416 # maximum MDS thread count
3419 # lustre/utils/gss/gss_util.c
3420 # lustre/utils/gss/gssd_proc.c
3421 # lustre/utils/gss/krb5_util.c
3422 # lustre/utils/llog_reader.c
3423 # lustre/utils/create_iam.c
3424 # lustre/utils/libiam.c
3425 AC_CHECK_HEADERS([netdb.h endian.h])
3426 AC_CHECK_FUNCS([gethostbyname])
3428 # lustre/utils/llverdev.c
3429 AC_CHECK_HEADERS([blkid/blkid.h])
3431 # lustre/utils/llverfs.c
3432 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
3434 # lustre/utils/lfs.c
3435 AC_CHECK_LIB([z], [crc32], [
3436 AC_CHECK_HEADER([zlib.h], [], [
3437 AC_MSG_ERROR([zlib.h not found.])])
3440 zlib library not found. Please install zlib development package.])
3444 AC_CHECK_LIB([selinux], [is_selinux_enabled],
3445 [AC_CHECK_HEADERS([selinux/selinux.h],
3446 [SELINUX="-lselinux"
3447 AC_DEFINE([HAVE_SELINUX], 1,
3448 [support for selinux ])],
3451 No libselinux-devel package found, unable to build selinux enabled tools
3456 No selinux package found, unable to build selinux enabled tools
3462 AC_MSG_CHECKING([whether to report minimum OST free space])
3463 AC_ARG_ENABLE([mindf],
3464 AC_HELP_STRING([--enable-mindf],
3465 [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
3466 [], [enable_mindf="no"])
3467 AC_MSG_RESULT([$enable_mindf])
3468 AS_IF([test "$enable_mindf" = "yes"],
3469 [AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])])
3471 AC_MSG_CHECKING([whether to randomly failing memory alloc])
3472 AC_ARG_ENABLE([fail_alloc],
3473 AC_HELP_STRING([--disable-fail-alloc],
3474 [disable randomly alloc failure]),
3475 [], [enable_fail_alloc="yes"])
3476 AC_MSG_RESULT([$enable_fail_alloc])
3477 AS_IF([test "x$enable_fail_alloc" != xno],
3478 [AC_DEFINE([RANDOM_FAIL_ALLOC], 1,
3479 [enable randomly alloc failure])])
3481 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
3482 AC_ARG_ENABLE([invariants],
3483 AC_HELP_STRING([--enable-invariants],
3484 [enable invariant checking (cpu intensive)]),
3485 [], [enable_invariants="no"])
3486 AC_MSG_RESULT([$enable_invariants])
3487 AS_IF([test "x$enable_invariants" = xyes],
3488 [AC_DEFINE([CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK], 1,
3489 [enable invariant checking])])
3491 AC_MSG_CHECKING([whether to track references with lu_ref])
3492 AC_ARG_ENABLE([lu_ref],
3493 AC_HELP_STRING([--enable-lu_ref],
3494 [enable lu_ref reference tracking code]),
3495 [], [enable_lu_ref="no"])
3496 AC_MSG_RESULT([$enable_lu_ref])
3497 AS_IF([test "x$enable_lu_ref" = xyes],
3498 [AC_DEFINE([USE_LU_REF], 1,
3499 [enable lu_ref reference tracking code])])
3501 AC_MSG_CHECKING([whether to enable page state tracking])
3502 AC_ARG_ENABLE([pgstate-track],
3503 AC_HELP_STRING([--enable-pgstate-track],
3504 [enable page state tracking]),
3505 [], [enable_pgstat_track="no"])
3506 AC_MSG_RESULT([$enable_pgstat_track])
3507 AS_IF([test "x$enable_pgstat_track" = xyes],
3508 [AC_DEFINE([CONFIG_DEBUG_PAGESTATE_TRACKING], 1,
3509 [enable page state tracking code])])
3512 AC_MSG_CHECKING([systemd unit file directory])
3513 AC_ARG_WITH([systemdsystemunitdir],
3514 [AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
3515 [Directory for systemd service files])],
3516 [], [with_systemdsystemunitdir=auto])
3517 AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"],
3518 [def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
3519 AS_IF([test "x$def_systemdsystemunitdir" = "x"],
3520 [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
3521 [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
3522 with_systemdsystemunitdir=no],
3523 [with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
3524 AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
3525 [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
3526 AC_MSG_RESULT([$with_systemdsystemunitdir])
3532 # AM_CONDITIONALS for lustre
3534 AC_DEFUN([LC_CONDITIONALS], [
3535 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
3536 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
3537 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
3538 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
3539 AM_CONDITIONAL(BLKID, test x$ac_cv_header_blkid_blkid_h = xyes)
3540 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
3541 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
3542 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
3543 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
3544 AM_CONDITIONAL(GSS_SSK, test x$enable_ssk = xyes)
3545 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
3546 AM_CONDITIONAL(HAVE_SYSTEMD, test "x$with_systemdsystemunitdir" != "xno")
3547 AM_CONDITIONAL(XATTR_HANDLER, test "x$lb_cv_compile_xattr_handler_flags" = xyes)
3548 AM_CONDITIONAL(SELINUX, test "$SELINUX" = "-lselinux")
3549 ]) # LC_CONDITIONALS
3554 # files that should be generated with AC_OUTPUT
3556 AC_DEFUN([LC_CONFIG_FILES],
3560 lustre/autoconf/Makefile
3561 lustre/conf/Makefile
3562 lustre/conf/resource/Makefile
3563 lustre/contrib/Makefile
3565 lustre/include/Makefile
3566 lustre/include/lustre/Makefile
3567 lustre/include/uapi/linux/lustre/Makefile
3568 lustre/kernel_patches/targets/3.10-rhel7.6.target
3569 lustre/kernel_patches/targets/3.10-rhel7.5.target
3570 lustre/kernel_patches/targets/4.14-rhel7.5.target
3571 lustre/kernel_patches/targets/4.14-rhel7.6.target
3572 lustre/kernel_patches/targets/2.6-rhel6.9.target
3573 lustre/kernel_patches/targets/2.6-rhel6.8.target
3574 lustre/kernel_patches/targets/2.6-rhel6.7.target
3575 lustre/kernel_patches/targets/2.6-rhel6.6.target
3576 lustre/kernel_patches/targets/2.6-rhel6.target
3577 lustre/kernel_patches/targets/2.6-rhel5.target
3578 lustre/kernel_patches/targets/2.6-sles11.target
3579 lustre/kernel_patches/targets/3.0-sles11.target
3580 lustre/kernel_patches/targets/3.0-sles11sp3.target
3581 lustre/kernel_patches/targets/3.0-sles11sp4.target
3582 lustre/kernel_patches/targets/3.12-sles12.target
3583 lustre/kernel_patches/targets/4.4-sles12.target
3584 lustre/kernel_patches/targets/4.4-sles12sp3.target
3585 lustre/kernel_patches/targets/2.6-fc11.target
3586 lustre/kernel_patches/targets/2.6-fc12.target
3587 lustre/kernel_patches/targets/2.6-fc15.target
3588 lustre/kernel_patches/targets/3.x-fc18.target
3589 lustre/ldlm/Makefile
3591 lustre/fid/autoMakefile
3592 lustre/llite/Makefile
3593 lustre/llite/autoMakefile
3595 lustre/lov/autoMakefile
3597 lustre/mdc/autoMakefile
3599 lustre/lmv/autoMakefile
3600 lustre/lfsck/Makefile
3601 lustre/lfsck/autoMakefile
3603 lustre/mdt/autoMakefile
3605 lustre/mdd/autoMakefile
3607 lustre/fld/autoMakefile
3608 lustre/obdclass/Makefile
3609 lustre/obdclass/autoMakefile
3610 lustre/obdecho/Makefile
3611 lustre/obdecho/autoMakefile
3613 lustre/ofd/autoMakefile
3615 lustre/osc/autoMakefile
3617 lustre/ost/autoMakefile
3618 lustre/osd-ldiskfs/Makefile
3619 lustre/osd-ldiskfs/autoMakefile
3620 lustre/osd-zfs/Makefile
3621 lustre/osd-zfs/autoMakefile
3623 lustre/mgc/autoMakefile
3625 lustre/mgs/autoMakefile
3626 lustre/target/Makefile
3627 lustre/ptlrpc/Makefile
3628 lustre/ptlrpc/autoMakefile
3629 lustre/ptlrpc/gss/Makefile
3630 lustre/ptlrpc/gss/autoMakefile
3631 lustre/quota/Makefile
3632 lustre/quota/autoMakefile
3633 lustre/scripts/Makefile
3634 lustre/scripts/systemd/Makefile
3635 lustre/tests/Makefile
3636 lustre/tests/mpi/Makefile
3637 lustre/tests/kernel/Makefile
3638 lustre/tests/kernel/autoMakefile
3639 lustre/utils/Makefile
3640 lustre/utils/gss/Makefile
3642 lustre/osp/autoMakefile
3644 lustre/lod/autoMakefile
3646 ]) # LC_CONFIG_FILES