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_CONFIG_OBD_BUFFER_SIZE
52 # the maximum buffer size of lctl ioctls
54 AC_DEFUN([LC_CONFIG_OBD_BUFFER_SIZE], [
55 AC_MSG_CHECKING([for maximum OBD ioctl size])
56 AC_ARG_WITH([obd-buffer-size],
57 AC_HELP_STRING([--with-obd-buffer-size=[size]],
58 [set lctl ioctl maximum bytes (default=8192)]),
59 [OBD_BUFFER_SIZE=$with_obd_buffer_size],
60 [OBD_BUFFER_SIZE=8192])
61 AC_MSG_RESULT([$OBD_BUFFER_SIZE bytes])
62 AC_DEFINE_UNQUOTED(CONFIG_LUSTRE_OBD_MAX_IOCTL_BUFFER, $OBD_BUFFER_SIZE,
64 ]) # LC_CONFIG_OBD_BUFFER_SIZE
67 # LC_GLIBC_SUPPORT_FHANDLES
69 AC_DEFUN([LC_GLIBC_SUPPORT_FHANDLES], [
70 AC_CHECK_FUNCS([name_to_handle_at],
71 [AC_DEFINE(HAVE_FHANDLE_GLIBC_SUPPORT, 1,
72 [file handle and related syscalls are supported])],
73 [AC_MSG_WARN([file handle and related syscalls are not supported])])
74 ]) # LC_GLIBC_SUPPORT_FHANDLES
79 # Ensure the stack size is at least 8k in Lustre server (all kernels)
81 AC_DEFUN([LC_STACK_SIZE], [
82 LB_CHECK_COMPILE([if stack size is at least 8k],
84 #include <linux/thread_info.h>
86 #if THREAD_SIZE < 8192
87 #error "stack size < 8192"
89 ], [], [AC_MSG_ERROR([
91 Lustre requires that Linux is configured with at least a 8KB stack.
98 # Allow the user to set the MDS thread upper limit
100 AC_DEFUN([LC_MDS_MAX_THREADS], [
101 AC_MSG_CHECKING([for maximum number of MDS threads])
102 AC_ARG_WITH([mds_max_threads],
103 AC_HELP_STRING([--with-mds-max-threads=count],
104 [maximum threads available on the MDS: (default=512)]),
105 [AC_DEFINE_UNQUOTED(MDS_MAX_THREADS, $with_mds_max_threads,
106 [maximum number of MDS threads])])
107 AC_MSG_RESULT([$with_mds_max_threads])
108 ]) # LC_MDS_MAX_THREADS
113 # the pinger is temporary, until we have the recovery node in place
115 AC_DEFUN([LC_CONFIG_PINGER], [
116 AC_MSG_CHECKING([whether to enable Lustre pinger support])
117 AC_ARG_ENABLE([pinger],
118 AC_HELP_STRING([--disable-pinger],
119 [disable recovery pinger support]),
120 [], [enable_pinger="yes"])
121 AC_MSG_RESULT([$enable_pinger])
122 AS_IF([test "x$enable_pinger" != xno],
123 [AC_DEFINE(ENABLE_PINGER, 1,[Use the Pinger])])
124 ]) # LC_CONFIG_PINGER
129 # do checksum of bulk data between client and OST
131 AC_DEFUN([LC_CONFIG_CHECKSUM], [
132 AC_MSG_CHECKING([whether to enable data checksum support])
133 AC_ARG_ENABLE([checksum],
134 AC_HELP_STRING([--disable-checksum],
135 [disable data checksum support]),
136 [], [enable_checksum="yes"])
137 AC_MSG_RESULT([$enable_checksum])
138 AS_IF([test "x$enable_checksum" != xno],
139 [AC_DEFINE(ENABLE_CHECKSUM, 1, [do data checksums])])
140 ]) # LC_CONFIG_CHECKSUM
143 # LC_CONFIG_HEALTH_CHECK_WRITE
145 # Turn off the actual write to the disk
147 AC_DEFUN([LC_CONFIG_HEALTH_CHECK_WRITE], [
148 AC_MSG_CHECKING([whether to enable a write with the health check])
149 AC_ARG_ENABLE([health_write],
150 AC_HELP_STRING([--enable-health_write],
151 [enable disk writes when doing health check]),
152 [], [enable_health_write="no"])
153 AC_MSG_RESULT([$enable_health_write])
154 AS_IF([test "x$enable_health_write" != xno],
155 [AC_DEFINE(USE_HEALTH_CHECK_WRITE, 1, [Write when Checking Health])])
156 ]) # LC_CONFIG_HEALTH_CHECK_WRITE
159 # LC_CONFIG_LRU_RESIZE
161 AC_DEFUN([LC_CONFIG_LRU_RESIZE], [
162 AC_MSG_CHECKING([whether to enable lru self-adjusting])
163 AC_ARG_ENABLE([lru_resize],
164 AC_HELP_STRING([--enable-lru-resize],
165 [enable lru resize support]),
166 [], [enable_lru_resize="yes"])
167 AC_MSG_RESULT([$enable_lru_resize])
168 AS_IF([test "x$enable_lru_resize" != xno],
169 [AC_DEFINE(HAVE_LRU_RESIZE_SUPPORT, 1, [Enable lru resize support])])
170 ]) # LC_CONFIG_LRU_RESIZE
175 # Quota support. The kernel must support CONFIG_QUOTA.
177 AC_DEFUN([LC_QUOTA_CONFIG], [
178 LB_CHECK_CONFIG_IM([QUOTA], [],
181 Lustre quota requires that CONFIG_QUOTA is enabled in your kernel.
186 # LC_EXPORT_TRUNCATE_COMPLETE_PAGE
188 # truncate_complete_page() has never been exported from an upstream kernel
189 # remove_from_page_cache() was exported between 2.6.35 and 2.6.38
190 # delete_from_page_cache() is exported from 2.6.39
192 AC_DEFUN([LC_EXPORT_TRUNCATE_COMPLETE_PAGE], [
193 LB_CHECK_EXPORT([truncate_complete_page], [mm/truncate.c],
194 [AC_DEFINE(HAVE_TRUNCATE_COMPLETE_PAGE, 1,
195 [kernel export truncate_complete_page])])
196 LB_CHECK_EXPORT([remove_from_page_cache], [mm/filemap.c],
197 [AC_DEFINE(HAVE_REMOVE_FROM_PAGE_CACHE, 1,
198 [kernel export remove_from_page_cache])])
199 LB_CHECK_EXPORT([delete_from_page_cache], [mm/filemap.c],
200 [AC_DEFINE(HAVE_DELETE_FROM_PAGE_CACHE, 1,
201 [kernel export delete_from_page_cache])])
202 ]) # LC_EXPORT_TRUNCATE_COMPLETE_PAGE
205 # LC_CONFIG_GSS_KEYRING
207 # default 'auto', tests for dependencies, if found, enables;
208 # only called if gss is enabled
210 AC_DEFUN([LC_CONFIG_GSS_KEYRING], [
211 AC_MSG_CHECKING([whether to enable gss keyring backend])
212 AC_ARG_ENABLE([gss_keyring],
213 [AC_HELP_STRING([--disable-gss-keyring],
214 [disable gss keyring backend])],
215 [], [enable_gss_keyring="auto"])
216 AC_MSG_RESULT([$enable_gss_keyring])
217 AS_IF([test "x$enable_gss_keyring" != xno], [
218 LB_CHECK_CONFIG_IM([KEYS], [], [
219 gss_keyring_conf_test="fail"
220 AC_MSG_WARN([GSS keyring backend requires that CONFIG_KEYS be enabled in your kernel.])])
222 AC_CHECK_LIB([keyutils], [keyctl_search], [], [
223 gss_keyring_conf_test="fail"
224 AC_MSG_WARN([GSS keyring backend requires libkeyutils])])
226 AS_IF([test "x$gss_keyring_conf_test" != xfail], [
227 AC_DEFINE([HAVE_GSS_KEYRING], [1],
228 [Define this if you enable gss keyring backend])
229 enable_gss_keyring="yes"
231 AS_IF([test "x$enable_gss_keyring" = xyes], [
232 AC_MSG_ERROR([Cannot enable gss_keyring. See above for details.])
236 ]) # LC_CONFIG_GSS_KEYRING
239 # LC_HAVE_CRED_TGCRED
241 # rhel7 struct cred has no member tgcred
243 AC_DEFUN([LC_HAVE_CRED_TGCRED], [
244 LB_CHECK_COMPILE([if 'struct cred' has member 'tgcred'],
246 #include <linux/cred.h>
248 ((struct cred *)0)->tgcred = NULL;
250 AC_DEFINE(HAVE_CRED_TGCRED, 1,
251 [struct cred has member tgcred])
253 ]) # LC_HAVE_CRED_TGCRED
256 # LC_KEY_TYPE_INSTANTIATE_2ARGS
258 # rhel7 key_type->instantiate takes 2 args (struct key, struct key_preparsed_payload)
260 AC_DEFUN([LC_KEY_TYPE_INSTANTIATE_2ARGS], [
261 LB_CHECK_COMPILE([if 'key_type->instantiate' has two args],
262 key_type_instantiate_2args, [
263 #include <linux/key-type.h>
265 ((struct key_type *)0)->instantiate(0, NULL);
267 AC_DEFINE(HAVE_KEY_TYPE_INSTANTIATE_2ARGS, 1,
268 [key_type->instantiate has two args])
270 ]) # LC_KEY_TYPE_INSTANTIATE_2ARGS
275 AC_DEFUN([LC_CONFIG_SUNRPC], [
276 LB_CHECK_CONFIG_IM([SUNRPC], [], [
277 AS_IF([test "x$sunrpc_required" = xyes], [
280 kernel SUNRPC support is required by using GSS.
283 ]) # LC_CONFIG_SUNRPC
286 # LC_HAVE_CRYPTO_HASH
288 # 4.6 kernel commit 896545098777564212b9e91af4c973f094649aa7
289 # removed crypto_hash support. Since GSS only works with
290 # crypto_hash it has to be disabled for newer distros.
292 AC_DEFUN([LC_HAVE_CRYPTO_HASH], [
293 LB_CHECK_COMPILE([if crypto_hash API is supported],
295 #include <linux/crypto.h>
297 crypto_hash_digestsize(NULL);
298 ], [], [enable_gss="no"])
300 ]) # LC_HAVE_CRYPTO_HASH
303 # LC_CONFIG_GSS (default 'auto' (tests for dependencies, if found, enables))
305 # Build gss and related tools of Lustre. Currently both kernel and user space
306 # parts are depend on linux platform.
308 AC_DEFUN([LC_CONFIG_GSS], [
309 AC_MSG_CHECKING([whether to enable gss support])
311 [AC_HELP_STRING([--enable-gss], [enable gss support])],
312 [], [enable_gss="auto"])
313 AC_MSG_RESULT([$enable_gss])
315 AS_IF([test "x$enable_gss" != xno], [
316 LC_CONFIG_GSS_KEYRING
319 LC_KEY_TYPE_INSTANTIATE_2ARGS
320 sunrpc_required=$enable_gss
324 LB_CHECK_CONFIG_IM([CRYPTO_MD5], [],
325 [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
326 LB_CHECK_CONFIG_IM([CRYPTO_SHA1], [],
327 [AC_MSG_WARN([kernel SHA1 support is recommended by using GSS.])])
328 LB_CHECK_CONFIG_IM([CRYPTO_SHA256], [],
329 [AC_MSG_WARN([kernel SHA256 support is recommended by using GSS.])])
330 LB_CHECK_CONFIG_IM([CRYPTO_SHA512], [],
331 [AC_MSG_WARN([kernel SHA512 support is recommended by using GSS.])])
333 require_krb5=$enable_gss
337 AS_IF([test -n "$KRBDIR"], [
338 gss_conf_test="success"
340 gss_conf_test="failure"
343 AS_IF([test "x$gss_conf_test" = xsuccess], [
344 AC_DEFINE([HAVE_GSS], [1], [Define this is if you enable gss])
350 enable_ssk=$enable_gss
356 # OpenSSL 1.0+ return int for HMAC functions but older SLES11 versions do not
357 AC_DEFUN([LC_OPENSSL_SSK], [
358 AC_MSG_CHECKING([whether OpenSSL has functions needed for SSK])
359 AS_IF([test "x$enable_ssk" != xno], [
360 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
361 #include <openssl/hmac.h>
362 #include <openssl/evp.h>
368 rc = HMAC_Init_ex(&ctx, "test", 4, EVP_md_null(), NULL);
370 ])],[AC_DEFINE(HAVE_OPENSSL_SSK, 1,
371 [OpenSSL HMAC functions needed for SSK])],
374 AC_MSG_RESULT([$enable_ssk])
377 # LC_INODE_PERMISION_2ARGS
379 # up to v2.6.27 had a 3 arg version (inode, mask, nameidata)
380 # v2.6.27->v2.6.37 had a 2 arg version (inode, mask)
381 # v2.6.37->v3.0 had a 3 arg version (inode, mask, nameidata)
382 # v3.1 onward have a 2 arg version (inode, mask)
384 AC_DEFUN([LC_INODE_PERMISION_2ARGS], [
385 LB_CHECK_COMPILE([if 'inode_operations->permission' has two args],
386 inode_ops_permission_2args, [
387 #include <linux/fs.h>
389 struct inode *inode __attribute__ ((unused));
392 inode->i_op->permission(NULL, 0);
394 AC_DEFINE(HAVE_INODE_PERMISION_2ARGS, 1,
395 [inode_operations->permission has two args])
397 ]) # LC_INODE_PERMISION_2ARGS
400 # LC_BLK_QUEUE_MAX_SEGMENTS
402 # 2.6.32 replaces 2 functions blk_queue_max_phys_segments and blk_queue_max_hw_segments by blk_queue_max_segments
404 AC_DEFUN([LC_BLK_QUEUE_MAX_SEGMENTS], [
405 LB_CHECK_COMPILE([if 'blk_queue_max_segments' is defined],
406 blk_queue_max_segments, [
407 #include <linux/blkdev.h>
409 blk_queue_max_segments(NULL, 0);
411 AC_DEFINE(HAVE_BLK_QUEUE_MAX_SEGMENTS, 1,
412 [blk_queue_max_segments is defined])
414 ]) # LC_BLK_QUEUE_MAX_SEGMENTS
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;
509 __add_wait_queue_exclusive(&queue, &wait);
511 AC_DEFINE(HAVE___ADD_WAIT_QUEUE_EXCLUSIVE, 1,
512 [__add_wait_queue_exclusive exists])
514 ]) # LC_HAVE_ADD_WAIT_QUEUE_EXCLUSIVE
517 # LC_FS_STRUCT_RWLOCK
519 # 2.6.36 fs_struct.lock use spinlock instead of rwlock.
521 AC_DEFUN([LC_FS_STRUCT_RWLOCK], [
522 LB_CHECK_COMPILE([if 'fs_struct.lock' use rwlock],
524 #include <asm/atomic.h>
525 #include <linux/spinlock.h>
526 #include <linux/fs_struct.h>
528 ((struct fs_struct *)0)->lock = (rwlock_t){ 0 };
530 AC_DEFINE(HAVE_FS_STRUCT_RWLOCK, 1, [fs_struct.lock use rwlock])
532 ]) # LC_FS_STRUCT_RWLOCK
535 # LC_SBOPS_EVICT_INODE
537 # 2.6.36 super_operations add evict_inode method. it hybird of
538 # delete_inode & clear_inode.
540 AC_DEFUN([LC_SBOPS_EVICT_INODE], [
541 LB_CHECK_COMPILE([if 'super_operations.evict_inode' exist],
542 super_ops_evict_inode, [
543 #include <linux/fs.h>
545 ((struct super_operations *)0)->evict_inode(NULL);
547 AC_DEFINE(HAVE_SBOPS_EVICT_INODE, 1,
548 [super_operations.evict_inode() is exist in kernel])
550 ]) # LC_SBOPS_EVICT_INODE
555 # 2.6.35 file_operations.fsync taken 2 arguments.
556 # 3.0.0 file_operations.fsync takes 4 arguments.
558 AC_DEFUN([LC_FILE_FSYNC], [
559 LB_CHECK_COMPILE([if 'file_operations.fsync' takes 4 arguments],
560 file_ops_fsync_4args, [
561 #include <linux/fs.h>
563 ((struct file_operations *)0)->fsync(NULL, 0, 0, 0);
565 AC_DEFINE(HAVE_FILE_FSYNC_4ARGS, 1,
566 [file_operations.fsync takes 4 arguments])
568 LB_CHECK_COMPILE([if 'file_operations.fsync' takes 2 arguments],
569 file_ops_fsync_2args, [
570 #include <linux/fs.h>
572 ((struct file_operations *)0)->fsync(NULL, 0);
574 AC_DEFINE(HAVE_FILE_FSYNC_2ARGS, 1,
575 [file_operations.fsync takes 2 arguments])
583 # 2.6.37 remove kernel_locked
585 AC_DEFUN([LC_KERNEL_LOCKED], [
586 LB_CHECK_COMPILE([if 'kernel_locked' is defined],
588 #include <linux/smp_lock.h>
592 AC_DEFINE(HAVE_KERNEL_LOCKED, 1, [kernel_locked is defined])
594 ]) # LC_KERNEL_LOCKED
599 # 2.6.38 dentry_operations.d_compare() taken 7 arguments.
601 AC_DEFUN([LC_D_COMPARE_7ARGS], [
602 LB_CHECK_COMPILE([if 'dentry_operations.d_compare()' taken 7 arguments],
603 dentry_ops_d_compare_7arg, [
604 #include <linux/dcache.h>
606 ((struct dentry_operations*)0)->d_compare(NULL,NULL,NULL,NULL,0,NULL,NULL);
608 AC_DEFINE(HAVE_D_COMPARE_7ARGS, 1, [d_compare need 7 arguments])
610 ]) # LC_D_COMPARE_7ARGS
615 # 2.6.38 dentry_operations.d_delete() defined 'const' for 1st parameter.
617 AC_DEFUN([LC_D_DELETE_CONST], [
618 tmp_flags="$EXTRA_KCFLAGS"
619 EXTRA_KCFLAGS="-Werror"
620 LB_CHECK_COMPILE([if 'dentry_operations.d_delete()' has const declare on first parameter],
621 dentry_ops_d_delete_1st_const, [
622 #include <linux/dcache.h>
624 const struct dentry *d = NULL;
625 ((struct dentry_operations*)0)->d_delete(d);
627 AC_DEFINE(HAVE_D_DELETE_CONST, const,
628 [d_delete first parameter declared const])
630 AC_DEFINE(HAVE_D_DELETE_CONST, [],
631 [d_delete first parameter declared is not const])
633 EXTRA_KCFLAGS="$tmp_flags"
634 ]) # LC_D_DELETE_CONST
639 # 2.6.38 dcache_lock removed. rcu-walk committed.
641 AC_DEFUN([LC_DCACHE_LOCK], [
642 LB_CHECK_COMPILE([if 'dcache_lock' is exist],
644 #include <linux/dcache.h>
646 spin_lock(&dcache_lock);
648 AC_DEFINE(HAVE_DCACHE_LOCK, 1,
649 [dcache_lock is exist])
656 # 2.6.38 inode.i_rcu added.
658 AC_DEFUN([LC_INODE_I_RCU], [
659 LB_CHECK_COMPILE([if 'inode.i_rcu' exists],
661 #include <linux/fs.h>
664 struct rcu_head rcu = {};
667 AC_DEFINE(HAVE_INODE_I_RCU, 1,
668 [inode.i_rcu exists])
673 # LC_BLKDEV_GET_BY_DEV
675 # 2.6.38 export blkdev_get_by_dev
677 AC_DEFUN([LC_BLKDEV_GET_BY_DEV], [
678 LB_CHECK_EXPORT([blkdev_get_by_dev], [fs/block_dev.c],
679 [AC_DEFINE(HAVE_BLKDEV_GET_BY_DEV, 1,
680 [blkdev_get_by_dev is exported by the kernel])])
681 ]) # LC_BLKDEV_GET_BY_DEV
684 # LC_EXPORT_SIMPLE_SETATTR
686 # 2.6.38 export simple_setattr
688 AC_DEFUN([LC_EXPORT_SIMPLE_SETATTR], [
689 LB_CHECK_EXPORT([simple_setattr], [fs/libfs.c],
690 [AC_DEFINE(HAVE_SIMPLE_SETATTR, 1,
691 [simple_setattr is exported by the kernel])])
692 ]) # LC_EXPORT_SIMPLE_SETATTR
697 # 2.6.38 add struct blk_plug
699 AC_DEFUN([LC_HAVE_BLK_PLUG], [
700 LB_CHECK_COMPILE([if 'struct blk_plug' exists],
702 #include <linux/blkdev.h>
704 struct blk_plug plug;
706 blk_start_plug(&plug);
707 blk_finish_plug(&plug);
709 AC_DEFINE(HAVE_BLK_PLUG, 1,
710 [blk_plug struct exists])
712 ]) # LC_HAVE_BLK_PLUG
717 # truncate callback removed since 2.6.39
719 AC_DEFUN([LC_IOP_TRUNCATE], [
720 LB_CHECK_COMPILE([if 'inode_operations' has '.truncate' member function],
721 inode_ops_truncate, [
722 #include <linux/fs.h>
724 ((struct inode_operations *)0)->truncate(NULL);
726 AC_DEFINE(HAVE_INODEOPS_TRUNCATE, 1,
727 [inode_operations has .truncate member function])
732 # LC_REQUEST_QUEUE_UNPLUG_FN
734 # 2.6.39 remove unplug_fn from request_queue.
736 AC_DEFUN([LC_REQUEST_QUEUE_UNPLUG_FN], [
737 LB_CHECK_COMPILE([if 'request_queue' has 'unplug_fn' field],
738 request_queue_unplug_fn, [
739 #include <linux/blkdev.h>
741 do {} while(sizeof(((struct request_queue *)0)->unplug_fn));
743 AC_DEFINE(HAVE_REQUEST_QUEUE_UNPLUG_FN, 1,
744 [request_queue has unplug_fn field])
746 ]) # LC_REQUEST_QUEUE_UNPLUG_FN
749 # LC_HAVE_FSTYPE_MOUNT
751 # 2.6.39 replace get_sb with mount in struct file_system_type
753 AC_DEFUN([LC_HAVE_FSTYPE_MOUNT], [
754 LB_CHECK_COMPILE([if 'file_system_type' has 'mount' field],
755 file_system_type_mount, [
756 #include <linux/fs.h>
758 struct file_system_type fst;
759 void *i = (void *) fst.mount;
761 AC_DEFINE(HAVE_FSTYPE_MOUNT, 1,
762 [struct file_system_type has mount field])
764 ]) # LC_HAVE_FSTYPE_MOUNT
767 # LC_HAVE_FHANDLE_SYSCALLS
769 # 2.6.39 The open_by_handle_at() and name_to_handle_at() system calls were
770 # added to Linux kernel 2.6.39.
771 # Check if client supports these functions
773 AC_DEFUN([LC_HAVE_FHANDLE_SYSCALLS], [
774 LB_CHECK_CONFIG_IM([FHANDLE],[
775 AC_DEFINE(HAVE_FHANDLE_SYSCALLS, 1,
776 [kernel supports fhandles and related syscalls])
778 ]) # LC_HAVE_FHANDLE_SYSCALLS
781 # LC_HAVE_INODE_OWNER_OR_CAPABLE
783 # 2.6.39 renames is_owner_or_cap to inode_owner_or_capable
785 AC_DEFUN([LC_HAVE_INODE_OWNER_OR_CAPABLE], [
786 LB_CHECK_COMPILE([if 'inode_owner_or_capable' exist],
787 inode_owner_or_capable, [
788 #include <linux/fs.h>
790 inode_owner_or_capable(NULL);
792 AC_DEFINE(HAVE_INODE_OWNER_OR_CAPABLE, 1,
793 [inode_owner_or_capable exist])
795 ]) # LC_HAVE_INODE_OWNER_OR_CAPABLE
798 # LC_DIRTY_INODE_WITH_FLAG
800 # 3.0 dirty_inode() has a flag parameter
801 # see kernel commit aa38572954ade525817fe88c54faebf85e5a61c0
803 AC_DEFUN([LC_DIRTY_INODE_WITH_FLAG], [
804 LB_CHECK_COMPILE([if 'dirty_inode' super_operation takes flag],
805 dirty_inode_super_operation_flag, [
806 #include <linux/fs.h>
809 inode->i_sb->s_op->dirty_inode(NULL, 0);
811 AC_DEFINE(HAVE_DIRTY_INODE_HAS_FLAG, 1,
812 [dirty_inode super_operation takes flag])
814 ]) # LC_DIRTY_INODE_WITH_FLAG
819 # 3.0 introduced setns
821 AC_DEFUN([LC_SETNS], [
822 AC_CHECK_HEADERS([sched.h], [], [],
825 AC_CHECK_FUNCS([setns])
829 # LC_GENERIC_PERMISSION
831 # 2.6.38 generic_permission taken 4 parameters.
832 # in fact, it means rcu-walk aware permission bring.
834 # 3.1 generic_permission taken 2 parameters.
835 # see kernel commit 2830ba7f34ebb27c4e5b8b6ef408cd6d74860890
837 AC_DEFUN([LC_GENERIC_PERMISSION], [
838 LB_CHECK_COMPILE([if 'generic_permission' take 2 arguments],
839 generic_permission_2args, [
840 #include <linux/fs.h>
842 generic_permission(NULL, 0);
844 AC_DEFINE(HAVE_GENERIC_PERMISSION_2ARGS, 1,
845 [generic_permission taken 2 arguments])
847 LB_CHECK_COMPILE([if 'generic_permission' take 4 arguments],
848 generic_permission_4args, [
849 #include <linux/fs.h>
851 generic_permission(NULL, 0, 0, NULL);
853 AC_DEFINE(HAVE_GENERIC_PERMISSION_4ARGS, 1,
854 [generic_permission taken 4 arguments])
857 ]) # LC_GENERIC_PERMISSION
860 # LC_LM_XXX_LOCK_MANAGER_OPS
862 # 3.1 renames lock-manager ops(lock_manager_operations) from fl_xxx to lm_xxx
863 # see kernel commit 8fb47a4fbf858a164e973b8ea8ef5e83e61f2e50
865 AC_DEFUN([LC_LM_XXX_LOCK_MANAGER_OPS], [
866 LB_CHECK_COMPILE([if 'lock-manager' ops renamed to 'lm_xxx'],
867 lock_manager_ops_lm_xxx, [
868 #include <linux/fs.h>
870 struct lock_manager_operations lm_ops;
871 lm_ops.lm_compare_owner = NULL;
873 AC_DEFINE(HAVE_LM_XXX_LOCK_MANAGER_OPS, 1,
874 [lock-manager ops renamed to lm_xxx])
876 ]) # LC_LM_XXX_LOCK_MANAGER_OPS
881 # 3.1 kills inode->i_alloc_sem, use i_dio_count and inode_dio_wait
883 # see kernel commit bd5fe6c5eb9c548d7f07fe8f89a150bb6705e8e3
885 AC_DEFUN([LC_INODE_DIO_WAIT], [
886 LB_CHECK_COMPILE([if 'inode->i_alloc_sem' is killed and use inode_dio_wait],
888 #include <linux/fs.h>
890 inode_dio_wait((struct inode *)0);
892 AC_DEFINE(HAVE_INODE_DIO_WAIT, 1,
893 [inode->i_alloc_sem is killed and use inode_dio_wait])
895 ]) # LC_INODE_DIO_WAIT
900 # 3.1 adds get_acl method to inode_operations to read ACL from disk.
901 # see kernel commit 4e34e719e457f2e031297175410fc0bd4016a085
903 AC_DEFUN([LC_IOP_GET_ACL], [
904 LB_CHECK_COMPILE([if 'inode_operations' has '.get_acl' member function],
906 #include <linux/fs.h>
908 struct inode_operations iop;
911 AC_DEFINE(HAVE_IOP_GET_ACL, 1,
912 [inode_operations has .get_acl member function])
917 # LC_FILE_LLSEEK_SIZE
919 # 3.1 introduced generic_file_llseek_size()
921 AC_DEFUN([LC_FILE_LLSEEK_SIZE], [
922 LB_CHECK_EXPORT([generic_file_llseek_size], [fs/read_write.c],
923 [AC_DEFINE(HAVE_FILE_LLSEEK_SIZE, 1,
924 [generic_file_llseek_size is exported by the kernel])])
925 ]) # LC_FILE_LLSEEK_SIZE
928 # LC_RADIX_EXCEPTION_ENTRY
929 # 3.1 adds radix_tree_exception_entry.
931 AC_DEFUN([LC_RADIX_EXCEPTION_ENTRY], [
932 LB_CHECK_COMPILE([radix_tree_exceptional_entry exist],
933 radix_tree_exceptional_entry, [
934 #include <linux/radix-tree.h>
936 radix_tree_exceptional_entry(NULL);
938 AC_DEFINE(HAVE_RADIX_EXCEPTION_ENTRY, 1,
939 [radix_tree_exceptional_entry exist])
941 ]) # LC_RADIX_EXCEPTION_ENTRY
944 # LC_HAVE_VOID_MAKE_REQUEST_FN
946 # 3.2 request_queue.make_request_fn defined as function returns with void
947 # see kernel commit 5a7bbad27a410350e64a2d7f5ec18fc73836c14f
949 AC_DEFUN([LC_HAVE_VOID_MAKE_REQUEST_FN], [
950 LB_CHECK_COMPILE([if 'request_queue.make_request_fn' returns void but not int],
951 make_request_fn_void, [
952 #include <linux/blkdev.h>
955 make_request_fn *mrf;
956 ret = mrf(NULL, NULL);
958 AC_DEFINE(HAVE_VOID_MAKE_REQUEST_FN, 1,
959 [request_queue.make_request_fn returns void but not int])
961 ]) # LC_HAVE_VOID_MAKE_REQUEST_FN
964 # LC_HAVE_PROTECT_I_NLINK
966 # 3.2 protects inode->i_nlink from direct modification
967 # see kernel commit a78ef704a8dd430225955f0709b22d4a6ba21deb
968 # at the same time adds set_nlink(), so checks set_nlink() for it.
970 AC_DEFUN([LC_HAVE_PROTECT_I_NLINK], [
971 LB_CHECK_COMPILE([if 'inode->i_nlink' is protected from direct modification],
972 inode_i_nlink_protected, [
973 #include <linux/fs.h>
978 AC_DEFINE(HAVE_PROTECT_I_NLINK, 1,
979 [inode->i_nlink is protected from direct modification])
981 ]) # LC_HAVE_PROTECT_I_NLINK
984 # 2.6.39 security_inode_init_security takes a 'struct qstr' parameter
986 # 3.2 security_inode_init_security takes a callback to set xattrs
988 AC_DEFUN([LC_HAVE_SECURITY_IINITSEC], [
989 LB_CHECK_COMPILE([if security_inode_init_security takes a callback],
990 security_inode_init_security_callback, [
991 #include <linux/security.h>
993 security_inode_init_security(NULL, NULL, NULL, (const initxattrs)NULL, NULL);
995 AC_DEFINE(HAVE_SECURITY_IINITSEC_CALLBACK, 1,
996 [security_inode_init_security takes a callback to set xattrs])
998 LB_CHECK_COMPILE([if security_inode_init_security takes a 'struct qstr' parameter],
999 security_inode_init_security_qstr, [
1000 #include <linux/security.h>
1002 security_inode_init_security(NULL, NULL, (struct qstr *)NULL, NULL, NULL, NULL);
1004 AC_DEFINE(HAVE_SECURITY_IINITSEC_QSTR, 1,
1005 [security_inode_init_security takes a 'struct qstr' parameter])
1008 ]) # LC_HAVE_SECURITY_IINITSEC
1011 # LC_HAVE_MIGRATE_HEADER
1013 # 3.3 introduces migrate_mode.h and migratepage has 4 args
1015 AC_DEFUN([LC_HAVE_MIGRATE_HEADER], [
1016 LB_CHECK_FILE([$LINUX/include/linux/migrate.h], [
1017 AC_DEFINE(HAVE_MIGRATE_H, 1,
1018 [kernel has include/linux/migrate.h])
1020 LB_CHECK_FILE([$LINUX/include/linux/migrate_mode.h], [
1021 AC_DEFINE(HAVE_MIGRATE_MODE_H, 1,
1022 [kernel has include/linux/migrate_mode.h])
1025 ]) # LC_HAVE_MIGRATE_HEADER
1028 # LC_MIGRATEPAGE_4ARGS
1030 AC_DEFUN([LC_MIGRATEPAGE_4ARGS], [
1031 LB_CHECK_COMPILE([if 'address_space_operations.migratepage' has 4 args],
1032 address_space_ops_migratepage_4args, [
1033 #include <linux/fs.h>
1034 #ifdef HAVE_MIGRATE_H
1035 #include <linux/migrate.h>
1036 #elif defined(HAVE_MIGRATE_MODE_H)
1037 #include <linux/migrate_mode.h>
1040 struct address_space_operations aops;
1041 aops.migratepage(NULL, NULL, NULL, MIGRATE_ASYNC);
1043 AC_DEFINE(HAVE_MIGRATEPAGE_4ARGS, 1,
1044 [address_space_operations.migratepage has 4 args])
1046 ]) # LC_MIGRATEPAGE_4ARGS
1049 # LC_SUPEROPS_USE_DENTRY
1051 # 3.3 switchs super_operations to use dentry as parameter (but not vfsmount)
1052 # see kernel commit 34c80b1d93e6e20ca9dea0baf583a5b5510d92d4
1054 AC_DEFUN([LC_SUPEROPS_USE_DENTRY], [
1055 tmp_flags="$EXTRA_KCFLAGS"
1056 EXTRA_KCFLAGS="-Werror"
1057 LB_CHECK_COMPILE([if 'super_operations' use 'dentry' as parameter],
1059 #include <linux/fs.h>
1060 int show_options(struct seq_file *seq, struct dentry *root) {
1064 struct super_operations ops;
1065 ops.show_options = show_options;
1067 AC_DEFINE(HAVE_SUPEROPS_USE_DENTRY, 1,
1068 [super_operations use dentry as parameter])
1070 EXTRA_KCFLAGS="$tmp_flags"
1071 ]) # LC_SUPEROPS_USE_DENTRY
1074 # LC_INODEOPS_USE_UMODE_T
1076 # 3.3 switchs inode_operations to use umode_t as parameter (but not int)
1077 # see kernel commit 1a67aafb5f72a436ca044293309fa7e6351d6a35
1079 AC_DEFUN([LC_INODEOPS_USE_UMODE_T], [
1080 tmp_flags="$EXTRA_KCFLAGS"
1081 EXTRA_KCFLAGS="-Werror"
1082 LB_CHECK_COMPILE([if 'inode_operations' use 'umode_t' as parameter],
1083 inode_ops_umode_t, [
1084 #include <linux/fs.h>
1085 #include <linux/types.h>
1086 int my_mknod(struct inode *dir, struct dentry *dchild,
1087 umode_t mode, dev_t dev)
1092 struct inode_operations ops;
1093 ops.mknod = my_mknod;
1095 AC_DEFINE(HAVE_INODEOPS_USE_UMODE_T, 1,
1096 [inode_operations use umode_t as parameter])
1098 EXTRA_KCFLAGS="$tmp_flags"
1099 ]) # LC_INODEOPS_USE_UMODE_T
1102 # LC_KMAP_ATOMIC_HAS_1ARG
1104 # 3.4 kmap_atomic removes second argument
1105 # see kernel commit 1ec9c5ddc17aa398f05646abfcbaf315b544e62f
1107 AC_DEFUN([LC_KMAP_ATOMIC_HAS_1ARG], [
1108 LB_CHECK_COMPILE([if 'kmap_atomic' has only 1 argument],
1110 #include <linux/highmem.h>
1114 AC_DEFINE(HAVE_KMAP_ATOMIC_HAS_1ARG, 1,
1115 [have kmap_atomic has only 1 argument])
1117 ]) # LC_KMAP_ATOMIC_HAS_1ARG
1120 # LC_HAVE_D_MAKE_ROOT
1122 # 3.4 converts d_alloc_root to d_make_root
1123 # see kernel commit 32991ab305ace7017c62f8eecbe5eb36dc32e13b
1125 AC_DEFUN([LC_HAVE_D_MAKE_ROOT], [
1126 LB_CHECK_COMPILE([if have 'd_make_root'],
1128 #include <linux/fs.h>
1130 d_make_root((struct inode *)NULL);
1132 AC_DEFINE(HAVE_D_MAKE_ROOT, 1,
1135 ]) # LC_HAVE_D_MAKE_ROOT
1138 # LC_HAVE_CACHE_REGISTER
1140 # 3.4 cache_register/cache_unregister are removed
1141 # see kernel commit 2c5f846747526e2b83c5f1b8e69016be0e2e87c0
1142 # Note, since 2.6.37 cache_register_net/cache_unregister_net
1143 # are defined, but not exported.
1144 # 3.3 cache_register_net/cache_unregister_net are
1145 # exported and replacing cache_register/cache_unregister in 3.4
1147 AC_DEFUN([LC_HAVE_CACHE_REGISTER], [
1148 LB_CHECK_COMPILE([if have 'cache_register'],
1150 #include <linux/sunrpc/cache.h>
1152 cache_register(NULL);
1154 AC_DEFINE(HAVE_CACHE_REGISTER, 1,
1155 [have cache_register])
1157 ]) # LC_HAVE_CACHE_REGISTER
1160 # LC_HAVE_CLEAR_INODE
1162 # 3.5 renames end_writeback() back to clear_inode()...
1163 # see kernel commit dbd5768f87ff6fb0a4fe09c4d7b6c4a24de99430
1165 AC_DEFUN([LC_HAVE_CLEAR_INODE], [
1166 LB_CHECK_COMPILE([if have 'clear_inode'],
1168 #include <linux/fs.h>
1170 clear_inode((struct inode *)NULL);
1172 AC_DEFINE(HAVE_CLEAR_INODE, 1,
1175 ]) # LC_HAVE_CLEAR_INODE
1178 # LC_HAVE_ENCODE_FH_PARENT
1180 # 3.5 encode_fh has parent inode passed in directly
1181 # see kernel commit b0b0382b
1183 AC_DEFUN([LC_HAVE_ENCODE_FH_PARENT], [
1184 tmp_flags="$EXTRA_KCFLAGS"
1185 EXTRA_KCFLAGS="-Werror"
1186 LB_CHECK_COMPILE([if 'encode_fh' have parent inode as parameter],
1187 encode_fh_parent_inode, [
1188 #include <linux/exportfs.h>
1189 #include <linux/fs.h>
1190 #include <linux/types.h>
1191 int ll_encode_fh(struct inode *i, __u32 *a, int *b, struct inode *p)
1196 struct export_operations exp_op;
1197 exp_op.encode_fh = ll_encode_fh;
1199 AC_DEFINE(HAVE_ENCODE_FH_PARENT, 1,
1200 [have parent inode as parameter])
1202 EXTRA_KCFLAGS="$tmp_flags"
1203 ]) # LC_HAVE_ENCODE_FH_PARENT
1206 # LC_FILE_LLSEEK_SIZE_5ARG
1208 # 3.5 has generic_file_llseek_size with 5 args
1210 AC_DEFUN([LC_FILE_LLSEEK_SIZE_5ARG], [
1211 LB_CHECK_COMPILE([if Linux kernel has 'generic_file_llseek_size' with 5 args],
1212 generic_file_llseek_size_5args, [
1213 #include <linux/fs.h>
1215 generic_file_llseek_size(NULL, 0, 0, 0, 0);
1217 AC_DEFINE(HAVE_FILE_LLSEEK_SIZE_5ARGS, 1,
1218 [kernel has generic_file_llseek_size with 5 args])
1220 ]) # LC_FILE_LLSEEK_SIZE_5ARG
1223 # LC_LLITE_DATA_IS_LIST
1225 # 3.6 switch i_dentry/d_alias from list to hlist
1227 # In the upstream kernels d_alias first changes
1228 # to a hlist and then in later version, 3.11, gets
1229 # moved to the union d_u. Due to some distros having
1230 # d_alias in the d_u union as a struct list, which
1231 # has never existed upstream stream, we can't test
1232 # if d_alias is a list or hlist directly. If ever
1233 # i_dentry and d_alias even up different combos then
1234 # the build will fail. In that case then we will need
1235 # to separate out the i_dentry and d_alias test below.
1237 AC_DEFUN([LC_DATA_FOR_LLITE_IS_LIST], [
1238 tmp_flags="$EXTRA_KCFLAGS"
1239 EXTRA_KCFLAGS="-Werror"
1240 LB_CHECK_COMPILE([if 'i_dentry/d_alias' uses 'list'],
1241 i_dentry_d_alias_list, [
1242 #include <linux/fs.h>
1245 INIT_LIST_HEAD(&inode.i_dentry);
1247 AC_DEFINE(DATA_FOR_LLITE_IS_LIST, 1,
1248 [both i_dentry/d_alias uses list])
1250 EXTRA_KCFLAGS="$tmp_flags"
1251 ]) # LC_DATA_FOR_LLITE_IS_LIST
1254 # LC_DENTRY_OPEN_USE_PATH
1256 # 3.6 dentry_open uses struct path as first argument
1257 # see kernel commit 765927b2
1259 AC_DEFUN([LC_DENTRY_OPEN_USE_PATH], [
1260 tmp_flags="$EXTRA_KCFLAGS"
1261 EXTRA_KCFLAGS="-Werror"
1262 LB_CHECK_COMPILE([if 'dentry_open' uses 'struct path' as first argument],
1264 #include <linux/fs.h>
1265 #include <linux/path.h>
1268 dentry_open(&path, 0, NULL);
1270 AC_DEFINE(HAVE_DENTRY_OPEN_USE_PATH, 1,
1271 [dentry_open uses struct path as first argument])
1273 EXTRA_KCFLAGS="$tmp_flags"
1274 ]) # LC_DENTRY_OPEN_USE_PATH
1277 # LC_HAVE_IOP_ATOMIC_OPEN
1279 # 3.6 vfs adds iop->atomic_open
1281 AC_DEFUN([LC_HAVE_IOP_ATOMIC_OPEN], [
1282 LB_CHECK_COMPILE([if 'iop' has 'atomic_open'],
1283 inode_ops_atomic_open, [
1284 #include <linux/fs.h>
1286 struct inode_operations iop;
1287 iop.atomic_open = NULL;
1289 AC_DEFINE(HAVE_IOP_ATOMIC_OPEN, 1,
1290 [have iop atomic_open])
1292 ]) # LC_HAVE_IOP_ATOMIC_OPEN
1295 # LC_HAVE_SB_START_WRITE
1297 # RHEL6 2.6.32, 3.6 or newer support wrapped FS freeze functions
1299 AC_DEFUN([LC_HAVE_SB_START_WRITE], [
1300 LB_CHECK_COMPILE([if kernel supports wrapped FS freeze functions],
1302 #include <linux/fs.h>
1304 sb_start_write(NULL);
1306 AC_DEFINE(HAVE_SB_START_WRITE, 1,
1307 [kernel supports wrapped FS freeze functions])
1309 ]) # LC_HAVE_SB_START_WRITE
1312 # LC_HAVE_POSIXACL_USER_NS
1314 # 3.7 posix_acl_{to,from}_xattr take struct user_namespace
1316 AC_DEFUN([LC_HAVE_POSIXACL_USER_NS], [
1317 LB_CHECK_COMPILE([if 'posix_acl_to_xattr' takes 'struct user_namespace'],
1318 posix_acl_to_xattr_user_namespace, [
1319 #include <linux/fs.h>
1320 #include <linux/posix_acl_xattr.h>
1322 posix_acl_to_xattr((struct user_namespace *)NULL, NULL, NULL, 0);
1324 AC_DEFINE(HAVE_POSIXACL_USER_NS, 1,
1325 [posix_acl_to_xattr takes struct user_namespace])
1327 ]) # LC_HAVE_POSIXACL_USER_NS
1330 # LC_HAVE_FILE_F_INODE
1332 # 3.8 struct file has new member f_inode
1334 AC_DEFUN([LC_HAVE_FILE_F_INODE], [
1335 LB_CHECK_COMPILE([if 'struct file' has member 'f_inode'],
1337 #include <linux/fs.h>
1339 ((struct file *)0)->f_inode = NULL;
1341 AC_DEFINE(HAVE_FILE_F_INODE, 1,
1342 [struct file has member f_inode])
1344 ]) # LC_HAVE_FILE_F_INODE
1347 # LC_HAVE_FILE_INODE
1349 # 3.8 has introduced inline function file_inode
1351 AC_DEFUN([LC_HAVE_FILE_INODE], [
1352 LB_CHECK_COMPILE([if file_inode() exists],
1354 #include <linux/fs.h>
1358 AC_DEFINE(HAVE_FILE_INODE, 1,
1359 [file_inode() has been defined])
1361 ]) # LC_HAVE_FILE_INODE
1364 # LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS
1366 AC_DEFUN([LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS], [
1367 LB_CHECK_COMPILE([if 'sunrpc_cache_pipe_upcall' takes 3 args],
1368 sunrpc_cache_pipe_upcall_3args, [
1369 #include <linux/sunrpc/cache.h>
1371 sunrpc_cache_pipe_upcall(NULL, NULL, NULL);
1373 AC_DEFINE(HAVE_SUNRPC_UPCALL_HAS_3ARGS, 1,
1374 [sunrpc_cache_pipe_upcall takes 3 args])
1376 ]) # LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS
1379 # LC_HAVE_HLIST_FOR_EACH_3ARG
1381 # 3.9 uses hlist_for_each_entry with 3 args
1382 # b67bfe0d42cac56c512dd5da4b1b347a23f4b70a
1384 AC_DEFUN([LC_HAVE_HLIST_FOR_EACH_3ARG], [
1385 LB_CHECK_COMPILE([if 'hlist_for_each_entry' has 3 args],
1386 hlist_for_each_entry_3args, [
1387 #include <linux/list.h>
1388 #include <linux/fs.h>
1390 struct hlist_head *head = NULL;
1391 struct inode *inode;
1393 hlist_for_each_entry(inode, head, i_hash) {
1397 AC_DEFINE(HAVE_HLIST_FOR_EACH_3ARG, 1,
1398 [hlist_for_each_entry has 3 args])
1400 ]) # LC_HAVE_HLIST_FOR_EACH_3ARG
1403 # LC_HAVE_BIO_END_SECTOR
1405 # 3.9 introduces bio_end_sector macro
1406 # f73a1c7d117d07a96d89475066188a2b79e53c48
1408 AC_DEFUN([LC_HAVE_BIO_END_SECTOR], [
1409 LB_CHECK_COMPILE([if 'bio_end_sector' is defined],
1411 #include <linux/bio.h>
1415 bio_end_sector(&bio);
1417 AC_DEFINE(HAVE_BIO_END_SECTOR, 1,
1418 [bio_end_sector is defined])
1420 ]) # LC_HAVE_BIO_END_SECTOR
1423 # 3.9 created is_sxid
1425 AC_DEFUN([LC_HAVE_IS_SXID], [
1426 LB_CHECK_COMPILE([if 'is_sxid' is defined],
1428 #include <linux/fs.h>
1432 is_sxid(inode.i_mode);
1434 AC_DEFINE(HAVE_IS_SXID, 1, [is_sxid is defined])
1436 ]) # LC_HAVE_IS_SXID
1439 # LC_HAVE_REMOVE_PROC_SUBTREE
1441 # 3.10 introduced remove_proc_subtree
1443 AC_DEFUN([LC_HAVE_REMOVE_PROC_SUBTREE], [
1444 LB_CHECK_COMPILE([if 'remove_proc_subtree' is defined],
1445 remove_proc_subtree, [
1446 #include <linux/proc_fs.h>
1448 remove_proc_subtree(NULL, NULL);
1450 AC_DEFINE(HAVE_REMOVE_PROC_SUBTREE, 1,
1451 [remove_proc_subtree is defined])
1453 ]) # LC_HAVE_REMOVE_PROC_SUBTREE
1456 # LC_HAVE_PROC_REMOVE
1458 # 3.10 introduced proc_remove
1460 AC_DEFUN([LC_HAVE_PROC_REMOVE], [
1461 LB_CHECK_COMPILE([if 'proc_remove' is defined],
1463 #include <linux/proc_fs.h>
1467 AC_DEFINE(HAVE_PROC_REMOVE, 1,
1468 [proc_remove is defined])
1470 ]) # LC_HAVE_PROC_REMOVE
1473 # LC_BLKDEV_RELEASE_RETURN_INT
1475 # 3.10 release for block device doesn't return int
1477 AC_DEFUN([LC_BLKDEV_RELEASE_RETURN_INT], [
1478 LB_CHECK_COMPILE([if 'block_device_operations' release returns 'int'],
1479 block_device_ops_release_return_int, [
1480 #include <linux/blkdev.h>
1482 struct block_device_operations fops;
1483 int i __attribute__ ((unused));
1485 i = fops.release(NULL, 0);
1487 AC_DEFINE(HAVE_BLKDEV_RELEASE_RETURN_INT, 1,
1488 [block device release returns int])
1490 ]) # LC_BLKDEV_RELEASE_RETURN_INT
1492 AC_DEFUN([LC_HAVE_PROJECT_QUOTA], [
1493 LB_CHECK_COMPILE([if get_projid exists],
1495 #include <linux/quota.h>
1497 struct dquot_operations ops;
1499 ops.get_projid(NULL, NULL);
1501 AC_DEFINE(HAVE_PROJECT_QUOTA, 1,
1502 [get_projid function exists])
1504 ]) # LC_HAVE_PROJECT_QUOTA
1508 # LC_HAVE_SECURITY_DENTRY_INIT_SECURITY
1510 # 3.10 introduced security_dentry_init_security()
1512 AC_DEFUN([LC_HAVE_SECURITY_DENTRY_INIT_SECURITY], [
1513 LB_CHECK_COMPILE([if 'security_dentry_init_security' is defined],
1514 security_dentry_init_security, [
1515 #include <linux/security.h>
1517 security_dentry_init_security(NULL, 0, NULL, NULL, NULL);
1519 AC_DEFINE(HAVE_SECURITY_DENTRY_INIT_SECURITY, 1,
1520 [security_dentry_init_security' is defined])
1522 ]) # LC_HAVE_SECURITY_DENTRY_INIT_SECURITY
1525 # LC_INVALIDATE_RANGE
1527 # 3.11 invalidatepage requires the length of the range to invalidate
1529 AC_DEFUN([LC_INVALIDATE_RANGE], [
1530 LB_CHECK_COMPILE([if 'address_space_operations.invalidatepage' requires 3 arguments],
1531 address_space_ops_invalidatepage_3args, [
1532 #include <linux/fs.h>
1534 struct address_space_operations a_ops;
1535 a_ops.invalidatepage(NULL, 0, 0);
1537 AC_DEFINE(HAVE_INVALIDATE_RANGE, 1,
1538 [address_space_operations.invalidatepage needs 3 arguments])
1540 ]) # LC_INVALIDATE_RANGE
1543 # LC_HAVE_DIR_CONTEXT
1545 # 3.11 readdir now takes the new struct dir_context
1547 AC_DEFUN([LC_HAVE_DIR_CONTEXT], [
1548 LB_CHECK_COMPILE([if 'dir_context' exist],
1550 #include <linux/fs.h>
1552 struct dir_context ctx;
1555 AC_DEFINE(HAVE_DIR_CONTEXT, 1,
1556 [dir_context exist])
1558 ]) # LC_HAVE_DIR_CONTEXT
1561 # LC_D_COMPARE_5ARGS
1563 # 3.11 dentry_operations.d_compare() taken 5 arguments.
1565 AC_DEFUN([LC_D_COMPARE_5ARGS], [
1566 LB_CHECK_COMPILE([if 'd_compare' taken 5 arguments],
1568 #include <linux/dcache.h>
1570 ((struct dentry_operations*)0)->d_compare(NULL,NULL,0,NULL,NULL);
1572 AC_DEFINE(HAVE_D_COMPARE_5ARGS, 1,
1573 [d_compare need 5 arguments])
1575 ]) # LC_D_COMPARE_5ARGS
1580 # 3.11 need to access d_count to get dentry reference count
1582 AC_DEFUN([LC_HAVE_DCOUNT], [
1583 LB_CHECK_COMPILE([if 'd_count' exist],
1585 #include <linux/dcache.h>
1590 AC_DEFINE(HAVE_D_COUNT, 1,
1596 # LC_PID_NS_FOR_CHILDREN
1598 # 3.11 replaces pid_ns by pid_ns_for_children in struct nsproxy
1600 AC_DEFUN([LC_PID_NS_FOR_CHILDREN], [
1601 LB_CHECK_COMPILE([if 'struct nsproxy' has 'pid_ns_for_children'],
1602 pid_ns_for_children, [
1603 #include <linux/nsproxy.h>
1606 ns.pid_ns_for_children = NULL;
1608 AC_DEFINE(HAVE_PID_NS_FOR_CHILDREN, 1,
1609 ['struct nsproxy' has 'pid_ns_for_children'])
1611 ]) # LC_PID_NS_FOR_CHILDREN
1614 # LC_OLDSIZE_TRUNCATE_PAGECACHE
1616 # 3.12 truncate_pagecache without oldsize parameter
1618 AC_DEFUN([LC_OLDSIZE_TRUNCATE_PAGECACHE], [
1619 LB_CHECK_COMPILE([if 'truncate_pagecache' with 'old_size' parameter],
1620 truncate_pagecache_old_size, [
1621 #include <linux/mm.h>
1623 truncate_pagecache(NULL, 0, 0);
1625 AC_DEFINE(HAVE_OLDSIZE_TRUNCATE_PAGECACHE, 1,
1628 ]) # LC_OLDSIZE_TRUNCATE_PAGECACHE
1631 # LC_HAVE_DENTRY_D_U_D_ALIAS
1633 # 3.11 kernel moved d_alias to the union d_u in struct dentry
1635 # Some distros move d_alias to d_u but it is still a struct list
1637 AC_DEFUN([LC_HAVE_DENTRY_D_U_D_ALIAS], [
1638 AS_IF([test "x$lb_cv_compile_i_dentry_d_alias_list" = xyes], [
1639 LB_CHECK_COMPILE([if list 'dentry.d_u.d_alias' exist],
1641 #include <linux/list.h>
1642 #include <linux/dcache.h>
1645 INIT_LIST_HEAD(&de.d_u.d_alias);
1647 AC_DEFINE(HAVE_DENTRY_D_U_D_ALIAS, 1,
1648 [list dentry.d_u.d_alias exist])
1651 LB_CHECK_COMPILE([if hlist 'dentry.d_u.d_alias' exist],
1653 #include <linux/list.h>
1654 #include <linux/dcache.h>
1657 INIT_HLIST_NODE(&de.d_u.d_alias);
1659 AC_DEFINE(HAVE_DENTRY_D_U_D_ALIAS, 1,
1660 [hlist dentry.d_u.d_alias exist])
1663 ]) # LC_HAVE_DENTRY_D_U_D_ALIAS
1666 # LC_HAVE_DENTRY_D_CHILD
1668 # 3.11 kernel d_child has been moved out of the union d_u
1671 AC_DEFUN([LC_HAVE_DENTRY_D_CHILD], [
1672 LB_CHECK_COMPILE([if 'dentry.d_child' exist],
1674 #include <linux/list.h>
1675 #include <linux/dcache.h>
1678 INIT_LIST_HEAD(&de.d_child);
1680 AC_DEFINE(HAVE_DENTRY_D_CHILD, 1,
1681 [dentry.d_child exist])
1683 ]) # LC_HAVE_DENTRY_D_CHILD
1688 # 3.12 ki_left removed from struct kiocb
1690 AC_DEFUN([LC_KIOCB_KI_LEFT], [
1691 LB_CHECK_COMPILE([if 'struct kiocb' with 'ki_left' member],
1693 #include <linux/aio.h>
1695 ((struct kiocb*)0)->ki_left = 0;
1697 AC_DEFINE(HAVE_KIOCB_KI_LEFT, 1,
1700 ]) # LC_KIOCB_KI_LEFT
1703 # LC_VFS_RENAME_5ARGS
1705 # 3.13 has vfs_rename with 5 args
1707 AC_DEFUN([LC_VFS_RENAME_5ARGS], [
1708 LB_CHECK_COMPILE([if Linux kernel has 'vfs_rename' with 5 args],
1710 #include <linux/fs.h>
1712 vfs_rename(NULL, NULL, NULL, NULL, NULL);
1714 AC_DEFINE(HAVE_VFS_RENAME_5ARGS, 1,
1715 [kernel has vfs_rename with 5 args])
1717 ]) # LC_VFS_RENAME_5ARGS
1720 # LC_VFS_UNLINK_3ARGS
1722 # 3.13 has vfs_unlink with 3 args
1724 AC_DEFUN([LC_VFS_UNLINK_3ARGS], [
1725 LB_CHECK_COMPILE([if Linux kernel has 'vfs_unlink' with 3 args],
1727 #include <linux/fs.h>
1729 vfs_unlink(NULL, NULL, NULL);
1731 AC_DEFINE(HAVE_VFS_UNLINK_3ARGS, 1,
1732 [kernel has vfs_unlink with 3 args])
1734 ]) # LC_VFS_UNLINK_3ARGS
1739 # 3.14 move some of its data in struct bio into the new
1742 AC_DEFUN([LC_HAVE_BVEC_ITER], [
1743 LB_CHECK_COMPILE([if Linux kernel has struct bvec_iter],
1745 #include <linux/bio.h>
1747 struct bvec_iter iter;
1748 iter.bi_bvec_done = 0;
1750 AC_DEFINE(HAVE_BVEC_ITER, 1,
1751 [kernel has struct bvec_iter])
1753 ]) # LC_HAVE_BVEC_ITER
1758 # 4.4 redefined bi_cnt as __bi_cnt
1760 AC_DEFUN([LC_HAVE_BI_CNT], [
1761 LB_CHECK_COMPILE([if Linux kernel has bi_cnt in struct bio],
1763 #include <asm/atomic.h>
1764 #include <linux/bio.h>
1768 cnt = atomic_read(&bio.bi_cnt);
1770 AC_DEFINE(HAVE_BI_CNT, 1,
1771 [struct bio has bi_cnt])
1776 # LC_HAVE_TRUNCATE_IPAGE_FINAL
1778 # 3.14 bring truncate_inode_pages_final for evict_inode
1780 AC_DEFUN([LC_HAVE_TRUNCATE_IPAGES_FINAL], [
1781 LB_CHECK_COMPILE([if Linux kernel has truncate_inode_pages_final],
1782 truncate_ipages_final, [
1783 #include <linux/mm.h>
1785 truncate_inode_pages_final(NULL);
1787 AC_DEFINE(HAVE_TRUNCATE_INODE_PAGES_FINAL, 1,
1788 [kernel has truncate_inode_pages_final])
1790 ]) # LC_HAVE_TRUNCATE_IPAGES_FINAL
1793 # LC_IOPS_RENAME_WITH_FLAGS
1795 # 3.14 has inode_operations->rename with 5 args
1796 # commit 520c8b16505236fc82daa352e6c5e73cd9870cff
1798 AC_DEFUN([LC_IOPS_RENAME_WITH_FLAGS], [
1799 LB_CHECK_COMPILE([if 'inode_operations->rename' taken flags as argument],
1800 iops_rename_with_flags, [
1801 #include <linux/fs.h>
1803 struct inode *i1 = NULL, *i2 = NULL;
1804 struct dentry *d1 = NULL, *d2 = NULL;
1806 rc = ((struct inode_operations *)0)->rename(i1, d1, i2, d2, 0);
1808 AC_DEFINE(HAVE_IOPS_RENAME_WITH_FLAGS, 1,
1809 [inode_operations->rename need flags as argument])
1811 ]) # LC_IOPS_RENAME_WITH_FLAGS
1814 # LC_VFS_RENAME_6ARGS
1816 # 3.15 has vfs_rename with 6 args
1818 AC_DEFUN([LC_VFS_RENAME_6ARGS], [
1819 LB_CHECK_COMPILE([if Linux kernel has 'vfs_rename' with 6 args],
1821 #include <linux/fs.h>
1823 vfs_rename(NULL, NULL, NULL, NULL, NULL, NULL);
1825 AC_DEFINE(HAVE_VFS_RENAME_6ARGS, 1,
1826 [kernel has vfs_rename with 6 args])
1828 ]) # LC_VFS_RENAME_6ARGS
1831 # LC_DIRECTIO_USE_ITER
1833 # 3.16 kernel changes direct IO to use iov_iter
1835 AC_DEFUN([LC_DIRECTIO_USE_ITER], [
1836 LB_CHECK_COMPILE([if direct IO uses iov_iter],
1838 #include <linux/fs.h>
1840 struct address_space_operations ops;
1841 struct iov_iter *iter = NULL;
1844 ops.direct_IO(0, NULL, iter, offset);
1846 AC_DEFINE(HAVE_DIRECTIO_ITER, 1,
1847 [direct IO uses iov_iter])
1849 ]) # LC_DIRECTIO_USE_ITER
1852 # LC_HAVE_IOV_ITER_INIT_DIRECTION
1855 # 3.16 linux commit 71d8e532b1549a478e6a6a8a44f309d050294d00
1856 # changed iov_iter_init api to start accepting a tag
1857 # that defines if its a read or write operation
1859 AC_DEFUN([LC_HAVE_IOV_ITER_INIT_DIRECTION], [
1860 tmp_flags="$EXTRA_KCFLAGS"
1861 EXTRA_KCFLAGS="-Werror"
1862 LB_CHECK_COMPILE([if 'iov_iter_init' takes a tag],
1864 #include <linux/uio.h>
1865 #include <linux/fs.h>
1867 const struct iovec *iov = NULL;
1869 iov_iter_init(NULL, READ, iov, 1, 0);
1871 AC_DEFINE(HAVE_IOV_ITER_INIT_DIRECTION, 1,
1872 [iov_iter_init handles directional tag])
1874 EXTRA_KCFLAGS="$tmp_flags"
1875 ]) # LC_HAVE_IOV_ITER_INIT_DIRECTION
1878 # LC_HAVE_IOV_ITER_TRUNCATE
1881 # 3.16 introduces a new API iov_iter_truncate()
1883 AC_DEFUN([LC_HAVE_IOV_ITER_TRUNCATE], [
1884 tmp_flags="$EXTRA_KCFLAGS"
1885 EXTRA_KCFLAGS="-Werror"
1886 LB_CHECK_COMPILE([if 'iov_iter_truncate' exists ],
1888 #include <linux/uio.h>
1889 #include <linux/fs.h>
1891 struct iov_iter *i = NULL;
1893 iov_iter_truncate(i, 0);
1895 AC_DEFINE(HAVE_IOV_ITER_TRUNCATE, 1, [iov_iter_truncate exists])
1897 EXTRA_KCFLAGS="$tmp_flags"
1898 ]) # LC_HAVE_IOV_ITER_TRUNCATE
1901 # LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
1903 # 3.16 introduces [read|write]_iter to struct file_operations
1905 AC_DEFUN([LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER], [
1906 LB_CHECK_COMPILE([if 'file_operations.[read|write]_iter' exist],
1907 file_function_iter, [
1908 #include <linux/fs.h>
1910 ((struct file_operations *)NULL)->read_iter(NULL, NULL);
1911 ((struct file_operations *)NULL)->write_iter(NULL, NULL);
1913 AC_DEFINE(HAVE_FILE_OPERATIONS_READ_WRITE_ITER, 1,
1914 [file_operations.[read|write]_iter functions exist])
1916 ]) # LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
1921 # 3.17 replaces key_type::match with match_preparse
1922 # and has new struct key_match_data
1924 AC_DEFUN([LC_KEY_MATCH_DATA], [
1925 LB_CHECK_COMPILE([if struct key_match field exist],
1927 #include <linux/key-type.h>
1929 struct key_match_data data;
1931 AC_DEFINE(HAVE_KEY_MATCH_DATA, 1,
1932 [struct key_match_data exist])
1934 ]) # LC_KEY_MATCH_DATA
1937 # LC_NFS_FILLDIR_USE_CTX
1939 # 3.18 kernel moved from void cookie to struct dir_context
1941 AC_DEFUN([LC_NFS_FILLDIR_USE_CTX], [
1942 tmp_flags="$EXTRA_KCFLAGS"
1943 EXTRA_KCFLAGS="-Werror"
1944 LB_CHECK_COMPILE([if filldir_t uses struct dir_context],
1946 #include <linux/fs.h>
1948 int filldir(struct dir_context *ctx, const char* name,
1949 int i, loff_t off, u64 tmp, unsigned temp)
1954 struct dir_context ctx = {
1958 ctx.actor(NULL, "test", 0, (loff_t) 0, 0, 0);
1960 AC_DEFINE(HAVE_FILLDIR_USE_CTX, 1,
1961 [filldir_t needs struct dir_context as argument])
1963 EXTRA_KCFLAGS="$tmp_flags"
1964 ]) # LC_NFS_FILLDIR_USE_CTX
1967 # LC_PERCPU_COUNTER_INIT
1969 # 3.18 For kernels 3.18 and after percpu_counter_init starts
1970 # to pass a GFP_* memory allocation flag for internal
1971 # memory allocation purposes.
1973 AC_DEFUN([LC_PERCPU_COUNTER_INIT], [
1974 LB_CHECK_COMPILE([if percpu_counter_init uses GFP_* flag as argument],
1975 percpu_counter_init, [
1976 #include <linux/percpu_counter.h>
1978 percpu_counter_init(NULL, 0, GFP_KERNEL);
1980 AC_DEFINE(HAVE_PERCPU_COUNTER_INIT_GFP_FLAG, 1,
1981 [percpu_counter_init uses GFP_* flag])
1983 ]) # LC_PERCPU_COUNTER_INIT
1986 # LC_KIOCB_HAS_NBYTES
1988 # 3.19 kernel removed ki_nbytes from struct kiocb
1990 AC_DEFUN([LC_KIOCB_HAS_NBYTES], [
1991 LB_CHECK_COMPILE([if struct kiocb has ki_nbytes field],
1993 #include <linux/fs.h>
1999 AC_DEFINE(HAVE_KI_NBYTES, 1, [ki_nbytes field exist])
2001 ]) # LC_KIOCB_HAS_NBYTES
2004 # LC_HAVE_DQUOT_QC_DQBLK
2006 # 3.19 has quotactl_ops->[sg]et_dqblk that take struct kqid and qc_dqblk
2007 # Added in commit 14bf61ffe
2009 AC_DEFUN([LC_HAVE_DQUOT_QC_DQBLK], [
2010 tmp_flags="$EXTRA_KCFLAGS"
2011 EXTRA_KCFLAGS="-Werror"
2012 LB_CHECK_COMPILE([if 'quotactl_ops.set_dqblk' takes struct qc_dqblk],
2014 #include <linux/fs.h>
2015 #include <linux/quota.h>
2017 ((struct quotactl_ops *)0)->set_dqblk(NULL, *((struct kqid*)0), (struct qc_dqblk*)0);
2019 AC_DEFINE(HAVE_DQUOT_QC_DQBLK, 1,
2020 [quotactl_ops.set_dqblk takes struct qc_dqblk])
2021 AC_DEFINE(HAVE_DQUOT_KQID, 1,
2022 [quotactl_ops.set_dqblk takes struct kqid])
2024 EXTRA_KCFLAGS="$tmp_flags"
2025 ]) # LC_HAVE_DQUOT_QC_DQBLK
2028 # LC_BACKING_DEV_INFO_REMOVAL
2030 # 3.20 kernel removed backing_dev_info from address_space
2032 AC_DEFUN([LC_BACKING_DEV_INFO_REMOVAL], [
2033 LB_CHECK_COMPILE([if struct address_space has backing_dev_info],
2035 #include <linux/fs.h>
2037 struct address_space mapping;
2039 mapping.backing_dev_info = NULL;
2041 AC_DEFINE(HAVE_BACKING_DEV_INFO, 1, [backing_dev_info exist])
2043 ]) # LC_BACKING_DEV_INFO_REMOVAL
2046 # LC_HAVE_BDI_CAP_MAP_COPY
2048 # 3.20 removed mmap handling for backing devices since
2049 # it breaks on non-MMU systems. See kernel commit
2050 # b4caecd48005fbed3949dde6c1cb233142fd69e9
2052 AC_DEFUN([LC_HAVE_BDI_CAP_MAP_COPY], [
2053 LB_CHECK_COMPILE([if have 'BDI_CAP_MAP_COPY'],
2055 #include <linux/backing-dev.h>
2057 struct backing_dev_info info;
2059 info.capabilities = BDI_CAP_MAP_COPY;
2061 AC_DEFINE(HAVE_BDI_CAP_MAP_COPY, 1,
2062 [BDI_CAP_MAP_COPY exist])
2064 ]) # LC_HAVE_BDI_CAP_MAP_COPY
2067 # LC_CANCEL_DIRTY_PAGE
2069 # 4.0.0 kernel removed cancel_dirty_page
2071 AC_DEFUN([LC_CANCEL_DIRTY_PAGE], [
2072 LB_CHECK_COMPILE([if cancel_dirty_page still exist],
2073 cancel_dirty_page, [
2074 #include <linux/mm.h>
2076 cancel_dirty_page(NULL, PAGE_SIZE);
2078 AC_DEFINE(HAVE_CANCEL_DIRTY_PAGE, 1,
2079 [cancel_dirty_page is still available])
2081 ]) # LC_CANCEL_DIRTY_PAGE
2086 # 4.1 kernel has iov_iter_rw
2088 AC_DEFUN([LC_IOV_ITER_RW], [
2089 LB_CHECK_COMPILE([if iov_iter_rw exist],
2091 #include <linux/fs.h>
2092 #include <linux/uio.h>
2094 struct iov_iter *iter = NULL;
2098 AC_DEFINE(HAVE_IOV_ITER_RW, 1,
2099 [iov_iter_rw exist])
2104 # LC_HAVE_SYNC_READ_WRITE
2106 # 4.1 new_sync_[read|write] no longer exported
2108 AC_DEFUN([LC_HAVE_SYNC_READ_WRITE], [
2109 LB_CHECK_EXPORT([new_sync_read], [fs/read_write.c],
2110 [AC_DEFINE(HAVE_SYNC_READ_WRITE, 1,
2111 [new_sync_[read|write] is exported by the kernel])])
2112 ]) # LC_HAVE_SYNC_READ_WRITE
2115 # LC_NEW_CANCEL_DIRTY_PAGE
2117 # 4.2 kernel has new cancel_dirty_page
2119 AC_DEFUN([LC_NEW_CANCEL_DIRTY_PAGE], [
2120 LB_CHECK_COMPILE([if cancel_dirty_page with one argument exist],
2121 new_cancel_dirty_page, [
2122 #include <linux/mm.h>
2124 cancel_dirty_page(NULL);
2126 AC_DEFINE(HAVE_NEW_CANCEL_DIRTY_PAGE, 1,
2127 [cancel_dirty_page with one arguement is available])
2129 ]) # LC_NEW_CANCEL_DIRTY_PAGE
2132 # LC_SYMLINK_OPS_USE_NAMEIDATA
2134 # For the 4.2+ kernels the file system internal symlink api no
2135 # longer uses struct nameidata as a argument
2137 AC_DEFUN([LC_SYMLINK_OPS_USE_NAMEIDATA], [
2138 LB_CHECK_COMPILE([if symlink inode operations have struct nameidata argument],
2139 symlink_use_nameidata, [
2140 #include <linux/namei.h>
2141 #include <linux/fs.h>
2143 struct nameidata *nd = NULL;
2145 ((struct inode_operations *)0)->follow_link(NULL, nd);
2146 ((struct inode_operations *)0)->put_link(NULL, nd, NULL);
2148 AC_DEFINE(HAVE_SYMLINK_OPS_USE_NAMEIDATA, 1,
2149 [symlink inode operations need struct nameidata argument])
2151 ]) # LC_SYMLINK_OPS_USE_NAMEIDATA
2154 # LC_BIO_ENDIO_USES_ONE_ARG
2156 # 4.2 kernel bio_endio now only takes one argument
2158 AC_DEFUN([LC_BIO_ENDIO_USES_ONE_ARG], [
2159 LB_CHECK_COMPILE([if 'bio_endio' with one argument exist],
2161 #include <linux/bio.h>
2165 AC_DEFINE(HAVE_BIO_ENDIO_USES_ONE_ARG, 1,
2166 [bio_endio takes only one argument])
2168 ]) # LC_BIO_ENDIO_USES_ONE_ARG
2171 # LC_HAVE_LOOP_CTL_GET_FREE
2173 # 4.x kernel have moved userspace APIs to
2174 # the separate directory and all of them
2175 # support LOOP_CTL_GET_FREE
2177 AC_DEFUN([LC_HAVE_LOOP_CTL_GET_FREE], [
2178 LB_CHECK_FILE([$LINUX/include/linux/loop.h], [
2179 LB_CHECK_COMPILE([if have 'HAVE_LOOP_CTL_GET_FREE'],
2180 LOOP_CTL_GET_FREE, [
2181 #include <linux/loop.h>
2185 i = LOOP_CTL_GET_FREE;
2187 AC_DEFINE(HAVE_LOOP_CTL_GET_FREE, 1,
2188 [LOOP_CTL_GET_FREE exist])
2191 AC_DEFINE(HAVE_LOOP_CTL_GET_FREE, 1,
2192 [kernel has LOOP_CTL_GET_FREE])
2194 ]) # LC_HAVE_LOOP_CTL_GET_FREE
2197 # LC_HAVE_CACHE_HEAD_HLIST
2199 # 4.3 kernel swiched to hlist for cache_head
2201 AC_DEFUN([LC_HAVE_CACHE_HEAD_HLIST], [
2202 LB_CHECK_COMPILE([if 'struct cache_head' has 'cache_list' field],
2203 cache_head_has_hlist, [
2204 #include <linux/sunrpc/cache.h>
2206 do {} while(sizeof(((struct cache_head *)0)->cache_list));
2208 AC_DEFINE(HAVE_CACHE_HEAD_HLIST, 1,
2209 [cache_head has hlist cache_list])
2211 ]) # LC_HAVE_CACHE_HEAD_HLIST
2214 # LC_HAVE_LOCKS_LOCK_FILE_WAIT
2216 # 4.4 kernel have moved locks API users to
2217 # locks_lock_inode_wait()
2219 AC_DEFUN([LC_HAVE_LOCKS_LOCK_FILE_WAIT], [
2220 LB_CHECK_COMPILE([if 'locks_lock_file_wait' exists],
2221 locks_lock_file_wait, [
2222 #include <linux/fs.h>
2224 locks_lock_file_wait(NULL, NULL);
2226 AC_DEFINE(HAVE_LOCKS_LOCK_FILE_WAIT, 1,
2227 [kernel has locks_lock_file_wait])
2229 ]) # LC_HAVE_LOCKS_LOCK_FILE_WAIT
2232 # LC_HAVE_QC_MAKE_REQUEST_FN
2234 # 4.4 request_queue.make_request_fn defined as function returns with blk_qc_t
2235 # see kernel commit dece16353ef47d8d33f5302bc158072a9d65e26f
2237 AC_DEFUN([LC_HAVE_QC_MAKE_REQUEST_FN], [
2238 LB_CHECK_COMPILE([if 'request_queue.make_request_fn' returns blk_qc_t],
2239 make_request_fn_blk_qc_t, [
2240 #include <linux/blkdev.h>
2243 make_request_fn *mrf;
2244 ret = mrf(NULL, NULL);
2246 AC_DEFINE(HAVE_QC_MAKE_REQUEST_FN, 1,
2247 [request_queue.make_request_fn returns blk_qc_t])
2249 ]) # LC_HAVE_QC_MAKE_REQUEST_FN
2252 # LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
2254 # 4.4 kernel merged type-specific data with the payload data for keys
2256 AC_DEFUN([LC_HAVE_KEY_PAYLOAD_DATA_ARRAY], [
2257 LB_CHECK_COMPILE([if 'struct key' has 'payload.data' as an array],
2258 key_payload_data_array, [
2259 #include <linux/key.h>
2261 ((struct key *)0)->payload.data[0] = NULL;
2263 AC_DEFINE(HAVE_KEY_PAYLOAD_DATA_ARRAY, 1, [payload.data is an array])
2265 ]) #LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
2268 # LC_HAVE_FILE_DENTRY
2270 # 4.5 adds wrapper file_dentry
2272 AC_DEFUN([LC_HAVE_FILE_DENTRY], [
2273 LB_CHECK_COMPILE([if Linux kernel has 'file_dentry'],
2275 #include <linux/fs.h>
2279 AC_DEFINE(HAVE_FILE_DENTRY, 1,
2280 [kernel has file_dentry])
2282 ]) # LC_HAVE_FILE_DENTRY
2285 # LC_HAVE_INODE_LOCK
2287 # 4.5 introduced inode_lock
2289 AC_DEFUN([LC_HAVE_INODE_LOCK], [
2290 LB_CHECK_COMPILE([if 'inode_lock' is defined],
2292 #include <linux/fs.h>
2296 AC_DEFINE(HAVE_INODE_LOCK, 1,
2297 [inode_lock is defined])
2299 ]) # LC_HAVE_INODE_LOCK
2302 # LC_HAVE_IOP_GET_LINK
2304 # 4.5 vfs replaced iop->follow_link with
2307 AC_DEFUN([LC_HAVE_IOP_GET_LINK], [
2308 LB_CHECK_COMPILE([if 'iop' has 'get_link'],
2309 inode_ops_get_link, [
2310 #include <linux/fs.h>
2312 struct inode_operations iop;
2313 iop.get_link = NULL;
2315 AC_DEFINE(HAVE_IOP_GET_LINK, 1,
2316 [have iop get_link])
2318 ]) # LC_HAVE_IOP_GET_LINK
2321 # LC_HAVE_IN_COMPAT_SYSCALL
2323 # 4.6 renamed is_compat_task to in_compat_syscall
2325 AC_DEFUN([LC_HAVE_IN_COMPAT_SYSCALL], [
2326 LB_CHECK_COMPILE([if 'in_compat_syscall' is defined],
2327 in_compat_syscall, [
2328 #include <linux/compat.h>
2330 in_compat_syscall();
2332 AC_DEFINE(HAVE_IN_COMPAT_SYSCALL, 1,
2333 [have in_compat_syscall])
2335 ]) # LC_HAVE_IN_COMPAT_SYSCALL
2340 # Kernel version 4.7 commit c8b8e32d700fe943a935e435ae251364d016c497
2341 # direct-io: eliminate the offset argument to ->direct_IO
2343 AC_DEFUN([LC_DIRECTIO_2ARGS], [
2344 LB_CHECK_COMPILE([if '->direct_IO()' taken 2 arguments],
2346 #include <linux/fs.h>
2348 struct address_space_operations ops;
2349 struct iov_iter *iter = NULL;
2350 struct kiocb *iocb = NULL;
2352 rc = ops.direct_IO(iocb, iter);
2354 AC_DEFINE(HAVE_DIRECTIO_2ARGS, 1,
2355 [direct_IO need 2 arguments])
2357 ]) # LC_DIRECTIO_2ARGS
2360 # LC_GENERIC_WRITE_SYNC_2ARGS
2362 # Kernel version 4.7 commit c8b8e32d700fe943a935e435ae251364d016c497
2363 # direct-io: eliminate the offset argument to ->direct_IO
2365 AC_DEFUN([LC_GENERIC_WRITE_SYNC_2ARGS], [
2366 LB_CHECK_COMPILE([if 'generic_write_sync()' taken 2 arguments],
2367 generic_write_sync_2args, [
2368 #include <linux/fs.h>
2370 struct kiocb *iocb = NULL;
2372 rc = generic_write_sync(iocb, 0);
2374 AC_DEFINE(HAVE_GENERIC_WRITE_SYNC_2ARGS, 1,
2375 [generic_write_sync need 2 arguments])
2377 ]) # LC_GENERIC_WRITE_SYNC_2ARGS
2380 # LC_HAVE_POSIX_ACL_VALID_USER_NS
2382 # 4.8 posix_acl_valid takes struct user_namespace
2384 AC_DEFUN([LC_HAVE_POSIX_ACL_VALID_USER_NS], [
2385 LB_CHECK_COMPILE([if 'posix_acl_valid' takes 'struct user_namespace'],
2387 #include <linux/fs.h>
2388 #include <linux/posix_acl.h>
2390 posix_acl_valid((struct user_namespace*)NULL, (const struct posix_acl*)NULL);
2392 AC_DEFINE(HAVE_POSIX_ACL_VALID_USER_NS, 1,
2393 [posix_acl_valid takes struct user_namespace])
2395 ]) # LC_HAVE_POSIX_ACL_VALID_USER_NS
2398 # LC_D_COMPARE_4ARGS
2400 # Kernel version 4.8 commit 6fa67e707559303e086303aeecc9e8b91ef497d5
2401 # get rid of 'parent' argument of ->d_compare()
2403 AC_DEFUN([LC_D_COMPARE_4ARGS], [
2404 LB_CHECK_COMPILE([if 'd_compare' taken 4 arguments],
2406 #include <linux/dcache.h>
2408 ((struct dentry_operations*)0)->d_compare(NULL,0,NULL,NULL);
2410 AC_DEFINE(HAVE_D_COMPARE_4ARGS, 1,
2411 [d_compare need 4 arguments])
2413 ]) # LC_D_COMPARE_4ARGS
2416 # LC_FULL_NAME_HASH_3ARGS
2418 # Kernel version 4.8 commit 8387ff2577eb9ed245df9a39947f66976c6bcd02
2419 # vfs: make the string hashes salt the hash
2421 AC_DEFUN([LC_FULL_NAME_HASH_3ARGS], [
2422 LB_CHECK_COMPILE([if 'full_name_hash' taken 3 arguments],
2423 full_name_hash_3args, [
2424 #include <linux/stringhash.h>
2427 hash = full_name_hash(NULL,NULL,0);
2429 AC_DEFINE(HAVE_FULL_NAME_HASH_3ARGS, 1,
2430 [full_name_hash need 3 arguments])
2432 ]) # LC_FULL_NAME_HASH_3ARGS
2437 # Kernel version 4.9 commit 81243eacfa400f5f7b89f4c2323d0de9982bb0fb
2438 # cred: simpler, 1D supplementary groups
2440 AC_DEFUN([LC_GROUP_INFO_GID], [
2441 LB_CHECK_COMPILE([if 'struct group_info' has member 'gid'],
2443 #include <linux/cred.h>
2446 p = ((struct group_info *)0)->gid;
2448 AC_DEFINE(HAVE_GROUP_INFO_GID, 1,
2449 [struct group_info has member gid])
2451 ]) # LC_GROUP_INFO_GID
2454 # LC_STRUCT_POSIX_ACL_XATTR
2456 # Kernel version 4.8 commit 2211d5ba5c6c4e972ba6dbc912b2897425ea6621
2457 # posix_acl: xattr representation cleanups
2459 AC_DEFUN([LC_STRUCT_POSIX_ACL_XATTR], [
2460 LB_CHECK_COMPILE([if 'struct posix_acl_xattr_{header,entry}' defined],
2461 struct_posix_acl_xattr, [
2462 #include <linux/fs.h>
2463 #include <linux/posix_acl_xattr.h>
2465 struct posix_acl_xattr_header *h = NULL;
2466 struct posix_acl_xattr_entry *e;
2467 e = (void *)(h + 1);
2469 AC_DEFINE(HAVE_STRUCT_POSIX_ACL_XATTR, 1,
2470 [struct posix_acl_xattr_{header,entry} defined])
2472 ]) # LC_STRUCT_POSIX_ACL_XATTR
2475 # LC_IOP_GENERIC_READLINK
2477 # Kernel version 4.10 commit dfeef68862edd7d4bafe68ef7aeb5f658ef24bb5
2478 # removed generic_readlink from individual file systems
2480 AC_DEFUN([LC_IOP_GENERIC_READLINK], [
2481 LB_CHECK_COMPILE([if 'generic_readlink' still exist],
2482 inode_ops_readlink, [
2483 #include <linux/fs.h>
2485 struct inode_operations iop;
2486 iop.readlink = generic_readlink;
2488 AC_DEFINE(HAVE_IOP_GENERIC_READLINK, 1,
2489 [generic_readlink has been removed])
2491 ]) # LC_IOP_GENERIC_READLINK
2494 # LC_HAVE_VM_FAULT_ADDRESS
2496 # Kernel version 4.10 commit 1a29d85eb0f19b7d8271923d8917d7b4f5540b3e
2497 # removed virtual_address field. Need to use address field instead
2499 AC_DEFUN([LC_HAVE_VM_FAULT_ADDRESS], [
2500 LB_CHECK_COMPILE([if 'struct vm_fault' replaced virtual_address with address field],
2502 #include <linux/mm.h>
2504 struct vm_fault vmf;
2507 AC_DEFINE(HAVE_VM_FAULT_ADDRESS, 1,
2508 [virtual_address has been replaced by address field])
2510 ]) # LC_HAVE_VM_FAULT_ADDRESS
2515 # Lustre linux kernel checks
2517 AC_DEFUN([LC_PROG_LINUX], [
2518 AC_MSG_NOTICE([Lustre kernel checks
2519 ==============================================================================])
2523 LC_CONFIG_HEALTH_CHECK_WRITE
2524 LC_CONFIG_LRU_RESIZE
2526 LC_GLIBC_SUPPORT_FHANDLES
2531 LC_BLK_QUEUE_MAX_SEGMENTS
2534 LC_HAVE_DQUOT_FS_DISK_QUOTA
2535 LC_HAVE_DQUOT_SUSPEND
2536 LC_HAVE_ADD_WAIT_QUEUE_EXCLUSIVE
2540 LC_EXPORT_SIMPLE_SETATTR
2541 LC_EXPORT_TRUNCATE_COMPLETE_PAGE
2545 LC_SBOPS_EVICT_INODE
2551 LC_BLKDEV_GET_BY_DEV
2552 LC_GENERIC_PERMISSION
2560 LC_REQUEST_QUEUE_UNPLUG_FN
2561 LC_HAVE_FHANDLE_SYSCALLS
2562 LC_HAVE_FSTYPE_MOUNT
2564 LC_HAVE_INODE_OWNER_OR_CAPABLE
2565 LC_HAVE_SECURITY_IINITSEC
2568 LC_DIRTY_INODE_WITH_FLAG
2572 LC_LM_XXX_LOCK_MANAGER_OPS
2576 LC_INODE_PERMISION_2ARGS
2577 LC_RADIX_EXCEPTION_ENTRY
2578 LC_HAVE_LOOP_CTL_GET_FREE
2581 LC_HAVE_VOID_MAKE_REQUEST_FN
2582 LC_HAVE_PROTECT_I_NLINK
2585 LC_HAVE_MIGRATE_HEADER
2586 LC_MIGRATEPAGE_4ARGS
2587 LC_SUPEROPS_USE_DENTRY
2588 LC_INODEOPS_USE_UMODE_T
2589 LC_HAVE_CACHE_REGISTER
2593 LC_KMAP_ATOMIC_HAS_1ARG
2597 LC_HAVE_ENCODE_FH_PARENT
2598 LC_FILE_LLSEEK_SIZE_5ARG
2601 LC_DATA_FOR_LLITE_IS_LIST
2602 LC_DENTRY_OPEN_USE_PATH
2603 LC_HAVE_IOP_ATOMIC_OPEN
2604 LC_HAVE_SB_START_WRITE
2607 LC_HAVE_POSIXACL_USER_NS
2610 LC_HAVE_FILE_F_INODE
2612 LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS
2615 LC_HAVE_HLIST_FOR_EACH_3ARG
2616 LC_HAVE_BIO_END_SECTOR
2620 LC_BLKDEV_RELEASE_RETURN_INT
2621 LC_HAVE_REMOVE_PROC_SUBTREE
2623 LC_HAVE_PROJECT_QUOTA
2624 LC_HAVE_SECURITY_DENTRY_INIT_SECURITY
2631 LC_HAVE_DENTRY_D_U_D_ALIAS
2632 LC_HAVE_DENTRY_D_CHILD
2633 LC_PID_NS_FOR_CHILDREN
2636 LC_OLDSIZE_TRUNCATE_PAGECACHE
2645 LC_HAVE_TRUNCATE_IPAGES_FINAL
2646 LC_IOPS_RENAME_WITH_FLAGS
2652 LC_DIRECTIO_USE_ITER
2653 LC_HAVE_IOV_ITER_INIT_DIRECTION
2654 LC_HAVE_IOV_ITER_TRUNCATE
2655 LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
2661 LC_PERCPU_COUNTER_INIT
2662 LC_NFS_FILLDIR_USE_CTX
2666 LC_HAVE_DQUOT_QC_DQBLK
2669 LC_BACKING_DEV_INFO_REMOVAL
2670 LC_HAVE_BDI_CAP_MAP_COPY
2673 LC_CANCEL_DIRTY_PAGE
2677 LC_HAVE_SYNC_READ_WRITE
2680 LC_NEW_CANCEL_DIRTY_PAGE
2681 LC_BIO_ENDIO_USES_ONE_ARG
2682 LC_SYMLINK_OPS_USE_NAMEIDATA
2685 LC_HAVE_CACHE_HEAD_HLIST
2688 LC_HAVE_LOCKS_LOCK_FILE_WAIT
2689 LC_HAVE_QC_MAKE_REQUEST_FN
2690 LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
2698 LC_HAVE_IOP_GET_LINK
2701 LC_HAVE_IN_COMPAT_SYSCALL
2705 LC_GENERIC_WRITE_SYNC_2ARGS
2708 LC_HAVE_POSIX_ACL_VALID_USER_NS
2710 LC_FULL_NAME_HASH_3ARGS
2711 LC_STRUCT_POSIX_ACL_XATTR
2717 LC_IOP_GENERIC_READLINK
2718 LC_HAVE_VM_FAULT_ADDRESS
2721 AS_IF([test "x$enable_server" != xno], [
2731 # Check whether to build the client side of Lustre
2733 AC_DEFUN([LC_CONFIG_CLIENT], [
2734 AC_MSG_CHECKING([whether to build Lustre client support])
2735 AC_ARG_ENABLE([client],
2736 AC_HELP_STRING([--disable-client],
2737 [disable Lustre client support]),
2738 [], [enable_client="yes"])
2739 AC_MSG_RESULT([$enable_client])
2740 ]) # LC_CONFIG_CLIENT
2745 AC_DEFUN([LB_CONFIG_MPITESTS], [
2746 AC_ARG_ENABLE([mpitests],
2747 AC_HELP_STRING([--enable-mpitests=<yes|no|mpicc wrapper>],
2748 [include mpi tests]), [
2749 enable_mpitests="yes"
2752 MPICC_WRAPPER="mpicc"
2755 enable_mpitests="no"
2758 MPICC_WRAPPER=$enableval
2762 enable_mpitests="yes"
2763 MPICC_WRAPPER="mpicc"
2766 if test "x$enable_mpitests" != "xno"; then
2769 AC_CACHE_CHECK([whether mpitests can be built],
2770 lb_cv_mpi_tests, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([
2774 MPI_Initialized(&flag);
2777 ])], [lb_cv_mpi_tests="yes"], [lb_cv_mpi_tests="no"])
2779 enable_mpitests=$lb_cv_mpi_tests
2782 AC_SUBST(MPICC_WRAPPER)
2783 ]) # LB_CONFIG_MPITESTS
2788 # whether to enable quota support global control
2790 AC_DEFUN([LC_CONFIG_QUOTA], [
2791 AC_MSG_CHECKING([whether to enable quota support global control])
2792 AC_ARG_ENABLE([quota],
2793 AC_HELP_STRING([--enable-quota],
2794 [enable quota support]),
2795 [], [enable_quota="yes"])
2796 AS_IF([test "x$enable_quota" = xyes],
2797 [AC_MSG_RESULT([yes])],
2798 [AC_MSG_RESULT([no])])
2799 ]) # LC_CONFIG_QUOTA
2804 AC_DEFUN([LC_QUOTA], [
2808 AS_IF([test "x$enable_quota" != xno -a "x$enable_utils" != xno], [
2809 AC_CHECK_HEADER([sys/quota.h],
2810 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1,
2811 [Define to 1 if you have <sys/quota.h>.])],
2812 [AC_MSG_ERROR([don't find <sys/quota.h> in your system])])
2817 # LC_CONFIG_NODEMAP_PROC_DEBUG
2819 # enable nodemap proc file debugging
2821 AC_DEFUN([LC_NODEMAP_PROC_DEBUG], [
2822 AC_MSG_CHECKING([whether to enable nodemap proc debug])
2823 AC_ARG_ENABLE([nodemap_proc_debug],
2824 AC_HELP_STRING([--enable-nodemap-proc-debug],
2825 [enable nodemap proc debug]),
2826 [], [enable_nodemap_proc_debug="no"])
2827 AC_MSG_RESULT([$enable_nodemap_proc_debug])
2828 AS_IF([test "x$enable_nodemap_proc_debug" != xno],
2829 [AC_DEFINE(NODEMAP_PROC_DEBUG, 1,
2830 [enable nodemap proc debug support])])
2831 ]) # LC_NODEMAP_PROC_DEBUG
2836 # configure support for optional OSD implementation
2838 AC_DEFUN([LC_OSD_ADDON], [
2839 AC_MSG_CHECKING([whether to use OSD addon])
2841 AC_HELP_STRING([--with-osd=path],
2842 [set path to optional osd]),
2849 OSDADDON="$with_osd"
2856 AS_IF([test $ENABLEOSDADDON -eq 0], [
2860 OSDMODNAME=$(basename $OSDADDON)
2861 AS_IF([test -e $LUSTRE/$OSDMODNAME], [
2862 AC_MSG_RESULT([can't link])
2864 ], [ln -s $OSDADDON $LUSTRE/$OSDMODNAME], [
2865 AC_MSG_RESULT([$OSDMODNAME])
2866 OSDADDON="subdir-m += $OSDMODNAME"
2868 AC_MSG_RESULT([can't link])
2878 # other configure checks
2880 AC_DEFUN([LC_CONFIGURE], [
2881 AC_MSG_NOTICE([Lustre core checks
2882 ==============================================================================])
2884 LC_CONFIG_OBD_BUFFER_SIZE
2886 AS_IF([test $target_cpu == "i686" -o $target_cpu == "x86_64"],
2887 [CFLAGS="$CFLAGS -Wall -Werror"])
2889 # maximum MDS thread count
2892 # lustre/utils/gss/gss_util.c
2893 # lustre/utils/gss/gssd_proc.c
2894 # lustre/utils/gss/krb5_util.c
2895 # lustre/utils/llog_reader.c
2896 # lustre/utils/create_iam.c
2897 # lustre/utils/libiam.c
2898 AC_CHECK_HEADERS([netdb.h endian.h])
2899 AC_CHECK_FUNCS([gethostbyname])
2901 # lustre/utils/llverdev.c
2902 AC_CHECK_HEADERS([blkid/blkid.h])
2904 # lustre/utils/llverfs.c
2905 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
2908 AC_CHECK_LIB([selinux], [is_selinux_enabled],
2909 [AC_CHECK_HEADERS([selinux/selinux.h],
2910 [SELINUX="-lselinux"
2911 AC_DEFINE([HAVE_SELINUX], 1,
2912 [support for selinux ])],
2915 No libselinux-devel package found, unable to build selinux enabled tools
2920 No selinux package found, unable to build selinux enabled tools
2926 AC_MSG_CHECKING([whether to report minimum OST free space])
2927 AC_ARG_ENABLE([mindf],
2928 AC_HELP_STRING([--enable-mindf],
2929 [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
2930 [], [enable_mindf="no"])
2931 AC_MSG_RESULT([$enable_mindf])
2932 AS_IF([test "$enable_mindf" = "yes"],
2933 [AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])])
2935 AC_MSG_CHECKING([whether to randomly failing memory alloc])
2936 AC_ARG_ENABLE([fail_alloc],
2937 AC_HELP_STRING([--disable-fail-alloc],
2938 [disable randomly alloc failure]),
2939 [], [enable_fail_alloc="yes"])
2940 AC_MSG_RESULT([$enable_fail_alloc])
2941 AS_IF([test "x$enable_fail_alloc" != xno],
2942 [AC_DEFINE([RANDOM_FAIL_ALLOC], 1,
2943 [enable randomly alloc failure])])
2945 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
2946 AC_ARG_ENABLE([invariants],
2947 AC_HELP_STRING([--enable-invariants],
2948 [enable invariant checking (cpu intensive)]),
2949 [], [enable_invariants="no"])
2950 AC_MSG_RESULT([$enable_invariants])
2951 AS_IF([test "x$enable_invariants" = xyes],
2952 [AC_DEFINE([CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK], 1,
2953 [enable invariant checking])])
2955 AC_MSG_CHECKING([whether to track references with lu_ref])
2956 AC_ARG_ENABLE([lu_ref],
2957 AC_HELP_STRING([--enable-lu_ref],
2958 [enable lu_ref reference tracking code]),
2959 [], [enable_lu_ref="no"])
2960 AC_MSG_RESULT([$enable_lu_ref])
2961 AS_IF([test "x$enable_lu_ref" = xyes],
2962 [AC_DEFINE([USE_LU_REF], 1,
2963 [enable lu_ref reference tracking code])])
2965 AC_MSG_CHECKING([whether to enable page state tracking])
2966 AC_ARG_ENABLE([pgstate-track],
2967 AC_HELP_STRING([--enable-pgstate-track],
2968 [enable page state tracking]),
2969 [], [enable_pgstat_track="no"])
2970 AC_MSG_RESULT([$enable_pgstat_track])
2971 AS_IF([test "x$enable_pgstat_track" = xyes],
2972 [AC_DEFINE([CONFIG_DEBUG_PAGESTATE_TRACKING], 1,
2973 [enable page state tracking code])])
2976 AC_MSG_CHECKING([systemd unit file directory])
2977 AC_ARG_WITH([systemdsystemunitdir],
2978 [AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
2979 [Directory for systemd service files])],
2980 [], [with_systemdsystemunitdir=auto])
2981 AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"],
2982 [def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
2983 AS_IF([test "x$def_systemdsystemunitdir" = "x"],
2984 [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
2985 [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
2986 with_systemdsystemunitdir=no],
2987 [with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
2988 AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
2989 [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
2990 AC_MSG_RESULT([$with_systemdsystemunitdir])
2996 # AM_CONDITIONALS for lustre
2998 AC_DEFUN([LC_CONDITIONALS], [
2999 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
3000 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
3001 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
3002 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
3003 AM_CONDITIONAL(BLKID, test x$ac_cv_header_blkid_blkid_h = xyes)
3004 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
3005 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
3006 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
3007 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
3008 AM_CONDITIONAL(GSS_SSK, test x$enable_ssk = xyes)
3009 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
3010 AM_CONDITIONAL(HAVE_SYSTEMD, test "x$with_systemdsystemunitdir" != "xno")
3011 ]) # LC_CONDITIONALS
3016 # files that should be generated with AC_OUTPUT
3018 AC_DEFUN([LC_CONFIG_FILES],
3022 lustre/autoconf/Makefile
3023 lustre/conf/Makefile
3024 lustre/contrib/Makefile
3026 lustre/include/Makefile
3027 lustre/include/lustre/Makefile
3028 lustre/include/uapi/linux/Makefile
3029 lustre/kernel_patches/targets/3.10-rhel7.target
3030 lustre/kernel_patches/targets/2.6-rhel6.9.target
3031 lustre/kernel_patches/targets/2.6-rhel6.8.target
3032 lustre/kernel_patches/targets/2.6-rhel6.7.target
3033 lustre/kernel_patches/targets/2.6-rhel6.6.target
3034 lustre/kernel_patches/targets/2.6-rhel6.target
3035 lustre/kernel_patches/targets/2.6-rhel5.target
3036 lustre/kernel_patches/targets/2.6-sles11.target
3037 lustre/kernel_patches/targets/3.0-sles11.target
3038 lustre/kernel_patches/targets/3.0-sles11sp3.target
3039 lustre/kernel_patches/targets/3.0-sles11sp4.target
3040 lustre/kernel_patches/targets/3.12-sles12.target
3041 lustre/kernel_patches/targets/4.4-sles12.target
3042 lustre/kernel_patches/targets/2.6-fc11.target
3043 lustre/kernel_patches/targets/2.6-fc12.target
3044 lustre/kernel_patches/targets/2.6-fc15.target
3045 lustre/kernel_patches/targets/3.x-fc18.target
3046 lustre/ldlm/Makefile
3048 lustre/fid/autoMakefile
3049 lustre/llite/Makefile
3050 lustre/llite/autoMakefile
3052 lustre/lov/autoMakefile
3054 lustre/mdc/autoMakefile
3056 lustre/lmv/autoMakefile
3057 lustre/lfsck/Makefile
3058 lustre/lfsck/autoMakefile
3060 lustre/mdt/autoMakefile
3062 lustre/mdd/autoMakefile
3064 lustre/fld/autoMakefile
3065 lustre/obdclass/Makefile
3066 lustre/obdclass/autoMakefile
3067 lustre/obdclass/linux/Makefile
3068 lustre/obdecho/Makefile
3069 lustre/obdecho/autoMakefile
3071 lustre/ofd/autoMakefile
3073 lustre/osc/autoMakefile
3075 lustre/ost/autoMakefile
3076 lustre/osd-ldiskfs/Makefile
3077 lustre/osd-ldiskfs/autoMakefile
3078 lustre/osd-zfs/Makefile
3079 lustre/osd-zfs/autoMakefile
3081 lustre/mgc/autoMakefile
3083 lustre/mgs/autoMakefile
3084 lustre/target/Makefile
3085 lustre/ptlrpc/Makefile
3086 lustre/ptlrpc/autoMakefile
3087 lustre/ptlrpc/gss/Makefile
3088 lustre/ptlrpc/gss/autoMakefile
3089 lustre/quota/Makefile
3090 lustre/quota/autoMakefile
3091 lustre/scripts/Makefile
3092 lustre/scripts/systemd/Makefile
3093 lustre/tests/Makefile
3094 lustre/tests/mpi/Makefile
3095 lustre/tests/kernel/Makefile
3096 lustre/tests/kernel/autoMakefile
3097 lustre/utils/Makefile
3098 lustre/utils/gss/Makefile
3100 lustre/osp/autoMakefile
3102 lustre/lod/autoMakefile
3104 ]) # LC_CONFIG_FILES