Whamcloud - gitweb
LU-16335 build: remove _GNU_SOURCE dependency in lustre_user.h
[fs/lustre-release.git] / lustre / autoconf / lustre-core.m4
1 #
2 # LC_CONFIG_SRCDIR
3 #
4 # Wrapper for AC_CONFIG_SUBDIR
5 #
6 AC_DEFUN([LC_CONFIG_SRCDIR], [
7 AC_CONFIG_SRCDIR([lustre/obdclass/obdo.c])
8 ldiskfs_is_ext4="yes"
9 ])
10
11 #
12 # LC_PATH_DEFAULTS
13 #
14 # lustre specific paths
15 #
16 AC_DEFUN([LC_PATH_DEFAULTS], [
17 # ptlrpc kernel build requires this
18 LUSTRE="$PWD/lustre"
19 AC_SUBST(LUSTRE)
20
21 # mount.lustre
22 rootsbindir='/sbin'
23 AC_SUBST(rootsbindir)
24
25 demodir='$(docdir)/demo'
26 AC_SUBST(demodir)
27
28 pkgexampledir='${pkgdatadir}/examples'
29 AC_SUBST(pkgexampledir)
30 ]) # LC_PATH_DEFAULTS
31
32 #
33 # LC_TARGET_SUPPORTED
34 #
35 # is the target os supported?
36 #
37 AC_DEFUN([LC_TARGET_SUPPORTED], [
38 case $target_os in
39         linux*)
40 $1
41                 ;;
42         *)
43 $2
44                 ;;
45 esac
46 ]) # LC_TARGET_SUPPORTED
47
48 #
49 # LC_GLIBC_SUPPORT_FHANDLES
50 #
51 AC_DEFUN([LC_GLIBC_SUPPORT_FHANDLES], [
52 AC_CHECK_FUNCS([name_to_handle_at],
53         [AC_DEFINE(HAVE_FHANDLE_GLIBC_SUPPORT, 1,
54                 [file handle and related syscalls are supported])],
55         [AC_MSG_WARN([file handle and related syscalls are not supported])])
56 ]) # LC_GLIBC_SUPPORT_FHANDLES
57
58 #
59 # LC_GLIBC_SUPPORT_COPY_FILE_RANGE
60 #
61 AC_DEFUN([LC_GLIBC_SUPPORT_COPY_FILE_RANGE], [
62 AC_CHECK_FUNCS([copy_file_range],
63         [AC_DEFINE(HAVE_COPY_FILE_RANGE, 1,
64                 [copy_file_range() is supported])],
65         [AC_MSG_WARN([copy_file_range() is not supported])])
66 ]) # LC_GLIBC_SUPPORT_COPY_FILE_RANGE
67
68 #
69 # LC_FID2PATH_UNION
70 #
71 AC_DEFUN([LC_FID2PATH_ANON_UNION], [
72 saved_flags="$CFLAGS"
73 CFLAGS="$CFLAGS -Werror"
74 AC_MSG_CHECKING([if 'struct getinfo_fid2path' has anonymous union])
75 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
76         #include <linux/lustre/lustre_idl.h>
77
78         int main(void) {
79                 struct getinfo_fid2path gf;
80                 struct lu_fid root_fid;
81
82                 *gf.gf_root_fid = root_fid;
83                 return 0;
84         }
85 ])],[
86         AC_DEFINE(HAVE_FID2PATH_ANON_UNIONS, 1, [union is unnamed])
87         AC_MSG_RESULT([yes])
88 ],[
89         AC_MSG_RESULT([no])
90 ])
91 CFLAGS="$saved_flags"
92 ]) # LC_FID2PATH_ANON_UNION
93
94 #
95 # LC_STACK_SIZE
96 #
97 # Ensure the stack size is at least 8k in Lustre server (all kernels)
98 #
99 AC_DEFUN([LC_STACK_SIZE], [
100 LB_CHECK_COMPILE([if stack size is at least 8k],
101 stack_size_8k, [
102         #include <linux/thread_info.h>
103 ], [
104         #if THREAD_SIZE < 8192
105         #error "stack size < 8192"
106         #endif
107 ], [], [AC_MSG_ERROR([
108
109 Lustre requires that Linux is configured with at least a 8KB stack.
110 ])])
111 ]) # LC_STACK_SIZE
112
113 #
114 # LC_MDS_MAX_THREADS
115 #
116 # Allow the user to set the MDS thread upper limit
117 #
118 AC_DEFUN([LC_MDS_MAX_THREADS], [
119 AC_MSG_CHECKING([for maximum number of MDS threads])
120 AC_ARG_WITH([mds_max_threads],
121         AS_HELP_STRING([--with-mds-max-threads=count],
122                 [maximum threads available on the MDS: (default=512)]),
123         [AC_DEFINE_UNQUOTED(MDS_MAX_THREADS, $with_mds_max_threads,
124                 [maximum number of MDS threads])])
125 AC_MSG_RESULT([$with_mds_max_threads])
126 ]) # LC_MDS_MAX_THREADS
127
128 #
129 # LC_CONFIG_PINGER
130 #
131 # the pinger is temporary, until we have the recovery node in place
132 #
133 AC_DEFUN([LC_CONFIG_PINGER], [
134 AC_MSG_CHECKING([whether to enable Lustre pinger support])
135 AC_ARG_ENABLE([pinger],
136         AS_HELP_STRING([--disable-pinger],
137                 [disable recovery pinger support]),
138         [], [enable_pinger="yes"])
139 AC_MSG_RESULT([$enable_pinger])
140 AS_IF([test "x$enable_pinger" != xno],
141         [AC_DEFINE(CONFIG_LUSTRE_FS_PINGER, 1,[Use the Pinger])])
142 ]) # LC_CONFIG_PINGER
143
144 #
145 # LC_CONFIG_CHECKSUM
146 #
147 # do checksum of bulk data between client and OST
148 #
149 AC_DEFUN([LC_CONFIG_CHECKSUM], [
150 AC_MSG_CHECKING([whether to enable data checksum support])
151 AC_ARG_ENABLE([checksum],
152         AS_HELP_STRING([--disable-checksum],
153                 [disable data checksum support]),
154         [], [enable_checksum="yes"])
155 AC_MSG_RESULT([$enable_checksum])
156 AS_IF([test "x$enable_checksum" != xno],
157         [AC_DEFINE(ENABLE_CHECKSUM, 1, [do data checksums])])
158 ]) # LC_CONFIG_CHECKSUM
159
160 #
161 # LC_CONFIG_FLOCK
162 #
163 # enable distributed flock by default
164 #
165 AC_DEFUN([LC_CONFIG_FLOCK], [
166 AC_MSG_CHECKING([whether to enable flock by default])
167 AC_ARG_ENABLE([flock],
168         AS_HELP_STRING([--disable-flock],
169                 [disable flock by default]),
170         [], [enable_flock="yes"])
171 AC_MSG_RESULT([$enable_flock])
172 AS_IF([test "x$enable_flock" != xno],
173         [AC_DEFINE(ENABLE_FLOCK, 1, [enable flock by default])])
174 ]) # LC_CONFIG_FLOCK
175
176 #
177 # LC_CONFIG_HEALTH_CHECK_WRITE
178 #
179 # Turn off the actual write to the disk
180 #
181 AC_DEFUN([LC_CONFIG_HEALTH_CHECK_WRITE], [
182 AC_MSG_CHECKING([whether to enable a write with the health check])
183 AC_ARG_ENABLE([health_write],
184         AS_HELP_STRING([--enable-health_write],
185                 [enable disk writes when doing health check]),
186         [], [enable_health_write="no"])
187 AC_MSG_RESULT([$enable_health_write])
188 AS_IF([test "x$enable_health_write" != xno],
189         [AC_DEFINE(USE_HEALTH_CHECK_WRITE, 1, [Write when Checking Health])])
190 ]) # LC_CONFIG_HEALTH_CHECK_WRITE
191
192 #
193 # LC_CONFIG_LRU_RESIZE
194 #
195 AC_DEFUN([LC_CONFIG_LRU_RESIZE], [
196 AC_MSG_CHECKING([whether to enable lru self-adjusting])
197 AC_ARG_ENABLE([lru_resize],
198         AS_HELP_STRING([--enable-lru-resize],
199                 [enable lru resize support]),
200         [], [enable_lru_resize="yes"])
201 AC_MSG_RESULT([$enable_lru_resize])
202 AS_IF([test "x$enable_lru_resize" != xno],
203         [AC_DEFINE(HAVE_LRU_RESIZE_SUPPORT, 1, [Enable lru resize support])])
204 ]) # LC_CONFIG_LRU_RESIZE
205
206 #
207 # LC_QUOTA_CONFIG
208 #
209 # Quota support. The kernel must support CONFIG_QUOTA.
210 #
211 AC_DEFUN([LC_QUOTA_CONFIG], [
212 LB_CHECK_CONFIG_IM([QUOTA], [],
213         [AC_MSG_ERROR([
214
215 Lustre quota requires that CONFIG_QUOTA is enabled in your kernel.
216 ])])
217 ]) # LC_QUOTA_CONFIG
218
219 #
220 # LC_CONFIG_FHANDLE
221 #
222 # fhandle kernel support for open_by_handle_at() and name_to_handle_at()
223 # system calls. The kernel must support CONFIG_FHANDLE.
224 #
225 AC_DEFUN([LC_CONFIG_FHANDLE], [
226 LB_CHECK_CONFIG_IM([FHANDLE], [],
227         [AC_MSG_ERROR([
228
229 Lustre fid handling requires that CONFIG_FHANDLE is enabled in your kernel.
230 ])])
231 ]) # LC_CONFIG_FHANDLE
232
233 #
234 # LC_POSIX_ACL_CONFIG
235 #
236 # POSIX ACL support.
237 #
238 AC_DEFUN([LC_POSIX_ACL_CONFIG], [
239 LB_CHECK_CONFIG_IM([FS_POSIX_ACL],
240         [AC_DEFINE(CONFIG_LUSTRE_FS_POSIX_ACL, 1, [Enable POSIX acl])
241 ], [ ])
242 ]) # LC_POSIX_ACL_CONFIG
243
244 LB_CHECK_CONFIG_IM([CRYPTO_MD5], [],
245                 [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
246
247 #
248 # LC_CONFIG_GSS_KEYRING
249 #
250 # default 'auto', tests for dependencies, if found, enables;
251 # only called if gss is enabled
252 #
253 AC_DEFUN([LC_CONFIG_GSS_KEYRING], [
254 AC_MSG_CHECKING([whether to enable gss keyring backend])
255 AC_ARG_ENABLE([gss_keyring],
256         [AS_HELP_STRING([--disable-gss-keyring],
257                 [disable gss keyring backend])],
258         [], [AS_IF([test "x$enable_gss" != xno], [
259                         enable_gss_keyring="yes"], [
260                         enable_gss_keyring="auto"])])
261 AC_MSG_RESULT([$enable_gss_keyring])
262 AS_IF([test "x$enable_gss_keyring" != xno], [
263         LB_CHECK_CONFIG_IM([KEYS], [], [
264                 gss_keyring_conf_test="fail"
265                 AC_MSG_WARN([GSS keyring backend requires that CONFIG_KEYS be enabled in your kernel.])])
266
267         AC_CHECK_LIB([keyutils], [keyctl_search], [], [
268                 gss_keyring_conf_test="fail"
269                 AC_MSG_WARN([GSS keyring backend requires libkeyutils])])
270
271         AS_IF([test "x$gss_keyring_conf_test" != xfail], [
272                 AC_DEFINE([HAVE_GSS_KEYRING], [1],
273                         [Define this if you enable gss keyring backend])
274                 enable_gss_keyring="yes"
275         ], [
276                 AS_IF([test "x$enable_gss_keyring" = xyes], [
277                         AC_MSG_ERROR([Cannot enable gss_keyring. See above for details.])
278                 ])
279                 enable_ssk="no"
280         ])
281 ], [
282         enable_ssk="no"
283 ])
284 ]) # LC_CONFIG_GSS_KEYRING
285
286 #
287 # LC_KEY_TYPE_INSTANTIATE_2ARGS
288 #
289 # rhel7 key_type->instantiate takes 2 args (struct key, struct key_preparsed_payload)
290 #
291 AC_DEFUN([LC_KEY_TYPE_INSTANTIATE_2ARGS], [
292 LB_CHECK_COMPILE([if 'key_type->instantiate' has two args],
293 key_type_instantiate_2args, [
294         #include <linux/key-type.h>
295 ],[
296         ((struct key_type *)0)->instantiate(0, NULL);
297 ],[
298         AC_DEFINE(HAVE_KEY_TYPE_INSTANTIATE_2ARGS, 1,
299                 [key_type->instantiate has two args])
300 ])
301 ]) # LC_KEY_TYPE_INSTANTIATE_2ARGS
302
303 #
304 # LC_CONFIG_SUNRPC
305 #
306 AC_DEFUN([LC_CONFIG_SUNRPC], [
307 LB_CHECK_CONFIG_IM([SUNRPC], [], [
308         AS_IF([test "x$sunrpc_required" = xyes], [
309                 AC_MSG_ERROR([
310
311 kernel SUNRPC support is required by using GSS.
312 ])
313         ])])
314 ]) # LC_CONFIG_SUNRPC
315
316 #
317 # LC_CONFIG_GSS (default 'auto' (tests for dependencies, if found, enables))
318 #
319 # Build gss and related tools of Lustre. Currently both kernel and user space
320 # parts are depend on linux platform.
321 #
322 AC_DEFUN([LC_CONFIG_GSS], [
323 AC_MSG_CHECKING([whether to enable gss support])
324 AC_ARG_ENABLE([gss],
325         [AS_HELP_STRING([--enable-gss], [enable gss support])],
326         [], [enable_gss="auto"])
327 AC_MSG_RESULT([$enable_gss])
328
329 AC_ARG_VAR([TEST_JOBS],
330     [simultaneous jobs during configure (defaults to $(nproc))])
331 if test "x$ac_cv_env_TEST_JOBS_set" != "xset"; then
332         TEST_JOBS=${TEST_JOBS:-$(nproc)}
333 fi
334 AC_SUBST(TEST_JOBS)
335
336 AC_ARG_VAR([TEST_DIR],
337     [location of temporary parallel configure tests (defaults to $PWD/lb2)])
338         TEST_DIR=${TEST_DIR:-${ac_pwd}/_lpb}
339 AC_SUBST(TEST_DIR)
340
341 AS_IF([test "x$enable_gss" != xno], [
342         LC_CONFIG_GSS_KEYRING
343         LC_KEY_TYPE_INSTANTIATE_2ARGS
344         sunrpc_required=$enable_gss
345         LC_CONFIG_SUNRPC
346         sunrpc_required="no"
347
348         LB_CHECK_CONFIG_IM([CRYPTO_MD5], [],
349                 [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
350         LB_CHECK_CONFIG_IM([CRYPTO_SHA1], [],
351                 [AC_MSG_WARN([kernel SHA1 support is recommended by using GSS.])])
352         LB_CHECK_CONFIG_IM([CRYPTO_SHA256], [],
353                 [AC_MSG_WARN([kernel SHA256 support is recommended by using GSS.])])
354         LB_CHECK_CONFIG_IM([CRYPTO_SHA512], [],
355                 [AC_MSG_WARN([kernel SHA512 support is recommended by using GSS.])])
356
357         require_krb5=$enable_gss
358         AC_KERBEROS_V5
359         require_krb5="no"
360
361         AS_IF([test -n "$KRBDIR"], [
362                 gss_conf_test="success"
363         ], [
364                 gss_conf_test="failure"
365         ])
366
367         AS_IF([test "x$gss_conf_test" = xsuccess && test "x$enable_gss" != xno], [
368                 AC_DEFINE([HAVE_GSS], [1], [Define this is if you enable gss])
369                 enable_gss="yes"
370         ], [
371                 enable_gss_keyring="no"
372                 enable_gss="no"
373         ])
374
375         AS_IF([test "x$enable_ssk" != xno], [
376                 enable_ssk=$enable_gss
377         ])
378 ], [
379         enable_gss_keyring="no"
380 ])
381 ]) # LC_CONFIG_GSS
382
383 # LC_OPENSSL_HMAC
384 #
385 # OpenSSL 1.0+ return int for HMAC functions but older SLES11 versions do not
386 AC_DEFUN([LC_OPENSSL_HMAC], [
387 has_hmac_functions="no"
388 saved_flags="$CFLAGS"
389 CFLAGS="$CFLAGS -Werror"
390 AC_MSG_CHECKING([whether OpenSSL has HMAC_Init_ex])
391 AS_IF([test "x$enable_ssk" != xno], [
392 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
393         #include <openssl/hmac.h>
394         #include <openssl/evp.h>
395
396         int main(void) {
397                 int rc;
398                 rc = HMAC_Init_ex(NULL, "test", 4, EVP_md_null(), NULL);
399         }
400 ])],[
401         has_hmac_functions="yes"
402 ])
403 ])
404 AC_MSG_RESULT([$has_hmac_functions])
405 CFLAGS="$saved_flags"
406 ]) # LC_OPENSSL_HMAC
407
408 # LC_OPENSSL_EVP_PKEY
409 #
410 # OpenSSL 3.0 introduces EVP_PKEY_get_params
411 AC_DEFUN([LC_OPENSSL_EVP_PKEY], [
412 has_evp_pkey="no"
413 saved_flags="$CFLAGS"
414 CFLAGS="$CFLAGS -Werror"
415 AC_MSG_CHECKING([whether OpenSSL has EVP_PKEY_get_params])
416 AS_IF([test "x$enable_ssk" != xno], [
417 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
418         #include <openssl/evp.h>
419
420         int main(void) {
421                 OSSL_PARAM *params;
422
423                 int rc = EVP_PKEY_get_params(NULL, params);
424         }
425 ])],[
426         AC_DEFINE(HAVE_OPENSSL_EVP_PKEY, 1, [OpenSSL EVP_PKEY_get_params])
427         has_evp_pkey="yes"
428 ])
429 ])
430 CFLAGS="$saved_flags"
431 AC_MSG_RESULT([$has_evp_pkey])
432 ]) # LC_OPENSSL_EVP_PKEY
433
434 #
435 # LC_OPENSSL_SSK
436 #
437 # Check whether to enable Lustre client crypto
438 #
439 AC_DEFUN([LC_OPENSSL_SSK], [
440 AC_MSG_CHECKING([whether OpenSSL has functions needed for SSK])
441 AS_IF([test "x$enable_ssk" != xno], [
442         AC_MSG_RESULT(
443         )
444         LC_OPENSSL_HMAC
445         LC_OPENSSL_EVP_PKEY
446 ])
447 AS_IF([test "x$has_hmac_functions" = xyes -o "x$has_evp_pkey" = xyes], [
448         AC_DEFINE(HAVE_OPENSSL_SSK, 1, [OpenSSL HMAC functions needed for SSK])
449 ], [
450         enable_ssk="no"
451 ])
452 AC_MSG_RESULT([$enable_ssk])
453 ]) # LC_OPENSSL_SSK
454
455 # LC_OPENSSL_GETSEPOL
456 #
457 # OpenSSL is needed for l_getsepol
458 AC_DEFUN([LC_OPENSSL_GETSEPOL], [
459 saved_flags="$CFLAGS"
460 CFLAGS="$CFLAGS -Werror"
461 AC_MSG_CHECKING([whether openssl-devel is present])
462 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
463         #include <openssl/evp.h>
464
465         int main(void) {
466                 EVP_MD_CTX *mdctx = EVP_MD_CTX_create();
467         }
468 ])],[
469         AC_DEFINE(HAVE_OPENSSL_GETSEPOL, 1, [openssl-devel is present])
470         enable_getsepol="yes"
471
472 ],[
473         enable_getsepol="no"
474         AC_MSG_WARN([
475
476 No openssl-devel headers found, unable to build l_getsepol and SELinux status checking
477 ])
478 ])
479 AC_MSG_RESULT([$enable_getsepol])
480 CFLAGS="$saved_flags"
481 ]) # LC_OPENSSL_GETSEPOL
482
483 # LC_HAVE_LIBAIO
484 AC_DEFUN([LC_HAVE_LIBAIO], [
485         AC_CHECK_HEADER([libaio.h],
486                 enable_libaio="yes",
487                 AC_MSG_WARN([libaio is not installed in the system]))
488 ]) # LC_HAVE_LIBAIO
489
490 #
491 # LC_INVALIDATE_RANGE
492 #
493 # 3.11 invalidatepage requires the length of the range to invalidate
494 #
495 AC_DEFUN([LC_INVALIDATE_RANGE], [
496 LB_CHECK_COMPILE([if 'address_space_operations.invalidatepage' requires 3 arguments],
497 address_space_ops_invalidatepage_3args, [
498         #include <linux/fs.h>
499 ],[
500         struct address_space_operations a_ops;
501         a_ops.invalidatepage(NULL, 0, 0);
502 ],[
503         AC_DEFINE(HAVE_INVALIDATE_RANGE, 1,
504                 [address_space_operations.invalidatepage needs 3 arguments])
505 ])
506 ]) # LC_INVALIDATE_RANGE
507
508 #
509 # LC_HAVE_DIR_CONTEXT
510 #
511 # 3.11 readdir now takes the new struct dir_context
512 #
513 AC_DEFUN([LC_HAVE_DIR_CONTEXT], [
514 LB_CHECK_COMPILE([if 'dir_context' exist],
515 dir_context, [
516         #include <linux/fs.h>
517 ],[
518 #ifdef FMODE_KABI_ITERATE
519 #error "back to use readdir in kabi_extand mode"
520 #else
521         struct dir_context ctx;
522
523         ctx.pos = 0;
524 #endif
525 ],[
526         AC_DEFINE(HAVE_DIR_CONTEXT, 1,
527                 [dir_context exist])
528 ])
529 ]) # LC_HAVE_DIR_CONTEXT
530
531 #
532 # LC_D_COMPARE_5ARGS
533 #
534 # 3.11 dentry_operations.d_compare() taken 5 arguments.
535 #
536 AC_DEFUN([LC_D_COMPARE_5ARGS], [
537 LB_CHECK_COMPILE([if 'd_compare' taken 5 arguments],
538 d_compare_5args, [
539         #include <linux/dcache.h>
540 ],[
541         ((struct dentry_operations*)0)->d_compare(NULL,NULL,0,NULL,NULL);
542 ],[
543         AC_DEFINE(HAVE_D_COMPARE_5ARGS, 1,
544                 [d_compare need 5 arguments])
545 ])
546 ]) # LC_D_COMPARE_5ARGS
547
548 #
549 # LC_HAVE_DCOUNT
550 #
551 # 3.11 need to access d_count to get dentry reference count
552 #
553 AC_DEFUN([LC_HAVE_DCOUNT], [
554 LB_CHECK_COMPILE([if 'd_count' exists],
555 d_count, [
556         #include <linux/dcache.h>
557 ],[
558         struct dentry de = { };
559         int count;
560
561         count = d_count(&de);
562 ],[
563         AC_DEFINE(HAVE_D_COUNT, 1,
564                 [d_count exist])
565 ])
566 ]) # LC_HAVE_DCOUNT
567
568 #
569 # LC_PID_NS_FOR_CHILDREN
570 #
571 # 3.11 replaces pid_ns by pid_ns_for_children in struct nsproxy
572 #
573 AC_DEFUN([LC_PID_NS_FOR_CHILDREN], [
574 LB_CHECK_COMPILE([if 'struct nsproxy' has 'pid_ns_for_children'],
575 pid_ns_for_children, [
576         #include <linux/nsproxy.h>
577 ],[
578         struct nsproxy ns;
579         ns.pid_ns_for_children = NULL;
580 ],[
581         AC_DEFINE(HAVE_PID_NS_FOR_CHILDREN, 1,
582                   ['struct nsproxy' has 'pid_ns_for_children'])
583 ])
584 ]) # LC_PID_NS_FOR_CHILDREN
585
586 #
587 # LC_OLDSIZE_TRUNCATE_PAGECACHE
588 #
589 # 3.12 truncate_pagecache without oldsize parameter
590 #
591 AC_DEFUN([LC_OLDSIZE_TRUNCATE_PAGECACHE], [
592 LB_CHECK_COMPILE([if 'truncate_pagecache' with 'old_size' parameter],
593 truncate_pagecache_old_size, [
594         #include <linux/mm.h>
595 ],[
596         truncate_pagecache(NULL, 0, 0);
597 ],[
598         AC_DEFINE(HAVE_OLDSIZE_TRUNCATE_PAGECACHE, 1,
599                 [with oldsize])
600 ])
601 ]) # LC_OLDSIZE_TRUNCATE_PAGECACHE
602
603 #
604 # LC_PTR_ERR_OR_ZERO
605 #
606 # For some reason SLES11SP4 is missing the PTR_ERR_OR_ZERO macro
607 # It was added to linux kernel 3.12
608 #
609 AC_DEFUN([LC_PTR_ERR_OR_ZERO_MISSING], [
610 LB_CHECK_COMPILE([if 'PTR_ERR_OR_ZERO' is missing],
611 is_err_or_null, [
612         #include <linux/err.h>
613 ],[
614         if (PTR_ERR_OR_ZERO(NULL)) return 0;
615 ],[
616         AC_DEFINE(HAVE_PTR_ERR_OR_ZERO, 1,
617                 ['PTR_ERR_OR_ZERO' exist])
618 ])
619 ]) # LC_PTR_ERR_OR_ZERO_MISSING
620
621 #
622 # LC_HAVE_DENTRY_D_U_D_ALIAS
623 #
624 # 3.11 kernel moved d_alias to the union d_u in struct dentry
625 #
626 # Some distros move d_alias to d_u but it is still a struct list
627 #
628 AC_DEFUN([LC_HAVE_DENTRY_D_U_D_ALIAS], [
629 AS_IF([test "x$lb_cv_compile_i_dentry_d_alias_list" = xyes], [
630         LB_CHECK_COMPILE([if list 'dentry.d_u.d_alias' exist],
631         d_alias, [
632                 #include <linux/list.h>
633                 #include <linux/dcache.h>
634         ],[
635                 struct dentry de;
636                 INIT_LIST_HEAD(&de.d_u.d_alias);
637         ],[
638                 AC_DEFINE(HAVE_DENTRY_D_U_D_ALIAS, 1,
639                         [list dentry.d_u.d_alias exist])
640         ])
641 ],[
642         LB_CHECK_COMPILE([if hlist 'dentry.d_u.d_alias' exist],
643         d_alias, [
644                 #include <linux/list.h>
645                 #include <linux/dcache.h>
646         ],[
647                 struct dentry de;
648                 INIT_HLIST_NODE(&de.d_u.d_alias);
649         ],[
650                 AC_DEFINE(HAVE_DENTRY_D_U_D_ALIAS, 1,
651                         [hlist dentry.d_u.d_alias exist])
652         ])
653 ])
654 ]) # LC_HAVE_DENTRY_D_U_D_ALIAS
655
656 #
657 # LC_HAVE_DENTRY_D_CHILD
658 #
659 # 3.11 kernel d_child has been moved out of the union d_u
660 # in struct dentry
661 #
662 AC_DEFUN([LC_HAVE_DENTRY_D_CHILD], [
663 LB_CHECK_COMPILE([if 'dentry.d_child' exist],
664 d_child, [
665         #include <linux/list.h>
666         #include <linux/dcache.h>
667 ],[
668         struct dentry de;
669         INIT_LIST_HEAD(&de.d_child);
670 ],[
671         AC_DEFINE(HAVE_DENTRY_D_CHILD, 1,
672                 [dentry.d_child exist])
673 ])
674 ]) # LC_HAVE_DENTRY_D_CHILD
675
676 #
677 # LC_KIOCB_KI_LEFT
678 #
679 # 3.12 ki_left removed from struct kiocb
680 #
681 AC_DEFUN([LC_KIOCB_KI_LEFT], [
682 LB_CHECK_COMPILE([if 'struct kiocb' with 'ki_left' member],
683 kiocb_ki_left, [
684         #include <linux/aio.h>
685 ],[
686         ((struct kiocb*)0)->ki_left = 0;
687 ],[
688         AC_DEFINE(HAVE_KIOCB_KI_LEFT, 1,
689                 [ki_left exist])
690 ])
691 ]) # LC_KIOCB_KI_LEFT
692
693 #
694 # LC_REGISTER_SHRINKER_RET
695 #
696 # v3.11-8748-g1d3d4437eae1 register_shrinker returns a status
697 #
698 AC_DEFUN([LC_REGISTER_SHRINKER_RET], [
699 LB_CHECK_COMPILE([if register_shrinker() returns status],
700 register_shrinker_ret, [
701         #include <linux/mm.h>
702 ],[
703         if (register_shrinker(NULL))
704                 unregister_shrinker(NULL);
705 ],[
706         AC_DEFINE(HAVE_REGISTER_SHRINKER_RET, 1,
707                 [register_shrinker() returns status])
708 ])
709 ]) # LC_REGISTER_SHRINKER_RET
710
711 #
712 # LC_VFS_RENAME_5ARGS
713 #
714 # 3.13 has vfs_rename with 5 args
715 #
716 AC_DEFUN([LC_VFS_RENAME_5ARGS], [
717 LB_CHECK_COMPILE([if Linux kernel has 'vfs_rename' with 5 args],
718 vfs_rename_5args, [
719         #include <linux/fs.h>
720 ],[
721         vfs_rename(NULL, NULL, NULL, NULL, NULL);
722 ], [
723         AC_DEFINE(HAVE_VFS_RENAME_5ARGS, 1,
724                 [kernel has vfs_rename with 5 args])
725 ])
726 ]) # LC_VFS_RENAME_5ARGS
727
728 #
729 # LC_VFS_UNLINK_3ARGS
730 #
731 # 3.13 has vfs_unlink with 3 args
732 #
733 AC_DEFUN([LC_VFS_UNLINK_3ARGS], [
734 LB_CHECK_COMPILE([if Linux kernel has 'vfs_unlink' with 3 args],
735 vfs_unlink_3args, [
736         #include <linux/fs.h>
737 ],[
738         vfs_unlink(NULL, NULL, NULL);
739 ], [
740         AC_DEFINE(HAVE_VFS_UNLINK_3ARGS, 1,
741                 [kernel has vfs_unlink with 3 args])
742 ])
743 ]) # LC_VFS_UNLINK_3ARGS
744
745 # LC_HAVE_D_IS_POSITIVE
746 #
747 # Kernel version 3.13 b18825a7c8e37a7cf6abb97a12a6ad71af160de7
748 # d_is_positive is added
749 #
750 AC_DEFUN([LC_HAVE_D_IS_POSITIVE], [
751 LB_CHECK_COMPILE([if 'd_is_positive' exist],
752 d_is_positive, [
753         #include <linux/dcache.h>
754 ],[
755         d_is_positive(NULL);
756 ],[
757         AC_DEFINE(HAVE_D_IS_POSITIVE, 1,
758                 ['d_is_positive' is available])
759 ])
760 ]) # LC_HAVE_D_IS_POSITIVE
761
762 #
763 # LC_HAVE_BVEC_ITER
764 #
765 # 3.14 move some of its data in struct bio into the new
766 # struct bvec_iter
767 #
768 AC_DEFUN([LC_HAVE_BVEC_ITER], [
769 LB_CHECK_COMPILE([if Linux kernel has struct bvec_iter],
770 have_bvec_iter, [
771         #include <linux/bio.h>
772 ],[
773         struct bvec_iter iter;
774
775         iter.bi_bvec_done = 0;
776 ], [
777         AC_DEFINE(HAVE_BVEC_ITER, 1,
778                 [kernel has struct bvec_iter])
779 ])
780 ]) # LC_HAVE_BVEC_ITER
781
782 #
783 # LC_IOP_SET_ACL
784 #
785 # 3.14 adds set_acl method to inode_operations
786 # see kernel commit 893d46e443346370cd4ea81d9d35f72952c62a37
787 #
788 AC_DEFUN([LC_IOP_SET_ACL], [
789 LB_CHECK_COMPILE([if 'inode_operations' has '.set_acl' member function],
790 inode_ops_set_acl, [
791         #include <linux/fs.h>
792 ],[
793         struct inode_operations iop;
794         iop.set_acl = NULL;
795 ],[
796         AC_DEFINE(HAVE_IOP_SET_ACL, 1,
797                 [inode_operations has .set_acl member function])
798 ])
799 ]) # LC_IOP_SET_ACL
800
801 #
802 # LC_HAVE_TRUNCATE_IPAGE_FINAL
803 #
804 # 3.14 bring truncate_inode_pages_final for evict_inode
805 #
806 AC_DEFUN([LC_HAVE_TRUNCATE_IPAGES_FINAL], [
807 LB_CHECK_COMPILE([if Linux kernel has truncate_inode_pages_final],
808 truncate_ipages_final, [
809         #include <linux/mm.h>
810 ],[
811         truncate_inode_pages_final(NULL);
812 ], [
813         AC_DEFINE(HAVE_TRUNCATE_INODE_PAGES_FINAL, 1,
814                 [kernel has truncate_inode_pages_final])
815 ])
816 ]) # LC_HAVE_TRUNCATE_IPAGES_FINAL
817
818 #
819 # LC_IOPS_RENAME_WITH_FLAGS
820 #
821 # 3.14 has inode_operations->rename with 5 args
822 # commit 520c8b16505236fc82daa352e6c5e73cd9870cff
823 #
824 AC_DEFUN([LC_IOPS_RENAME_WITH_FLAGS], [
825 LB_CHECK_COMPILE([if 'inode_operations->rename' taken flags as argument],
826 iops_rename_with_flags, [
827         #include <linux/fs.h>
828 ],[
829         struct inode *i1 = NULL, *i2 = NULL;
830         struct dentry *d1 = NULL, *d2 = NULL;
831         int rc;
832         rc = ((struct inode_operations *)0)->rename(i1, d1, i2, d2, 0);
833 ], [
834         AC_DEFINE(HAVE_IOPS_RENAME_WITH_FLAGS, 1,
835                 [inode_operations->rename need flags as argument])
836 ])
837 ]) # LC_IOPS_RENAME_WITH_FLAGS
838
839 #
840 # LC_VFS_RENAME_6ARGS
841 #
842 # 3.15 has vfs_rename with 6 args
843 #
844 AC_DEFUN([LC_VFS_RENAME_6ARGS], [
845 LB_CHECK_COMPILE([if Linux kernel has 'vfs_rename' with 6 args],
846 vfs_rename_6args, [
847         #include <linux/fs.h>
848 ],[
849         vfs_rename(NULL, NULL, NULL, NULL, NULL, NULL);
850 ], [
851         AC_DEFINE(HAVE_VFS_RENAME_6ARGS, 1,
852                 [kernel has vfs_rename with 6 args])
853 ])
854 ]) # LC_VFS_RENAME_6ARGS
855
856 #
857 # LC_DIRECTIO_USE_ITER
858 #
859 # 3.16 kernel changes direct IO to use iov_iter
860 #
861 AC_DEFUN([LC_DIRECTIO_USE_ITER], [
862 LB_CHECK_COMPILE([if direct IO uses iov_iter],
863 direct_io_iter, [
864         #include <linux/fs.h>
865 ],[
866         struct address_space_operations ops = { };
867         struct iov_iter *iter = NULL;
868         loff_t offset = 0;
869
870         ops.direct_IO(0, NULL, iter, offset);
871 ],[
872         AC_DEFINE(HAVE_DIRECTIO_ITER, 1,
873                 [direct IO uses iov_iter])
874 ])
875 ]) # LC_DIRECTIO_USE_ITER
876
877 #
878 # LC_HAVE_IOV_ITER_INIT_DIRECTION
879 #
880 #
881 # 3.16 linux commit 71d8e532b1549a478e6a6a8a44f309d050294d00
882 #      changed iov_iter_init api to start accepting a tag
883 #      that defines if its a read or write operation
884 #
885 AC_DEFUN([LC_HAVE_IOV_ITER_INIT_DIRECTION], [
886 tmp_flags="$EXTRA_KCFLAGS"
887 EXTRA_KCFLAGS="-Werror"
888 LB_CHECK_COMPILE([if 'iov_iter_init' takes a tag],
889 iter_init, [
890         #include <linux/uio.h>
891         #include <linux/fs.h>
892 ],[
893         const struct iovec *iov = NULL;
894
895         iov_iter_init(NULL, READ, iov, 1, 0);
896 ],[
897         AC_DEFINE(HAVE_IOV_ITER_INIT_DIRECTION, 1,
898                 [iov_iter_init handles directional tag])
899 ])
900 EXTRA_KCFLAGS="$tmp_flags"
901 ]) # LC_HAVE_IOV_ITER_INIT_DIRECTION
902
903 #
904 # LC_HAVE_IOV_ITER_TRUNCATE
905 #
906 #
907 # 3.16 introduces a new API iov_iter_truncate()
908 #
909 AC_DEFUN([LC_HAVE_IOV_ITER_TRUNCATE], [
910 tmp_flags="$EXTRA_KCFLAGS"
911 EXTRA_KCFLAGS="-Werror"
912 LB_CHECK_COMPILE([if 'iov_iter_truncate' exists ],
913 iter_truncate, [
914         #include <linux/uio.h>
915         #include <linux/fs.h>
916 ],[
917         struct iov_iter *i = NULL;
918
919         iov_iter_truncate(i, 0);
920 ],[
921         AC_DEFINE(HAVE_IOV_ITER_TRUNCATE, 1, [iov_iter_truncate exists])
922 ])
923 EXTRA_KCFLAGS="$tmp_flags"
924 ]) # LC_HAVE_IOV_ITER_TRUNCATE
925
926 #
927 # LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
928 #
929 # 3.16 introduces [read|write]_iter to struct file_operations
930 #
931 AC_DEFUN([LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER], [
932 LB_CHECK_COMPILE([if 'file_operations.[read|write]_iter' exist],
933 file_function_iter, [
934         #include <linux/fs.h>
935 ],[
936         ((struct file_operations *)NULL)->read_iter(NULL, NULL);
937         ((struct file_operations *)NULL)->write_iter(NULL, NULL);
938 ],[
939         AC_DEFINE(HAVE_FILE_OPERATIONS_READ_WRITE_ITER, 1,
940                 [file_operations.[read|write]_iter functions exist])
941 ])
942 ]) # LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
943
944 #
945 # LC_HAVE_INTERVAL_BLK_INTEGRITY
946 #
947 # 3.17 replace sector_size with interval in struct blk_integrity
948 #
949 AC_DEFUN([LC_HAVE_INTERVAL_BLK_INTEGRITY], [
950 LB_CHECK_COMPILE([if 'blk_integrity.interval' exist],
951 interval_blk_integrity, [
952         #include <linux/blkdev.h>
953 ],[
954         ((struct blk_integrity *)0)->interval = 0;
955 ],[
956         AC_DEFINE(HAVE_INTERVAL_BLK_INTEGRITY, 1,
957                 [blk_integrity.interval exist])
958 ])
959 ]) # LC_HAVE_INTERVAL_BLK_INTEGRITY
960
961 #
962 # LC_KEY_MATCH_DATA
963 #
964 # 3.17  replaces key_type::match with match_preparse
965 #       and has new struct key_match_data
966 #
967 AC_DEFUN([LC_KEY_MATCH_DATA], [
968 LB_CHECK_COMPILE([if struct key_match field exist],
969 key_match, [
970         #include <linux/key-type.h>
971 ],[
972         struct key_match_data data;
973
974         data.raw_data = NULL;
975 ],[
976         AC_DEFINE(HAVE_KEY_MATCH_DATA, 1,
977                 [struct key_match_data exist])
978 ])
979 ]) # LC_KEY_MATCH_DATA
980
981 #
982 # LC_NFS_FILLDIR_USE_CTX
983 #
984 # 3.18 kernel moved from void cookie to struct dir_context
985 #
986 AC_DEFUN([LC_NFS_FILLDIR_USE_CTX], [
987 tmp_flags="$EXTRA_KCFLAGS"
988 EXTRA_KCFLAGS="-Werror"
989 LB_CHECK_COMPILE([if filldir_t uses struct dir_context],
990 filldir_ctx, [
991         #include <linux/fs.h>
992 ],[
993         int filldir(struct dir_context *ctx, const char* name,
994                     int i, loff_t off, u64 tmp, unsigned temp)
995         {
996                 return 0;
997         }
998
999         struct dir_context ctx = {
1000                 .actor = filldir,
1001         };
1002
1003         ctx.actor(NULL, "test", 0, (loff_t) 0, 0, 0);
1004 ],[
1005         AC_DEFINE(HAVE_FILLDIR_USE_CTX, 1,
1006                 [filldir_t needs struct dir_context as argument])
1007 ])
1008 EXTRA_KCFLAGS="$tmp_flags"
1009 ]) # LC_NFS_FILLDIR_USE_CTX
1010
1011 #
1012 # LC_PERCPU_COUNTER_INIT
1013 #
1014 # 3.18  For kernels 3.18 and after percpu_counter_init starts
1015 #       to pass a GFP_* memory allocation flag for internal
1016 #       memory allocation purposes.
1017 #
1018 AC_DEFUN([LC_PERCPU_COUNTER_INIT], [
1019 LB_CHECK_COMPILE([if percpu_counter_init uses GFP_* flag as argument],
1020 percpu_counter_init, [
1021         #include <linux/percpu_counter.h>
1022 ],[
1023         percpu_counter_init(NULL, 0, GFP_KERNEL);
1024 ],[
1025         AC_DEFINE(HAVE_PERCPU_COUNTER_INIT_GFP_FLAG, 1,
1026                 [percpu_counter_init uses GFP_* flag])
1027 ])
1028 ]) # LC_PERCPU_COUNTER_INIT
1029
1030 #
1031 # LC_KIOCB_HAS_NBYTES
1032 #
1033 # 3.19 kernel removed ki_nbytes from struct kiocb
1034 #
1035 AC_DEFUN([LC_KIOCB_HAS_NBYTES], [
1036 LB_CHECK_COMPILE([if struct kiocb has ki_nbytes field],
1037 ki_nbytes, [
1038         #include <linux/fs.h>
1039 ],[
1040         struct kiocb iocb = { };
1041
1042         iocb.ki_nbytes = 0;
1043 ],[
1044         AC_DEFINE(HAVE_KI_NBYTES, 1, [ki_nbytes field exist])
1045 ])
1046 ]) # LC_KIOCB_HAS_NBYTES
1047
1048 #
1049 # LC_HAVE_DQUOT_QC_DQBLK
1050 #
1051 # 3.19 has quotactl_ops->[sg]et_dqblk that take struct kqid and qc_dqblk
1052 # Added in commit 14bf61ffe
1053 #
1054 AC_DEFUN([LC_HAVE_DQUOT_QC_DQBLK], [
1055 tmp_flags="$EXTRA_KCFLAGS"
1056 EXTRA_KCFLAGS="-Werror"
1057 LB_CHECK_COMPILE([if 'quotactl_ops.set_dqblk' takes struct qc_dqblk],
1058 qc_dqblk, [
1059         #include <linux/fs.h>
1060         #include <linux/quota.h>
1061 ],[
1062         ((struct quotactl_ops *)0)->set_dqblk(NULL, *((struct kqid*)0), (struct qc_dqblk*)0);
1063 ],[
1064         AC_DEFINE(HAVE_DQUOT_QC_DQBLK, 1,
1065                 [quotactl_ops.set_dqblk takes struct qc_dqblk])
1066         AC_DEFINE(HAVE_DQUOT_KQID, 1,
1067                 [quotactl_ops.set_dqblk takes struct kqid])
1068 ])
1069 EXTRA_KCFLAGS="$tmp_flags"
1070 ]) # LC_HAVE_DQUOT_QC_DQBLK
1071
1072 #
1073 # LC_HAVE_AIO_COMPLETE
1074 #
1075 # 3.19 kernel makes aio_complete() static
1076 #
1077 AC_DEFUN([LC_HAVE_AIO_COMPLETE], [
1078 LB_CHECK_COMPILE([if kernel has exported aio_complete() ],
1079 aio_complete, [
1080         #include <linux/aio.h>
1081 ],[
1082         aio_complete(NULL, 0, 0);
1083 ],[
1084         AC_DEFINE(HAVE_AIO_COMPLETE, 1, [aio_complete defined])
1085 ])
1086 ]) # LC_HAVE_AIO_COMPLETE
1087
1088 #
1089 # LC_HAVE_IS_ROOT_INODE
1090 #
1091 # 3.19 kernel adds is_root_inode()
1092 # Commit a7400222e3eb ("new helper: is_root_inode()")
1093 #
1094 AC_DEFUN([LC_HAVE_IS_ROOT_INODE], [
1095 LB_CHECK_COMPILE([if kernel has is_root_inode() ],
1096 is_root_inode, [
1097         #include <linux/fs.h>
1098 ],[
1099         is_root_inode(NULL);
1100 ],[
1101         AC_DEFINE(HAVE_IS_ROOT_INODE, 1, [is_root_inode defined])
1102 ])
1103 ]) # LC_HAVE_IS_ROOT_INODE
1104
1105 #
1106 # LC_BACKING_DEV_INFO_REMOVAL
1107 #
1108 # 3.20 kernel removed backing_dev_info from address_space
1109 #
1110 AC_DEFUN([LC_BACKING_DEV_INFO_REMOVAL], [
1111 LB_CHECK_COMPILE([if struct address_space has backing_dev_info],
1112 backing_dev_info, [
1113         #include <linux/fs.h>
1114 ],[
1115         struct address_space mapping;
1116
1117         mapping.backing_dev_info = NULL;
1118 ],[
1119         AC_DEFINE(HAVE_BACKING_DEV_INFO, 1, [backing_dev_info exist])
1120 ])
1121 ]) # LC_BACKING_DEV_INFO_REMOVAL
1122
1123 #
1124 # LC_HAVE_BDI_CAP_MAP_COPY
1125 #
1126 # 3.20  removed mmap handling for backing devices since
1127 #       it breaks on non-MMU systems. See kernel commit
1128 #       b4caecd48005fbed3949dde6c1cb233142fd69e9
1129 #
1130 AC_DEFUN([LC_HAVE_BDI_CAP_MAP_COPY], [
1131 LB_CHECK_COMPILE([if have 'BDI_CAP_MAP_COPY'],
1132 bdi_cap_map_copy, [
1133         #include <linux/backing-dev.h>
1134 ],[
1135         struct backing_dev_info info;
1136
1137         info.capabilities = BDI_CAP_MAP_COPY;
1138 ],[
1139         AC_DEFINE(HAVE_BDI_CAP_MAP_COPY, 1,
1140                 [BDI_CAP_MAP_COPY exist])
1141 ])
1142 ]) # LC_HAVE_BDI_CAP_MAP_COPY
1143
1144 #
1145 # LC_HAVE_PROJECT_QUOTA
1146 #
1147 # Kernel version v4.0-rc1-197-g847aac644e92
1148 #
1149 AC_DEFUN([LC_HAVE_PROJECT_QUOTA], [
1150 LB_CHECK_COMPILE([if get_projid exists],
1151 get_projid, [
1152         struct inode;
1153         #include <linux/quota.h>
1154 ],[
1155         struct dquot_operations ops = { };
1156
1157         ops.get_projid(NULL, NULL);
1158 ],[
1159         AC_DEFINE(HAVE_PROJECT_QUOTA, 1,
1160                 [get_projid function exists])
1161 ])
1162 ]) # LC_HAVE_PROJECT_QUOTA
1163
1164 #
1165 # LC_IOV_ITER_RW
1166 #
1167 # 4.1 kernel has iov_iter_rw
1168 #
1169 AC_DEFUN([LC_IOV_ITER_RW], [
1170 LB_CHECK_COMPILE([if iov_iter_rw exist],
1171 iov_iter_rw, [
1172         #include <linux/fs.h>
1173         #include <linux/uio.h>
1174 ],[
1175         struct iov_iter *iter = NULL;
1176
1177         iov_iter_rw(iter);
1178 ],[
1179         AC_DEFINE(HAVE_IOV_ITER_RW, 1,
1180                 [iov_iter_rw exist])
1181 ])
1182 ]) # LC_IOV_ITER_RW
1183
1184 #
1185 # LC_HAVE_SYNC_READ_WRITE
1186 #
1187 # 4.1 new_sync_[read|write] no longer exported
1188 #
1189 AC_DEFUN([LC_HAVE_SYNC_READ_WRITE], [
1190 LB_CHECK_EXPORT([new_sync_read], [fs/read_write.c],
1191         [AC_DEFINE(HAVE_SYNC_READ_WRITE, 1,
1192                         [new_sync_[read|write] is exported by the kernel])])
1193 ]) # LC_HAVE_SYNC_READ_WRITE
1194
1195 #
1196 # LC_HAVE___BI_CNT
1197 #
1198 # 4.1 redefined bi_cnt as __bi_cnt in commit dac56212e8127dbc0
1199 #
1200 AC_DEFUN([LC_HAVE___BI_CNT], [
1201 LB_CHECK_COMPILE([if Linux kernel has __bi_cnt in struct bio],
1202 have___bi_cnt, [
1203         #include <asm/atomic.h>
1204         #include <linux/bio.h>
1205         #include <linux/blk_types.h>
1206 ],[
1207         struct bio bio = { };
1208         int cnt;
1209         cnt = atomic_read(&bio.__bi_cnt);
1210 ], [
1211         AC_DEFINE(HAVE___BI_CNT, 1,
1212                 [struct bio has __bi_cnt])
1213 ])
1214 ]) # LC_HAVE___BI_CNT
1215
1216 #
1217 # LC_SYMLINK_OPS_USE_NAMEIDATA
1218 #
1219 # For the 4.2+ kernels the file system internal symlink api no
1220 # longer uses struct nameidata as a argument
1221 #
1222 AC_DEFUN([LC_SYMLINK_OPS_USE_NAMEIDATA], [
1223 LB_CHECK_COMPILE([if symlink inode operations have struct nameidata argument],
1224 symlink_use_nameidata, [
1225         #include <linux/namei.h>
1226         #include <linux/fs.h>
1227 ],[
1228         struct nameidata *nd = NULL;
1229
1230         ((struct inode_operations *)0)->follow_link(NULL, nd);
1231         ((struct inode_operations *)0)->put_link(NULL, nd, NULL);
1232 ],[
1233         AC_DEFINE(HAVE_SYMLINK_OPS_USE_NAMEIDATA, 1,
1234                 [symlink inode operations need struct nameidata argument])
1235 ])
1236 ]) # LC_SYMLINK_OPS_USE_NAMEIDATA
1237
1238 #
1239 # LC_BIO_ENDIO_USES_ONE_ARG
1240 #
1241 # 4.2 kernel bio_endio now only takes one argument
1242 #
1243 AC_DEFUN([LC_BIO_ENDIO_USES_ONE_ARG], [
1244 LB_CHECK_COMPILE([if 'bio_endio' with one argument exist],
1245 bio_endio, [
1246         #include <linux/bio.h>
1247 ],[
1248         bio_endio(NULL);
1249 ],[
1250         AC_DEFINE(HAVE_BIO_ENDIO_USES_ONE_ARG, 1,
1251                 [bio_endio takes only one argument])
1252 ])
1253 ]) # LC_BIO_ENDIO_USES_ONE_ARG
1254
1255 #
1256 # LC_ACCOUNT_PAGE_DIRTIED_3ARGS
1257 #
1258 # 4.2 [to 4.5] kernel page dirtied takes 3 arguments
1259 #
1260 AC_DEFUN([LC_ACCOUNT_PAGE_DIRTIED_3ARGS], [
1261 LB_CHECK_COMPILE([if 'account_page_dirtied' with 3 args exists],
1262 account_page_dirtied, [
1263         #include <linux/mm.h>
1264 ],[
1265         account_page_dirtied(NULL, NULL, NULL);
1266 ],[
1267         AC_DEFINE(HAVE_ACCOUNT_PAGE_DIRTIED_3ARGS, 1,
1268                 [account_page_dirtied takes three arguments])
1269 ])
1270 ]) # LC_ACCOUNT_PAGE_DIRTIED_3ARGS
1271
1272 #
1273 # LC_HAVE_CRYPTO_ALLOC_SKCIPHER
1274 #
1275 # Kernel version 4.12 commit 7a7ffe65c8c5
1276 # introduced crypto_alloc_skcipher().
1277 #
1278 AC_DEFUN([LC_HAVE_CRYPTO_ALLOC_SKCIPHER], [
1279 LB_CHECK_COMPILE([if crypto_alloc_skcipher is defined],
1280 crypto_alloc_skcipher, [
1281         #include <crypto/skcipher.h>
1282 ],[
1283         crypto_alloc_skcipher(NULL, 0, 0);
1284 ],[
1285         AC_DEFINE(HAVE_CRYPTO_ALLOC_SKCIPHER, 1,
1286                 [crypto_alloc_skcipher is defined])
1287 ])
1288 ]) # LC_HAVE_CRYPTO_ALLOC_SKCIPHER
1289
1290 #
1291 # LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
1292 #
1293 # 4.3 replace interval with interval_exp in 'struct blk_integrity'
1294 # 'struct blk_integrity_profile' is also added in this version,
1295 # thus use this to determine whether 'struct blk_integrity' has profile
1296 #
1297 AC_DEFUN([LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY], [
1298 LB_CHECK_COMPILE([if 'blk_integrity.interval_exp' exist],
1299 blk_integrity_interval_exp, [
1300         #include <linux/blkdev.h>
1301 ],[
1302         ((struct blk_integrity *)0)->interval_exp = 0;
1303 ],[
1304         AC_DEFINE(HAVE_INTERVAL_EXP_BLK_INTEGRITY, 1,
1305                 [blk_integrity.interval_exp exist])
1306 ])
1307 ]) # LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
1308
1309 #
1310 # LC_HAVE_CACHE_HEAD_HLIST
1311 #
1312 # 4.3 kernel swiched to hlist for cache_head
1313 #
1314 AC_DEFUN([LC_HAVE_CACHE_HEAD_HLIST], [
1315 LB_CHECK_COMPILE([if 'struct cache_head' has 'cache_list' field],
1316 cache_head_has_hlist, [
1317         #include <linux/sunrpc/cache.h>
1318 ],[
1319         do {} while(sizeof(((struct cache_head *)0)->cache_list));
1320 ],[
1321         AC_DEFINE(HAVE_CACHE_HEAD_HLIST, 1,
1322                 [cache_head has hlist cache_list])
1323 ])
1324 ]) # LC_HAVE_CACHE_HEAD_HLIST
1325
1326 #
1327 # LC_HAVE_XATTR_HANDLER_SIMPLIFIED
1328 #
1329 # Kernel version 4.3 commit e409de992e3ea3674393465f07cc71c948edd87a
1330 # simplified xattr_handler handling by passing in the handler pointer
1331 #
1332 AC_DEFUN([LC_HAVE_XATTR_HANDLER_SIMPLIFIED], [
1333 tmp_flags="$EXTRA_KCFLAGS"
1334 EXTRA_KCFLAGS="-Werror"
1335 LB_CHECK_COMPILE([if 'struct xattr_handler' functions pass in handler pointer],
1336 xattr_handler_simplified, [
1337         #include <linux/xattr.h>
1338 ],[
1339         struct xattr_handler handler;
1340
1341         ((struct xattr_handler *)0)->get(&handler, NULL, NULL, NULL, 0);
1342         ((struct xattr_handler *)0)->set(&handler, NULL, NULL, NULL, 0, 0);
1343 ],[
1344         AC_DEFINE(HAVE_XATTR_HANDLER_SIMPLIFIED, 1, [handler pointer is parameter])
1345 ])
1346 EXTRA_KCFLAGS="$tmp_flags"
1347 ]) # LC_HAVE_XATTR_HANDLER_SIMPLIFIED
1348
1349 #
1350 # LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
1351 #
1352 # 4.3 replace interval with interval_exp in 'struct blk_integrity'.
1353 #
1354 AC_DEFUN([LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD], [
1355 LB_CHECK_COMPILE([if 'bio_integrity_payload.bip_iter' exist],
1356 bio_integrity_payload_bip_iter, [
1357         #include <linux/bio.h>
1358 ],[
1359         ((struct bio_integrity_payload *)0)->bip_iter.bi_size = 0;
1360 ],[
1361         AC_DEFINE(HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD, 1,
1362                 [bio_integrity_payload.bip_iter exist])
1363 ])
1364 ]) # LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
1365
1366 #
1367 # LC_BIO_INTEGRITY_PREP_FN
1368 #
1369 # Lustre kernel patch extents bio_integrity_prep to accept optional
1370 # generate/verify_fn as extra args.
1371 #
1372 AC_DEFUN([LC_BIO_INTEGRITY_PREP_FN], [
1373 LB_CHECK_COMPILE([if 'bio_integrity_prep_fn' exists],
1374 bio_integrity_prep_fn, [
1375         #include <linux/bio.h>
1376 ],[
1377         bio_integrity_prep_fn(NULL, NULL, NULL);
1378 ],[
1379         AC_DEFINE(HAVE_BIO_INTEGRITY_PREP_FN, 1,
1380                 [kernel has bio_integrity_prep_fn])
1381         AC_SUBST(PATCHED_INTEGRITY_INTF)
1382 ],[
1383         AC_SUBST(PATCHED_INTEGRITY_INTF, [#])
1384 ])
1385 ]) # LC_BIO_INTEGRITY_PREP_FN
1386
1387 # LC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL
1388 #
1389 # 13 kernel integrity API has changed and in 4.13+
1390 # (as well as in rhel 8.4) bio_integrity_prep() returns boolean true
1391 # on success.
1392 #
1393 AC_DEFUN([LC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL], [
1394 LB_CHECK_COMPILE([if 'bio_integrity_prep_fn' returns bool],
1395 bio_integrity_prep, [
1396        #include <linux/bio.h>
1397        #include <linux/typecheck.h>
1398 ],[
1399         #pragma GCC diagnostic warning "-Werror"
1400         typedef bool (*bio_integrity_prep_type)(struct bio *bio) ;
1401
1402         typecheck_fn(bio_integrity_prep_type, bio_integrity_prep);
1403 ],[
1404        AC_DEFINE(HAVE_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL, 1,
1405                [bio_integrity_prep_fn returns bool])
1406 ])
1407 ]) # LC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL
1408
1409 #
1410 # LC_HAVE_BI_OPF
1411 #
1412 # 4.4/4.8 redefined bi_rw as bi_opf (SLES12/kernel commit 4382e33ad37486)
1413 #
1414 AC_DEFUN([LC_HAVE_BI_OPF], [
1415 LB_CHECK_COMPILE([if Linux kernel has bi_opf in struct bio],
1416 have_bi_opf, [
1417         #include <linux/bio.h>
1418 ],[
1419         struct bio bio;
1420
1421         bio.bi_opf = 0;
1422 ], [
1423         AC_DEFINE(HAVE_BI_OPF, 1,
1424                 [struct bio has bi_opf])
1425 ])
1426 ]) # LC_HAVE_BI_OPF
1427
1428 #
1429 # LC_HAVE_SUBMIT_BIO_2ARGS
1430 #
1431 # 4.4 removed an argument from submit_bio
1432 #
1433 AC_DEFUN([LC_HAVE_SUBMIT_BIO_2ARGS], [
1434 LB_CHECK_COMPILE([if submit_bio takes two arguments],
1435 have_submit_bio_2args, [
1436         #include <linux/bio.h>
1437 ],[
1438         struct bio bio;
1439         submit_bio(READ, &bio);
1440 ], [
1441         AC_DEFINE(HAVE_SUBMIT_BIO_2ARGS, 1,
1442                 [submit_bio takes two arguments])
1443 ])
1444 ]) # LC_HAVE_SUBMIT_BIO_2_ARGS
1445
1446 #
1447 # LC_HAVE_CLEAN_BDEV_ALIASES
1448 #
1449 # 4.4/4.9 unmap_underlying_metadata was replaced by clean_bdev_aliases
1450 # (SLES12/kernel commit 29f3ad7d8380364c)
1451 #
1452 AC_DEFUN([LC_HAVE_CLEAN_BDEV_ALIASES], [
1453 LB_CHECK_COMPILE([if kernel has clean_bdev_aliases],
1454 have_clean_bdev_aliases, [
1455         #include <linux/buffer_head.h>
1456 ],[
1457         clean_bdev_aliases(NULL,1,1);
1458 ], [
1459         AC_DEFINE(HAVE_CLEAN_BDEV_ALIASES, 1,
1460                 [kernel has clean_bdev_aliases])
1461 ])
1462 ]) # LC_HAVE_CLEAN_BDEV_ALIASES
1463
1464 #
1465 # LC_HAVE_LOCKS_LOCK_FILE_WAIT
1466 #
1467 # 4.4 kernel have moved locks API users to
1468 # locks_lock_inode_wait()
1469 #
1470 AC_DEFUN([LC_HAVE_LOCKS_LOCK_FILE_WAIT], [
1471 LB_CHECK_COMPILE([if 'locks_lock_file_wait' exists],
1472 locks_lock_file_wait, [
1473         #include <linux/fs.h>
1474 ],[
1475         locks_lock_file_wait(NULL, NULL);
1476 ],[
1477         AC_DEFINE(HAVE_LOCKS_LOCK_FILE_WAIT, 1,
1478                 [kernel has locks_lock_file_wait])
1479 ])
1480 ]) # LC_HAVE_LOCKS_LOCK_FILE_WAIT
1481
1482 #
1483 # LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
1484 #
1485 # 4.4 kernel merged type-specific data with the payload data for keys
1486 #
1487 AC_DEFUN([LC_HAVE_KEY_PAYLOAD_DATA_ARRAY], [
1488 LB_CHECK_COMPILE([if 'struct key' has 'payload.data' as an array],
1489 key_payload_data_array, [
1490         #include <linux/key.h>
1491 ],[
1492         struct key key = { };
1493
1494         key.payload.data[0] = NULL;
1495 ],[
1496         AC_DEFINE(HAVE_KEY_PAYLOAD_DATA_ARRAY, 1, [payload.data is an array])
1497 ])
1498 ]) #LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
1499
1500 #
1501 # LC_HAVE_XATTR_HANDLER_NAME
1502 #
1503 # Kernel version 4.4 commit 98e9cb5711c68223f0e4d5201b9a6add255ec550
1504 # add a name member to struct xattr_handler
1505 #
1506 AC_DEFUN([LC_HAVE_XATTR_HANDLER_NAME], [
1507 tmp_flags="$EXTRA_KCFLAGS"
1508 EXTRA_KCFLAGS="-Werror"
1509 LB_CHECK_COMPILE([if 'struct xattr_handler' has a name member],
1510 xattr_handler_name, [
1511         #include <linux/xattr.h>
1512 ],[
1513         ((struct xattr_handler *)NULL)->name = NULL;
1514 ],[
1515         AC_DEFINE(HAVE_XATTR_HANDLER_NAME, 1, [xattr_handler has a name member])
1516 ])
1517 EXTRA_KCFLAGS="$tmp_flags"
1518 ]) # LC_HAVE_XATTR_HANDLER_NAME
1519
1520 #
1521 # LC_HAVE_FILE_DENTRY
1522 #
1523 # 4.5 adds wrapper file_dentry
1524 #
1525 AC_DEFUN([LC_HAVE_FILE_DENTRY], [
1526 LB_CHECK_COMPILE([if Linux kernel has 'file_dentry'],
1527 file_dentry, [
1528         #include <linux/fs.h>
1529 ],[
1530         file_dentry(NULL);
1531 ], [
1532         AC_DEFINE(HAVE_FILE_DENTRY, 1,
1533                 [kernel has file_dentry])
1534 ])
1535 ]) # LC_HAVE_FILE_DENTRY
1536
1537 #
1538 # LC_HAVE_INODE_LOCK
1539 #
1540 # 4.5 introduced inode_lock
1541 #
1542 AC_DEFUN([LC_HAVE_INODE_LOCK], [
1543 LB_CHECK_COMPILE([if 'inode_lock' is defined],
1544 inode_lock, [
1545         #include <linux/fs.h>
1546 ],[
1547         inode_lock(NULL);
1548 ], [
1549         AC_DEFINE(HAVE_INODE_LOCK, 1,
1550                   [inode_lock is defined])
1551 ])
1552 ]) # LC_HAVE_INODE_LOCK
1553
1554 #
1555 # LC_HAVE_IOP_GET_LINK
1556 #
1557 # 4.5 vfs replaced iop->follow_link with
1558 # iop->get_link
1559 #
1560 AC_DEFUN([LC_HAVE_IOP_GET_LINK], [
1561 LB_CHECK_COMPILE([if 'iop' has 'get_link'],
1562 inode_ops_get_link, [
1563         #include <linux/fs.h>
1564 ],[
1565         struct inode_operations iop;
1566         iop.get_link = NULL;
1567 ],[
1568         AC_DEFINE(HAVE_IOP_GET_LINK, 1,
1569                 [have iop get_link])
1570 ])
1571 ]) # LC_HAVE_IOP_GET_LINK
1572
1573 #
1574 # LC_HAVE_IN_COMPAT_SYSCALL
1575 #
1576 # 4.6 renamed is_compat_task to in_compat_syscall
1577 #
1578 AC_DEFUN([LC_HAVE_IN_COMPAT_SYSCALL], [
1579 LB_CHECK_COMPILE([if 'in_compat_syscall' is defined],
1580 in_compat_syscall, [
1581         #include <linux/compat.h>
1582 ],[
1583         in_compat_syscall();
1584 ],[
1585         AC_DEFINE(HAVE_IN_COMPAT_SYSCALL, 1,
1586                 [have in_compat_syscall])
1587 ])
1588 ]) # LC_HAVE_IN_COMPAT_SYSCALL
1589
1590 #
1591 # LC_HAVE_XATTR_HANDLER_INODE_PARAM
1592 #
1593 # Kernel version 4.6 commit b296821a7c42fa58baa17513b2b7b30ae66f3336
1594 # and commit 5930122683dff58f0846b0f0405b4bd598a3ba6a added inode parameter
1595 # to xattr_handler functions
1596 #
1597 AC_DEFUN([LC_HAVE_XATTR_HANDLER_INODE_PARAM], [
1598 tmp_flags="$EXTRA_KCFLAGS"
1599 EXTRA_KCFLAGS="-Werror"
1600 LB_CHECK_COMPILE([if 'struct xattr_handler' functions have inode parameter],
1601 xattr_handler_inode_param, [
1602         #include <linux/xattr.h>
1603 ],[
1604         const struct xattr_handler handler;
1605
1606         ((struct xattr_handler *)0)->get(&handler, NULL, NULL, NULL, NULL, 0);
1607         ((struct xattr_handler *)0)->set(&handler, NULL, NULL, NULL, NULL, 0, 0);
1608 ],[
1609         AC_DEFINE(HAVE_XATTR_HANDLER_INODE_PARAM, 1, [needs inode parameter])
1610 ])
1611 EXTRA_KCFLAGS="$tmp_flags"
1612 ]) # LC_HAVE_XATTR_HANDLER_INODE_PARAM
1613
1614 #
1615 # LC_D_IN_LOOKUP
1616 #
1617 # Kernel version 4.6 commit 85c7f81041d57cfe9dc97f4680d5586b54534a39
1618 # introduced parallel lookups in the VFS layer. The inline function
1619 # d_in_lookup was added to notify when the same item was being queried
1620 # at the same time.
1621 #
1622 AC_DEFUN([LC_D_IN_LOOKUP], [
1623 tmp_flags="$EXTRA_KCFLAGS"
1624 EXTRA_KCFLAGS="-Werror"
1625 LB_CHECK_COMPILE([if 'd_in_lookup' is defined],
1626 d_in_lookup, [
1627         #include <linux/dcache.h>
1628 ],[
1629         d_in_lookup(NULL);
1630 ],[
1631         AC_DEFINE(HAVE_D_IN_LOOKUP, 1, [d_in_lookup is defined])
1632 ])
1633 EXTRA_KCFLAGS="$tmp_flags"
1634 ]) # LC_D_IN_LOOKUP
1635
1636 #
1637 # LC_LOCK_PAGE_MEMCG
1638 #
1639 # Kernel version 4.6 adds lock_page_memcg
1640 #
1641 AC_DEFUN([LC_LOCK_PAGE_MEMCG], [
1642 LB_CHECK_COMPILE([if 'lock_page_memcg' is defined],
1643 lock_page_memcg, [
1644         #include <linux/memcontrol.h>
1645 ],[
1646         lock_page_memcg(NULL);
1647 ],[
1648         AC_DEFINE(HAVE_LOCK_PAGE_MEMCG, 1,
1649                 [lock_page_memcg is defined])
1650 ])
1651 ]) # LC_LOCK_PAGE_MEMCG
1652
1653 #
1654 # LC_HAVE_DOWN_WRITE_KILLABLE
1655 #
1656 # Kernel version v4.6-rc3-28-g916633a40370
1657 #
1658 AC_DEFUN([LC_HAVE_DOWN_WRITE_KILLABLE], [
1659 LB_CHECK_COMPILE([if down_write_killable exists],
1660 down_write_killable, [
1661         struct rw_semaphore sem;
1662         #include <linux/rwsem.h>
1663 ],[
1664         int rc;
1665
1666         rc = down_write_killable(&sem);
1667 ],[
1668         AC_DEFINE(HAVE_DOWN_WRITE_KILLABLE, 1,
1669                 [down_write_killable function exists])
1670 ])
1671 ]) # LC_HAVE_DOWN_WRITE_KILLABLE
1672
1673 #
1674 # LC_D_INIT
1675 #
1676 # Kernel version 4.7-rc5 commit 285b102d3b745f3c2c110c9c327741d87e64aacc
1677 # add new d_init to initialize dentry at allocation time
1678 #
1679 AC_DEFUN([LC_D_INIT], [
1680 LB_CHECK_COMPILE([if dentry operations supports 'd_init'],
1681 d_init, [
1682         #include <linux/dcache.h>
1683 ],[
1684         struct dentry_operations ops = { };
1685         int rc;
1686
1687         rc = ops.d_init(NULL);
1688 ],[
1689         AC_DEFINE(HAVE_D_INIT, 1, ['d_init' exists])
1690 ])
1691 ]) # LC_D_INIT
1692
1693 #
1694 # LC_DIRECTIO_2ARGS
1695 #
1696 # Kernel version 4.7 commit c8b8e32d700fe943a935e435ae251364d016c497
1697 # direct-io: eliminate the offset argument to ->direct_IO
1698 #
1699 AC_DEFUN([LC_DIRECTIO_2ARGS], [
1700 LB_CHECK_COMPILE([if '->direct_IO()' taken 2 arguments],
1701 direct_io_2args, [
1702         #include <linux/fs.h>
1703 ],[
1704         struct address_space_operations ops = { };
1705         struct iov_iter *iter = NULL;
1706         struct kiocb *iocb = NULL;
1707         int rc;
1708
1709         rc = ops.direct_IO(iocb, iter);
1710 ],[
1711         AC_DEFINE(HAVE_DIRECTIO_2ARGS, 1,
1712                 [direct_IO need 2 arguments])
1713 ])
1714 ]) # LC_DIRECTIO_2ARGS
1715
1716 #
1717 # LC_GENERIC_WRITE_SYNC_2ARGS
1718 #
1719 # Kernel version 4.7 commit dde0c2e79848298cc25621ad080d47f94dbd7cce
1720 # fs: add IOCB_SYNC and IOCB_DSYNC
1721 #
1722 AC_DEFUN([LC_GENERIC_WRITE_SYNC_2ARGS], [
1723 LB_CHECK_COMPILE([if 'generic_write_sync()' taken 2 arguments],
1724 generic_write_sync_2args, [
1725         #include <linux/fs.h>
1726 ],[
1727         struct kiocb *iocb = NULL;
1728         ssize_t rc;
1729
1730         rc = generic_write_sync(iocb, 0);
1731 ],[
1732         AC_DEFINE(HAVE_GENERIC_WRITE_SYNC_2ARGS, 1,
1733                 [generic_write_sync need 2 arguments])
1734 ])
1735 ]) # LC_GENERIC_WRITE_SYNC_2ARGS
1736
1737 #
1738 # LC_FOP_ITERATE_SHARED
1739 #
1740 # Kernel v4.6-rc3-29-g6192269 adds iterate_shared method to file_operations
1741 #
1742 AC_DEFUN([LC_FOP_ITERATE_SHARED], [
1743 LB_CHECK_COMPILE([if 'file_operations' has 'iterate_shared'],
1744 fop_iterate_shared, [
1745         #include <linux/fs.h>
1746 ],[
1747         struct file_operations fop;
1748         fop.iterate_shared = NULL;
1749 ],[
1750         AC_DEFINE(HAVE_FOP_ITERATE_SHARED, 1,
1751                 [file_operations has iterate_shared])
1752 ])
1753 ]) # LC_FOP_ITERATE_SHARED
1754
1755 #
1756 # LC_EXPORT_DEFAULT_FILE_SPLICE_READ
1757 #
1758 # 4.8-rc8 commit 82c156f853840645604acd7c2cebcb75ed1b6652 switched
1759 # generic_file_splice_read() to using ->read_iter. We can test this
1760 # change since default_file_splice_read() is no longer exported.
1761 #
1762 AC_DEFUN([LC_EXPORT_DEFAULT_FILE_SPLICE_READ], [
1763 LB_CHECK_EXPORT([default_file_splice_read], [fs/splice.c],
1764         [AC_DEFINE(HAVE_DEFAULT_FILE_SPLICE_READ_EXPORT, 1,
1765                         [default_file_splice_read is exported])])
1766 ]) # LC_EXPORT_DEFAULT_FILE_SPLCE_READ
1767
1768 #
1769 # LC_HAVE_POSIX_ACL_VALID_USER_NS
1770 #
1771 # 4.8 posix_acl_valid takes struct user_namespace
1772 #
1773 AC_DEFUN([LC_HAVE_POSIX_ACL_VALID_USER_NS], [
1774 LB_CHECK_COMPILE([if 'posix_acl_valid' takes 'struct user_namespace'],
1775 posix_acl_valid, [
1776         #include <linux/fs.h>
1777         #include <linux/posix_acl.h>
1778 ],[
1779         posix_acl_valid((struct user_namespace*)NULL, (const struct posix_acl*)NULL);
1780 ],[
1781         AC_DEFINE(HAVE_POSIX_ACL_VALID_USER_NS, 1,
1782                 [posix_acl_valid takes struct user_namespace])
1783 ])
1784 ]) # LC_HAVE_POSIX_ACL_VALID_USER_NS
1785
1786 #
1787 # LC_D_COMPARE_4ARGS
1788 #
1789 # Kernel version 4.8 commit 6fa67e707559303e086303aeecc9e8b91ef497d5
1790 # get rid of 'parent' argument of ->d_compare()
1791 #
1792 AC_DEFUN([LC_D_COMPARE_4ARGS], [
1793 LB_CHECK_COMPILE([if 'd_compare' taken 4 arguments],
1794 d_compare_4args, [
1795         #include <linux/dcache.h>
1796 ],[
1797         ((struct dentry_operations*)0)->d_compare(NULL,0,NULL,NULL);
1798 ],[
1799         AC_DEFINE(HAVE_D_COMPARE_4ARGS, 1,
1800                 [d_compare need 4 arguments])
1801 ])
1802 ]) # LC_D_COMPARE_4ARGS
1803
1804 #
1805 # LC_FULL_NAME_HASH_3ARGS
1806 #
1807 # Kernel version 4.8 commit 8387ff2577eb9ed245df9a39947f66976c6bcd02
1808 # vfs: make the string hashes salt the hash
1809 #
1810 AC_DEFUN([LC_FULL_NAME_HASH_3ARGS], [
1811 LB_CHECK_COMPILE([if 'full_name_hash' taken 3 arguments],
1812 full_name_hash_3args, [
1813         #include <linux/stringhash.h>
1814 ],[
1815         unsigned int hash;
1816         hash = full_name_hash(NULL,NULL,0);
1817 ],[
1818         AC_DEFINE(HAVE_FULL_NAME_HASH_3ARGS, 1,
1819                 [full_name_hash need 3 arguments])
1820 ])
1821 ]) # LC_FULL_NAME_HASH_3ARGS
1822
1823 #
1824 # LC_STRUCT_POSIX_ACL_XATTR
1825 #
1826 # Kernel version 4.8 commit 2211d5ba5c6c4e972ba6dbc912b2897425ea6621
1827 # posix_acl: xattr representation cleanups
1828 #
1829 AC_DEFUN([LC_STRUCT_POSIX_ACL_XATTR], [
1830 LB_CHECK_COMPILE([if 'struct posix_acl_xattr_{header,entry}' defined],
1831 struct_posix_acl_xattr, [
1832         #include <linux/fs.h>
1833         #include <linux/posix_acl_xattr.h>
1834 ],[
1835         struct posix_acl_xattr_header *h = NULL;
1836         struct posix_acl_xattr_entry  *e;
1837         e = (void *)(h + 1);
1838 ],[
1839         AC_DEFINE(HAVE_STRUCT_POSIX_ACL_XATTR, 1,
1840                 [struct posix_acl_xattr_{header,entry} defined])
1841 ])
1842 ]) # LC_STRUCT_POSIX_ACL_XATTR
1843
1844 #
1845 # LC_IOP_XATTR
1846 #
1847 # Kernel version 4.8 commit fd50ecaddf8372a1d96e0daeaac0f93cf04e4d42
1848 # removed {get,set,remove}xattr inode operations
1849 #
1850 AC_DEFUN([LC_IOP_XATTR], [
1851 LB_CHECK_COMPILE([if 'inode_operations' has {get,set,remove}xattr members],
1852 inode_ops_xattr, [
1853         #include <linux/fs.h>
1854 ],[
1855         struct inode_operations iop;
1856         iop.setxattr = NULL;
1857         iop.getxattr = NULL;
1858         iop.removexattr = NULL;
1859 ],[
1860         AC_DEFINE(HAVE_IOP_XATTR, 1,
1861                 [inode_operations has {get,set,remove}xattr members])
1862 ])
1863 ]) # LC_IOP_XATTR
1864
1865 #
1866 # LC_GROUP_INFO_GID
1867 #
1868 # Kernel version 4.9 commit 81243eacfa400f5f7b89f4c2323d0de9982bb0fb
1869 # cred: simpler, 1D supplementary groups
1870 #
1871 AC_DEFUN([LC_GROUP_INFO_GID], [
1872 LB_CHECK_COMPILE([if 'struct group_info' has member 'gid'],
1873 group_info_gid, [
1874         #include <linux/cred.h>
1875 ],[
1876         kgid_t *p;
1877         p = ((struct group_info *)0)->gid;
1878 ],[
1879         AC_DEFINE(HAVE_GROUP_INFO_GID, 1,
1880                 [struct group_info has member gid])
1881 ])
1882 ]) # LC_GROUP_INFO_GID
1883
1884 #
1885 # LC_VFS_SETXATTR
1886 #
1887 # Kernel version 4.9 commit 5d6c31910bc0713e37628dc0ce677dcb13c8ccf4
1888 # added __vfs_{get,set,remove}xattr helpers
1889 #
1890 AC_DEFUN([LC_VFS_SETXATTR], [
1891 LB_CHECK_COMPILE([if '__vfs_setxattr' helper is available],
1892 vfs_setxattr, [
1893         #include <linux/xattr.h>
1894 ],[
1895         __vfs_setxattr(NULL, NULL, NULL, NULL, 0, 0);
1896 ],[
1897         AC_DEFINE(HAVE_VFS_SETXATTR, 1,
1898                 ['__vfs_setxattr' is available])
1899 ])
1900 ]) # LC_VFS_SETXATTR
1901
1902 #
1903 # LC_POSIX_ACL_UPDATE_MODE
1904 #
1905 # Kernel version 4.9 commit 073931017b49d9458aa351605b43a7e34598caef
1906 # posix_acl: Clear SGID bit when setting file permissions
1907 #
1908 AC_DEFUN([LC_POSIX_ACL_UPDATE_MODE], [
1909 LB_CHECK_COMPILE([if 'posix_acl_update_mode' exists],
1910 posix_acl_update_mode, [
1911         #include <linux/fs.h>
1912         #include <linux/posix_acl.h>
1913 ],[
1914         posix_acl_update_mode(NULL, NULL, NULL);
1915 ],[
1916         AC_DEFINE(HAVE_POSIX_ACL_UPDATE_MODE, 1,
1917                 ['posix_acl_update_mode' is available])
1918 ])
1919 ]) # LC_POSIX_ACL_UPDATE_MODE
1920
1921 #
1922 # LC_HAVE_BDI_IO_PAGES
1923 #
1924 # Kernel version 4.9 commit 9491ae4aade6814afcfa67f4eb3e3342c2b39750
1925 # mm: don't cap request size based on read-ahead setting
1926 # This patch introduces a bdi hint, io_pages.
1927 #
1928 AC_DEFUN([LC_HAVE_BDI_IO_PAGES], [
1929 LB_CHECK_COMPILE([if 'struct backing_dev_info' has 'io_pages' field],
1930 bdi_has_io_pages, [
1931         #include <linux/backing-dev.h>
1932 ],[
1933         struct backing_dev_info info;
1934
1935         info.io_pages = 0;
1936 ],[
1937         AC_DEFINE(HAVE_BDI_IO_PAGES, 1,
1938                 [backing_dev_info has io_pages])
1939 ])
1940 ]) # LC_HAVE_BDI_IO_PAGES
1941
1942 #
1943 # LC_IOP_GENERIC_READLINK
1944 #
1945 # Kernel version 4.10 commit dfeef68862edd7d4bafe68ef7aeb5f658ef24bb5
1946 # removed generic_readlink from individual file systems
1947 #
1948 AC_DEFUN([LC_IOP_GENERIC_READLINK], [
1949 LB_CHECK_COMPILE([if 'generic_readlink' still exist],
1950 inode_ops_readlink, [
1951         #include <linux/fs.h>
1952 ],[
1953         struct inode_operations iop;
1954         iop.readlink = generic_readlink;
1955 ],[
1956         AC_DEFINE(HAVE_IOP_GENERIC_READLINK, 1,
1957                 [generic_readlink has been removed])
1958 ])
1959 ]) # LC_IOP_GENERIC_READLINK
1960
1961 #
1962 # LC_HAVE_VM_FAULT_ADDRESS
1963 #
1964 # Kernel version 4.10 commit 1a29d85eb0f19b7d8271923d8917d7b4f5540b3e
1965 # removed virtual_address field. Need to use address field instead
1966 #
1967 AC_DEFUN([LC_HAVE_VM_FAULT_ADDRESS], [
1968 LB_CHECK_COMPILE([if 'struct vm_fault' replaced virtual_address with address field],
1969 vm_fault_address, [
1970         #include <linux/mm.h>
1971 ],[
1972                 struct vm_fault vmf = { 0 };
1973                 unsigned long addr = (unsigned long)vmf.address;
1974                 (void)addr;
1975 ],[
1976         AC_DEFINE(HAVE_VM_FAULT_ADDRESS, 1,
1977                 [virtual_address has been replaced by address field])
1978 ])
1979 ]) # LC_HAVE_VM_FAULT_ADDRESS
1980
1981 #
1982 # LC_INODEOPS_ENHANCED_GETATTR
1983 #
1984 # Kernel version 4.11 commit a528d35e8bfcc521d7cb70aaf03e1bd296c8493f
1985 # expanded getattr to be able to get more stat information.
1986 #
1987 AC_DEFUN([LC_INODEOPS_ENHANCED_GETATTR], [
1988 LB_CHECK_COMPILE([if 'inode_operations' getattr member can gather advance stats],
1989 getattr_path, [
1990         #include <linux/fs.h>
1991 ],[
1992         struct path path;
1993
1994         ((struct inode_operations *)1)->getattr(&path, NULL, 0, 0);
1995 ],[
1996         AC_DEFINE(HAVE_INODEOPS_ENHANCED_GETATTR, 1,
1997                 [inode_operations .getattr member function can gather advance stats])
1998 ])
1999 ]) # LC_INODEOPS_ENHANCED_GETATTR
2000
2001 #
2002 # LC_VM_OPERATIONS_REMOVE_VMF_ARG
2003 #
2004 # Kernel version 4.11 commit 11bac80004499ea59f361ef2a5516c84b6eab675
2005 # removed struct vm_area_struct as an argument for vm_operations since
2006 # in the same kernel version struct vma_area_struct was folded into
2007 # struct vm_fault.
2008 #
2009 AC_DEFUN([LC_VM_OPERATIONS_REMOVE_VMF_ARG], [
2010 LB_CHECK_COMPILE([if 'struct vm_operations' removed struct vm_area_struct],
2011 vm_operations_no_vm_area_struct, [
2012         #include <linux/mm.h>
2013 ],[
2014         struct vm_fault vmf;
2015
2016         ((struct vm_operations_struct *)0)->fault(&vmf);
2017         ((struct vm_operations_struct *)0)->page_mkwrite(&vmf);
2018 ],[
2019         AC_DEFINE(HAVE_VM_OPS_USE_VM_FAULT_ONLY, 1,
2020                 ['struct vm_operations' remove struct vm_area_struct argument])
2021 ])
2022 ]) # LC_VM_OPERATIONS_REMOVE_VMF_ARG
2023
2024 #
2025 # LC_HAVE_KEY_USAGE_REFCOUNT
2026 #
2027 # Kernel version 4.11 commit fff292914d3a2f1efd05ca71c2ba72a3c663201e
2028 # converted key.usage from atomic_t to refcount_t.
2029 #
2030 AC_DEFUN([LC_HAVE_KEY_USAGE_REFCOUNT], [
2031 LB_CHECK_COMPILE([if 'key.usage' is refcount_t],
2032 key_usage_refcount, [
2033         #include <linux/key.h>
2034 ],[
2035         struct key key = { };
2036
2037         refcount_read(&key.usage);
2038 ],[
2039         AC_DEFINE(HAVE_KEY_USAGE_REFCOUNT, 1, [key.usage is of type refcount_t])
2040 ])
2041 ]) #LC_HAVE_KEY_USAGE_REFCOUNT
2042
2043 #
2044 # LC_HAVE_CRYPTO_MAX_ALG_NAME_128
2045 #
2046 # Kernel version 4.11 commit f437a3f477cce402dbec6537b29e9e33962c9f73
2047 # switched CRYPTO_MAX_ALG_NAME from 64 to 128.
2048 #
2049 AC_DEFUN([LC_HAVE_CRYPTO_MAX_ALG_NAME_128], [
2050 LB_CHECK_COMPILE([if 'CRYPTO_MAX_ALG_NAME' is 128],
2051 crypto_max_alg_name, [
2052         #include <linux/crypto.h>
2053 ],[
2054         #if CRYPTO_MAX_ALG_NAME != 128
2055         exit(1);
2056         #endif
2057 ],[
2058         AC_DEFINE(HAVE_CRYPTO_MAX_ALG_NAME_128, 1,
2059                 ['CRYPTO_MAX_ALG_NAME' is 128])
2060 ])
2061 ]) # LC_HAVE_CRYPTO_MAX_ALG_NAME_128
2062
2063 #
2064 # Kernel version 4.12 commit 47f38c539e9a42344ff5a664942075bd4df93876
2065 # CURRENT_TIME is not 64 bit time safe so it was replaced with
2066 # current_time()
2067 #
2068 AC_DEFUN([LC_CURRENT_TIME], [
2069 LB_CHECK_COMPILE([if CURRENT_TIME has been replaced with current_time],
2070 current_time, [
2071         #include <linux/fs.h>
2072 ],[
2073         struct iattr attr;
2074
2075         attr.ia_atime = current_time(NULL);
2076 ],[
2077         AC_DEFINE(HAVE_CURRENT_TIME, 1,
2078                 [current_time() has replaced CURRENT_TIME])
2079 ])
2080 ]) # LIBCFS_CURRENT_TIME
2081
2082 #
2083 # LC_HAVE_GET_INODE_USAGE
2084 #
2085 # Kernel version v4.12-rc2-43-g7a9ca53aea10
2086 #
2087 AC_DEFUN([LC_HAVE_GET_INODE_USAGE], [
2088 LB_CHECK_COMPILE([if get_inode_usage exists],
2089 get_inode_usage, [
2090         struct inode;
2091         #include <linux/quota.h>
2092 ],[
2093         struct dquot_operations ops = { };
2094
2095         ops.get_inode_usage(NULL, NULL);
2096 ],[
2097         AC_DEFINE(HAVE_GET_INODE_USAGE, 1,
2098                 [get_inode_usage function exists])
2099 ])
2100 ]) # LC_HAVE_GET_INODE_USAGE
2101
2102
2103 #
2104 # Kernel version 4.12-rc3 85787090a21eb749d8b347eaf9ff1a455637473c
2105 # changed struct super_block s_uuid into a proper uuid_t
2106 #
2107 AC_DEFUN([LC_SUPER_BLOCK_S_UUID], [
2108 LB_CHECK_COMPILE([if 'struct super_block' s_uuid is uuid_t],
2109 super_block_s_uuid, [
2110         #include <linux/fs.h>
2111 ],[
2112         struct super_block sb;
2113
2114         uuid_parse(NULL, &sb.s_uuid);
2115 ],[
2116         AC_DEFINE(HAVE_S_UUID_AS_UUID_T, 1, ['s_uuid' is an uuid_t])
2117 ])
2118 ]) # LC_SUPER_BLOCK_S_UUID
2119
2120 #
2121 # LC_SUPER_SETUP_BDI_NAME
2122 #
2123 # Kernel version 4.12 commit 9594caf216dc0fe3e318b34af0127276db661241
2124 # unified bdi handling
2125 #
2126 AC_DEFUN([LC_SUPER_SETUP_BDI_NAME], [
2127 LB_CHECK_COMPILE([if 'super_setup_bdi_name' exist],
2128 super_setup_bdi_name, [
2129         #include <linux/fs.h>
2130 ],[
2131         super_setup_bdi_name(NULL, "lustre");
2132 ],[
2133         AC_DEFINE(HAVE_SUPER_SETUP_BDI_NAME, 1,
2134                 ['super_setup_bdi_name' is available])
2135 ])
2136 ]) # LC_SUPER_SETUP_BDI_NAME
2137
2138 #
2139 # LC_BI_STATUS
2140 #
2141 # 4.12 replace bi_error to bi_status
2142 #
2143 AC_DEFUN([LC_BI_STATUS], [
2144 LB_CHECK_COMPILE([if 'bi_status' exist],
2145 bi_status, [
2146         #include <linux/blk_types.h>
2147 ],[
2148         ((struct bio *)0)->bi_status = 0;
2149 ],[
2150         AC_DEFINE(HAVE_BI_STATUS, 1,
2151                 ['bi_status' is available])
2152 ])
2153 ]) # LC_BI_STATUS
2154
2155 #
2156 # LC_BIO_INTEGRITY_ENABLED
2157 #
2158 # 4.13 removed bio_integrity_enabled
2159 #
2160 AC_DEFUN([LC_BIO_INTEGRITY_ENABLED], [
2161 LB_CHECK_COMPILE([if 'bio_integrity_enabled' exist],
2162 bio_integrity_enabled, [
2163         #include <linux/bio.h>
2164 ],[
2165         bio_integrity_enabled(NULL);
2166 ],[
2167         AC_DEFINE(HAVE_BIO_INTEGRITY_ENABLED, 1,
2168                 ['bio_integrity_enabled' is available])
2169 ])
2170 ]) # LC_BIO_INTEGRITY_ENABLED
2171
2172 #
2173 # LC_PAGEVEC_INIT_ONE_PARAM
2174 #
2175 # 4.14 pagevec_init takes one parameter
2176 #
2177 AC_DEFUN([LC_PAGEVEC_INIT_ONE_PARAM], [
2178 LB_CHECK_COMPILE([if 'pagevec_init' takes one parameter],
2179 pagevec_init, [
2180         #include <linux/pagevec.h>
2181 ],[
2182         pagevec_init(NULL);
2183 ],[
2184         AC_DEFINE(HAVE_PAGEVEC_INIT_ONE_PARAM, 1,
2185                 ['pagevec_init' takes one parameter])
2186 ])
2187 ]) # LC_PAGEVEC_INIT_ONE_PARAM
2188
2189 #
2190 # LC_BI_BDEV
2191 #
2192 # 4.14 replaced bi_bdev to bi_disk
2193 #
2194 AC_DEFUN([LC_BI_BDEV], [
2195 LB_CHECK_COMPILE([if 'bi_bdev' exist],
2196 bi_bdev, [
2197         #include <linux/bio.h>
2198 ],[
2199         ((struct bio *)0)->bi_bdev = NULL;
2200 ],[
2201         AC_DEFINE(HAVE_BI_BDEV, 1,
2202                 ['bi_bdev' is available])
2203 ])
2204 ]) # LC_BI_BDEV
2205
2206 #
2207 # LC_INTERVAL_TREE_CACHED
2208 #
2209 # 4.14 f808c13fd3738948e10196496959871130612b61
2210 # switched INTERVAL_TREE_DEFINE to use cached RB_Trees.
2211 #
2212 AC_DEFUN([LC_INTERVAL_TREE_CACHED], [
2213 tmp_flags="$EXTRA_KCFLAGS"
2214 EXTRA_KCFLAGS="-Werror"
2215 LB_CHECK_COMPILE([if interval_trees use rb_tree_cached],
2216 itree_cached, [
2217         #include <linux/interval_tree_generic.h>
2218         struct foo { struct rb_node rb; int last; int a,b;};
2219         #define START(n) ((n)->a)
2220         #define LAST(n) ((n)->b)
2221         struct rb_root_cached tree;
2222         INTERVAL_TREE_DEFINE(struct foo, rb, int, last,
2223                 START, LAST, , foo);
2224 ],[
2225         foo_insert(NULL, &tree);
2226 ],[
2227         AC_DEFINE(HAVE_INTERVAL_TREE_CACHED, 1,
2228                 [interval trees use rb_tree_cached])
2229 ])
2230 EXTRA_KCFLAGS="$tmp_flags"
2231 ]) # LC_INTERVAL_TREE_CACHED
2232
2233 #
2234 # LC_IS_ENCRYPTED
2235 #
2236 # 4.14 introduced IS_ENCRYPTED and S_ENCRYPTED
2237 #
2238 AC_DEFUN([LC_IS_ENCRYPTED], [
2239 LB_CHECK_COMPILE([if IS_ENCRYPTED is defined],
2240 is_encrypted, [
2241         #include <linux/fs.h>
2242 ],[
2243         IS_ENCRYPTED((struct inode *)0);
2244 ],[
2245         has_is_encrypted="yes"
2246 ])
2247 ]) # LC_IS_ENCRYPTED
2248
2249 #
2250 # LC_I_PAGES
2251 #
2252 # kernel 4.17 commit b93b016313b3ba8003c3b8bb71f569af91f19fc7
2253 #
2254 AC_DEFUN([LC_I_PAGES], [
2255 LB_CHECK_COMPILE([if struct address_space has i_pages],
2256 i_pages, [
2257         #include <linux/fs.h>
2258 ],[
2259         struct address_space mapping = {};
2260         void *i_pages;
2261
2262         i_pages = &mapping.i_pages;
2263 ],[
2264         AC_DEFINE(HAVE_I_PAGES, 1,
2265                 [struct address_space has i_pages])
2266 ])
2267 ]) # LC_I_PAGES
2268
2269 #
2270 # LC_VM_FAULT_T
2271 #
2272 # kernel 4.17 commit 3d3539018d2cbd12e5af4a132636ee7fd8d43ef0
2273 # mm: create the new vm_fault_t type
2274 #
2275 AC_DEFUN([LC_VM_FAULT_T], [
2276 LB_CHECK_COMPILE([if vm_fault_t type exists],
2277 vm_fault_t, [
2278         #include <linux/mm_types.h>
2279 ],[
2280         vm_fault_t x = VM_FAULT_SIGBUS;
2281         (void)x
2282 ],[
2283         AC_DEFINE(HAVE_VM_FAULT_T, 1,
2284                 [if vm_fault_t type exists])
2285 ])
2286 ]) # LC_VM_FAULT_T
2287
2288 #
2289 # LC_VM_FAULT_RETRY
2290 #
2291 # kernel 4.17 commit 3d3539018d2cbd12e5af4a132636ee7fd8d43ef0
2292 # mm: VM_FAULT_RETRY is defined in enum vm_fault_reason
2293 #
2294 AC_DEFUN([LC_VM_FAULT_RETRY], [
2295 LB_CHECK_COMPILE([if VM_FAULT_RETRY is defined],
2296 VM_FAULT_RETRY, [
2297         #include <linux/mm.h>
2298 ],[
2299         #ifndef VM_FAULT_RETRY
2300                 vm_fault_t x;
2301                 x = VM_FAULT_RETRY;
2302         #endif
2303 ],[
2304         AC_DEFINE(HAVE_VM_FAULT_RETRY, 1,
2305                 [if VM_FAULT_RETRY is defined])
2306 ])
2307 ]) # LC_VM_FAULT_RETRY
2308
2309 #
2310 # LC_ALLOC_FILE_PSEUDO
2311 #
2312 # kernel 4.18-rc1 commit d93aa9d82aea80b80f225dbf9c7986df444d8106
2313 # new wrapper: alloc_file_pseudo()
2314 #
2315 AC_DEFUN([LC_ALLOC_FILE_PSEUDO], [
2316 LB_CHECK_COMPILE([if 'alloc_file_pseudo' is defined],
2317 alloc_file_pseudo, [
2318         #include <linux/file.h>
2319 ],[
2320         struct file *file;
2321         file = alloc_file_pseudo(NULL, NULL, "[test]",
2322                                  00000002, NULL);
2323 ],[
2324         AC_DEFINE(HAVE_ALLOC_FILE_PSEUDO, 1,
2325                 ['alloc_file_pseudo' exist])
2326 ])
2327 ]) # LC_ALLOC_FILE_PSEUDO
2328
2329 #
2330 # LC_INODE_TIMESPEC64
2331 #
2332 # kernel 4.17-rc7 commit 8efd6894ff089adeeac7cb9f32125b85d963d1bc
2333 # fs: add timespec64_truncate()
2334 # kernel 4.18 commit 95582b00838837fc07e042979320caf917ce3fe6
2335 # inode timestamps switched to timespec64
2336 # kernel 4.19-rc2 commit 976516404ff3fab2a8caa8bd6f5efc1437fed0b8
2337 # y2038: remove unused time interfaces
2338 # ...
2339 #  timespec_trunc
2340 # ...
2341 # When inode times are timespec64 stop using the deprecated
2342 # time interfaces.
2343 #
2344 # kernel v5.5-rc1-6-gba70609d5ec6 ba70609d5ec664a8f36ba1c857fcd97a478adf79
2345 # fs: Delete timespec64_trunc()
2346 #
2347 AC_DEFUN([LC_INODE_TIMESPEC64], [
2348 tmp_flags="$EXTRA_KCFLAGS"
2349 EXTRA_KCFLAGS="-Werror"
2350 LB_CHECK_COMPILE([if inode timestamps are struct timespec64],
2351 inode_timespec64, [
2352         #include <linux/fs.h>
2353 ],[
2354         struct inode *inode = NULL;
2355         struct timespec64 ts = {0, 1};
2356
2357         inode->i_atime = ts;
2358         (void)inode;
2359 ],[
2360         AC_DEFINE(HAVE_INODE_TIMESPEC64, 1,
2361                 [inode times are using timespec64])
2362 ])
2363 EXTRA_KCFLAGS="$tmp_flags"
2364 ]) # LC_INODE_TIMESPEC64
2365
2366 #
2367 # LC_RADIX_TREE_TAG_SET
2368 #
2369 # kernel 4.20 commit v4.19-rc5-248-g9b89a0355144
2370 # xarray: Add XArray marks - replaced radix_tree_tag_set
2371 #
2372 AC_DEFUN([LC_RADIX_TREE_TAG_SET], [
2373 tmp_flags="$EXTRA_KCFLAGS"
2374 EXTRA_KCFLAGS="-Werror"
2375 LB_CHECK_COMPILE([if 'radix_tree_tag_set' exists],
2376 radix_tree_tag_set, [
2377         #include <linux/fs.h>
2378         #include <linux/radix-tree.h>
2379 ],[
2380         radix_tree_tag_set(NULL, 0, PAGECACHE_TAG_DIRTY);
2381 ],[
2382         AC_DEFINE(HAVE_RADIX_TREE_TAG_SET, 1,
2383                 [radix_tree_tag_set exists])
2384 ])
2385 EXTRA_KCFLAGS="$tmp_flags"
2386 ]) # LC_RADIX_TREE_TAG_SET
2387
2388 #
2389 # LC_UAPI_LINUX_MOUNT_H
2390 #
2391 # kernel 4.20 commit e262e32d6bde0f77fb0c95d977482fc872c51996
2392 # vfs: Suppress MS_* flag defs within the kernel ...
2393 #
2394 AC_DEFUN([LC_UAPI_LINUX_MOUNT_H], [
2395 tmp_flags="$EXTRA_KCFLAGS"
2396 EXTRA_KCFLAGS="-Werror"
2397 LB_CHECK_COMPILE([if MS_RDONLY was moved to uapi/linux/mount.h],
2398 uapi_linux_mount, [
2399         #include <uapi/linux/mount.h>
2400 ],[
2401         int x = MS_RDONLY;
2402         (void)x;
2403 ],[
2404         AC_DEFINE(HAVE_UAPI_LINUX_MOUNT_H, 1,
2405                 [if MS_RDONLY was moved to uapi/linux/mount.h])
2406 ])
2407 EXTRA_KCFLAGS="$tmp_flags"
2408 ]) # LC_UAPI_LINUX_MOUNT_H
2409
2410 #
2411 # LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
2412 #
2413 # kernel 4.20 commit 1863d77f15da0addcd293a1719fa5d3ef8cde3ca
2414 # SUNRPC: Replace the cache_detail->hash_lock with a regular spinlock
2415 #
2416 # Now that the reader functions are all RCU protected, use a regular
2417 # spinlock rather than a reader/writer lock.
2418 #
2419 AC_DEFUN([LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK], [
2420 tmp_flags="$EXTRA_KCFLAGS"
2421 EXTRA_KCFLAGS="-Werror"
2422 LB_CHECK_COMPILE([if cache_detail->hash_lock is a spinlock],
2423 hash_lock_isa_spinlock_t, [
2424         #include <linux/sunrpc/cache.h>
2425 ],[
2426         spinlock_t *lock = &(((struct cache_detail *)0)->hash_lock);
2427         spin_lock(lock);
2428 ],[
2429         AC_DEFINE(HAVE_CACHE_HASH_SPINLOCK, 1,
2430                 [if cache_detail->hash_lock is a spinlock])
2431 ])
2432 EXTRA_KCFLAGS="$tmp_flags"
2433 ]) # LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
2434
2435 #
2436 # LC_HAS_LINUX_SELINUX_ENABLED
2437 #
2438 # kernel 5.1 commit 3d252529480c68bfd6a6774652df7c8968b28e41
2439 # SELinux: Remove unused selinux_is_enabled
2440 #
2441 AC_DEFUN([LC_HAS_LINUX_SELINUX_ENABLED], [
2442 tmp_flags="$EXTRA_KCFLAGS"
2443 EXTRA_KCFLAGS="-Werror"
2444 LB_CHECK_COMPILE([if linux/selinux.h exists],
2445 selinux_is_enabled, [
2446         #include <linux/selinux.h>
2447 ],[
2448         bool has_selinux = selinux_is_enabled();
2449         (void)has_selinux;
2450 ],[
2451         AC_DEFINE(HAVE_LINUX_SELINUX_IS_ENABLED, 1,
2452                 [if linux/selinux.h exists])
2453 ])
2454 EXTRA_KCFLAGS="$tmp_flags"
2455 ]) # LC_HAS_LINUX_SELINUX_ENABLED
2456
2457 #
2458 # LB_HAVE_BVEC_ITER_ALL
2459 #
2460 # kernel 5.1 commit 6dc4f100c175dd0511ae8674786e7c9006cdfbfa
2461 # block: allow bio_for_each_segment_all() to iterate over multi-page bvec
2462 #
2463 AC_DEFUN([LB_HAVE_BVEC_ITER_ALL], [
2464 tmp_flags="$EXTRA_KCFLAGS"
2465 EXTRA_KCFLAGS="-Werror"
2466 LB_CHECK_COMPILE([if bvec_iter_all exists for multi-page bvec iternation],
2467 ext4fs_dirhash, [
2468         #include <linux/bvec.h>
2469 ],[
2470         struct bvec_iter_all iter;
2471         (void)iter;
2472 ],[
2473         AC_DEFINE(HAVE_BVEC_ITER_ALL, 1,
2474                 [if bvec_iter_all exists for multi-page bvec iternation])
2475 ])
2476 EXTRA_KCFLAGS="$tmp_flags"
2477 ]) # LB_HAVE_BVEC_ITER_ALL
2478
2479 #
2480 # LC_ACCOUNT_PAGE_DIRTIED
2481 #
2482 # After 5.2 kernel page dirtied is not exported
2483 #
2484 AC_DEFUN([LC_ACCOUNT_PAGE_DIRTIED], [
2485 LB_CHECK_EXPORT([account_page_dirtied], [mm/page-writeback.c],
2486         [AC_DEFINE(HAVE_ACCOUNT_PAGE_DIRTIED_EXPORT, 1,
2487                         [account_page_dirtied is exported])])
2488 ]) # LC_ACCOUNT_PAGE_DIRTIED
2489
2490 #
2491 # LC_KEYRING_SEARCH_4ARGS
2492 #
2493 # Kernel 5.2 commit dcf49dbc8077
2494 # keys: Add a 'recurse' flag for keyring searches
2495 #
2496 AC_DEFUN([LC_KEYRING_SEARCH_4ARGS], [
2497 LB_CHECK_COMPILE([if 'keyring_search' has 4 args],
2498 keyring_search_4args, [
2499         #include <linux/key.h>
2500 ],[
2501         key_ref_t keyring;
2502         keyring_search(keyring, NULL, NULL, false);
2503 ],[
2504         AC_DEFINE(HAVE_KEYRING_SEARCH_4ARGS, 1,
2505                 [keyring_search has 4 args])
2506 ])
2507 ]) # LC_KEYRING_SEARCH_4ARGS
2508
2509 #
2510 # LC_BIO_BI_PHYS_SEGMENTS
2511 #
2512 # kernel 5.3-rc1 commit 14ccb66b3f585b2bc21e7256c96090abed5a512c
2513 # block: remove the bi_phys_segments field in struct bio
2514 #
2515 AC_DEFUN([LC_BIO_BI_PHYS_SEGMENTS], [
2516 tmp_flags="$EXTRA_KCFLAGS"
2517 EXTRA_KCFLAGS="-Werror"
2518 LB_CHECK_COMPILE([if struct bio has bi_phys_segments member],
2519 bye_bio_bi_phys_segments, [
2520         #include <linux/bio.h>
2521 ],[
2522         struct bio *bio = NULL;
2523         bio->bi_phys_segments++;
2524 ],[
2525         AC_DEFINE(HAVE_BIO_BI_PHYS_SEGMENTS, 1,
2526                 [struct bio has bi_phys_segments member])
2527 ])
2528 EXTRA_KCFLAGS="$tmp_flags"
2529 ]) # LC_BIO_BI_PHYS_SEGMENTS
2530
2531 #
2532 # LC_LM_COMPARE_OWNER_EXISTS
2533 #
2534 # kernel 5.3-rc3 commit f85d93385e9fe6886a751f647f6812a89bf6bee3
2535 # locks: Cleanup lm_compare_owner and lm_owner_key
2536 # removed lm_compare_owner
2537 #
2538 AC_DEFUN([LC_LM_COMPARE_OWNER_EXISTS], [
2539 tmp_flags="$EXTRA_KCFLAGS"
2540 EXTRA_KCFLAGS="-Werror"
2541 LB_CHECK_COMPILE([if lock_manager_operations has lm_compare_owner],
2542 lock_manager_ops_lm_compare_owner, [
2543         #include <linux/fs.h>
2544 ],[
2545         struct lock_manager_operations lm_ops;
2546         lm_ops.lm_compare_owner = NULL;
2547 ],[
2548         AC_DEFINE(HAVE_LM_COMPARE_OWNER, 1,
2549                 [lock_manager_operations has lm_compare_owner])
2550 ])
2551 EXTRA_KCFLAGS="$tmp_flags"
2552 ]) # LC_LM_COMPARE_OWNER_EXISTS
2553
2554 #
2555 # LC_FSCRYPT_SUPPORT
2556 #
2557 # 5.4 introduced fscrypt encryption policies v2
2558 #
2559 AC_DEFUN([LC_FSCRYPT_SUPPORT], [
2560 LB_CHECK_COMPILE([for fscrypt in-kernel support],
2561 fscrypt_support, [
2562         #define __FS_HAS_ENCRYPTION 0
2563         #include <linux/fscrypt.h>
2564 ],[
2565         fscrypt_ioctl_get_policy_ex(NULL, NULL);
2566 ],[
2567         has_fscrypt_support="yes"
2568 ])
2569 ]) # LC_FSCRYPT_SUPPORT
2570
2571 #
2572 # LC_FSCRYPT_DIGESTED_NAME
2573 #
2574 # Kernel 5.5-rc4 edc440e3d27fb31e6f9663cf413fad97d714c060
2575 # improved the format of no-key names. This results in the
2576 # removal of FSCRYPT_FNAME_DIGEST and FSCRYPT_FNAME_DIGEST_SIZE.
2577 #
2578 AC_DEFUN([LC_FSCRYPT_DIGESTED_NAME], [
2579 tmp_flags="$EXTRA_KCFLAGS"
2580 EXTRA_KCFLAGS="-Werror"
2581 LB_CHECK_COMPILE([if fscrypt has 'struct fscrypt_digested_name'],
2582 fscrypt_digested_name, [
2583         #include <linux/fscrypt.h>
2584 ],[
2585         struct fscrypt_digested_name fname;
2586
2587         fname.hash = 0;
2588 ],[
2589         AC_DEFINE(HAVE_FSCRYPT_DIGESTED_NAME, 1,
2590                 ['struct fscrypt_digested_name' exists])
2591 ])
2592 EXTRA_KCFLAGS="$tmp_flags"
2593 ]) # LC_FSCRYPT_DIGESTED_NAME
2594
2595 #
2596 # LC_FSCRYPT_DUMMY_CONTEXT_ENABLED
2597 #
2598 # Kernel 5.7-rc7 ed318a6cc0b620440e65f48eb527dc3df7269ce4
2599 # replaces fscrypt_dummy_context_enabled() with
2600 # fscrypt_get_dummy_context(). Later kernels rename
2601 # fscrypt_get_dummy_context() to fscrypt_get_dummy_policy()
2602 # which is why we test fscrypt_dummy_context_enabled().
2603 #
2604 AC_DEFUN([LC_FSCRYPT_DUMMY_CONTEXT_ENABLED], [
2605 tmp_flags="$EXTRA_KCFLAGS"
2606 EXTRA_KCFLAGS="-Werror"
2607 LB_CHECK_COMPILE([if fscrypt_dummy_context_enabled() exists],
2608 fscrypt_dummy_context_enabled, [
2609         #include <linux/fscrypt.h>
2610 ],[
2611         fscrypt_dummy_context_enabled(NULL);
2612 ],[
2613         AC_DEFINE(HAVE_FSCRYPT_DUMMY_CONTEXT_ENABLED, 1,
2614                 [fscrypt_dummy_context_enabled() exists])
2615 ])
2616 EXTRA_KCFLAGS="$tmp_flags"
2617 ]) # LC_FSCRYPT_DUMMY_CONTEXT_ENABLED
2618
2619 #
2620 # LC_HAVE_ITER_FILE_SPLICE_WRITE
2621 #
2622 # Linux commit v5.9-rc1-6-g36e2c7421f02
2623 #  fs: don't allow splice read/write without explicit ops
2624 #
2625 AC_DEFUN([LC_HAVE_ITER_FILE_SPLICE_WRITE], [
2626 tmp_flags="$EXTRA_KCFLAGS"
2627 EXTRA_KCFLAGS="-Werror"
2628 LB_CHECK_COMPILE([if 'iter_file_splice_write' exists],
2629 iter_file_splice_write, [
2630         #include <linux/fs.h>
2631 ],[
2632         (void)iter_file_splice_write(NULL, NULL, NULL, 1, 0);
2633 ],[
2634         AC_DEFINE(HAVE_ITER_FILE_SPLICE_WRITE, 1,
2635                 ['iter_file_splice_write' exists])
2636 ])
2637 EXTRA_KCFLAGS="$tmp_flags"
2638 ]) # LC_HAVE_ITER_FILE_SPLICE_WRITE
2639
2640 #
2641 # LC_FSCRYPT_IS_NOKEY_NAME
2642 #
2643 # Kernel 5.10-rc4 159e1de201b6fca10bfec50405a3b53a561096a8
2644 # introduced fscrypt_is_nokey_name() inline macro. While
2645 # introduced for 5.10 kernels it was backported to earlier
2646 # Ubuntu kernels. Also it hides the change introduced due
2647 # to git commit 501e43fbe for kernel 5.9 which also was
2648 # backported to earlier Ubuntu kernels.
2649 #
2650 AC_DEFUN([LC_FSCRYPT_IS_NOKEY_NAME], [
2651 tmp_flags="$EXTRA_KCFLAGS"
2652 EXTRA_KCFLAGS="-Werror"
2653 LB_CHECK_COMPILE([if fscrypt_is_nokey_name() exists],
2654 fscrypt_is_no_key_name, [
2655         #include <linux/fscrypt.h>
2656 ],[
2657         fscrypt_is_nokey_name(NULL);
2658 ],[
2659         AC_DEFINE(HAVE_FSCRYPT_IS_NOKEY_NAME, 1,
2660                 [fscrypt_is_nokey_name() exists])
2661 ])
2662 EXTRA_KCFLAGS="$tmp_flags"
2663 ]) # LC_FSCRYPT_IS_NOKEY_NAME
2664
2665 #
2666 # LC_BIO_SET_DEV
2667 #
2668 # Linux: v5.11-rc5-9-g309dca309fc3
2669 #   block: store a block_device pointer in struct bio
2670 # created bio_set_dev macro
2671 # Linux: v5.15-rc6-127-gcf6d6238cdd3
2672 #   block: turn macro helpers into inline functions
2673 # created inline function(s).
2674 #
2675 # Only provide a bio_set_dev it is is not proveded by the kernel
2676 #
2677 AC_DEFUN([LC_BIO_SET_DEV], [
2678 tmp_flags="$EXTRA_KCFLAGS"
2679 EXTRA_KCFLAGS="-Werror"
2680         LB_CHECK_COMPILE([if 'bio_set_dev' is available],
2681         [bio_set_dev], [
2682                 #include <linux/bio.h>
2683         ],[
2684                 struct bio *bio = NULL;
2685                 struct block_device *bdev = NULL;
2686
2687                 bio_set_dev(bio, bdev);
2688         ],[
2689                 AC_DEFINE(HAVE_BIO_SET_DEV, 1, ['bio_set_dev' is available])
2690         ])
2691 EXTRA_KCFLAGS="$tmp_flags"
2692 ]) # LC_BIO_SET_DEV
2693
2694 #
2695 # LC_HAVE_USER_NAMESPACE_ARG
2696 #
2697 # kernel 5.12 commit 549c7297717c32ee53f156cd949e055e601f67bb
2698 # fs: make helpers idmap mount aware
2699 # Extend some inode methods with an additional user namespace argument.
2700 #
2701 AC_DEFUN([LC_HAVE_USER_NAMESPACE_ARG], [
2702 tmp_flags="$EXTRA_KCFLAGS"
2703 EXTRA_KCFLAGS="-Werror"
2704 LB_CHECK_COMPILE([if 'inode_operations' members have user namespace argument],
2705 user_namespace_argument, [
2706         #include <linux/fs.h>
2707 ],[
2708         ((struct inode_operations *)1)->getattr((struct user_namespace *)NULL,
2709                                                 NULL, NULL, 0, 0);
2710 ],[
2711         AC_DEFINE(HAVE_USER_NAMESPACE_ARG, 1,
2712                 ['inode_operations' members have user namespace argument])
2713 ])
2714 EXTRA_KCFLAGS="$tmp_flags"
2715 ]) # LC_HAVE_USER_NAMESPACE_ARG
2716
2717 #
2718 # LC_HAVE_GET_ACL_RCU_ARG
2719 #
2720 # kernel 5.15 commit 0cad6246621b5887d5b33fea84219d2a71f2f99a
2721 # vfs: add rcu argument to ->get_acl() callback
2722 # Add a rcu argument to the ->get_acl() callback to allow
2723 # get_cached_acl_rcu() to call the ->get_acl() method.
2724 #
2725 AC_DEFUN([LC_HAVE_GET_ACL_RCU_ARG], [
2726 tmp_flags="$EXTRA_KCFLAGS"
2727 EXTRA_KCFLAGS="-Werror"
2728 LB_CHECK_COMPILE([if 'get_acl' has a rcu argument],
2729 get_acl_rcu_argument, [
2730         #include <linux/fs.h>
2731 ],[
2732         ((struct inode_operations *)1)->get_acl((struct inode *)NULL, 0, false);
2733 ],[
2734         AC_DEFINE(HAVE_GET_ACL_RCU_ARG, 1,
2735                 ['get_acl' has a rcu argument])
2736 ])
2737 EXTRA_KCFLAGS="$tmp_flags"
2738 ]) # LC_HAVE_GET_ACL_RCU_ARG
2739
2740 #
2741 # LC_HAVE_SECURITY_DENTRY_INIT_WITH_XATTR_NAME_ARG
2742 #
2743 # Linux v5.15-rc1-20-g15bf32398ad4
2744 # security: Return xattr name from security_dentry_init_security()
2745 #
2746 AC_DEFUN([LC_HAVE_SECURITY_DENTRY_INIT_WITH_XATTR_NAME_ARG], [
2747 tmp_flags="$EXTRA_KCFLAGS"
2748 EXTRA_KCFLAGS="-Werror"
2749 LB_CHECK_COMPILE([if security_dentry_init_security() returns xattr name],
2750 security_dentry_init_security_xattr_name_arg, [
2751         #include <linux/security.h>
2752 ],[
2753         struct dentry *dentry = NULL;
2754         int mode = 0;
2755         const struct qstr *name = NULL;
2756         const char *xattr_name = NULL;
2757         void **ctx = NULL;
2758         u32 *ctxlen = 0;
2759         int rc = security_dentry_init_security(dentry, mode, name, &xattr_name,
2760                                                ctx, ctxlen);
2761         (void)rc;
2762
2763 ],[
2764         AC_DEFINE(HAVE_SECURITY_DENTRY_INIT_WITH_XATTR_NAME_ARG, 1,
2765                 [security_dentry_init_security() returns xattr name])
2766 ])
2767 EXTRA_KCFLAGS="$tmp_flags"
2768 ]) # LC_HAVE_SECURITY_DENTRY_INIT_WITH_XATTR_NAME_ARG
2769
2770 #
2771 # LC_HAVE_KIOCB_COMPLETE_2ARGS
2772 #
2773 # kernel v5.15-rc6-145-g6b19b766e8f0
2774 # fs: get rid of the res2 iocb->ki_complete argument
2775 #
2776 AC_DEFUN([LC_HAVE_KIOCB_COMPLETE_2ARGS], [
2777 tmp_flags="$EXTRA_KCFLAGS"
2778 EXTRA_KCFLAGS="-Werror"
2779 LB_CHECK_COMPILE([if kiocb->ki_complete() has 2 arguments],
2780 kiocb_ki_complete_2args, [
2781         #include <linux/fs.h>
2782
2783         static void complete_fn(struct kiocb *iocb, long ret)
2784         {
2785                 (void)iocb;
2786                 (void)ret;
2787         }
2788 ],[
2789         struct kiocb *kio = NULL;
2790
2791         kio->ki_complete = complete_fn;
2792 ],[
2793         AC_DEFINE(HAVE_KIOCB_COMPLETE_2ARGS, 1,
2794                 [kiocb->ki_complete() has 2 arguments])
2795 ])
2796 EXTRA_KCFLAGS="$tmp_flags"
2797 ]) # LC_HAVE_KIOCB_COMPLETE_2ARGS
2798
2799 AC_DEFUN([LC_PROG_LINUX_SRC], [])
2800 AC_DEFUN([LC_PROG_LINUX_RESULTS], [])
2801
2802 #
2803 # LC_PROG_LINUX
2804 #
2805 # Lustre linux kernel checks
2806 #
2807 AC_DEFUN([LC_PROG_LINUX], [
2808         AC_MSG_NOTICE([Lustre kernel checks
2809 ==============================================================================])
2810
2811         LC_CONFIG_PINGER
2812         LC_CONFIG_CHECKSUM
2813         LC_CONFIG_FLOCK
2814         LC_CONFIG_HEALTH_CHECK_WRITE
2815         LC_CONFIG_LRU_RESIZE
2816         LC_CONFIG_FHANDLE
2817         LC_CONFIG_GSS
2818
2819         # 3.10
2820         LC_HAVE_PROJECT_QUOTA
2821
2822         # 3.11
2823         LC_INVALIDATE_RANGE
2824         LC_HAVE_DIR_CONTEXT
2825         LC_D_COMPARE_5ARGS
2826         LC_HAVE_DCOUNT
2827         LC_HAVE_DENTRY_D_U_D_ALIAS
2828         LC_HAVE_DENTRY_D_CHILD
2829         LC_PID_NS_FOR_CHILDREN
2830
2831         # 3.12
2832         LC_OLDSIZE_TRUNCATE_PAGECACHE
2833         LC_PTR_ERR_OR_ZERO_MISSING
2834         LC_KIOCB_KI_LEFT
2835         LC_REGISTER_SHRINKER_RET
2836
2837         # 3.13
2838         LC_VFS_RENAME_5ARGS
2839         LC_VFS_UNLINK_3ARGS
2840         LC_HAVE_D_IS_POSITIVE
2841
2842         # 3.14
2843         LC_HAVE_BVEC_ITER
2844         LC_HAVE_TRUNCATE_IPAGES_FINAL
2845         LC_IOPS_RENAME_WITH_FLAGS
2846         LC_IOP_SET_ACL
2847
2848         # 3.15
2849         LC_VFS_RENAME_6ARGS
2850
2851         # 3.16
2852         LC_DIRECTIO_USE_ITER
2853         LC_HAVE_IOV_ITER_INIT_DIRECTION
2854         LC_HAVE_IOV_ITER_TRUNCATE
2855         LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
2856
2857         # 3.17
2858         LC_HAVE_INTERVAL_BLK_INTEGRITY
2859         LC_KEY_MATCH_DATA
2860
2861         # 3.18
2862         LC_PERCPU_COUNTER_INIT
2863         LC_NFS_FILLDIR_USE_CTX
2864
2865         # 3.19
2866         LC_KIOCB_HAS_NBYTES
2867         LC_HAVE_DQUOT_QC_DQBLK
2868         LC_HAVE_AIO_COMPLETE
2869         LC_HAVE_IS_ROOT_INODE
2870
2871         # 3.20
2872         LC_BACKING_DEV_INFO_REMOVAL
2873         LC_HAVE_BDI_CAP_MAP_COPY
2874
2875         # 4.1.0
2876         LC_IOV_ITER_RW
2877         LC_HAVE_SYNC_READ_WRITE
2878         LC_HAVE___BI_CNT
2879
2880         # 4.2
2881         LC_BIO_ENDIO_USES_ONE_ARG
2882         LC_SYMLINK_OPS_USE_NAMEIDATA
2883         LC_ACCOUNT_PAGE_DIRTIED_3ARGS
2884         LC_HAVE_CRYPTO_ALLOC_SKCIPHER
2885
2886         # 4.3
2887         LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
2888         LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
2889         LC_HAVE_CACHE_HEAD_HLIST
2890         LC_HAVE_XATTR_HANDLER_SIMPLIFIED
2891
2892         # 4.4
2893         LC_HAVE_LOCKS_LOCK_FILE_WAIT
2894         LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
2895         LC_HAVE_XATTR_HANDLER_NAME
2896         LC_HAVE_BI_OPF
2897         LC_HAVE_SUBMIT_BIO_2ARGS
2898         LC_HAVE_CLEAN_BDEV_ALIASES
2899
2900         # 4.5
2901         LC_HAVE_FILE_DENTRY
2902
2903         # 4.5
2904         LC_HAVE_INODE_LOCK
2905         LC_HAVE_IOP_GET_LINK
2906
2907         # 4.6
2908         LC_HAVE_IN_COMPAT_SYSCALL
2909         LC_HAVE_XATTR_HANDLER_INODE_PARAM
2910         LC_LOCK_PAGE_MEMCG
2911         LC_HAVE_DOWN_WRITE_KILLABLE
2912
2913         # 4.7
2914         LC_D_IN_LOOKUP
2915         LC_D_INIT
2916         LC_DIRECTIO_2ARGS
2917         LC_GENERIC_WRITE_SYNC_2ARGS
2918         LC_FOP_ITERATE_SHARED
2919
2920         # 4.8
2921         LC_EXPORT_DEFAULT_FILE_SPLICE_READ
2922         LC_HAVE_POSIX_ACL_VALID_USER_NS
2923         LC_D_COMPARE_4ARGS
2924         LC_FULL_NAME_HASH_3ARGS
2925         LC_STRUCT_POSIX_ACL_XATTR
2926         LC_IOP_XATTR
2927
2928         # 4.9
2929         LC_GROUP_INFO_GID
2930         LC_VFS_SETXATTR
2931         LC_POSIX_ACL_UPDATE_MODE
2932         LC_HAVE_BDI_IO_PAGES
2933
2934         # 4.10
2935         LC_IOP_GENERIC_READLINK
2936         LC_HAVE_VM_FAULT_ADDRESS
2937
2938         # 4.11
2939         LC_INODEOPS_ENHANCED_GETATTR
2940         LC_VM_OPERATIONS_REMOVE_VMF_ARG
2941         LC_HAVE_KEY_USAGE_REFCOUNT
2942         LC_HAVE_CRYPTO_MAX_ALG_NAME_128
2943
2944         # 4.12
2945         LC_CURRENT_TIME
2946         LC_SUPER_BLOCK_S_UUID
2947         LC_SUPER_SETUP_BDI_NAME
2948         LC_BI_STATUS
2949
2950         # 4.13
2951         LC_BIO_INTEGRITY_ENABLED
2952         LC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL
2953         LC_HAVE_GET_INODE_USAGE
2954
2955         # 4.14
2956         LC_PAGEVEC_INIT_ONE_PARAM
2957         LC_BI_BDEV
2958         LC_INTERVAL_TREE_CACHED
2959
2960         # 4.17
2961         LC_VM_FAULT_T
2962         LC_VM_FAULT_RETRY
2963         LC_I_PAGES
2964
2965         # 4.18
2966         LC_ALLOC_FILE_PSEUDO
2967         LC_INODE_TIMESPEC64
2968
2969         # 4.20
2970         LC_RADIX_TREE_TAG_SET
2971         LC_UAPI_LINUX_MOUNT_H
2972         LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
2973
2974         # 5.1
2975         LC_HAS_LINUX_SELINUX_ENABLED
2976         LB_HAVE_BVEC_ITER_ALL
2977
2978         # 5.2
2979         LC_ACCOUNT_PAGE_DIRTIED
2980         LC_KEYRING_SEARCH_4ARGS
2981
2982         # 5.3
2983         LC_BIO_BI_PHYS_SEGMENTS
2984         LC_LM_COMPARE_OWNER_EXISTS
2985
2986         # 5.5
2987         LC_FSCRYPT_DIGESTED_NAME
2988
2989         # 5.7
2990         LC_FSCRYPT_DUMMY_CONTEXT_ENABLED
2991
2992         # 5.9
2993         LC_HAVE_ITER_FILE_SPLICE_WRITE
2994
2995         # 5.10
2996         LC_FSCRYPT_IS_NOKEY_NAME
2997
2998         # 5.11
2999         LC_BIO_SET_DEV
3000
3001         # 5.12
3002         LC_HAVE_USER_NAMESPACE_ARG
3003
3004         # 5.15
3005         LC_HAVE_GET_ACL_RCU_ARG
3006
3007         # 5.16
3008         LC_HAVE_SECURITY_DENTRY_INIT_WITH_XATTR_NAME_ARG
3009         LC_HAVE_KIOCB_COMPLETE_2ARGS
3010
3011         # kernel patch to extend integrity interface
3012         LC_BIO_INTEGRITY_PREP_FN
3013
3014         #
3015         AS_IF([test "x$enable_server" != xno], [
3016                 LC_STACK_SIZE
3017                 LC_QUOTA_CONFIG
3018         ])
3019         LC_POSIX_ACL_CONFIG
3020 ]) # LC_PROG_LINUX
3021
3022 #
3023 # LC_CONFIG_CLIENT
3024 #
3025 # Check whether to build the client side of Lustre
3026 #
3027 AC_DEFUN([LC_CONFIG_CLIENT], [
3028 AC_MSG_CHECKING([whether to build Lustre client support])
3029 AC_ARG_ENABLE([client],
3030         AS_HELP_STRING([--disable-client],
3031                 [disable Lustre client support]),
3032         [], [enable_client="yes"])
3033 AC_MSG_RESULT([$enable_client])
3034 ]) # LC_CONFIG_CLIENT
3035
3036 #
3037 # --enable-mpitests
3038 #
3039 AC_DEFUN([LB_CONFIG_MPITESTS], [
3040 AC_ARG_ENABLE([mpitests],
3041         AS_HELP_STRING([--enable-mpitests=<yes|no|mpicc wrapper>],
3042                        [include mpi tests]), [
3043                 enable_mpitests="yes"
3044                 case $enableval in
3045                 yes)
3046                         MPICC_WRAPPER="mpicc"
3047                         MPI_BIN=$(eval which $MPICC_WRAPPER | xargs dirname)
3048                         ;;
3049                 no)
3050                         enable_mpitests="no"
3051                         MPI_BIN=""
3052                         ;;
3053                 *)
3054                         MPICC_WRAPPER=$enableval
3055                         MPI_BIN=$(eval echo $MPICC_WRAPPER | xargs dirname)
3056                         ;;
3057                 esac
3058         ], [
3059                 enable_mpitests="yes"
3060                 MPICC_WRAPPER="mpicc"
3061                 MPI_BIN=$(eval which $MPICC_WRAPPER | xargs dirname)
3062         ])
3063
3064         if test "x$enable_mpitests" != "xno"; then
3065                 oldcc=$CC
3066                 CC=$MPICC_WRAPPER
3067                 AC_CACHE_CHECK([whether mpitests can be built],
3068                 lb_cv_mpi_tests, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([
3069                         #include <mpi.h>
3070                         int main(void) {
3071                                 int flag;
3072                                 MPI_Initialized(&flag);
3073                                 return 0;
3074                         }
3075                 ])], [lb_cv_mpi_tests="yes"], [lb_cv_mpi_tests="no"])
3076                 ])
3077                 enable_mpitests=$lb_cv_mpi_tests
3078                 CC=$oldcc
3079         fi
3080         AC_SUBST(MPI_BIN)
3081         AC_SUBST(MPICC_WRAPPER)
3082 ]) # LB_CONFIG_MPITESTS
3083
3084 #
3085 # LC_CONFIG_QUOTA
3086 #
3087 # whether to enable quota support global control
3088 #
3089 AC_DEFUN([LC_CONFIG_QUOTA], [
3090 AC_MSG_CHECKING([whether to enable quota support global control])
3091 AC_ARG_ENABLE([quota],
3092         AS_HELP_STRING([--enable-quota],
3093                 [enable quota support]),
3094         [], [enable_quota="yes"])
3095 AS_IF([test "x$enable_quota" = xyes],
3096         [AC_MSG_RESULT([yes])],
3097         [AC_MSG_RESULT([no])])
3098 ]) # LC_CONFIG_QUOTA
3099
3100 #
3101 # LC_QUOTA
3102 #
3103 AC_DEFUN([LC_QUOTA], [
3104 #check global
3105 LC_CONFIG_QUOTA
3106 #check for utils
3107 AS_IF([test "x$enable_quota" != xno -a "x$enable_utils" != xno], [
3108         AC_CHECK_HEADER([sys/quota.h],
3109                 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1,
3110                         [Define to 1 if you have <sys/quota.h>.])],
3111                 [AC_MSG_ERROR([don't find <sys/quota.h> in your system])])
3112 ])
3113 ]) # LC_QUOTA
3114
3115 #
3116 # LC_OSD_ADDON
3117 #
3118 # configure support for optional OSD implementation
3119 #
3120 AC_DEFUN([LC_OSD_ADDON], [
3121 AC_MSG_CHECKING([whether to use OSD addon])
3122 AC_ARG_WITH([osd],
3123         AS_HELP_STRING([--with-osd=path],
3124                 [set path to optional osd]),
3125         [
3126         case "$with_osd" in
3127         no)
3128                 ENABLEOSDADDON=0
3129                 ;;
3130         *)
3131                 OSDADDON="$with_osd"
3132                 ENABLEOSDADDON=1
3133                 ;;
3134         esac
3135         ], [
3136                 ENABLEOSDADDON=0
3137         ])
3138 AS_IF([test $ENABLEOSDADDON -eq 0], [
3139         AC_MSG_RESULT([no])
3140         OSDADDON=""
3141 ], [
3142         OSDMODNAME=$(basename $OSDADDON)
3143         AS_IF([test -e $LUSTRE/$OSDMODNAME], [
3144                 AC_MSG_RESULT([can't link])
3145                 OSDADDON=""
3146         ], [ln -s $OSDADDON $LUSTRE/$OSDMODNAME], [
3147                 AC_MSG_RESULT([$OSDMODNAME])
3148                 OSDADDON="obj-m += $OSDMODNAME/"
3149         ], [
3150                 AC_MSG_RESULT([can't link])
3151                 OSDADDON=""
3152         ])
3153 ])
3154 AC_SUBST(OSDADDON)
3155 ]) # LC_OSD_ADDON
3156
3157 #
3158 # LC_CONFIG_CRYPTO
3159 #
3160 # Check whether to enable Lustre client crypto
3161 #
3162 AC_DEFUN([LC_CONFIG_CRYPTO], [
3163 AC_MSG_CHECKING([whether to enable Lustre client crypto])
3164 AC_ARG_ENABLE([crypto],
3165         AS_HELP_STRING([--enable-crypto=yes|no|in-kernel],
3166                 [enable Lustre client crypto (default is yes), use 'in-kernel' to force use of in-kernel fscrypt instead of embedded llcrypt]),
3167         [], [enable_crypto="auto"])
3168 AS_IF([test "x$enable_crypto" != xno -a "x$enable_dist" = xno], [
3169         AC_MSG_RESULT(
3170         )
3171         LC_IS_ENCRYPTED
3172         LC_FSCRYPT_SUPPORT])
3173 AS_IF([test "x$enable_crypto" = xin-kernel], [
3174         AS_IF([test "x$has_fscrypt_support" = xyes], [
3175               AC_DEFINE(HAVE_LUSTRE_CRYPTO, 1, [Enable Lustre client crypto via in-kernel fscrypt])], [
3176               AC_MSG_ERROR([Lustre client crypto cannot be enabled via in-kernel fscrypt.])
3177               enable_crypto=no])],
3178         [AS_IF([test "x$has_is_encrypted" = xyes], [
3179               AC_DEFINE(HAVE_LUSTRE_CRYPTO, 1, [Enable Lustre client crypto via embedded llcrypt])
3180               AC_DEFINE(CONFIG_LL_ENCRYPTION, 1, [embedded llcrypt])
3181               AC_DEFINE(HAVE_FSCRYPT_DUMMY_CONTEXT_ENABLED, 1, [embedded llcrypt uses llcrypt_dummy_context_enabled()])
3182               enable_crypto="embedded-llcrypt"
3183               enable_llcrypt=yes], [
3184               AS_IF([test "x$enable_crypto" = xyes],
3185                     [AC_MSG_ERROR([Lustre client crypto cannot be enabled because of lack of encryption support in your kernel.])])
3186               AS_IF([test "x$enable_crypto" != xno -a "x$enable_dist" = xno],
3187                     [AC_MSG_WARN(Lustre client crypto cannot be enabled because of lack of encryption support in your kernel.)])
3188               enable_crypto=no])])
3189 AS_IF([test "x$enable_dist" != xno], [
3190         enable_crypto=yes
3191         enable_llcrypt=yes])
3192 AC_MSG_RESULT([$enable_crypto])
3193 ]) # LC_CONFIG_CRYPTO
3194
3195 #
3196 # LC_CONFIGURE
3197 #
3198 # other configure checks
3199 #
3200 AC_DEFUN([LC_CONFIGURE], [
3201 AC_MSG_NOTICE([Lustre core checks
3202 ==============================================================================])
3203
3204 AS_IF([test $target_cpu == "i686" -o $target_cpu == "x86_64"],
3205         [CFLAGS="$CFLAGS -Wall -Werror"])
3206
3207 # maximum MDS thread count
3208 LC_MDS_MAX_THREADS
3209
3210 # lustre/utils/gss/gss_util.c
3211 # lustre/utils/gss/gssd_proc.c
3212 # lustre/utils/gss/krb5_util.c
3213 # lustre/utils/llog_reader.c
3214 # lustre/utils/create_iam.c
3215 # lustre/utils/libiam.c
3216 AC_CHECK_HEADERS([netdb.h endian.h])
3217 AC_CHECK_FUNCS([gethostbyname])
3218
3219 # lustre/utils/llverfs.c lustre/utils/libmount_utils_ldiskfs.c
3220 AC_CHECK_HEADERS([ext2fs/ext2fs.h], [], [
3221         AS_IF([test "x$enable_utils" = xyes -a "x$enable_ldiskfs" = xyes], [
3222                 AC_MSG_ERROR([
3223 ext2fs.h not found. Please install e2fsprogs development package.
3224                 ])
3225         ])
3226 ])
3227
3228 # lustre/tests/statx_test.c
3229 AC_CHECK_FUNCS([statx])
3230
3231 # lustre/utils/lfs.c
3232 AS_IF([test "$enable_dist" = "no"], [
3233                 AC_CHECK_LIB([z], [crc32], [
3234                                  AC_CHECK_HEADER([zlib.h], [], [
3235                                                  AC_MSG_ERROR([zlib.h not found.])])
3236                                  ], [
3237                                  AC_MSG_ERROR([
3238                 zlib library not found. Please install zlib development package.])
3239                 ])
3240 ])
3241
3242 SELINUX=""
3243
3244 AC_CHECK_LIB([selinux], [is_selinux_enabled],
3245         [AC_CHECK_HEADERS([selinux/selinux.h],
3246                         [SELINUX="-lselinux"
3247                         AC_DEFINE([HAVE_SELINUX], 1,
3248                                 [support for selinux ])],
3249                         [AC_MSG_WARN([
3250
3251 No libselinux-devel package found, unable to build selinux enabled tools
3252 ])
3253 ])],
3254         [AC_MSG_WARN([
3255
3256 No selinux package found, unable to build selinux enabled tools
3257 ])
3258 ])
3259 AC_SUBST(SELINUX)
3260
3261 AC_CHECK_LIB([keyutils], [add_key])
3262
3263 # Super safe df
3264 AC_MSG_CHECKING([whether to report minimum OST free space])
3265 AC_ARG_ENABLE([mindf],
3266         AS_HELP_STRING([--enable-mindf],
3267                 [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
3268         [], [enable_mindf="no"])
3269 AC_MSG_RESULT([$enable_mindf])
3270 AS_IF([test "$enable_mindf" = "yes"],
3271         [AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])])
3272
3273 AC_MSG_CHECKING([whether to randomly failing memory alloc])
3274 AC_ARG_ENABLE([fail_alloc],
3275         AS_HELP_STRING([--disable-fail-alloc],
3276                 [disable randomly alloc failure]),
3277         [], [enable_fail_alloc="yes"])
3278 AC_MSG_RESULT([$enable_fail_alloc])
3279 AS_IF([test "x$enable_fail_alloc" != xno],
3280         [AC_DEFINE([RANDOM_FAIL_ALLOC], 1,
3281                 [enable randomly alloc failure])])
3282
3283 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
3284 AC_ARG_ENABLE([invariants],
3285         AS_HELP_STRING([--enable-invariants],
3286                 [enable invariant checking (cpu intensive)]),
3287         [], [enable_invariants="no"])
3288 AC_MSG_RESULT([$enable_invariants])
3289 AS_IF([test "x$enable_invariants" = xyes],
3290         [AC_DEFINE([CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK], 1,
3291                 [enable invariant checking])])
3292
3293 AC_MSG_CHECKING([whether to track references with lu_ref])
3294 AC_ARG_ENABLE([lu_ref],
3295         AS_HELP_STRING([--enable-lu_ref],
3296                 [enable lu_ref reference tracking code]),
3297         [], [enable_lu_ref="no"])
3298 AC_MSG_RESULT([$enable_lu_ref])
3299 AS_IF([test "x$enable_lu_ref" = xyes],
3300         [AC_DEFINE([CONFIG_LUSTRE_DEBUG_LU_REF], 1,
3301                 [enable lu_ref reference tracking code])])
3302
3303 AC_MSG_CHECKING([whether to enable page state tracking])
3304 AC_ARG_ENABLE([pgstate-track],
3305         AS_HELP_STRING([--enable-pgstate-track],
3306                 [enable page state tracking]),
3307         [], [enable_pgstat_track="no"])
3308 AC_MSG_RESULT([$enable_pgstat_track])
3309 AS_IF([test "x$enable_pgstat_track" = xyes],
3310         [AC_DEFINE([CONFIG_DEBUG_PAGESTATE_TRACKING], 1,
3311                 [enable page state tracking code])])
3312
3313 PKG_PROG_PKG_CONFIG
3314 AC_MSG_CHECKING([systemd unit file directory])
3315 AC_ARG_WITH([systemdsystemunitdir],
3316         [AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
3317                 [Directory for systemd service files])],
3318         [], [with_systemdsystemunitdir=auto])
3319 AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"],
3320         [def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
3321         AS_IF([test "x$def_systemdsystemunitdir" = "x"],
3322                 [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
3323                 [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
3324                 with_systemdsystemunitdir=no],
3325         [with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
3326 AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
3327         [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
3328 AC_MSG_RESULT([$with_systemdsystemunitdir])
3329
3330 AC_MSG_CHECKING([bash-completion directory])
3331 AC_ARG_WITH([bash-completion-dir],
3332         AS_HELP_STRING([--with-bash-completion-dir[=PATH]],
3333                 [Install the bash auto-completion script in this directory.]),
3334         [],
3335         [with_bash_completion_dir=yes])
3336 AS_IF([test "x$with_bash_completion_dir" = "xyes"], [
3337         BASH_COMPLETION_DIR="`pkg-config --variable=completionsdir bash-completion`"
3338         AS_IF([test "x$BASH_COMPLETION_DIR" = "x"], [
3339                 [BASH_COMPLETION_DIR="/usr/share/bash-completion/completions"]
3340         ])
3341 ], [
3342         BASH_COMPLETION_DIR="$with_bash_completion_dir"
3343 ])
3344 AC_SUBST([BASH_COMPLETION_DIR])
3345 AC_MSG_RESULT([$BASH_COMPLETION_DIR])
3346 ]) # LC_CONFIGURE
3347
3348 #
3349 # LC_CONDITIONALS
3350 #
3351 # AM_CONDITIONALS for lustre
3352 #
3353 AC_DEFUN([LC_CONDITIONALS], [
3354 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
3355 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
3356 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
3357 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
3358 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
3359 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
3360 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
3361 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
3362 AM_CONDITIONAL(GSS_SSK, test x$enable_ssk = xyes)
3363 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
3364 AM_CONDITIONAL(HAVE_SYSTEMD, test "x$with_systemdsystemunitdir" != "xno")
3365 AM_CONDITIONAL(ENABLE_BASH_COMPLETION, test "x$with_bash_completion_dir" != "xno")
3366 AM_CONDITIONAL(XATTR_HANDLER, test "x$lb_cv_compile_xattr_handler_flags" = xyes)
3367 AM_CONDITIONAL(SELINUX, test "$SELINUX" = "-lselinux")
3368 AM_CONDITIONAL(GETSEPOL, test x$enable_getsepol = xyes)
3369 AM_CONDITIONAL(LLCRYPT, test x$enable_llcrypt = xyes)
3370 AM_CONDITIONAL(LIBAIO, test x$enable_libaio = xyes)
3371 ]) # LC_CONDITIONALS
3372
3373 #
3374 # LC_CONFIG_FILES
3375 #
3376 # files that should be generated with AC_OUTPUT
3377 #
3378 AC_DEFUN([LC_CONFIG_FILES],
3379 [AC_CONFIG_FILES([
3380 lustre/Makefile
3381 lustre/autoMakefile
3382 lustre/autoconf/Makefile
3383 lustre/conf/Makefile
3384 lustre/conf/resource/Makefile
3385 lustre/contrib/Makefile
3386 lustre/doc/Makefile
3387 lustre/include/Makefile
3388 lustre/include/lustre/Makefile
3389 lustre/include/uapi/linux/lustre/Makefile
3390 lustre/kernel_patches/targets/5.14-rhel9.0.target
3391 lustre/kernel_patches/targets/4.18-rhel8.7.target
3392 lustre/kernel_patches/targets/4.18-rhel8.6.target
3393 lustre/kernel_patches/targets/4.18-rhel8.5.target
3394 lustre/kernel_patches/targets/4.18-rhel8.4.target
3395 lustre/kernel_patches/targets/4.18-rhel8.3.target
3396 lustre/kernel_patches/targets/4.18-rhel8.2.target
3397 lustre/kernel_patches/targets/4.18-rhel8.1.target
3398 lustre/kernel_patches/targets/4.18-rhel8.target
3399 lustre/kernel_patches/targets/3.10-rhel7.9.target
3400 lustre/kernel_patches/targets/3.10-rhel7.8.target
3401 lustre/kernel_patches/targets/3.10-rhel7.7.target
3402 lustre/kernel_patches/targets/3.10-rhel7.6.target
3403 lustre/kernel_patches/targets/3.10-rhel7.5.target
3404 lustre/kernel_patches/targets/4.14-rhel7.5.target
3405 lustre/kernel_patches/targets/4.14-rhel7.6.target
3406 lustre/kernel_patches/targets/4.12-sles12sp4.target
3407 lustre/kernel_patches/targets/4.12-sles12sp5.target
3408 lustre/kernel_patches/targets/4.12-sles15sp1.target
3409 lustre/kernel_patches/targets/5.3-sles15sp2.target
3410 lustre/kernel_patches/targets/5.3-sles15sp3.target
3411 lustre/kernel_patches/targets/5.14-sles15sp4.target
3412 lustre/kernel_patches/targets/3.x-fc18.target
3413 lustre/ldlm/Makefile
3414 lustre/ldlm/autoMakefile
3415 lustre/ec/autoMakefile
3416 lustre/ec/Makefile
3417 lustre/fid/Makefile
3418 lustre/fid/autoMakefile
3419 lustre/llite/Makefile
3420 lustre/llite/autoMakefile
3421 lustre/lov/Makefile
3422 lustre/lov/autoMakefile
3423 lustre/mdc/Makefile
3424 lustre/mdc/autoMakefile
3425 lustre/lmv/Makefile
3426 lustre/lmv/autoMakefile
3427 lustre/lfsck/Makefile
3428 lustre/lfsck/autoMakefile
3429 lustre/mdt/Makefile
3430 lustre/mdt/autoMakefile
3431 lustre/mdd/Makefile
3432 lustre/mdd/autoMakefile
3433 lustre/fld/Makefile
3434 lustre/fld/autoMakefile
3435 lustre/obdclass/Makefile
3436 lustre/obdclass/autoMakefile
3437 lustre/obdecho/Makefile
3438 lustre/obdecho/autoMakefile
3439 lustre/ofd/Makefile
3440 lustre/ofd/autoMakefile
3441 lustre/osc/Makefile
3442 lustre/osc/autoMakefile
3443 lustre/ost/Makefile
3444 lustre/ost/autoMakefile
3445 lustre/osd-ldiskfs/Makefile
3446 lustre/osd-ldiskfs/autoMakefile
3447 lustre/osd-zfs/Makefile
3448 lustre/osd-zfs/autoMakefile
3449 lustre/mgc/Makefile
3450 lustre/mgc/autoMakefile
3451 lustre/mgs/Makefile
3452 lustre/mgs/autoMakefile
3453 lustre/target/Makefile
3454 lustre/target/autoMakefile
3455 lustre/ptlrpc/Makefile
3456 lustre/ptlrpc/autoMakefile
3457 lustre/ptlrpc/gss/Makefile
3458 lustre/ptlrpc/gss/autoMakefile
3459 lustre/quota/Makefile
3460 lustre/quota/autoMakefile
3461 lustre/scripts/Makefile
3462 lustre/scripts/systemd/Makefile
3463 lustre/tests/Makefile
3464 lustre/tests/mpi/Makefile
3465 lustre/tests/iabf/Makefile
3466 lustre/tests/lutf/Makefile
3467 lustre/tests/lutf/src/Makefile
3468 lustre/tests/kernel/Makefile
3469 lustre/tests/kernel/autoMakefile
3470 lustre/utils/Makefile
3471 lustre/utils/gss/Makefile
3472 lustre/osp/Makefile
3473 lustre/osp/autoMakefile
3474 lustre/lod/Makefile
3475 lustre/lod/autoMakefile
3476 ])
3477 ]) # LC_CONFIG_FILES