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