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
23 rootsbindir='$(CROSS_PATH)/sbin'
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
69 AC_DEFUN([LC_READLINK_SSIZE_T], [
70 AC_CACHE_CHECK([if readlink returns ssize_t],
71 lb_cv_compile_readlink_ssize_t, [
75 ssize_t readlink(const char *, char *, size_t);
77 [lb_cv_compile_readlink_ssize_t="yes"],
78 [lb_cv_compile_readlink_ssize_t="no"])
80 AS_IF([test "x$lb_cv_compile_readlink_ssize_t" = xyes],
81 [AC_DEFINE(HAVE_POSIX_1003_READLINK, 1,
82 [readlink returns ssize_t])])
83 ]) # LC_READLINK_SSIZE_T
86 # LC_GLIBC_SUPPORT_FHANDLES
88 AC_DEFUN([LC_GLIBC_SUPPORT_FHANDLES], [
89 AC_CHECK_FUNCS([name_to_handle_at],
90 [AC_DEFINE(HAVE_FHANDLE_GLIBC_SUPPORT, 1,
91 [file handle and related syscalls are supported])],
92 [AC_MSG_WARN([file handle and related syscalls are not supported])])
93 ]) # LC_GLIBC_SUPPORT_FHANDLES
96 # LC_FUNC_DEV_SET_RDONLY
98 # check whether dev_set_rdonly is exported. This is needed until we
99 # have another mechanism to fence IO from the underlying device.
101 AC_DEFUN([LC_FUNC_DEV_SET_RDONLY], [
102 LB_CHECK_EXPORT([dev_set_rdonly], [block/ll_rw_block.c block/blk-core.c],
103 [AC_DEFINE(HAVE_DEV_SET_RDONLY, 1,
104 [kernel exports dev_set_rdonly])],
105 [AC_MSG_WARN([kernel missing dev_set_rdonly patch for testing])])
106 ]) # LC_FUNC_DEV_SET_RDONLY
111 # Ensure stack size big than 8k in Lustre server (all kernels)
113 AC_DEFUN([LC_STACK_SIZE], [
114 LB_CHECK_COMPILE([if stack size big than 8k],
116 #include <linux/thread_info.h>
118 #if THREAD_SIZE < 8192
119 #error "stack size < 8192"
121 ], [], [AC_MSG_ERROR([
123 Lustre requires that Linux is configured with at least a 8KB stack.
130 # Allow the user to set the MDS thread upper limit
132 AC_DEFUN([LC_MDS_MAX_THREADS], [
133 AC_MSG_CHECKING([for maximum number of MDS threads])
134 AC_ARG_WITH([mds_max_threads],
135 AC_HELP_STRING([--with-mds-max-threads=count],
136 [maximum threads available on the MDS: (default=512)]),
137 [AC_DEFINE_UNQUOTED(MDS_MAX_THREADS, $with_mds_max_threads,
138 [maximum number of MDS threads])])
139 AC_MSG_RESULT([$with_mds_max_threads])
140 ]) # LC_MDS_MAX_THREADS
145 # the pinger is temporary, until we have the recovery node in place
147 AC_DEFUN([LC_CONFIG_PINGER], [
148 AC_MSG_CHECKING([whether to enable Lustre pinger support])
149 AC_ARG_ENABLE([pinger],
150 AC_HELP_STRING([--disable-pinger],
151 [disable recovery pinger support]),
152 [], [enable_pinger="yes"])
153 AC_MSG_RESULT([$enable_pinger])
154 AS_IF([test "x$enable_pinger" != xno],
155 [AC_DEFINE(ENABLE_PINGER, 1,[Use the Pinger])])
156 ]) # LC_CONFIG_PINGER
161 # do checksum of bulk data between client and OST
163 AC_DEFUN([LC_CONFIG_CHECKSUM], [
164 AC_MSG_CHECKING([whether to enable data checksum support])
165 AC_ARG_ENABLE([checksum],
166 AC_HELP_STRING([--disable-checksum],
167 [disable data checksum support]),
168 [], [enable_checksum="yes"])
169 AC_MSG_RESULT([$enable_checksum])
170 AS_IF([test "x$enable_checksum" != xno],
171 [AC_DEFINE(ENABLE_CHECKSUM, 1, [do data checksums])])
172 ]) # LC_CONFIG_CHECKSUM
175 # LC_CONFIG_LIBLUSTRE_RECOVERY
177 AC_DEFUN([LC_CONFIG_LIBLUSTRE_RECOVERY], [
178 AC_MSG_CHECKING([whether to enable liblustre recovery support])
179 AC_ARG_ENABLE([liblustre-recovery],
180 AC_HELP_STRING([--disable-liblustre-recovery],
181 [disable liblustre recovery support]),
182 [], [enable_liblustre_recovery="yes"])
183 AC_MSG_RESULT([$enable_liblustre_recovery])
184 AS_IF([test "x$enable_liblustre_recovery" != xno],
185 [AC_DEFINE(ENABLE_LIBLUSTRE_RECOVERY, 1, [Liblustre Can Recover])])
186 ]) # LC_CONFIG_LIBLUSTRE_RECOVERY
189 # LC_CONFIG_HEALTH_CHECK_WRITE
191 # Turn off the actual write to the disk
193 AC_DEFUN([LC_CONFIG_HEALTH_CHECK_WRITE], [
194 AC_MSG_CHECKING([whether to enable a write with the health check])
195 AC_ARG_ENABLE([health_write],
196 AC_HELP_STRING([--enable-health_write],
197 [enable disk writes when doing health check]),
198 [], [enable_health_write="no"])
199 AC_MSG_RESULT([$enable_health_write])
200 AS_IF([test "x$enable_health_write" != xno],
201 [AC_DEFINE(USE_HEALTH_CHECK_WRITE, 1, [Write when Checking Health])])
202 ]) # LC_CONFIG_HEALTH_CHECK_WRITE
205 # LC_CONFIG_LRU_RESIZE
207 AC_DEFUN([LC_CONFIG_LRU_RESIZE], [
208 AC_MSG_CHECKING([whether to enable lru self-adjusting])
209 AC_ARG_ENABLE([lru_resize],
210 AC_HELP_STRING([--enable-lru-resize],
211 [enable lru resize support]),
212 [], [enable_lru_resize="yes"])
213 AC_MSG_RESULT([$enable_lru_resize])
214 AS_IF([test "x$enable_lru_resize" != xno],
215 [AC_DEFINE(HAVE_LRU_RESIZE_SUPPORT, 1, [Enable lru resize support])])
216 ]) # LC_CONFIG_LRU_RESIZE
221 # Quota support. The kernel must support CONFIG_QUOTA.
223 AC_DEFUN([LC_QUOTA_CONFIG], [
224 LB_CHECK_CONFIG_IM([QUOTA], [],
227 Lustre quota requires that CONFIG_QUOTA is enabled in your kernel.
232 # LC_EXPORT_TRUNCATE_COMPLETE_PAGE
234 # truncate_complete_page() has never been exported from an upstream kernel
235 # remove_from_page_cache() was exported between 2.6.35 and 2.6.38
236 # delete_from_page_cache() is exported from 2.6.39
238 AC_DEFUN([LC_EXPORT_TRUNCATE_COMPLETE_PAGE], [
239 LB_CHECK_EXPORT([truncate_complete_page], [mm/truncate.c],
240 [AC_DEFINE(HAVE_TRUNCATE_COMPLETE_PAGE, 1,
241 [kernel export truncate_complete_page])])
242 LB_CHECK_EXPORT([remove_from_page_cache], [mm/filemap.c],
243 [AC_DEFINE(HAVE_REMOVE_FROM_PAGE_CACHE, 1,
244 [kernel export remove_from_page_cache])])
245 LB_CHECK_EXPORT([delete_from_page_cache], [mm/filemap.c],
246 [AC_DEFINE(HAVE_DELETE_FROM_PAGE_CACHE, 1,
247 [kernel export delete_from_page_cache])])
248 ]) # LC_EXPORT_TRUNCATE_COMPLETE_PAGE
253 AC_DEFUN([LC_CAPA_CRYPTO], [
254 LB_CHECK_CONFIG_IM([CRYPTO], [],
255 [AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO is enabled in your kernel.])])
256 LB_CHECK_CONFIG_IM([CRYPTO_HMAC], [],
257 [AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_HMAC is enabled in your kernel.])])
258 LB_CHECK_CONFIG_IM([CRYPTO_SHA1], [],
259 [AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_SHA1 is enabled in your kernel.])])
263 # LC_CONFIG_RMTCLIENT
266 dnl the AES symbol usually tied with arch, e.g. CRYPTO_AES_586
268 AC_DEFUN([LC_CONFIG_RMTCLIENT], [
269 LB_CHECK_CONFIG_IM([CRYPTO_AES], [],
272 Lustre remote client require that CONFIG_CRYPTO_AES is enabled in your kernel.
274 ]) # LC_CONFIG_RMTCLIENT
277 # LC_CONFIG_GSS_KEYRING
279 # default 'auto', tests for dependencies, if found, enables;
280 # only called if gss is enabled
282 AC_DEFUN([LC_CONFIG_GSS_KEYRING], [
283 AC_MSG_CHECKING([whether to enable gss keyring backend])
284 AC_ARG_ENABLE([gss_keyring],
285 [AC_HELP_STRING([--disable-gss-keyring],
286 [disable gss keyring backend])],
287 [], [enable_gss_keyring="auto"])
288 AC_MSG_RESULT([$enable_gss_keyring])
289 AS_IF([test "x$enable_gss_keyring" != xno], [
290 LB_CHECK_CONFIG_IM([KEYS], [], [
291 gss_keyring_conf_test="fail"
294 GSS keyring backend require that CONFIG_KEYS be enabled in your kernel.
297 AC_CHECK_LIB([keyutils], [keyctl_search], [], [
298 gss_keyring_conf_test="fail"
301 libkeyutils is not found, which is required by gss keyring backend
304 AS_IF([test "x$gss_keyring_conf_test" != xfail], [
305 AC_DEFINE([HAVE_GSS_KEYRING], [1],
306 [Define this if you enable gss keyring backend])
307 enable_gss_keyring="yes"
309 AS_IF([test "x$enable_gss_keyring" = xyes], [
312 Cannot enable gss_keyring. See above for details.
317 Cannot enable gss keyring. See above for details.
322 ]) # LC_CONFIG_GSS_KEYRING
327 AC_DEFUN([LC_CONFIG_SUNRPC], [
328 LB_CHECK_CONFIG_IM([SUNRPC], [], [
329 AS_IF([test "x$sunrpc_required" = xyes], [
332 kernel SUNRPC support is required by using GSS.
335 ]) # LC_CONFIG_SUNRPC
338 # LC_CONFIG_GSS (default 'auto' (tests for dependencies, if found, enables))
340 # Build gss and related tools of Lustre. Currently both kernel and user space
341 # parts are depend on linux platform.
343 AC_DEFUN([LC_CONFIG_GSS], [
344 AC_MSG_CHECKING([whether to enable gss/krb5 support])
346 [AC_HELP_STRING([--enable-gss], [enable gss/krb5 support])],
347 [], [enable_gss="auto"])
348 AC_MSG_RESULT([$enable_gss])
350 AS_IF([test "x$enable_gss" != xno], [
351 LC_CONFIG_GSS_KEYRING
352 sunrpc_required=$enable_gss
356 LB_CHECK_CONFIG_IM([CRYPTO_MD5], [],
357 [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
358 LB_CHECK_CONFIG_IM([CRYPTO_SHA1], [],
359 [AC_MSG_WARN([kernel SHA1 support is recommended by using GSS.])])
360 LB_CHECK_CONFIG_IM([CRYPTO_SHA256], [],
361 [AC_MSG_WARN([kernel SHA256 support is recommended by using GSS.])])
362 LB_CHECK_CONFIG_IM([CRYPTO_SHA512], [],
363 [AC_MSG_WARN([kernel SHA512 support is recommended by using GSS.])])
365 require_krb5=$enable_gss
369 AS_IF([test -n "$KRBDIR"], [
370 AC_CHECK_LIB([gssapi], [gss_export_lucid_sec_context], [
371 GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi"
372 gss_conf_test="success"
374 AC_CHECK_LIB([gssglue], [gss_export_lucid_sec_context], [
375 GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssglue"
376 gss_conf_test="success"
378 AS_IF([test "x$enable_gss" = xyes], [
381 libgssapi or libgssglue is not found, which is required by GSS.
386 libgssapi or libgssglue is not found, which is required by GSS.
391 AC_SUBST(GSSAPI_LIBS)
394 AS_IF([test "x$gss_conf_test" = xsuccess], [
395 AC_DEFINE([HAVE_GSS], [1], [Define this is if you enable gss])
402 # LC_INODE_PERMISION_2ARGS
404 # up to v2.6.27 had a 3 arg version (inode, mask, nameidata)
405 # v2.6.27->v2.6.37 had a 2 arg version (inode, mask)
406 # v2.6.37->v3.0 had a 3 arg version (inode, mask, nameidata)
407 # v3.1 onward have a 2 arg version (inode, mask)
409 AC_DEFUN([LC_INODE_PERMISION_2ARGS], [
410 LB_CHECK_COMPILE([if 'inode_operations->permission' has two args],
411 inode_ops_permission_2args, [
412 #include <linux/fs.h>
414 struct inode *inode __attribute__ ((unused));
417 inode->i_op->permission(NULL, 0);
419 AC_DEFINE(HAVE_INODE_PERMISION_2ARGS, 1,
420 [inode_operations->permission has two args])
422 ]) # LC_INODE_PERMISION_2ARGS
425 # LC_BLK_QUEUE_MAX_SEGMENTS
427 # 2.6.32 replaces 2 functions blk_queue_max_phys_segments and blk_queue_max_hw_segments by blk_queue_max_segments
429 AC_DEFUN([LC_BLK_QUEUE_MAX_SEGMENTS], [
430 LB_CHECK_COMPILE([if 'blk_queue_max_segments' is defined],
431 blk_queue_max_segments, [
432 #include <linux/blkdev.h>
434 blk_queue_max_segments(NULL, 0);
436 AC_DEFINE(HAVE_BLK_QUEUE_MAX_SEGMENTS, 1,
437 [blk_queue_max_segments is defined])
439 ]) # LC_BLK_QUEUE_MAX_SEGMENTS
442 # LC_HAVE_DQUOT_FS_DISK_QUOTA
444 # 2.6.34 has quotactl_ops->[sg]et_dqblk that take struct fs_disk_quota
446 AC_DEFUN([LC_HAVE_DQUOT_FS_DISK_QUOTA], [
447 tmp_flags="$EXTRA_KCFLAGS"
448 EXTRA_KCFLAGS="-Werror"
449 LB_CHECK_COMPILE([if 'quotactl_ops.set_dqblk' takes struct fs_disk_quota],
451 #include <linux/fs.h>
452 #include <linux/quota.h>
454 ((struct quotactl_ops *)0)->set_dqblk(NULL, 0, 0, (struct fs_disk_quota*)0);
456 AC_DEFINE(HAVE_DQUOT_FS_DISK_QUOTA, 1,
457 [quotactl_ops.set_dqblk takes struct fs_disk_quota])
459 LB_CHECK_COMPILE([if 'quotactl_ops.set_dqblk' takes struct kqid & fs_disk_quota],
460 kqid_fs_disk_quota, [
461 #include <linux/fs.h>
462 #include <linux/quota.h>
464 ((struct quotactl_ops *)0)->set_dqblk((struct super_block*)0, *((struct kqid*)0), (struct fs_disk_quota*)0);
466 AC_DEFINE(HAVE_DQUOT_FS_DISK_QUOTA, 1,
467 [quotactl_ops.set_dqblk takes struct fs_disk_quota])
468 AC_DEFINE(HAVE_DQUOT_KQID, 1,
469 [quotactl_ops.set_dqblk takes struct kqid])
472 EXTRA_KCFLAGS="$tmp_flags"
473 ]) # LC_HAVE_DQUOT_FS_DISK_QUOTA
476 # LC_HAVE_DQUOT_SUSPEND
478 # 2.6.34 has renamed dquot options to dquot_*, check for dquot_suspend
480 AC_DEFUN([LC_HAVE_DQUOT_SUSPEND], [
481 LB_CHECK_COMPILE([if 'dquot_suspend' is defined],
483 #include <linux/quotaops.h>
485 dquot_suspend(NULL, -1);
487 AC_DEFINE(HAVE_DQUOT_SUSPEND, 1, [dquot_suspend is defined])
489 ]) # LC_HAVE_DQUOT_SUSPEND
494 # Check if kernel has been patched for 64-bit quota limits support.
495 # The upstream version of this patch in RHEL6 2.6.32 kernels introduces
496 # the constant QFMT_VFS_V1 in include/linux/quota.h, so we can check for
497 # that in the absence of quotaio_v1.h in the kernel headers.
499 AC_DEFUN([LC_QUOTA64], [
500 tmp_flags="$EXTRA_KCFLAGS"
501 EXTRA_KCFLAGS="-I$LINUX/fs"
502 LB_CHECK_COMPILE([if kernel has 64-bit quota limits support],
504 #include <linux/kernel.h>
505 #include <linux/fs.h>
506 #if defined(HAVE_FS_QUOTA_QUOTAIO_H)
507 #include <quota/quotaio_v2.h>
508 struct v2r1_disk_dqblk dqblk_r1;
510 #include <linux/quota.h>
511 int ver = QFMT_VFS_V1;
514 AC_DEFINE(HAVE_QUOTA64, 1, [have quota64])
516 LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],
517 [AC_MSG_ERROR([You have got no 64-bit kernel quota support.])])
519 EXTRA_KCFLAGS=$tmp_flags
523 # LC_FS_STRUCT_RWLOCK
525 # 2.6.36 fs_struct.lock use spinlock instead of rwlock.
527 AC_DEFUN([LC_FS_STRUCT_RWLOCK], [
528 LB_CHECK_COMPILE([if 'fs_struct.lock' use rwlock],
530 #include <asm/atomic.h>
531 #include <linux/spinlock.h>
532 #include <linux/fs_struct.h>
534 ((struct fs_struct *)0)->lock = (rwlock_t){ 0 };
536 AC_DEFINE(HAVE_FS_STRUCT_RWLOCK, 1, [fs_struct.lock use rwlock])
538 ]) # LC_FS_STRUCT_RWLOCK
541 # LC_SBOPS_EVICT_INODE
543 # 2.6.36 super_operations add evict_inode method. it hybird of
544 # delete_inode & clear_inode.
546 AC_DEFUN([LC_SBOPS_EVICT_INODE], [
547 LB_CHECK_COMPILE([if 'super_operations.evict_inode' exist],
548 super_ops_evict_inode, [
549 #include <linux/fs.h>
551 ((struct super_operations *)0)->evict_inode(NULL);
553 AC_DEFINE(HAVE_SBOPS_EVICT_INODE, 1,
554 [super_operations.evict_inode() is exist in kernel])
556 ]) # LC_SBOPS_EVICT_INODE
561 # 2.6.35 file_operations.fsync taken 2 arguments.
562 # 3.0.0 file_operations.fsync takes 4 arguments.
564 AC_DEFUN([LC_FILE_FSYNC], [
565 LB_CHECK_COMPILE([if 'file_operations.fsync' takes 4 arguments],
566 file_ops_fsync_4args, [
567 #include <linux/fs.h>
569 ((struct file_operations *)0)->fsync(NULL, 0, 0, 0);
571 AC_DEFINE(HAVE_FILE_FSYNC_4ARGS, 1,
572 [file_operations.fsync takes 4 arguments])
574 LB_CHECK_COMPILE([if 'file_operations.fsync' takes 2 arguments],
575 file_ops_fsync_2args, [
576 #include <linux/fs.h>
578 ((struct file_operations *)0)->fsync(NULL, 0);
580 AC_DEFINE(HAVE_FILE_FSYNC_2ARGS, 1,
581 [file_operations.fsync takes 2 arguments])
589 # 2.6.37 remove kernel_locked
591 AC_DEFUN([LC_KERNEL_LOCKED], [
592 LB_CHECK_COMPILE([if 'kernel_locked' is defined],
594 #include <linux/smp_lock.h>
598 AC_DEFINE(HAVE_KERNEL_LOCKED, 1, [kernel_locked is defined])
600 ]) # LC_KERNEL_LOCKED
605 # 2.6.38 dentry_operations.d_compare() taken 7 arguments.
607 AC_DEFUN([LC_D_COMPARE_7ARGS], [
608 LB_CHECK_COMPILE([if 'dentry_operations.d_compare()' taken 7 arguments],
609 dentry_ops_d_compare_7arg, [
610 #include <linux/dcache.h>
612 ((struct dentry_operations*)0)->d_compare(NULL,NULL,NULL,NULL,0,NULL,NULL);
614 AC_DEFINE(HAVE_D_COMPARE_7ARGS, 1, [d_compare need 7 arguments])
616 ]) # LC_D_COMPARE_7ARGS
621 # 2.6.38 dentry_operations.d_delete() defined 'const' for 1st parameter.
623 AC_DEFUN([LC_D_DELETE_CONST], [
624 tmp_flags="$EXTRA_KCFLAGS"
625 EXTRA_KCFLAGS="-Werror"
626 LB_CHECK_COMPILE([if 'dentry_operations.d_delete()' has const declare on first parameter],
627 dentry_ops_d_delete_1st_const, [
628 #include <linux/dcache.h>
630 const struct dentry *d = NULL;
631 ((struct dentry_operations*)0)->d_delete(d);
633 AC_DEFINE(HAVE_D_DELETE_CONST, const,
634 [d_delete first parameter declared const])
636 AC_DEFINE(HAVE_D_DELETE_CONST, [],
637 [d_delete first parameter declared is not const])
639 EXTRA_KCFLAGS="$tmp_flags"
640 ]) # LC_D_DELETE_CONST
645 # 2.6.38 dcache_lock removed. rcu-walk commited.
647 AC_DEFUN([LC_DCACHE_LOCK], [
648 LB_CHECK_COMPILE([if 'dcache_lock' is exist],
650 #include <linux/dcache.h>
652 spin_lock(&dcache_lock);
654 AC_DEFINE(HAVE_DCACHE_LOCK, 1,
655 [dcache_lock is exist])
662 # 2.6.38 inode.i_rcu added.
664 AC_DEFUN([LC_INODE_I_RCU], [
665 LB_CHECK_COMPILE([if 'inode.i_rcu' exists],
667 #include <linux/fs.h>
670 struct rcu_head rcu = {};
673 AC_DEFINE(HAVE_INODE_I_RCU, 1,
674 [inode.i_rcu exists])
679 # LC_BLKDEV_GET_BY_DEV
681 # 2.6.38 export blkdev_get_by_dev
683 AC_DEFUN([LC_BLKDEV_GET_BY_DEV], [
684 LB_CHECK_EXPORT([blkdev_get_by_dev], [fs/block_dev.c],
685 [AC_DEFINE(HAVE_BLKDEV_GET_BY_DEV, 1,
686 [blkdev_get_by_dev is exported by the kernel])])
687 ]) # LC_BLKDEV_GET_BY_DEV
690 # LC_EXPORT_SIMPLE_SETATTR
692 # 2.6.38 export simple_setattr
694 AC_DEFUN([LC_EXPORT_SIMPLE_SETATTR], [
695 LB_CHECK_EXPORT([simple_setattr], [fs/libfs.c],
696 [AC_DEFINE(HAVE_SIMPLE_SETATTR, 1,
697 [simple_setattr is exported by the kernel])])
698 ]) # LC_EXPORT_SIMPLE_SETATTR
703 # truncate callback removed since 2.6.39
705 AC_DEFUN([LC_IOP_TRUNCATE], [
706 LB_CHECK_COMPILE([if 'inode_operations' has '.truncate' member function],
707 inode_ops_truncate, [
708 #include <linux/fs.h>
710 ((struct inode_operations *)0)->truncate(NULL);
712 AC_DEFINE(HAVE_INODEOPS_TRUNCATE, 1,
713 [inode_operations has .truncate member function])
718 # LC_REQUEST_QUEUE_UNPLUG_FN
720 # 2.6.39 remove unplug_fn from request_queue.
722 AC_DEFUN([LC_REQUEST_QUEUE_UNPLUG_FN], [
723 LB_CHECK_COMPILE([if 'request_queue' has 'unplug_fn' field],
724 request_queue_unplug_fn, [
725 #include <linux/blkdev.h>
727 do {} while(sizeof(((struct request_queue *)0)->unplug_fn));
729 AC_DEFINE(HAVE_REQUEST_QUEUE_UNPLUG_FN, 1,
730 [request_queue has unplug_fn field])
732 ]) # LC_REQUEST_QUEUE_UNPLUG_FN
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;
745 void *i = (void *) fst.mount;
747 AC_DEFINE(HAVE_FSTYPE_MOUNT, 1,
748 [struct file_system_type has mount field])
750 ]) # LC_HAVE_FSTYPE_MOUNT
753 # LC_HAVE_FHANDLE_SYSCALLS
755 # 2.6.39 The open_by_handle_at() and name_to_handle_at() system calls were
756 # added to Linux kernel 2.6.39.
757 # Check if client supports these functions
759 AC_DEFUN([LC_HAVE_FHANDLE_SYSCALLS], [
760 LB_CHECK_CONFIG_IM([FHANDLE],[
761 AC_DEFINE(HAVE_FHANDLE_SYSCALLS, 1,
762 [kernel supports fhandles and related syscalls])
764 ]) # LC_HAVE_FHANDLE_SYSCALLS
767 # LC_HAVE_INODE_OWNER_OR_CAPABLE
769 # 2.6.39 renames is_owner_or_cap to inode_owner_or_capable
771 AC_DEFUN([LC_HAVE_INODE_OWNER_OR_CAPABLE], [
772 LB_CHECK_COMPILE([if 'inode_owner_or_capable' exist],
773 inode_owner_or_capable, [
774 #include <linux/fs.h>
776 inode_owner_or_capable(NULL);
778 AC_DEFINE(HAVE_INODE_OWNER_OR_CAPABLE, 1,
779 [inode_owner_or_capable exist])
781 ]) # LC_HAVE_INODE_OWNER_OR_CAPABLE
784 # LC_DIRTY_INODE_WITH_FLAG
786 # 3.0 dirty_inode() has a flag parameter
787 # see kernel commit aa38572954ade525817fe88c54faebf85e5a61c0
789 AC_DEFUN([LC_DIRTY_INODE_WITH_FLAG], [
790 LB_CHECK_COMPILE([if 'dirty_inode' super_operation takes flag],
791 dirty_inode_super_operation_flag, [
792 #include <linux/fs.h>
795 inode->i_sb->s_op->dirty_inode(NULL, 0);
797 AC_DEFINE(HAVE_DIRTY_INODE_HAS_FLAG, 1,
798 [dirty_inode super_operation takes flag])
800 ]) # LC_DIRTY_INODE_WITH_FLAG
803 # LC_GENERIC_PERMISSION
805 # 2.6.38 generic_permission taken 4 parameters.
806 # in fact, it means rcu-walk aware permission bring.
808 # 3.1 generic_permission taken 2 parameters.
809 # see kernel commit 2830ba7f34ebb27c4e5b8b6ef408cd6d74860890
811 AC_DEFUN([LC_GENERIC_PERMISSION], [
812 LB_CHECK_COMPILE([if 'generic_permission' take 2 arguments],
813 generic_permission_2args, [
814 #include <linux/fs.h>
816 generic_permission(NULL, 0);
818 AC_DEFINE(HAVE_GENERIC_PERMISSION_2ARGS, 1,
819 [generic_permission taken 2 arguments])
821 LB_CHECK_COMPILE([if 'generic_permission' take 4 arguments],
822 generic_permission_4args, [
823 #include <linux/fs.h>
825 generic_permission(NULL, 0, 0, NULL);
827 AC_DEFINE(HAVE_GENERIC_PERMISSION_4ARGS, 1,
828 [generic_permission taken 4 arguments])
831 ]) # LC_GENERIC_PERMISSION
834 # LC_LM_XXX_LOCK_MANAGER_OPS
836 # 3.1 renames lock-manager ops(lock_manager_operations) from fl_xxx to lm_xxx
837 # see kernel commit 8fb47a4fbf858a164e973b8ea8ef5e83e61f2e50
839 AC_DEFUN([LC_LM_XXX_LOCK_MANAGER_OPS], [
840 LB_CHECK_COMPILE([if 'lock-manager' ops renamed to 'lm_xxx'],
841 lock_manager_ops_lm_xxx, [
842 #include <linux/fs.h>
844 struct lock_manager_operations lm_ops;
845 lm_ops.lm_compare_owner = NULL;
847 AC_DEFINE(HAVE_LM_XXX_LOCK_MANAGER_OPS, 1,
848 [lock-manager ops renamed to lm_xxx])
850 ]) # LC_LM_XXX_LOCK_MANAGER_OPS
855 # 3.1 kills inode->i_alloc_sem, use i_dio_count and inode_dio_wait/
856 # inode_dio_done instead.
857 # see kernel commit bd5fe6c5eb9c548d7f07fe8f89a150bb6705e8e3
859 AC_DEFUN([LC_INODE_DIO_WAIT], [
860 LB_CHECK_COMPILE([if 'inode->i_alloc_sem' is killed and use inode_dio_wait/done],
862 #include <linux/fs.h>
864 inode_dio_wait((struct inode *)0);
865 inode_dio_done((struct inode *)0);
867 AC_DEFINE(HAVE_INODE_DIO_WAIT, 1,
868 [inode->i_alloc_sem is killed and use inode_dio_wait/done])
870 ]) # LC_INODE_DIO_WAIT
875 # 3.1 adds get_acl method to inode_operations to read ACL from disk.
876 # see kernel commit 4e34e719e457f2e031297175410fc0bd4016a085
878 AC_DEFUN([LC_IOP_GET_ACL], [
879 LB_CHECK_COMPILE([if 'inode_operations' has '.get_acl' member function],
881 #include <linux/fs.h>
883 struct inode_operations iop;
886 AC_DEFINE(HAVE_IOP_GET_ACL, 1,
887 [inode_operations has .get_acl member function])
892 # LC_FILE_LLSEEK_SIZE
894 # 3.1 introduced generic_file_llseek_size()
896 AC_DEFUN([LC_FILE_LLSEEK_SIZE], [
897 LB_CHECK_EXPORT([generic_file_llseek_size], [fs/read_write.c],
898 [AC_DEFINE(HAVE_FILE_LLSEEK_SIZE, 1,
899 [generic_file_llseek_size is exported by the kernel])])
900 ]) # LC_FILE_LLSEEK_SIZE
903 # LC_HAVE_VOID_MAKE_REQUEST_FN
905 # 3.2 request_queue.make_request_fn defined as function returns with void
906 # see kernel commit 5a7bbad27a410350e64a2d7f5ec18fc73836c14f
908 AC_DEFUN([LC_HAVE_VOID_MAKE_REQUEST_FN], [
909 LB_CHECK_COMPILE([if 'request_queue.make_request_fn' returns void but not int],
910 make_request_fn_void, [
911 #include <linux/blkdev.h>
914 make_request_fn *mrf;
915 ret = mrf(NULL, NULL);
917 AC_DEFINE(HAVE_VOID_MAKE_REQUEST_FN, 1,
918 [request_queue.make_request_fn returns void but not int])
920 ]) # LC_HAVE_VOID_MAKE_REQUEST_FN
923 # LC_HAVE_PROTECT_I_NLINK
925 # 3.2 protects inode->i_nlink from direct modification
926 # see kernel commit a78ef704a8dd430225955f0709b22d4a6ba21deb
927 # at the same time adds set_nlink(), so checks set_nlink() for it.
929 AC_DEFUN([LC_HAVE_PROTECT_I_NLINK], [
930 LB_CHECK_COMPILE([if 'inode->i_nlink' is protected from direct modification],
931 inode_i_nlink_protected, [
932 #include <linux/fs.h>
937 AC_DEFINE(HAVE_PROTECT_I_NLINK, 1,
938 [inode->i_nlink is protected from direct modification])
940 ]) # LC_HAVE_PROTECT_I_NLINK
943 # LC_HAVE_MIGRATE_HEADER
945 # 3.3 introduces migrate_mode.h and migratepage has 4 args
947 AC_DEFUN([LC_HAVE_MIGRATE_HEADER], [
948 LB_CHECK_FILE([$LINUX/include/linux/migrate.h], [
949 AC_DEFINE(HAVE_MIGRATE_H, 1,
950 [kernel has include/linux/migrate.h])
952 LB_CHECK_FILE([$LINUX/include/linux/migrate_mode.h], [
953 AC_DEFINE(HAVE_MIGRATE_MODE_H, 1,
954 [kernel has include/linux/migrate_mode.h])
957 ]) # LC_HAVE_MIGRATE_HEADER
960 # LC_MIGRATEPAGE_4ARGS
962 AC_DEFUN([LC_MIGRATEPAGE_4ARGS], [
963 LB_CHECK_COMPILE([if 'address_space_operations.migratepage' has 4 args],
964 address_space_ops_migratepage_4args, [
965 #include <linux/fs.h>
966 #ifdef HAVE_MIGRATE_H
967 #include <linux/migrate.h>
968 #elif defined(HAVE_MIGRATE_MODE_H)
969 #include <linux/migrate_mode.h>
972 struct address_space_operations aops;
973 aops.migratepage(NULL, NULL, NULL, MIGRATE_ASYNC);
975 AC_DEFINE(HAVE_MIGRATEPAGE_4ARGS, 1,
976 [address_space_operations.migratepage has 4 args])
978 ]) # LC_MIGRATEPAGE_4ARGS
981 # LC_SUPEROPS_USE_DENTRY
983 # 3.3 switchs super_operations to use dentry as parameter (but not vfsmount)
984 # see kernel commit 34c80b1d93e6e20ca9dea0baf583a5b5510d92d4
986 AC_DEFUN([LC_SUPEROPS_USE_DENTRY], [
987 tmp_flags="$EXTRA_KCFLAGS"
988 EXTRA_KCFLAGS="-Werror"
989 LB_CHECK_COMPILE([if 'super_operations' use 'dentry' as parameter],
991 #include <linux/fs.h>
992 int show_options(struct seq_file *seq, struct dentry *root) {
996 struct super_operations ops;
997 ops.show_options = show_options;
999 AC_DEFINE(HAVE_SUPEROPS_USE_DENTRY, 1,
1000 [super_operations use dentry as parameter])
1002 EXTRA_KCFLAGS="$tmp_flags"
1003 ]) # LC_SUPEROPS_USE_DENTRY
1006 # LC_INODEOPS_USE_UMODE_T
1008 # 3.3 switchs inode_operations to use umode_t as parameter (but not int)
1009 # see kernel commit 1a67aafb5f72a436ca044293309fa7e6351d6a35
1011 AC_DEFUN([LC_INODEOPS_USE_UMODE_T], [
1012 tmp_flags="$EXTRA_KCFLAGS"
1013 EXTRA_KCFLAGS="-Werror"
1014 LB_CHECK_COMPILE([if 'inode_operations' use 'umode_t' as parameter],
1015 inode_ops_umode_t, [
1016 #include <linux/fs.h>
1017 #include <linux/types.h>
1018 int my_mknod(struct inode *dir, struct dentry *dchild,
1019 umode_t mode, dev_t dev)
1024 struct inode_operations ops;
1025 ops.mknod = my_mknod;
1027 AC_DEFINE(HAVE_INODEOPS_USE_UMODE_T, 1,
1028 [inode_operations use umode_t as parameter])
1030 EXTRA_KCFLAGS="$tmp_flags"
1031 ]) # LC_INODEOPS_USE_UMODE_T
1034 # LC_KMAP_ATOMIC_HAS_1ARG
1036 # 3.4 kmap_atomic removes second argument
1037 # see kernel commit 1ec9c5ddc17aa398f05646abfcbaf315b544e62f
1039 AC_DEFUN([LC_KMAP_ATOMIC_HAS_1ARG], [
1040 LB_CHECK_COMPILE([if 'kmap_atomic' has only 1 argument],
1042 #include <linux/highmem.h>
1046 AC_DEFINE(HAVE_KMAP_ATOMIC_HAS_1ARG, 1,
1047 [have kmap_atomic has only 1 argument])
1049 ]) # LC_KMAP_ATOMIC_HAS_1ARG
1052 # LC_HAVE_D_MAKE_ROOT
1054 # 3.4 converts d_alloc_root to d_make_root
1055 # see kernel commit 32991ab305ace7017c62f8eecbe5eb36dc32e13b
1057 AC_DEFUN([LC_HAVE_D_MAKE_ROOT], [
1058 LB_CHECK_COMPILE([if have 'd_make_root'],
1060 #include <linux/fs.h>
1062 d_make_root((struct inode *)NULL);
1064 AC_DEFINE(HAVE_D_MAKE_ROOT, 1,
1067 ]) # LC_HAVE_D_MAKE_ROOT
1070 # LC_HAVE_CACHE_REGISTER
1072 # 3.4 cache_register/cache_unregister are removed
1073 # see kernel commit 2c5f846747526e2b83c5f1b8e69016be0e2e87c0
1074 # Note, since 2.6.37 cache_register_net/cache_unregister_net
1075 # are defined, but not exported.
1076 # 3.3 cache_register_net/cache_unregister_net are
1077 # exported and replacing cache_register/cache_unregister in 3.4
1079 AC_DEFUN([LC_HAVE_CACHE_REGISTER], [
1080 LB_CHECK_COMPILE([if have 'cache_register'],
1082 #include <linux/sunrpc/cache.h>
1084 cache_register(NULL);
1086 AC_DEFINE(HAVE_CACHE_REGISTER, 1,
1087 [have cache_register])
1089 ]) # LC_HAVE_CACHE_REGISTER
1092 # LC_HAVE_CLEAR_INODE
1094 # 3.5 renames end_writeback() back to clear_inode()...
1095 # see kernel commit dbd5768f87ff6fb0a4fe09c4d7b6c4a24de99430
1097 AC_DEFUN([LC_HAVE_CLEAR_INODE], [
1098 LB_CHECK_COMPILE([if have 'clear_inode'],
1100 #include <linux/fs.h>
1102 clear_inode((struct inode *)NULL);
1104 AC_DEFINE(HAVE_CLEAR_INODE, 1,
1107 ]) # LC_HAVE_CLEAR_INODE
1110 # LC_HAVE_ENCODE_FH_PARENT
1112 # 3.5 encode_fh has parent inode passed in directly
1113 # see kernel commit b0b0382b
1115 AC_DEFUN([LC_HAVE_ENCODE_FH_PARENT], [
1116 tmp_flags="$EXTRA_KCFLAGS"
1117 EXTRA_KCFLAGS="-Werror"
1118 LB_CHECK_COMPILE([if 'encode_fh' have parent inode as parameter],
1119 encode_fh_parent_inode, [
1120 #include <linux/exportfs.h>
1121 #include <linux/fs.h>
1122 #include <linux/types.h>
1123 int ll_encode_fh(struct inode *i, __u32 *a, int *b, struct inode *p)
1128 struct export_operations exp_op;
1129 exp_op.encode_fh = ll_encode_fh;
1131 AC_DEFINE(HAVE_ENCODE_FH_PARENT, 1,
1132 [have parent inode as parameter])
1134 EXTRA_KCFLAGS="$tmp_flags"
1135 ]) # LC_HAVE_ENCODE_FH_PARENT
1138 # LC_FILE_LLSEEK_SIZE_5ARG
1140 # 3.5 has generic_file_llseek_size with 5 args
1142 AC_DEFUN([LC_FILE_LLSEEK_SIZE_5ARG], [
1143 LB_CHECK_COMPILE([if Linux kernel has 'generic_file_llseek_size' with 5 args],
1144 generic_file_llseek_size_5args, [
1145 #include <linux/fs.h>
1147 generic_file_llseek_size(NULL, 0, 0, 0, 0);
1149 AC_DEFINE(HAVE_FILE_LLSEEK_SIZE_5ARGS, 1,
1150 [kernel has generic_file_llseek_size with 5 args])
1152 ]) # LC_FILE_LLSEEK_SIZE_5ARG
1155 # LC_HAVE_DENTRY_D_ALIAS_HLIST
1157 # 3.6 switch i_dentry/d_alias from list to hlist
1159 AC_DEFUN([LC_HAVE_DENTRY_D_ALIAS_HLIST], [
1160 tmp_flags="$EXTRA_KCFLAGS"
1161 EXTRA_KCFLAGS="-Werror"
1162 LB_CHECK_COMPILE([if 'i_dentry/d_alias' uses 'hlist'],
1163 i_dentry_d_alias_hlist, [
1164 #include <linux/fs.h>
1165 #include <linux/list.h>
1168 struct dentry dentry;
1169 struct hlist_head head;
1170 struct hlist_node node;
1171 inode.i_dentry = head;
1172 dentry.d_alias = node;
1174 AC_DEFINE(HAVE_DENTRY_D_ALIAS_HLIST, 1,
1175 [have i_dentry/d_alias uses hlist])
1177 EXTRA_KCFLAGS="$tmp_flags"
1178 ]) # LC_HAVE_DENTRY_D_ALIAS_HLIST
1181 # LC_DENTRY_OPEN_USE_PATH
1183 # 3.6 dentry_open uses struct path as first argument
1184 # see kernel commit 765927b2
1186 AC_DEFUN([LC_DENTRY_OPEN_USE_PATH], [
1187 tmp_flags="$EXTRA_KCFLAGS"
1188 EXTRA_KCFLAGS="-Werror"
1189 LB_CHECK_COMPILE([if 'dentry_open' uses 'struct path' as first argument],
1191 #include <linux/fs.h>
1192 #include <linux/path.h>
1195 dentry_open(&path, 0, NULL);
1197 AC_DEFINE(HAVE_DENTRY_OPEN_USE_PATH, 1,
1198 [dentry_open uses struct path as first argument])
1200 EXTRA_KCFLAGS="$tmp_flags"
1201 ]) # LC_DENTRY_OPEN_USE_PATH
1204 # LC_HAVE_IOP_ATOMIC_OPEN
1206 # 3.6 vfs adds iop->atomic_open
1208 AC_DEFUN([LC_HAVE_IOP_ATOMIC_OPEN], [
1209 LB_CHECK_COMPILE([if 'iop' has 'atomic_open'],
1210 inode_ops_atomic_open, [
1211 #include <linux/fs.h>
1213 struct inode_operations iop;
1214 iop.atomic_open = NULL;
1216 AC_DEFINE(HAVE_IOP_ATOMIC_OPEN, 1,
1217 [have iop atomic_open])
1219 ]) # LC_HAVE_IOP_ATOMIC_OPEN
1222 # LC_HAVE_POSIXACL_USER_NS
1224 # 3.7 posix_acl_{to,from}_xattr take struct user_namespace
1226 AC_DEFUN([LC_HAVE_POSIXACL_USER_NS], [
1227 LB_CHECK_COMPILE([if 'posix_acl_to_xattr' takes 'struct user_namespace'],
1228 posix_acl_to_xattr_user_namespace, [
1229 #include <linux/fs.h>
1230 #include <linux/posix_acl_xattr.h>
1232 posix_acl_to_xattr((struct user_namespace *)NULL, NULL, NULL, 0);
1234 AC_DEFINE(HAVE_POSIXACL_USER_NS, 1,
1235 [posix_acl_to_xattr takes struct user_namespace])
1237 ]) # LC_HAVE_POSIXACL_USER_NS
1240 # LC_HAVE_FILE_F_INODE
1242 # 3.8 struct file has new member f_inode
1244 AC_DEFUN([LC_HAVE_FILE_F_INODE], [
1245 LB_CHECK_COMPILE([if 'struct file' has memeber 'f_inode'],
1247 #include <linux/fs.h>
1249 ((struct file *)0)->f_inode = NULL;
1251 AC_DEFINE(HAVE_FILE_F_INODE, 1,
1252 [struct file has memeber f_inode])
1254 ]) # LC_HAVE_FILE_F_INODE
1257 # LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS
1259 AC_DEFUN([LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS], [
1260 LB_CHECK_COMPILE([if 'sunrpc_cache_pipe_upcall' takes 3 args],
1261 sunrpc_cache_pipe_upcall_3args, [
1262 #include <linux/sunrpc/cache.h>
1264 sunrpc_cache_pipe_upcall(NULL, NULL, NULL);
1266 AC_DEFINE(HAVE_SUNRPC_UPCALL_HAS_3ARGS, 1,
1267 [sunrpc_cache_pipe_upcall takes 3 args])
1269 ]) # LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS
1272 # LC_HAVE_HLIST_FOR_EACH_3ARG
1274 # 3.9 uses hlist_for_each_entry with 3 args
1275 # b67bfe0d42cac56c512dd5da4b1b347a23f4b70a
1277 AC_DEFUN([LC_HAVE_HLIST_FOR_EACH_3ARG], [
1278 LB_CHECK_COMPILE([if 'hlist_for_each_entry' has 3 args],
1279 hlist_for_each_entry_3args, [
1280 #include <linux/list.h>
1281 #include <linux/fs.h>
1283 struct inode *inode;
1284 struct dentry *dentry;
1285 hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) {
1289 AC_DEFINE(HAVE_HLIST_FOR_EACH_3ARG, 1,
1290 [hlist_for_each_entry has 3 args])
1292 ]) # LC_HAVE_HLIST_FOR_EACH_3ARG
1295 # LC_HAVE_ONLY_PROCFS_SEQ
1297 # 3.10+ only supports procfs seq_files handling
1299 AC_DEFUN([LC_HAVE_ONLY_PROCFS_SEQ], [
1300 LB_CHECK_COMPILE([if procfs only supports using 'seq_files'],
1301 only_procfs_seq_files, [
1302 #include <linux/proc_fs.h>
1304 ((struct proc_dir_entry *)0)->write_proc(NULL, NULL, 0, NULL);
1306 AC_DEFINE(HAVE_ONLY_PROCFS_SEQ, 1,
1307 [only seq_files supported])
1309 ]) # LC_HAVE_ONLY_PROCFS_SEQ
1312 # LC_BLKDEV_RELEASE_RETURN_INT
1314 # 3.10 release for block device doesn't return int
1316 AC_DEFUN([LC_BLKDEV_RELEASE_RETURN_INT], [
1317 LB_CHECK_COMPILE([if 'block_device_operations' release returns 'int'],
1318 block_device_ops_release_return_int, [
1319 #include <linux/blkdev.h>
1321 struct block_device_operations fops;
1322 int i __attribute__ ((unused));
1324 i = fops.release(NULL, 0);
1326 AC_DEFINE(HAVE_BLKDEV_RELEASE_RETURN_INT, 1,
1327 [block device release returns int])
1329 ]) # LC_BLKDEV_RELEASE_RETURN_INT
1332 # LC_INVALIDATE_RANGE
1334 # 3.11 invalidatepage requires the length of the range to invalidate
1336 AC_DEFUN([LC_INVALIDATE_RANGE], [
1337 LB_CHECK_COMPILE([if 'address_space_operations.invalidatepage' requires 3 arguments],
1338 address_space_ops_invalidatepage_3args, [
1339 #include <linux/fs.h>
1341 struct address_space_operations a_ops;
1342 a_ops.invalidatepage(NULL, 0, 0);
1344 AC_DEFINE(HAVE_INVALIDATE_RANGE, 1,
1345 [address_space_operations.invalidatepage needs 3 arguments])
1347 ]) # LC_INVALIDATE_RANGE
1350 # LC_HAVE_DIR_CONTEXT
1352 # 3.11 readdir now takes the new struct dir_context
1354 AC_DEFUN([LC_HAVE_DIR_CONTEXT], [
1355 LB_CHECK_COMPILE([if 'dir_context' exist],
1357 #include <linux/fs.h>
1359 struct dir_context ctx;
1362 AC_DEFINE(HAVE_DIR_CONTEXT, 1,
1363 [dir_context exist])
1365 ]) # LC_HAVE_DIR_CONTEXT
1368 # LC_D_COMPARE_5ARGS
1370 # 3.11 dentry_operations.d_compare() taken 5 arguments.
1372 AC_DEFUN([LC_D_COMPARE_5ARGS], [
1373 LB_CHECK_COMPILE([if 'd_compare' taken 5 arguments],
1375 #include <linux/dcache.h>
1377 ((struct dentry_operations*)0)->d_compare(NULL,NULL,0,NULL,NULL);
1379 AC_DEFINE(HAVE_D_COMPARE_5ARGS, 1,
1380 [d_compare need 5 arguments])
1382 ]) # LC_D_COMPARE_5ARGS
1387 # 3.11 need to access d_count to get dentry reference count
1389 AC_DEFUN([LC_HAVE_DCOUNT], [
1390 LB_CHECK_COMPILE([if 'd_count' exist],
1392 #include <linux/dcache.h>
1397 AC_DEFINE(HAVE_D_COUNT, 1,
1403 # LC_OLDSIZE_TRUNCATE_PAGECACHE
1405 # 3.12 truncate_pagecache without oldsize parameter
1407 AC_DEFUN([LC_OLDSIZE_TRUNCATE_PAGECACHE], [
1408 LB_CHECK_COMPILE([if 'truncate_pagecache' with 'old_size' parameter],
1409 truncate_pagecache_old_size, [
1410 #include <linux/mm.h>
1412 truncate_pagecache(NULL, 0, 0);
1414 AC_DEFINE(HAVE_OLDSIZE_TRUNCATE_PAGECACHE, 1,
1417 ]) # LC_OLDSIZE_TRUNCATE_PAGECACHE
1422 # 3.12 ki_left removed from struct kiocb
1424 AC_DEFUN([LC_KIOCB_KI_LEFT], [
1425 LB_CHECK_COMPILE([if 'struct kiocb' with 'ki_left' member],
1427 #include <linux/aio.h>
1429 ((struct kiocb*)0)->ki_left = 0;
1431 AC_DEFINE(HAVE_KIOCB_KI_LEFT, 1,
1434 ]) # LC_KIOCB_KI_LEFT
1437 # LC_VFS_RENAME_5ARGS
1439 # 3.13 has vfs_renane with 5 args
1441 AC_DEFUN([LC_VFS_RENAME_5ARGS], [
1442 LB_CHECK_COMPILE([if Linux kernel has 'vfs_rename' with 5 args],
1444 #include <linux/fs.h>
1446 vfs_rename(NULL, NULL, NULL, NULL, NULL);
1448 AC_DEFINE(HAVE_VFS_RENAME_5ARGS, 1,
1449 [kernel has vfs_rename with 5 args])
1451 ]) # LC_VFS_RENAME_5ARGS
1456 # Lustre linux kernel checks
1458 AC_DEFUN([LC_PROG_LINUX], [
1459 AC_MSG_NOTICE([Lustre kernel checks
1460 ==============================================================================])
1464 LC_CONFIG_LIBLUSTRE_RECOVERY
1465 LC_CONFIG_HEALTH_CHECK_WRITE
1466 LC_CONFIG_LRU_RESIZE
1467 LC_LLITE_LLOOP_MODULE
1469 LC_GLIBC_SUPPORT_FHANDLES
1475 LC_BLK_QUEUE_MAX_SEGMENTS
1478 LC_HAVE_DQUOT_FS_DISK_QUOTA
1479 LC_HAVE_DQUOT_SUSPEND
1483 LC_EXPORT_SIMPLE_SETATTR
1484 LC_EXPORT_TRUNCATE_COMPLETE_PAGE
1488 LC_SBOPS_EVICT_INODE
1494 LC_BLKDEV_GET_BY_DEV
1495 LC_GENERIC_PERMISSION
1502 LC_REQUEST_QUEUE_UNPLUG_FN
1503 LC_HAVE_FHANDLE_SYSCALLS
1504 LC_HAVE_FSTYPE_MOUNT
1506 LC_HAVE_INODE_OWNER_OR_CAPABLE
1509 LC_DIRTY_INODE_WITH_FLAG
1512 LC_LM_XXX_LOCK_MANAGER_OPS
1516 LC_INODE_PERMISION_2ARGS
1519 LC_HAVE_VOID_MAKE_REQUEST_FN
1520 LC_HAVE_PROTECT_I_NLINK
1523 LC_HAVE_MIGRATE_HEADER
1524 LC_MIGRATEPAGE_4ARGS
1525 LC_SUPEROPS_USE_DENTRY
1526 LC_INODEOPS_USE_UMODE_T
1527 LC_HAVE_CACHE_REGISTER
1531 LC_KMAP_ATOMIC_HAS_1ARG
1535 LC_HAVE_ENCODE_FH_PARENT
1536 LC_FILE_LLSEEK_SIZE_5ARG
1539 LC_HAVE_DENTRY_D_ALIAS_HLIST
1540 LC_DENTRY_OPEN_USE_PATH
1541 LC_HAVE_IOP_ATOMIC_OPEN
1544 LC_HAVE_POSIXACL_USER_NS
1547 LC_HAVE_FILE_F_INODE
1548 LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS
1551 LC_HAVE_HLIST_FOR_EACH_3ARG
1554 LC_HAVE_ONLY_PROCFS_SEQ
1555 LC_BLKDEV_RELEASE_RETURN_INT
1564 LC_OLDSIZE_TRUNCATE_PAGECACHE
1571 AS_IF([test "x$enable_server" != xno], [
1572 LC_FUNC_DEV_SET_RDONLY
1582 # Check whether to build the client side of Lustre
1584 AC_DEFUN([LC_CONFIG_CLIENT], [
1585 AC_MSG_CHECKING([whether to build Lustre client support])
1586 AC_ARG_ENABLE([client],
1587 AC_HELP_STRING([--disable-client],
1588 [disable Lustre client support]),
1589 [], [enable_client="yes"])
1590 AC_MSG_RESULT([$enable_client])
1591 ]) # LC_CONFIG_CLIENT
1594 # LC_CONFIG_LIBLUSTRE
1596 # whether to build liblustre
1598 AC_DEFUN([LC_CONFIG_LIBLUSTRE], [
1599 AC_MSG_CHECKING([whether to build Lustre library])
1600 AC_ARG_ENABLE([liblustre],
1601 AC_HELP_STRING([--enable-liblustre],
1602 [enable building of Lustre library]),
1604 AC_MSG_RESULT([$enable_liblustre])
1606 # only build sysio if liblustre is built
1607 with_sysio="$enable_liblustre"
1609 AC_MSG_CHECKING([whether to build liblustre tests])
1610 AC_ARG_ENABLE([liblustre-tests],
1611 AC_HELP_STRING([--enable-liblustre-tests],
1612 [enable liblustre tests, if --disable-tests is used]),
1613 [], [enable_liblustre_tests=$enable_tests])
1614 AS_IF([test "x$enable_liblustre" != xyes], [enable_liblustre_tests="no"])
1615 AC_MSG_RESULT([$enable_liblustre_tests])
1617 AC_MSG_CHECKING([whether to enable liblustre acl])
1618 AC_ARG_ENABLE([liblustre-acl],
1619 AC_HELP_STRING([--disable-liblustre-acl],
1620 [disable ACL support for liblustre]),
1621 [], [enable_liblustre_acl="yes"])
1622 AC_MSG_RESULT([$enable_liblustre_acl])
1624 AS_IF([test "x$enable_liblustre_acl" = xyes],
1625 [AC_DEFINE(LIBLUSTRE_POSIX_ACL, 1,
1626 [Liblustre Support ACL-enabled MDS])])
1631 AC_ARG_ENABLE(mpitests,
1632 AC_HELP_STRING([--enable-mpitests=yes|no|mpicc wrapper],
1633 [include mpi tests]),
1635 enable_mpitests="yes"
1644 MPICC_WRAPPER=$enableval
1652 AS_IF([test "x$enable_mpitests" != xno], [
1655 AC_MSG_CHECKING([whether mpitests can be built])
1661 MPI_Initialized(&flag);
1664 AC_MSG_RESULT([yes])
1671 AC_SUBST(MPICC_WRAPPER)
1673 AC_MSG_NOTICE([Enabling Lustre configure options for libsysio])
1674 ac_configure_args="$ac_configure_args --with-lustre-hack --with-sockets"
1677 LC_CONFIG_LIBLUSTRE_RECOVERY
1683 # whether to enable quota support global control
1685 AC_DEFUN([LC_CONFIG_QUOTA], [
1686 AC_MSG_CHECKING([whether to enable quota support global control])
1687 AC_ARG_ENABLE([quota],
1688 AC_HELP_STRING([--enable-quota],
1689 [enable quota support]),
1690 [], [enable_quota="yes"])
1691 AS_IF([test "x$enable_quota" = xyes],
1692 [AC_MSG_RESULT([yes])],
1693 [AC_MSG_RESULT([no])])
1694 ]) # LC_CONFIG_QUOTA
1699 AC_DEFUN([LC_QUOTA], [
1703 AS_IF([test "x$enable_quota" != xno -a "x$enable_utils" != xno], [
1704 AC_CHECK_HEADER([sys/quota.h],
1705 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1,
1706 [Define to 1 if you have <sys/quota.h>.])],
1707 [AC_MSG_ERROR([don't find <sys/quota.h> in your system])])
1714 # whether to enable split support
1716 AC_DEFUN([LC_CONFIG_SPLIT], [
1717 AC_MSG_CHECKING([whether to enable split support])
1718 AC_ARG_ENABLE([split],
1719 AC_HELP_STRING([--enable-split],
1720 [enable split support]),
1721 [], [enable_split='no'])
1722 AC_MSG_RESULT([$enable_split])
1723 AS_IF([test "x$enable_split" != xno],
1724 [AC_DEFINE(HAVE_SPLIT_SUPPORT, 1, [enable split support])])
1725 ]) # LC_CONFIG_SPLIT
1728 # LC_CONFIG_NODEMAP_PROC_DEBUG
1730 # enable nodemap proc file debugging
1732 AC_DEFUN([LC_NODEMAP_PROC_DEBUG], [
1733 AC_MSG_CHECKING([whether to enable nodemap proc debug])
1734 AC_ARG_ENABLE([nodemap_proc_debug],
1735 AC_HELP_STRING([--enable-nodemap-proc-debug],
1736 [enable nodemap proc debug]),
1737 [], [enable_nodemap_proc_debug="no"])
1738 AC_MSG_RESULT([$enable_nodemap_proc_debug])
1739 AS_IF([test "x$enable_nodemap_proc_debug" != xno],
1740 [AC_DEFINE(NODEMAP_PROC_DEBUG, 1,
1741 [enable nodemap proc debug support])])
1742 ]) # LC_NODEMAP_PROC_DEBUG
1745 # LC_LLITE_LLOOP_MODULE
1747 # lloop_llite.ko does not currently work with page sizes
1750 AC_DEFUN([LC_LLITE_LLOOP_MODULE], [
1751 LB_CHECK_COMPILE([whether to enable 'llite_lloop' module],
1752 enable_llite_lloop_module, [
1753 #include <asm/page.h>
1755 #if PAGE_SIZE >= 65536
1756 #error "PAGE_SIZE >= 65536"
1759 [enable_llite_lloop_module="yes"],
1760 [enable_llite_lloop_module="no"])
1761 ]) # LC_LLITE_LLOOP_MODULE
1766 # configure support for optional OSD implementation
1768 AC_DEFUN([LC_OSD_ADDON], [
1769 AC_MSG_CHECKING([whether to use OSD addon])
1771 AC_HELP_STRING([--with-osd=path],
1772 [set path to optional osd]),
1779 OSDADDON="$with_osd"
1786 AS_IF([test $ENABLEOSDADDON -eq 0], [
1790 OSDMODNAME=$(basename $OSDADDON)
1791 AS_IF([test -e $LUSTRE/$OSDMODNAME], [
1792 AC_MSG_RESULT([can't link])
1794 ], [ln -s $OSDADDON $LUSTRE/$OSDMODNAME], [
1795 AC_MSG_RESULT([$OSDMODNAME])
1796 OSDADDON="subdir-m += $OSDMODNAME"
1798 AC_MSG_RESULT([can't link])
1808 # other configure checks
1810 AC_DEFUN([LC_CONFIGURE], [
1811 AC_MSG_NOTICE([Lustre core checks
1812 ==============================================================================])
1814 LC_CONFIG_OBD_BUFFER_SIZE
1816 AS_IF([test $target_cpu == "i686" -o $target_cpu == "x86_64"],
1817 [CFLAGS="$CFLAGS -Werror"])
1819 # maximum MDS thread count
1822 # include/liblustre.h
1823 AC_CHECK_HEADERS([sys/user.h sys/vfs.h stdint.h blkid/blkid.h])
1825 # liblustre/llite_lib.h
1826 AC_CHECK_HEADERS([xtio.h file.h])
1829 AC_CHECK_HEADERS([linux/types.h sys/types.h linux/unistd.h unistd.h])
1832 AC_CHECK_HEADERS([netinet/in.h arpa/inet.h catamount/data.h])
1833 AC_CHECK_FUNCS([inet_ntoa])
1835 # libsysio/src/readlink.c
1838 # libcfs prng.c - depends on linux/types.h from liblustre/dir.c
1839 AC_CHECK_HEADERS([linux/random.h], [], [],
1840 [#ifdef HAVE_LINUX_TYPES_H
1841 #include <linux/types.h>
1846 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
1848 # check for -lz support
1850 AC_CHECK_LIB([z], [adler32],
1851 [AC_CHECK_HEADERS([zlib.h], [
1853 AC_DEFINE([HAVE_ADLER], 1,
1854 [support alder32 checksum type])
1858 No zlib-devel package found, unable to use adler32 checksum
1863 No zlib package found, unable to use adler32 checksum
1869 AC_CHECK_LIB([selinux], [is_selinux_enabled],
1870 [AC_CHECK_HEADERS([selinux.h],
1871 [SELINUX="-lselinux"
1872 AC_DEFINE([HAVE_SELINUX], 1,
1873 [support for selinux ])],
1876 No selinux-devel package found, unable to build selinux enabled tools
1881 No selinux package found, unable to build selinux enabled tools
1887 AC_MSG_CHECKING([whether to report minimum OST free space])
1888 AC_ARG_ENABLE([mindf],
1889 AC_HELP_STRING([--enable-mindf],
1890 [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
1891 [], [enable_mindf="no"])
1892 AC_MSG_RESULT([$enable_mindf])
1893 AS_IF([test "$enable_mindf" = "yes"],
1894 [AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])])
1896 AC_MSG_CHECKING([whether to randomly failing memory alloc])
1897 AC_ARG_ENABLE([fail_alloc],
1898 AC_HELP_STRING([--disable-fail-alloc],
1899 [disable randomly alloc failure]),
1900 [], [enable_fail_alloc="yes"])
1901 AC_MSG_RESULT([$enable_fail_alloc])
1902 AS_IF([test "x$enable_fail_alloc" != xno],
1903 [AC_DEFINE([RANDOM_FAIL_ALLOC], 1,
1904 [enable randomly alloc failure])])
1906 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
1907 AC_ARG_ENABLE([invariants],
1908 AC_HELP_STRING([--enable-invariants],
1909 [enable invariant checking (cpu intensive)]),
1910 [], [enable_invariants="no"])
1911 AC_MSG_RESULT([$enable_invariants])
1912 AS_IF([test "x$enable_invariants" = xyes],
1913 [AC_DEFINE([CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK], 1,
1914 [enable invariant checking])])
1916 AC_MSG_CHECKING([whether to track references with lu_ref])
1917 AC_ARG_ENABLE([lu_ref],
1918 AC_HELP_STRING([--enable-lu_ref],
1919 [enable lu_ref reference tracking code]),
1920 [], [enable_lu_ref="no"])
1921 AC_MSG_RESULT([$enable_lu_ref])
1922 AS_IF([test "x$enable_lu_ref" = xyes],
1923 [AC_DEFINE([USE_LU_REF], 1,
1924 [enable lu_ref reference tracking code])])
1926 AC_MSG_CHECKING([whether to enable page state tracking])
1927 AC_ARG_ENABLE([pgstate-track],
1928 AC_HELP_STRING([--enable-pgstate-track],
1929 [enable page state tracking]),
1930 [], [enable_pgstat_track="no"])
1931 AC_MSG_RESULT([$enable_pgstat_track])
1932 AS_IF([test "x$enable_pgstat_track" = xyes],
1933 [AC_DEFINE([CONFIG_DEBUG_PAGESTATE_TRACKING], 1,
1934 [enable page state tracking code])])
1940 # AM_CONDITIONALS for lustre
1942 AC_DEFUN([LC_CONDITIONALS], [
1943 AM_CONDITIONAL(LIBLUSTRE, test x$enable_liblustre = xyes)
1944 AM_CONDITIONAL(LIBLUSTRE_TESTS, test x$enable_liblustre_tests = xyes)
1945 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
1946 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
1947 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
1948 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
1949 AM_CONDITIONAL(BLKID, test x$ac_cv_header_blkid_blkid_h = xyes)
1950 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
1951 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
1952 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
1953 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
1954 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
1955 AM_CONDITIONAL(LLITE_LLOOP, test x$enable_llite_lloop_module = xyes)
1956 ]) # LC_CONDITIONALS
1961 # files that should be generated with AC_OUTPUT
1963 AC_DEFUN([LC_CONFIG_FILES],
1967 lustre/autoconf/Makefile
1968 lustre/conf/Makefile
1969 lustre/contrib/Makefile
1971 lustre/include/Makefile
1972 lustre/include/lustre_ver.h
1973 lustre/include/linux/Makefile
1974 lustre/include/darwin/Makefile
1975 lustre/include/lustre/Makefile
1976 lustre/kernel_patches/targets/2.6-rhel6.target
1977 lustre/kernel_patches/targets/2.6-rhel5.target
1978 lustre/kernel_patches/targets/2.6-sles11.target
1979 lustre/kernel_patches/targets/3.0-sles11.target
1980 lustre/kernel_patches/targets/3.0-sles11sp3.target
1981 lustre/kernel_patches/targets/2.6-fc11.target
1982 lustre/kernel_patches/targets/2.6-fc12.target
1983 lustre/kernel_patches/targets/2.6-fc15.target
1984 lustre/kernel_patches/targets/3.x-fc18.target
1985 lustre/ldlm/Makefile
1987 lustre/fid/autoMakefile
1988 lustre/liblustre/Makefile
1989 lustre/liblustre/tests/Makefile
1990 lustre/liblustre/tests/mpi/Makefile
1991 lustre/llite/Makefile
1992 lustre/llite/autoMakefile
1993 lustre/lclient/Makefile
1995 lustre/lov/autoMakefile
1997 lustre/mdc/autoMakefile
1999 lustre/lmv/autoMakefile
2000 lustre/lfsck/Makefile
2001 lustre/lfsck/autoMakefile
2003 lustre/mdt/autoMakefile
2004 lustre/nodemap/Makefile
2005 lustre/nodemap/autoMakefile
2007 lustre/mdd/autoMakefile
2009 lustre/fld/autoMakefile
2010 lustre/obdclass/Makefile
2011 lustre/obdclass/autoMakefile
2012 lustre/obdclass/linux/Makefile
2013 lustre/obdecho/Makefile
2014 lustre/obdecho/autoMakefile
2016 lustre/ofd/autoMakefile
2018 lustre/osc/autoMakefile
2020 lustre/ost/autoMakefile
2021 lustre/osd-ldiskfs/Makefile
2022 lustre/osd-ldiskfs/autoMakefile
2023 lustre/osd-zfs/Makefile
2024 lustre/osd-zfs/autoMakefile
2026 lustre/mgc/autoMakefile
2028 lustre/mgs/autoMakefile
2029 lustre/target/Makefile
2030 lustre/ptlrpc/Makefile
2031 lustre/ptlrpc/autoMakefile
2032 lustre/ptlrpc/gss/Makefile
2033 lustre/ptlrpc/gss/autoMakefile
2034 lustre/quota/Makefile
2035 lustre/quota/autoMakefile
2036 lustre/scripts/Makefile
2037 lustre/tests/Makefile
2038 lustre/tests/mpi/Makefile
2039 lustre/utils/Makefile
2040 lustre/utils/gss/Makefile
2042 lustre/osp/autoMakefile
2044 lustre/lod/autoMakefile
2045 lustre/obdclass/darwin/Makefile
2047 ]) # LC_CONFIG_FILES