Whamcloud - gitweb
358f102037633cd3e160000a0c0699996affb3cf
[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_PAGECACHE_GET_PAGE
1017 #
1018 # Kernel version 3.16 commit 2457aec63745e235bcafb7ef312b182d8682f0fc
1019 # @pagecache_get_page was introduced since Linux 3.16
1020 #
1021 AC_DEFUN([LC_SRC_PAGECACHE_GET_PAGE], [
1022         LB2_LINUX_TEST_SRC([pagecache_get_page], [
1023                 #include <linux/pagemap.h>
1024         ],[
1025                 pagecache_get_page(NULL, 0, 0, 0);
1026         ])
1027 ])
1028 AC_DEFUN([LC_PAGECACHE_GET_PAGE], [
1029         AC_MSG_CHECKING([if 'pagecache_get_page' exists])
1030         LB2_LINUX_TEST_RESULT([pagecache_get_page], [
1031                 AC_DEFINE(HAVE_PAGECACHE_GET_PAGE, 1,
1032                         ['pagecache_get_page' is available])
1033         ])
1034 ]) # LC_PAGECACHE_GET_PAGE
1035
1036 #
1037 # LC_HAVE_INTERVAL_BLK_INTEGRITY
1038 #
1039 # 3.17 replace sector_size with interval in struct blk_integrity
1040 #
1041 AC_DEFUN([LC_SRC_HAVE_INTERVAL_BLK_INTEGRITY], [
1042         LB2_LINUX_TEST_SRC([interval_blk_integrity], [
1043                 #include <linux/blkdev.h>
1044         ],[
1045                 ((struct blk_integrity *)0)->interval = 0;
1046         ])
1047 ])
1048 AC_DEFUN([LC_HAVE_INTERVAL_BLK_INTEGRITY], [
1049         AC_MSG_CHECKING([if 'blk_integrity.interval' exist])
1050         LB2_LINUX_TEST_RESULT([interval_blk_integrity], [
1051                 AC_DEFINE(HAVE_INTERVAL_BLK_INTEGRITY, 1,
1052                         [blk_integrity.interval exist])
1053         ])
1054 ]) # LC_HAVE_INTERVAL_BLK_INTEGRITY
1055
1056 #
1057 # LC_KEY_MATCH_DATA
1058 #
1059 # 3.17  replaces key_type::match with match_preparse
1060 #       and has new struct key_match_data
1061 #
1062 AC_DEFUN([LC_SRC_KEY_MATCH_DATA], [
1063         LB2_LINUX_TEST_SRC([key_match], [
1064                 #include <linux/key-type.h>
1065         ],[
1066                 struct key_match_data data;
1067
1068                 data.raw_data = NULL;
1069         ])
1070 ])
1071 AC_DEFUN([LC_KEY_MATCH_DATA], [
1072         AC_MSG_CHECKING([if struct key_match field exist])
1073         LB2_LINUX_TEST_RESULT([key_match], [
1074                 AC_DEFINE(HAVE_KEY_MATCH_DATA, 1, [struct key_match_data exist])
1075         ])
1076 ]) # LC_KEY_MATCH_DATA
1077
1078 #
1079 # LC_HAVE_BLK_INTEGRITY_ITER
1080 #
1081 # Linux commit v3.17-rc5-69-g1859308853b1 replaces
1082 # struct blk_integrity_exchg with struct blk_integrity_iter
1083 #
1084 # LB_CHECK_LINUX_HEADER has already run so we can rely on
1085 # HAVE_LINUX_BLK_INTEGRITY_HEADER being set correctly before
1086 # this test is run.
1087 #
1088 AC_DEFUN([LC_SRC_HAVE_BLK_INTEGRITY_ITER], [
1089         LB2_LINUX_TEST_SRC([blk_integrity_iter], [
1090                 #ifdef HAVE_LINUX_BLK_INTEGRITY_HEADER
1091                 # include <linux/blk-integrity.h>
1092                 #else
1093                 # include <linux/blkdev.h>
1094                 #endif
1095         ],[
1096                 struct blk_integrity_iter iter;
1097
1098                 iter.prot_buf = NULL;
1099         ])
1100 ])
1101 AC_DEFUN([LC_HAVE_BLK_INTEGRITY_ITER], [
1102         AC_MSG_CHECKING([if struct blk_integrity_iter exist])
1103         LB2_LINUX_TEST_RESULT([blk_integrity_iter], [
1104                 AC_DEFINE(HAVE_BLK_INTEGRITY_ITER, 1,
1105                         [kernel has struct blk_integrity_iter])
1106         ])
1107 ]) # LC_HAVE_BLK_INTEGRITY_ITER
1108
1109 #
1110 # LC_NFS_FILLDIR_USE_CTX
1111 #
1112 # 3.18 kernel moved from void cookie to struct dir_context
1113 #
1114 AC_DEFUN([LC_SRC_NFS_FILLDIR_USE_CTX], [
1115         LB2_LINUX_TEST_SRC([filldir_ctx], [
1116                 #include <linux/fs.h>
1117         ],[
1118                 int filldir(struct dir_context *ctx, const char* name,
1119                             int i, loff_t off, u64 tmp, unsigned temp)
1120                 {
1121                         return 0;
1122                 }
1123
1124                 struct dir_context ctx = {
1125                         .actor = filldir,
1126                 };
1127
1128                 ctx.actor(NULL, "test", 0, (loff_t) 0, 0, 0);
1129         ],[-Werror])
1130 ])
1131 AC_DEFUN([LC_NFS_FILLDIR_USE_CTX], [
1132         AC_MSG_CHECKING([if filldir_t uses struct dir_context])
1133         LB2_LINUX_TEST_RESULT([filldir_ctx], [
1134                 AC_DEFINE(HAVE_FILLDIR_USE_CTX, 1,
1135                         [filldir_t needs struct dir_context as argument])
1136         ])
1137 ]) # LC_NFS_FILLDIR_USE_CTX
1138
1139 #
1140 # LC_PERCPU_COUNTER_INIT
1141 #
1142 # 3.18  For kernels 3.18 and after percpu_counter_init starts
1143 #       to pass a GFP_* memory allocation flag for internal
1144 #       memory allocation purposes.
1145 #
1146 AC_DEFUN([LC_SRC_PERCPU_COUNTER_INIT], [
1147         LB2_LINUX_TEST_SRC([percpu_counter_init], [
1148                 #include <linux/percpu_counter.h>
1149         ],[
1150                 percpu_counter_init(NULL, 0, GFP_KERNEL);
1151         ])
1152 ])
1153 AC_DEFUN([LC_PERCPU_COUNTER_INIT], [
1154         AC_MSG_CHECKING([if percpu_counter_init uses GFP_* flag as argument])
1155         LB2_LINUX_TEST_RESULT([percpu_counter_init], [
1156                 AC_DEFINE(HAVE_PERCPU_COUNTER_INIT_GFP_FLAG, 1,
1157                         [percpu_counter_init uses GFP_* flag])
1158         ])
1159 ]) # LC_PERCPU_COUNTER_INIT
1160
1161 #
1162 # LC_KIOCB_HAS_NBYTES
1163 #
1164 # 3.19 kernel removed ki_nbytes from struct kiocb
1165 #
1166 AC_DEFUN([LC_SRC_KIOCB_HAS_NBYTES], [
1167         LB2_LINUX_TEST_SRC([ki_nbytes], [
1168                 #include <linux/fs.h>
1169         ],[
1170                 struct kiocb iocb = { };
1171
1172                 iocb.ki_nbytes = 0;
1173         ])
1174 ])
1175 AC_DEFUN([LC_KIOCB_HAS_NBYTES], [
1176         AC_MSG_CHECKING([if struct kiocb has ki_nbytes field])
1177         LB2_LINUX_TEST_RESULT([ki_nbytes], [
1178                 AC_DEFINE(HAVE_KI_NBYTES, 1, [ki_nbytes field exist])
1179         ])
1180 ]) # LC_KIOCB_HAS_NBYTES
1181
1182 #
1183 # LC_HAVE_DQUOT_QC_DQBLK
1184 #
1185 # 3.19 has quotactl_ops->[sg]et_dqblk that take struct kqid and qc_dqblk
1186 # Added in commit 14bf61ffe
1187 #
1188 AC_DEFUN([LC_SRC_HAVE_DQUOT_QC_DQBLK], [
1189         LB2_LINUX_TEST_SRC([qc_dqblk], [
1190                 #include <linux/fs.h>
1191                 #include <linux/quota.h>
1192         ],[
1193                 ((struct quotactl_ops *)0)->set_dqblk(NULL, *((struct kqid*)0), (struct qc_dqblk*)0);
1194         ],[-Werror])
1195 ])
1196 AC_DEFUN([LC_HAVE_DQUOT_QC_DQBLK], [
1197         AC_MSG_CHECKING([if 'quotactl_ops.set_dqblk' takes struct qc_dqblk])
1198         LB2_LINUX_TEST_RESULT([qc_dqblk], [
1199                 AC_DEFINE(HAVE_DQUOT_QC_DQBLK, 1,
1200                         [quotactl_ops.set_dqblk takes struct qc_dqblk])
1201                 AC_DEFINE(HAVE_DQUOT_KQID, 1,
1202                         [quotactl_ops.set_dqblk takes struct kqid])
1203         ])
1204 ]) # LC_HAVE_DQUOT_QC_DQBLK
1205
1206 #
1207 # LC_HAVE_AIO_COMPLETE
1208 #
1209 # 3.19 kernel makes aio_complete() static
1210 #
1211 AC_DEFUN([LC_SRC_HAVE_AIO_COMPLETE], [
1212         LB2_LINUX_TEST_SRC([aio_complete], [
1213                 #include <linux/aio.h>
1214         ],[
1215                 aio_complete(NULL, 0, 0);
1216         ])
1217 ])
1218 AC_DEFUN([LC_HAVE_AIO_COMPLETE], [
1219         AC_MSG_CHECKING([if kernel has exported aio_complete()])
1220         LB2_LINUX_TEST_RESULT([aio_complete], [
1221                 AC_DEFINE(HAVE_AIO_COMPLETE, 1, [aio_complete defined])
1222         ])
1223 ]) # LC_HAVE_AIO_COMPLETE
1224
1225 #
1226 # LC_HAVE_IS_ROOT_INODE
1227 #
1228 # 3.19 kernel adds is_root_inode()
1229 # Commit a7400222e3eb ("new helper: is_root_inode()")
1230 #
1231 AC_DEFUN([LC_SRC_HAVE_IS_ROOT_INODE], [
1232         LB2_LINUX_TEST_SRC([is_root_inode], [
1233                 #include <linux/fs.h>
1234         ],[
1235                 is_root_inode(NULL);
1236         ],[])
1237 ])
1238 AC_DEFUN([LC_HAVE_IS_ROOT_INODE], [
1239         AC_MSG_CHECKING([if kernel has is_root_inode()])
1240         LB2_LINUX_TEST_RESULT([is_root_inode], [
1241                 AC_DEFINE(HAVE_IS_ROOT_INODE, 1, [is_root_inode defined])
1242         ])
1243 ]) # LC_HAVE_IS_ROOT_INODE
1244
1245 #
1246 # LC_BACKING_DEV_INFO_REMOVAL
1247 #
1248 # 3.20 kernel removed backing_dev_info from address_space
1249 #
1250 AC_DEFUN([LC_SRC_BACKING_DEV_INFO_REMOVAL], [
1251         LB2_LINUX_TEST_SRC([backing_dev_info], [
1252                 #include <linux/fs.h>
1253         ],[
1254                 struct address_space mapping;
1255
1256                 mapping.backing_dev_info = NULL;
1257         ])
1258 ])
1259 AC_DEFUN([LC_BACKING_DEV_INFO_REMOVAL], [
1260         AC_MSG_CHECKING([if struct address_space has backing_dev_info])
1261         LB2_LINUX_TEST_RESULT([backing_dev_info], [
1262                 AC_DEFINE(HAVE_BACKING_DEV_INFO, 1, [backing_dev_info exist])
1263         ])
1264 ]) # LC_BACKING_DEV_INFO_REMOVAL
1265
1266 #
1267 # LC_HAVE_BDI_CAP_MAP_COPY
1268 #
1269 # 3.20  removed mmap handling for backing devices since
1270 #       it breaks on non-MMU systems. See kernel commit
1271 #       b4caecd48005fbed3949dde6c1cb233142fd69e9
1272 #
1273 AC_DEFUN([LC_SRC_HAVE_BDI_CAP_MAP_COPY], [
1274         LB2_LINUX_TEST_SRC([bdi_cap_map_copy], [
1275                 #include <linux/backing-dev.h>
1276         ],[
1277                 struct backing_dev_info info;
1278
1279                 info.capabilities = BDI_CAP_MAP_COPY;
1280         ])
1281 ]) # LC_HAVE_BDI_CAP_MAP_COPY
1282 AC_DEFUN([LC_HAVE_BDI_CAP_MAP_COPY], [
1283         AC_MSG_CHECKING([if have 'BDI_CAP_MAP_COPY'])
1284         LB2_LINUX_TEST_RESULT([bdi_cap_map_copy], [
1285                 AC_DEFINE(HAVE_BDI_CAP_MAP_COPY, 1,
1286                         [BDI_CAP_MAP_COPY exist])
1287         ])
1288 ]) # LC_HAVE_BDI_CAP_MAP_COPY
1289
1290 #
1291 # LC_HAVE_PROJECT_QUOTA
1292 #
1293 # Kernel version v4.0-rc1-197-g847aac644e92
1294 #
1295 AC_DEFUN([LC_SRC_HAVE_PROJECT_QUOTA], [
1296         LB2_LINUX_TEST_SRC([get_projid], [
1297                 struct inode;
1298                 #include <linux/quota.h>
1299         ],[
1300                 struct dquot_operations ops = { };
1301
1302                 ops.get_projid(NULL, NULL);
1303         ])
1304 ])
1305 AC_DEFUN([LC_HAVE_PROJECT_QUOTA], [
1306         AC_MSG_CHECKING([if get_projid exists])
1307         LB2_LINUX_TEST_RESULT([get_projid], [
1308                 AC_DEFINE(HAVE_PROJECT_QUOTA, 1,
1309                         [get_projid function exists])
1310         ])
1311 ]) # LC_HAVE_PROJECT_QUOTA
1312
1313 #
1314 # LC_IOV_ITER_RW
1315 #
1316 # 4.1 kernel has iov_iter_rw
1317 #
1318 AC_DEFUN([LC_SRC_IOV_ITER_RW], [
1319         LB2_LINUX_TEST_SRC([iov_iter_rw], [
1320                 #include <linux/fs.h>
1321                 #include <linux/uio.h>
1322         ],[
1323                 struct iov_iter *iter = NULL;
1324
1325                 iov_iter_rw(iter);
1326         ])
1327 ])
1328 AC_DEFUN([LC_IOV_ITER_RW], [
1329         AC_MSG_CHECKING([if iov_iter_rw exist])
1330         LB2_LINUX_TEST_RESULT([iov_iter_rw], [
1331                 AC_DEFINE(HAVE_IOV_ITER_RW, 1, [iov_iter_rw exist])
1332         ])
1333 ]) # LC_IOV_ITER_RW
1334
1335 #
1336 # LC_HAVE_SYNC_READ_WRITE
1337 #
1338 # 4.1 new_sync_[read|write] no longer exported
1339 #
1340 AC_DEFUN([LC_HAVE_SYNC_READ_WRITE], [
1341 LB_CHECK_EXPORT([new_sync_read], [fs/read_write.c],
1342         [AC_DEFINE(HAVE_SYNC_READ_WRITE, 1,
1343                         [new_sync_[read|write] is exported by the kernel])])
1344 ]) # LC_HAVE_SYNC_READ_WRITE
1345
1346 #
1347 # LC_HAVE___BI_CNT
1348 #
1349 # 4.1 redefined bi_cnt as __bi_cnt in commit dac56212e8127dbc0
1350 #
1351 AC_DEFUN([LC_SRC_HAVE___BI_CNT], [
1352         LB2_LINUX_TEST_SRC([have___bi_cnt], [
1353                 #include <asm/atomic.h>
1354                 #include <linux/bio.h>
1355                 #include <linux/blk_types.h>
1356         ],[
1357                 struct bio bio = { };
1358                 int cnt;
1359                 cnt = atomic_read(&bio.__bi_cnt);
1360         ])
1361 ])
1362 AC_DEFUN([LC_HAVE___BI_CNT], [
1363         AC_MSG_CHECKING([if Linux kernel has __bi_cnt in struct bio])
1364         LB2_LINUX_TEST_RESULT([have___bi_cnt], [
1365                 AC_DEFINE(HAVE___BI_CNT, 1, [struct bio has __bi_cnt])
1366         ])
1367 ]) # LC_HAVE___BI_CNT
1368
1369 #
1370 # LC_SYMLINK_OPS_USE_NAMEIDATA
1371 #
1372 # For the 4.2+ kernels the file system internal symlink api no
1373 # longer uses struct nameidata as a argument
1374 #
1375 AC_DEFUN([LC_SRC_SYMLINK_OPS_USE_NAMEIDATA], [
1376         LB2_LINUX_TEST_SRC([symlink_use_nameidata], [
1377                 #include <linux/namei.h>
1378                 #include <linux/fs.h>
1379         ],[
1380                 struct nameidata *nd = NULL;
1381
1382                 ((struct inode_operations *)0)->follow_link(NULL, nd);
1383                 ((struct inode_operations *)0)->put_link(NULL, nd, NULL);
1384         ])
1385 ])
1386 AC_DEFUN([LC_SYMLINK_OPS_USE_NAMEIDATA], [
1387         AC_MSG_CHECKING([if symlink inode operations have struct nameidata argument])
1388         LB2_LINUX_TEST_RESULT([symlink_use_nameidata], [
1389                 AC_DEFINE(HAVE_SYMLINK_OPS_USE_NAMEIDATA, 1,
1390                         [symlink inode operations need struct nameidata argument])
1391         ])
1392 ]) # LC_SYMLINK_OPS_USE_NAMEIDATA
1393
1394 #
1395 # LC_BIO_ENDIO_USES_ONE_ARG
1396 #
1397 # 4.2 kernel bio_endio now only takes one argument
1398 #
1399 AC_DEFUN([LC_SRC_BIO_ENDIO_USES_ONE_ARG], [
1400         LB2_LINUX_TEST_SRC([bio_endio], [
1401                 #include <linux/bio.h>
1402         ],[
1403                 bio_endio(NULL);
1404         ])
1405 ])
1406 AC_DEFUN([LC_BIO_ENDIO_USES_ONE_ARG], [
1407         AC_MSG_CHECKING([if 'bio_endio' with one argument exist])
1408         LB2_LINUX_TEST_RESULT([bio_endio], [
1409                 AC_DEFINE(HAVE_BIO_ENDIO_USES_ONE_ARG, 1,
1410                         [bio_endio takes only one argument])
1411         ])
1412 ]) # LC_BIO_ENDIO_USES_ONE_ARG
1413
1414 #
1415 # LC_ACCOUNT_PAGE_DIRTIED_3ARGS
1416 #
1417 # 4.2 [to 4.5] kernel page dirtied takes 3 arguments
1418 #
1419 AC_DEFUN([LC_SRC_ACCOUNT_PAGE_DIRTIED_3ARGS], [
1420         LB2_LINUX_TEST_SRC([account_page_dirtied_3a], [
1421                 #include <linux/mm.h>
1422         ],[
1423                 account_page_dirtied(NULL, NULL, NULL);
1424         ])
1425 ])
1426 AC_DEFUN([LC_ACCOUNT_PAGE_DIRTIED_3ARGS], [
1427         AC_MSG_CHECKING([if 'account_page_dirtied' with 3 args exists])
1428         LB2_LINUX_TEST_RESULT([account_page_dirtied_3a], [
1429                 AC_DEFINE(HAVE_ACCOUNT_PAGE_DIRTIED_3ARGS, 1,
1430                         [account_page_dirtied takes three arguments])
1431         ])
1432 ]) # LC_ACCOUNT_PAGE_DIRTIED_3ARGS
1433
1434 #
1435 # LC_HAVE_CRYPTO_ALLOC_SKCIPHER
1436 #
1437 # Kernel version 4.12 commit 7a7ffe65c8c5
1438 # introduced crypto_alloc_skcipher().
1439 #
1440 AC_DEFUN([LC_SRC_HAVE_CRYPTO_ALLOC_SKCIPHER], [
1441         LB2_LINUX_TEST_SRC([crypto_alloc_skcipher], [
1442                 #include <crypto/skcipher.h>
1443         ],[
1444                 crypto_alloc_skcipher(NULL, 0, 0);
1445         ])
1446 ])
1447 AC_DEFUN([LC_HAVE_CRYPTO_ALLOC_SKCIPHER], [
1448         AC_MSG_CHECKING([if crypto_alloc_skcipher is defined])
1449         LB2_LINUX_TEST_RESULT([crypto_alloc_skcipher], [
1450                 AC_DEFINE(HAVE_CRYPTO_ALLOC_SKCIPHER, 1,
1451                         [crypto_alloc_skcipher is defined])
1452         ])
1453 ]) # LC_HAVE_CRYPTO_ALLOC_SKCIPHER
1454
1455 #
1456 # LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
1457 #
1458 # 4.3 replace interval with interval_exp in 'struct blk_integrity'
1459 # 'struct blk_integrity_profile' is also added in this version,
1460 # thus use this to determine whether 'struct blk_integrity' has profile
1461 #
1462 AC_DEFUN([LC_SRC_HAVE_INTERVAL_EXP_BLK_INTEGRITY], [
1463         LB2_LINUX_TEST_SRC([blk_integrity_interval_exp], [
1464                 #include <linux/blkdev.h>
1465         ],[
1466                 ((struct blk_integrity *)0)->interval_exp = 0;
1467         ])
1468 ])
1469 AC_DEFUN([LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY], [
1470         AC_MSG_CHECKING([if 'blk_integrity.interval_exp' exist])
1471         LB2_LINUX_TEST_RESULT([blk_integrity_interval_exp], [
1472                 AC_DEFINE(HAVE_INTERVAL_EXP_BLK_INTEGRITY, 1,
1473                         [blk_integrity.interval_exp exist])
1474         ])
1475 ]) # LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
1476
1477 #
1478 # LC_HAVE_CACHE_HEAD_HLIST
1479 #
1480 # 4.3 kernel swiched to hlist for cache_head
1481 #
1482 AC_DEFUN([LC_SRC_HAVE_CACHE_HEAD_HLIST], [
1483         LB2_LINUX_TEST_SRC([cache_head_has_hlist], [
1484                 #include <linux/sunrpc/cache.h>
1485         ],[
1486                 do {} while(sizeof(((struct cache_head *)0)->cache_list));
1487         ])
1488 ])
1489 AC_DEFUN([LC_HAVE_CACHE_HEAD_HLIST], [
1490         AC_MSG_CHECKING([if 'struct cache_head' has 'cache_list' field])
1491         LB2_LINUX_TEST_RESULT([cache_head_has_hlist], [
1492                 AC_DEFINE(HAVE_CACHE_HEAD_HLIST, 1,
1493                         [cache_head has hlist cache_list])
1494         ])
1495 ]) # LC_HAVE_CACHE_HEAD_HLIST
1496
1497 #
1498 # LC_HAVE_XATTR_HANDLER_SIMPLIFIED
1499 #
1500 # Kernel version 4.3 commit e409de992e3ea3674393465f07cc71c948edd87a
1501 # simplified xattr_handler handling by passing in the handler pointer
1502 #
1503 AC_DEFUN([LC_SRC_HAVE_XATTR_HANDLER_SIMPLIFIED], [
1504         LB2_LINUX_TEST_SRC([xattr_handler_simplified], [
1505                 #include <linux/xattr.h>
1506         ],[
1507                 struct xattr_handler handler;
1508
1509                 ((struct xattr_handler *)0)->get(&handler, NULL, NULL, NULL, 0);
1510                 ((struct xattr_handler *)0)->set(&handler, NULL, NULL, NULL, 0, 0);
1511         ],[-Werror])
1512 ])
1513 AC_DEFUN([LC_HAVE_XATTR_HANDLER_SIMPLIFIED], [
1514         AC_MSG_CHECKING([if 'struct xattr_handler' functions pass in handler pointer])
1515         LB2_LINUX_TEST_RESULT([xattr_handler_simplified], [
1516                 AC_DEFINE(HAVE_XATTR_HANDLER_SIMPLIFIED, 1,
1517                         [handler pointer is parameter])
1518         ])
1519 ]) # LC_HAVE_XATTR_HANDLER_SIMPLIFIED
1520
1521 #
1522 # LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
1523 #
1524 # 4.3 replace interval with interval_exp in 'struct blk_integrity'.
1525 #
1526 AC_DEFUN([LC_SRC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD], [
1527         LB2_LINUX_TEST_SRC([bio_integrity_payload_bip_iter], [
1528                 #include <linux/bio.h>
1529         ],[
1530                 ((struct bio_integrity_payload *)0)->bip_iter.bi_size = 0;
1531         ])
1532 ])
1533 AC_DEFUN([LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD], [
1534         AC_MSG_CHECKING([if 'bio_integrity_payload.bip_iter' exist])
1535         LB2_LINUX_TEST_RESULT([bio_integrity_payload_bip_iter], [
1536                 AC_DEFINE(HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD, 1,
1537                         [bio_integrity_payload.bip_iter exist])
1538         ])
1539 ]) # LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
1540
1541 #
1542 # LC_BIO_INTEGRITY_PREP_FN
1543 #
1544 # Lustre kernel patch extents bio_integrity_prep to accept optional
1545 # generate/verify_fn as extra args.
1546 #
1547 AC_DEFUN([LC_SRC_BIO_INTEGRITY_PREP_FN], [
1548         LB2_LINUX_TEST_SRC([bio_integrity_prep_fn], [
1549                 #include <linux/bio.h>
1550         ],[
1551                 bio_integrity_prep_fn(NULL, NULL, NULL);
1552         ])
1553 ])
1554 AC_DEFUN([LC_BIO_INTEGRITY_PREP_FN], [
1555         AC_MSG_CHECKING([if 'bio_integrity_prep_fn' exists])
1556         LB2_LINUX_TEST_RESULT([bio_integrity_prep_fn], [
1557                 AC_DEFINE(HAVE_BIO_INTEGRITY_PREP_FN, 1,
1558                         [kernel has bio_integrity_prep_fn])
1559                 AC_SUBST(PATCHED_INTEGRITY_INTF)
1560         ],[
1561                 AC_SUBST(PATCHED_INTEGRITY_INTF, [#])
1562         ])
1563 ]) # LC_BIO_INTEGRITY_PREP_FN
1564
1565 # LC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL
1566 #
1567 # 13 kernel integrity API has changed and in 4.13+
1568 # (as well as in rhel 8.4) bio_integrity_prep() returns boolean true
1569 # on success.
1570 #
1571 AC_DEFUN([LC_SRC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL], [
1572         LB2_LINUX_TEST_SRC([bio_integrity_prep_ret_bool], [
1573                 #include <linux/bio.h>
1574                 #include <linux/typecheck.h>
1575         ],[
1576                 #pragma GCC diagnostic warning "-Werror"
1577                 typedef bool (*bio_integrity_prep_type)(struct bio *bio) ;
1578
1579                 typecheck_fn(bio_integrity_prep_type, bio_integrity_prep);
1580         ])
1581 ])
1582 AC_DEFUN([LC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL], [
1583         AC_MSG_CHECKING([if 'bio_integrity_prep_fn' returns bool])
1584         LB2_LINUX_TEST_RESULT([bio_integrity_prep_ret_bool], [
1585                 AC_DEFINE(HAVE_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL, 1,
1586                         [bio_integrity_prep_fn returns bool])
1587         ])
1588 ]) # LC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL
1589
1590 #
1591 # LC_HAVE_BI_OPF
1592 #
1593 # 4.4/4.8 redefined bi_rw as bi_opf (SLES12/kernel commit 4382e33ad37486)
1594 #
1595 AC_DEFUN([LC_SRC_HAVE_BI_OPF], [
1596         LB2_LINUX_TEST_SRC([have_bi_opf], [
1597                 #include <linux/bio.h>
1598         ],[
1599                 struct bio bio;
1600
1601                 bio.bi_opf = 0;
1602         ])
1603 ])
1604 AC_DEFUN([LC_HAVE_BI_OPF], [
1605         AC_MSG_CHECKING([if Linux kernel has bi_opf in struct bio])
1606         LB2_LINUX_TEST_RESULT([have_bi_opf], [
1607                 AC_DEFINE(HAVE_BI_OPF, 1, [struct bio has bi_opf])
1608         ])
1609 ]) # LC_HAVE_BI_OPF
1610
1611 #
1612 # LC_HAVE_SUBMIT_BIO_2ARGS
1613 #
1614 # 4.4 removed an argument from submit_bio
1615 #
1616 AC_DEFUN([LC_SRC_HAVE_SUBMIT_BIO_2ARGS], [
1617         LB2_LINUX_TEST_SRC([have_submit_bio_2args], [
1618                 #include <linux/bio.h>
1619         ],[
1620                 struct bio bio;
1621                 submit_bio(READ, &bio);
1622         ])
1623 ])
1624 AC_DEFUN([LC_HAVE_SUBMIT_BIO_2ARGS], [
1625         AC_MSG_CHECKING([if submit_bio takes two arguments])
1626         LB2_LINUX_TEST_RESULT([have_submit_bio_2args], [
1627                 AC_DEFINE(HAVE_SUBMIT_BIO_2ARGS, 1,
1628                         [submit_bio takes two arguments])
1629         ])
1630 ]) # LC_HAVE_SUBMIT_BIO_2_ARGS
1631
1632 #
1633 # LC_HAVE_CLEAN_BDEV_ALIASES
1634 #
1635 # 4.4/4.9 unmap_underlying_metadata was replaced by clean_bdev_aliases
1636 # (SLES12/kernel commit 29f3ad7d8380364c)
1637 #
1638 AC_DEFUN([LC_SRC_HAVE_CLEAN_BDEV_ALIASES], [
1639         LB2_LINUX_TEST_SRC([have_clean_bdev_aliases], [
1640                 #include <linux/buffer_head.h>
1641         ],[
1642                 clean_bdev_aliases(NULL,1,1);
1643         ])
1644 ])
1645 AC_DEFUN([LC_HAVE_CLEAN_BDEV_ALIASES], [
1646         AC_MSG_CHECKING([if kernel has clean_bdev_aliases])
1647         LB2_LINUX_TEST_RESULT([have_clean_bdev_aliases], [
1648                 AC_DEFINE(HAVE_CLEAN_BDEV_ALIASES, 1,
1649                         [kernel has clean_bdev_aliases])
1650         ])
1651 ]) # LC_HAVE_CLEAN_BDEV_ALIASES
1652
1653 #
1654 # LC_HAVE_LOCKS_LOCK_FILE_WAIT
1655 #
1656 # 4.4 kernel have moved locks API users to
1657 # locks_lock_inode_wait()
1658 #
1659 AC_DEFUN([LC_SRC_HAVE_LOCKS_LOCK_FILE_WAIT], [
1660         LB2_LINUX_TEST_SRC([locks_lock_file_wait], [
1661                 #include <linux/fs.h>
1662         ],[
1663                 locks_lock_file_wait(NULL, NULL);
1664         ])
1665 ])
1666 AC_DEFUN([LC_HAVE_LOCKS_LOCK_FILE_WAIT], [
1667         AC_MSG_CHECKING([if 'locks_lock_file_wait' exists])
1668         LB2_LINUX_TEST_RESULT([locks_lock_file_wait], [
1669                 AC_DEFINE(HAVE_LOCKS_LOCK_FILE_WAIT, 1,
1670                         [kernel has locks_lock_file_wait])
1671         ])
1672 ]) # LC_HAVE_LOCKS_LOCK_FILE_WAIT
1673
1674 #
1675 # LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
1676 #
1677 # 4.4 kernel merged type-specific data with the payload data for keys
1678 #
1679 AC_DEFUN([LC_SRC_HAVE_KEY_PAYLOAD_DATA_ARRAY], [
1680         LB2_LINUX_TEST_SRC([key_payload_data_array], [
1681                 #include <linux/key.h>
1682         ],[
1683                 struct key key = { };
1684
1685                 key.payload.data[0] = NULL;
1686         ])
1687 ])
1688 AC_DEFUN([LC_HAVE_KEY_PAYLOAD_DATA_ARRAY], [
1689         AC_MSG_CHECKING([if 'struct key' has 'payload.data' as an array])
1690         LB2_LINUX_TEST_RESULT([key_payload_data_array], [
1691                 AC_DEFINE(HAVE_KEY_PAYLOAD_DATA_ARRAY, 1, [payload.data is an array])
1692         ])
1693 ]) # LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
1694
1695 #
1696 # LC_HAVE_XATTR_HANDLER_NAME
1697 #
1698 # Kernel version 4.4 commit 98e9cb5711c68223f0e4d5201b9a6add255ec550
1699 # add a name member to struct xattr_handler
1700 #
1701 AC_DEFUN([LC_SRC_HAVE_XATTR_HANDLER_NAME], [
1702         LB2_LINUX_TEST_SRC([xattr_handler_name], [
1703                 #include <linux/xattr.h>
1704         ],[
1705                 ((struct xattr_handler *)NULL)->name = NULL;
1706         ],[-Werror])
1707 ])
1708 AC_DEFUN([LC_HAVE_XATTR_HANDLER_NAME], [
1709         AC_MSG_CHECKING([if 'struct xattr_handler' has a name member])
1710         LB2_LINUX_TEST_RESULT([xattr_handler_name], [
1711                 AC_DEFINE(HAVE_XATTR_HANDLER_NAME, 1,
1712                         [xattr_handler has a name member])
1713         ])
1714 ]) # LC_HAVE_XATTR_HANDLER_NAME
1715
1716 #
1717 # LC_HAVE_FILE_DENTRY
1718 #
1719 # 4.5 adds wrapper file_dentry
1720 #
1721 AC_DEFUN([LC_SRC_HAVE_FILE_DENTRY], [
1722         LB2_LINUX_TEST_SRC([file_dentry], [
1723                 #include <linux/fs.h>
1724         ],[
1725                 file_dentry(NULL);
1726         ])
1727 ])
1728 AC_DEFUN([LC_HAVE_FILE_DENTRY], [
1729         AC_MSG_CHECKING([if Linux kernel has 'file_dentry'])
1730         LB2_LINUX_TEST_RESULT([file_dentry], [
1731                 AC_DEFINE(HAVE_FILE_DENTRY, 1, [kernel has file_dentry])
1732         ])
1733 ]) # LC_HAVE_FILE_DENTRY
1734
1735 #
1736 # LC_HAVE_INODE_LOCK
1737 #
1738 # 4.5 introduced inode_lock
1739 #
1740 AC_DEFUN([LC_SRC_HAVE_INODE_LOCK], [
1741         LB2_LINUX_TEST_SRC([inode_lock], [
1742                 #include <linux/fs.h>
1743         ],[
1744                 inode_lock(NULL);
1745         ])
1746 ])
1747 AC_DEFUN([LC_HAVE_INODE_LOCK], [
1748         AC_MSG_CHECKING([if 'inode_lock' is defined])
1749         LB2_LINUX_TEST_RESULT([inode_lock], [
1750                 AC_DEFINE(HAVE_INODE_LOCK, 1, [inode_lock is defined])
1751         ])
1752 ]) # LC_HAVE_INODE_LOCK
1753
1754 #
1755 # LC_HAVE_IOP_GET_LINK
1756 #
1757 # 4.5 vfs replaced iop->follow_link with
1758 # iop->get_link
1759 #
1760 AC_DEFUN([LC_SRC_HAVE_IOP_GET_LINK], [
1761         LB2_LINUX_TEST_SRC([inode_ops_get_link], [
1762                 #include <linux/fs.h>
1763         ],[
1764                 struct inode_operations iop;
1765                 iop.get_link = NULL;
1766         ])
1767 ])
1768 AC_DEFUN([LC_HAVE_IOP_GET_LINK], [
1769         AC_MSG_CHECKING([if 'iop' has 'get_link'])
1770         LB2_LINUX_TEST_RESULT([inode_ops_get_link], [
1771                 AC_DEFINE(HAVE_IOP_GET_LINK, 1, [have iop get_link])
1772         ])
1773 ]) # LC_HAVE_IOP_GET_LINK
1774
1775 #
1776 # LC_HAVE_IN_COMPAT_SYSCALL
1777 #
1778 # 4.6 renamed is_compat_task to in_compat_syscall
1779 #
1780 AC_DEFUN([LC_SRC_HAVE_IN_COMPAT_SYSCALL], [
1781         LB2_LINUX_TEST_SRC([in_compat_syscall], [
1782                 #include <linux/compat.h>
1783         ],[
1784                 in_compat_syscall();
1785         ])
1786 ])
1787 AC_DEFUN([LC_HAVE_IN_COMPAT_SYSCALL], [
1788         AC_MSG_CHECKING([if 'in_compat_syscall' is defined])
1789         LB2_LINUX_TEST_RESULT([in_compat_syscall], [
1790                 AC_DEFINE(HAVE_IN_COMPAT_SYSCALL, 1, [have in_compat_syscall])
1791         ])
1792 ]) # LC_HAVE_IN_COMPAT_SYSCALL
1793
1794 #
1795 # LC_HAVE_XATTR_HANDLER_INODE_PARAM
1796 #
1797 # Kernel version 4.6 commit b296821a7c42fa58baa17513b2b7b30ae66f3336
1798 # and commit 5930122683dff58f0846b0f0405b4bd598a3ba6a added inode parameter
1799 # to xattr_handler functions
1800 #
1801 AC_DEFUN([LC_SRC_HAVE_XATTR_HANDLER_INODE_PARAM], [
1802         LB2_LINUX_TEST_SRC([xattr_handler_inode_param], [
1803                 #include <linux/xattr.h>
1804         ],[
1805                 const struct xattr_handler handler;
1806
1807                 ((struct xattr_handler *)0)->get(&handler, NULL, NULL, NULL, NULL, 0);
1808                 ((struct xattr_handler *)0)->set(&handler, NULL, NULL, NULL, NULL, 0, 0);
1809         ],[-Werror])
1810 ])
1811 AC_DEFUN([LC_HAVE_XATTR_HANDLER_INODE_PARAM], [
1812         AC_MSG_CHECKING([if 'struct xattr_handler' functions have inode parameter])
1813         LB2_LINUX_TEST_RESULT([xattr_handler_inode_param], [
1814                 AC_DEFINE(HAVE_XATTR_HANDLER_INODE_PARAM, 1, [needs inode parameter])
1815         ])
1816 ]) # LC_HAVE_XATTR_HANDLER_INODE_PARAM
1817
1818 #
1819 # LC_D_IN_LOOKUP
1820 #
1821 # Kernel version 4.6 commit 85c7f81041d57cfe9dc97f4680d5586b54534a39
1822 # introduced parallel lookups in the VFS layer. The inline function
1823 # d_in_lookup was added to notify when the same item was being queried
1824 # at the same time.
1825 #
1826 AC_DEFUN([LC_SRC_D_IN_LOOKUP], [
1827         LB2_LINUX_TEST_SRC([d_in_lookup], [
1828                 #include <linux/dcache.h>
1829         ],[
1830                 d_in_lookup(NULL);
1831         ],[-Werror])
1832 ])
1833 AC_DEFUN([LC_D_IN_LOOKUP], [
1834         AC_MSG_CHECKING([if 'd_in_lookup' is defined])
1835         LB2_LINUX_TEST_RESULT([d_in_lookup], [
1836                 AC_DEFINE(HAVE_D_IN_LOOKUP, 1, [d_in_lookup is defined])
1837         ])
1838 ]) # LC_D_IN_LOOKUP
1839
1840 #
1841 # LC_LOCK_PAGE_MEMCG
1842 #
1843 # Kernel version 4.6 adds lock_page_memcg(page)
1844 # Linux commit v5.15-12273-gab2f9d2d3626
1845 #   mm: unexport {,un}lock_page_memcg
1846 #
1847 AC_DEFUN([LC_SRC_LOCK_PAGE_MEMCG], [
1848         LB2_LINUX_TEST_SRC([lock_page_memcg], [
1849                 #include <linux/memcontrol.h>
1850         ],[
1851                 lock_page_memcg(NULL);
1852         ],[-Werror])
1853 ])
1854 AC_DEFUN([LC_LOCK_PAGE_MEMCG], [
1855         AC_MSG_CHECKING([if 'lock_page_memcg' is defined])
1856         LB2_LINUX_TEST_RESULT([lock_page_memcg], [
1857                 AC_DEFINE(HAVE_LOCK_PAGE_MEMCG, 1, [lock_page_memcg is defined])
1858         ])
1859 ]) # LC_LOCK_PAGE_MEMCG
1860
1861 #
1862 # LC_HAVE_DOWN_WRITE_KILLABLE
1863 #
1864 # Kernel version v4.6-rc3-28-g916633a40370
1865 #
1866 AC_DEFUN([LC_SRC_HAVE_DOWN_WRITE_KILLABLE], [
1867         LB2_LINUX_TEST_SRC([down_write_killable], [
1868                 #include <linux/rwsem.h>
1869
1870                 struct rw_semaphore sem;
1871         ],[
1872                 int rc;
1873
1874                 rc = down_write_killable(&sem);
1875                 (void)rc;
1876         ])
1877 ])
1878 AC_DEFUN([LC_HAVE_DOWN_WRITE_KILLABLE], [
1879         AC_MSG_CHECKING([if down_write_killable exists])
1880         LB2_LINUX_TEST_RESULT([down_write_killable], [
1881                 AC_DEFINE(HAVE_DOWN_WRITE_KILLABLE, 1,
1882                         [down_write_killable function exists])
1883         ])
1884 ]) # LC_HAVE_DOWN_WRITE_KILLABLE
1885
1886 #
1887 # LC_D_INIT
1888 #
1889 # Kernel version 4.7-rc5 commit 285b102d3b745f3c2c110c9c327741d87e64aacc
1890 # add new d_init to initialize dentry at allocation time
1891 #
1892 AC_DEFUN([LC_SRC_D_INIT], [
1893         LB2_LINUX_TEST_SRC([d_init], [
1894                 #include <linux/dcache.h>
1895         ],[
1896                 struct dentry_operations ops = { };
1897                 int rc;
1898
1899                 rc = ops.d_init(NULL);
1900         ])
1901 ])
1902 AC_DEFUN([LC_D_INIT], [
1903         AC_MSG_CHECKING([if dentry operations supports 'd_init'])
1904         LB2_LINUX_TEST_RESULT([d_init], [
1905                 AC_DEFINE(HAVE_D_INIT, 1, ['d_init' exists])
1906         ])
1907 ]) # LC_D_INIT
1908
1909 #
1910 # LC_DIRECTIO_2ARGS
1911 #
1912 # Kernel version 4.7 commit c8b8e32d700fe943a935e435ae251364d016c497
1913 # direct-io: eliminate the offset argument to ->direct_IO
1914 #
1915 AC_DEFUN([LC_SRC_DIRECTIO_2ARGS], [
1916         LB2_LINUX_TEST_SRC([direct_io_2args], [
1917                 #include <linux/fs.h>
1918         ],[
1919                 struct address_space_operations ops = { };
1920                 struct iov_iter *iter = NULL;
1921                 struct kiocb *iocb = NULL;
1922                 int rc;
1923
1924                 rc = ops.direct_IO(iocb, iter);
1925         ])
1926 ])
1927 AC_DEFUN([LC_DIRECTIO_2ARGS], [
1928         AC_MSG_CHECKING([if '->direct_IO()' takes 2 arguments])
1929         LB2_LINUX_TEST_RESULT([direct_io_2args], [
1930                 AC_DEFINE(HAVE_DIRECTIO_2ARGS, 1, [direct_IO has 2 arguments])
1931         ])
1932 ]) # LC_DIRECTIO_2ARGS
1933
1934 #
1935 # LC_GENERIC_WRITE_SYNC_2ARGS
1936 #
1937 # Kernel version 4.7 commit dde0c2e79848298cc25621ad080d47f94dbd7cce
1938 # fs: add IOCB_SYNC and IOCB_DSYNC
1939 #
1940 AC_DEFUN([LC_SRC_GENERIC_WRITE_SYNC_2ARGS], [
1941         LB2_LINUX_TEST_SRC([generic_write_sync_2args], [
1942                 #include <linux/fs.h>
1943         ],[
1944                 struct kiocb *iocb = NULL;
1945                 ssize_t rc;
1946
1947                 rc = generic_write_sync(iocb, 0);
1948         ])
1949 ])
1950 AC_DEFUN([LC_GENERIC_WRITE_SYNC_2ARGS], [
1951         AC_MSG_CHECKING([if 'generic_write_sync()' takes 2 arguments])
1952         LB2_LINUX_TEST_RESULT([generic_write_sync_2args], [
1953                 AC_DEFINE(HAVE_GENERIC_WRITE_SYNC_2ARGS, 1,
1954                         [generic_write_sync has 2 arguments])
1955         ])
1956 ]) # LC_GENERIC_WRITE_SYNC_2ARGS
1957
1958 #
1959 # LC_FOP_ITERATE_SHARED
1960 #
1961 # Kernel v4.6-rc3-29-g6192269 adds iterate_shared method to file_operations
1962 #
1963 AC_DEFUN([LC_SRC_FOP_ITERATE_SHARED], [
1964         LB2_LINUX_TEST_SRC([fop_iterate_shared], [
1965                 #include <linux/fs.h>
1966         ],[
1967                 struct file_operations fop;
1968                 fop.iterate_shared = NULL;
1969         ])
1970 ])
1971 AC_DEFUN([LC_FOP_ITERATE_SHARED], [
1972         AC_MSG_CHECKING([if 'file_operations' has 'iterate_shared'])
1973         LB2_LINUX_TEST_RESULT([fop_iterate_shared], [
1974                 AC_DEFINE(HAVE_FOP_ITERATE_SHARED, 1,
1975                         [file_operations has iterate_shared])
1976         ])
1977 ]) # LC_FOP_ITERATE_SHARED
1978
1979 #
1980 # LC_EXPORT_DEFAULT_FILE_SPLICE_READ
1981 #
1982 # 4.8-rc8 commit 82c156f853840645604acd7c2cebcb75ed1b6652 switched
1983 # generic_file_splice_read() to using ->read_iter. We can test this
1984 # change since default_file_splice_read() is no longer exported.
1985 #
1986 AC_DEFUN([LC_EXPORT_DEFAULT_FILE_SPLICE_READ], [
1987 LB_CHECK_EXPORT([default_file_splice_read], [fs/splice.c],
1988         [AC_DEFINE(HAVE_DEFAULT_FILE_SPLICE_READ_EXPORT, 1,
1989                         [default_file_splice_read is exported])])
1990 ]) # LC_EXPORT_DEFAULT_FILE_SPLCE_READ
1991
1992 #
1993 # LC_HAVE_POSIX_ACL_VALID_USER_NS
1994 #
1995 # 4.8 posix_acl_valid takes struct user_namespace
1996 #
1997 AC_DEFUN([LC_SRC_HAVE_POSIX_ACL_VALID_USER_NS], [
1998         LB2_LINUX_TEST_SRC([posix_acl_valid], [
1999                 #include <linux/fs.h>
2000                 #include <linux/posix_acl.h>
2001         ],[
2002                 posix_acl_valid((struct user_namespace*)NULL, (const struct posix_acl*)NULL);
2003         ])
2004 ])
2005 AC_DEFUN([LC_HAVE_POSIX_ACL_VALID_USER_NS], [
2006         AC_MSG_CHECKING([if 'posix_acl_valid' takes 'struct user_namespace'])
2007         LB2_LINUX_TEST_RESULT([posix_acl_valid], [
2008                 AC_DEFINE(HAVE_POSIX_ACL_VALID_USER_NS, 1,
2009                         [posix_acl_valid takes struct user_namespace])
2010         ])
2011 ]) # LC_HAVE_POSIX_ACL_VALID_USER_NS
2012
2013 #
2014 # LC_D_COMPARE_4ARGS
2015 #
2016 # Kernel version 4.8 commit 6fa67e707559303e086303aeecc9e8b91ef497d5
2017 # get rid of 'parent' argument of ->d_compare()
2018 #
2019 AC_DEFUN([LC_SRC_D_COMPARE_4ARGS], [
2020         LB2_LINUX_TEST_SRC([d_compare_4args], [
2021                 #include <linux/dcache.h>
2022         ],[
2023                 ((struct dentry_operations*)0)->d_compare(NULL,0,NULL,NULL);
2024         ])
2025 ])
2026 AC_DEFUN([LC_D_COMPARE_4ARGS], [
2027         AC_MSG_CHECKING([if 'd_compare' taken 4 arguments])
2028         LB2_LINUX_TEST_RESULT([d_compare_4args], [
2029                 AC_DEFINE(HAVE_D_COMPARE_4ARGS, 1,
2030                         [d_compare need 4 arguments])
2031         ])
2032 ]) # LC_D_COMPARE_4ARGS
2033
2034 #
2035 # LC_FULL_NAME_HASH_3ARGS
2036 #
2037 # Kernel version 4.8 commit 8387ff2577eb9ed245df9a39947f66976c6bcd02
2038 # vfs: make the string hashes salt the hash
2039 #
2040 AC_DEFUN([LC_SRC_FULL_NAME_HASH_3ARGS], [
2041         LB2_LINUX_TEST_SRC([full_name_hash_3args], [
2042                 #include <linux/stringhash.h>
2043         ],[
2044                 unsigned int hash;
2045                 hash = full_name_hash(NULL,NULL,0);
2046         ])
2047 ])
2048 AC_DEFUN([LC_FULL_NAME_HASH_3ARGS], [
2049         AC_MSG_CHECKING([if 'full_name_hash' taken 3 arguments])
2050         LB2_LINUX_TEST_RESULT([full_name_hash_3args], [
2051                 AC_DEFINE(HAVE_FULL_NAME_HASH_3ARGS, 1,
2052                         [full_name_hash need 3 arguments])
2053         ])
2054 ]) # LC_FULL_NAME_HASH_3ARGS
2055
2056 #
2057 # LC_STRUCT_POSIX_ACL_XATTR
2058 #
2059 # Kernel version 4.8 commit 2211d5ba5c6c4e972ba6dbc912b2897425ea6621
2060 # posix_acl: xattr representation cleanups
2061 #
2062 AC_DEFUN([LC_SRC_STRUCT_POSIX_ACL_XATTR], [
2063         LB2_LINUX_TEST_SRC([struct_posix_acl_xattr], [
2064                 #include <linux/fs.h>
2065                 #include <linux/posix_acl_xattr.h>
2066         ],[
2067                 struct posix_acl_xattr_header *h = NULL;
2068                 struct posix_acl_xattr_entry  *e;
2069                 e = (void *)(h + 1);
2070         ])
2071 ])
2072 AC_DEFUN([LC_STRUCT_POSIX_ACL_XATTR], [
2073         AC_MSG_CHECKING([if 'struct posix_acl_xattr_{header,entry}' defined])
2074         LB2_LINUX_TEST_RESULT([struct_posix_acl_xattr], [
2075                 AC_DEFINE(HAVE_STRUCT_POSIX_ACL_XATTR, 1,
2076                         [struct posix_acl_xattr_{header,entry} defined])
2077         ])
2078 ]) # LC_STRUCT_POSIX_ACL_XATTR
2079
2080 #
2081 # LC_IOP_XATTR
2082 #
2083 # Kernel version 4.8 commit fd50ecaddf8372a1d96e0daeaac0f93cf04e4d42
2084 # removed {get,set,remove}xattr inode operations
2085 #
2086 AC_DEFUN([LC_SRC_IOP_XATTR], [
2087         LB2_LINUX_TEST_SRC([inode_ops_xattr], [
2088                 #include <linux/fs.h>
2089         ],[
2090                 struct inode_operations iop;
2091                 iop.setxattr = NULL;
2092                 iop.getxattr = NULL;
2093                 iop.removexattr = NULL;
2094         ])
2095 ])
2096 AC_DEFUN([LC_IOP_XATTR], [
2097         AC_MSG_CHECKING([if 'inode_operations' has {get,set,remove}xattr members])
2098         LB2_LINUX_TEST_RESULT([inode_ops_xattr], [
2099                 AC_DEFINE(HAVE_IOP_XATTR, 1,
2100                         [inode_operations has {get,set,remove}xattr members])
2101         ])
2102 ]) # LC_IOP_XATTR
2103
2104 #
2105 # LC_GROUP_INFO_GID
2106 #
2107 # Kernel version 4.9 commit 81243eacfa400f5f7b89f4c2323d0de9982bb0fb
2108 # cred: simpler, 1D supplementary groups
2109 #
2110 AC_DEFUN([LC_SRC_GROUP_INFO_GID], [
2111         LB2_LINUX_TEST_SRC([group_info_gid], [
2112                 #include <linux/cred.h>
2113         ],[
2114                 kgid_t *p;
2115                 p = ((struct group_info *)0)->gid;
2116         ])
2117 ])
2118 AC_DEFUN([LC_GROUP_INFO_GID], [
2119         AC_MSG_CHECKING([if 'struct group_info' has member 'gid'])
2120         LB2_LINUX_TEST_RESULT([group_info_gid], [
2121                 AC_DEFINE(HAVE_GROUP_INFO_GID, 1,
2122                         [struct group_info has member gid])
2123         ])
2124 ]) # LC_GROUP_INFO_GID
2125
2126 #
2127 # LC_VFS_SETXATTR
2128 #
2129 # Kernel version 4.9 commit 5d6c31910bc0713e37628dc0ce677dcb13c8ccf4
2130 # added __vfs_{get,set,remove}xattr helpers
2131 #
2132 AC_DEFUN([LC_SRC_VFS_SETXATTR], [
2133         LB2_LINUX_TEST_SRC([vfs_setxattr], [
2134                 #include <linux/xattr.h>
2135         ],[
2136                 __vfs_setxattr(NULL, NULL, NULL, NULL, 0, 0);
2137         ])
2138 ])
2139 AC_DEFUN([LC_VFS_SETXATTR], [
2140         AC_MSG_CHECKING([if '__vfs_setxattr' helper is available])
2141         LB2_LINUX_TEST_RESULT([vfs_setxattr], [
2142                 AC_DEFINE(HAVE_VFS_SETXATTR, 1, ['__vfs_setxattr' is available])
2143         ])
2144 ]) # LC_VFS_SETXATTR
2145
2146 #
2147 # LC_POSIX_ACL_UPDATE_MODE
2148 #
2149 # Kernel version 4.9 commit 073931017b49d9458aa351605b43a7e34598caef
2150 # posix_acl: Clear SGID bit when setting file permissions
2151 #
2152 AC_DEFUN([LC_SRC_POSIX_ACL_UPDATE_MODE], [
2153         LB2_LINUX_TEST_SRC([posix_acl_update_mode], [
2154                 #include <linux/fs.h>
2155                 #include <linux/posix_acl.h>
2156         ],[
2157                 posix_acl_update_mode(NULL, NULL, NULL);
2158         ])
2159 ])
2160 AC_DEFUN([LC_POSIX_ACL_UPDATE_MODE], [
2161         AC_MSG_CHECKING([if 'posix_acl_update_mode' exists])
2162         LB2_LINUX_TEST_RESULT([posix_acl_update_mode], [
2163                 AC_DEFINE(HAVE_POSIX_ACL_UPDATE_MODE, 1,
2164                         ['posix_acl_update_mode' is available])
2165         ])
2166 ]) # LC_POSIX_ACL_UPDATE_MODE
2167
2168 #
2169 # LC_HAVE_BDI_IO_PAGES
2170 #
2171 # Kernel version 4.9 commit 9491ae4aade6814afcfa67f4eb3e3342c2b39750
2172 # mm: don't cap request size based on read-ahead setting
2173 # This patch introduces a bdi hint, io_pages.
2174 #
2175 AC_DEFUN([LC_SRC_HAVE_BDI_IO_PAGES], [
2176         LB2_LINUX_TEST_SRC([bdi_has_io_pages], [
2177                 #include <linux/backing-dev.h>
2178         ],[
2179                 struct backing_dev_info info;
2180
2181                 info.io_pages = 0;
2182         ])
2183 ])
2184 AC_DEFUN([LC_HAVE_BDI_IO_PAGES], [
2185         AC_MSG_CHECKING([if 'struct backing_dev_info' has 'io_pages' field])
2186         LB2_LINUX_TEST_RESULT([bdi_has_io_pages], [
2187                 AC_DEFINE(HAVE_BDI_IO_PAGES, 1,
2188                         [backing_dev_info has io_pages])
2189         ])
2190 ]) # LC_HAVE_BDI_IO_PAGES
2191
2192 #
2193 # LC_IOP_GENERIC_READLINK
2194 #
2195 # Kernel version 4.10 commit dfeef68862edd7d4bafe68ef7aeb5f658ef24bb5
2196 # removed generic_readlink from individual file systems
2197 #
2198 AC_DEFUN([LC_SRC_IOP_GENERIC_READLINK], [
2199         LB2_LINUX_TEST_SRC([inode_ops_readlink], [
2200                 #include <linux/fs.h>
2201         ],[
2202                 struct inode_operations iop;
2203                 iop.readlink = generic_readlink;
2204         ])
2205 ])
2206 AC_DEFUN([LC_IOP_GENERIC_READLINK], [
2207         AC_MSG_CHECKING([if 'generic_readlink' still exist])
2208         LB2_LINUX_TEST_RESULT([inode_ops_readlink], [
2209                 AC_DEFINE(HAVE_IOP_GENERIC_READLINK, 1,
2210                         [generic_readlink has been removed])
2211         ])
2212 ]) # LC_IOP_GENERIC_READLINK
2213
2214 #
2215 # LC_HAVE_VM_FAULT_ADDRESS
2216 #
2217 # Kernel version 4.10 commit 1a29d85eb0f19b7d8271923d8917d7b4f5540b3e
2218 # removed virtual_address field. Need to use address field instead
2219 #
2220 AC_DEFUN([LC_SRC_HAVE_VM_FAULT_ADDRESS], [
2221         LB2_LINUX_TEST_SRC([vm_fault_address], [
2222                 #include <linux/mm.h>
2223         ],[
2224                 struct vm_fault vmf = { 0 };
2225                 unsigned long addr = (unsigned long)vmf.address;
2226                 (void)addr;
2227         ])
2228 ])
2229 AC_DEFUN([LC_HAVE_VM_FAULT_ADDRESS], [
2230         AC_MSG_CHECKING([if 'struct vm_fault' replaced virtual_address with address field])
2231         LB2_LINUX_TEST_RESULT([vm_fault_address], [
2232                 AC_DEFINE(HAVE_VM_FAULT_ADDRESS, 1,
2233                         [virtual_address has been replaced by address field])
2234         ])
2235 ]) # LC_HAVE_VM_FAULT_ADDRESS
2236
2237 #
2238 # LC_INODEOPS_ENHANCED_GETATTR
2239 #
2240 # Kernel version 4.11 commit a528d35e8bfcc521d7cb70aaf03e1bd296c8493f
2241 # expanded getattr to be able to get more stat information.
2242 #
2243 AC_DEFUN([LC_SRC_INODEOPS_ENHANCED_GETATTR], [
2244         LB2_LINUX_TEST_SRC([getattr_path], [
2245                 #include <linux/fs.h>
2246         ],[
2247                 struct path path;
2248
2249                 ((struct inode_operations *)1)->getattr(&path, NULL, 0, 0);
2250         ])
2251 ])
2252 AC_DEFUN([LC_INODEOPS_ENHANCED_GETATTR], [
2253         AC_MSG_CHECKING([if 'inode_operations' getattr member can gather advance stats])
2254         LB2_LINUX_TEST_RESULT([getattr_path], [
2255                 AC_DEFINE(HAVE_INODEOPS_ENHANCED_GETATTR, 1,
2256                         [inode_operations .getattr member function can gather advance stats])
2257         ])
2258 ]) # LC_INODEOPS_ENHANCED_GETATTR
2259
2260 #
2261 # LC_VM_OPERATIONS_REMOVE_VMF_ARG
2262 #
2263 # Kernel version 4.11 commit 11bac80004499ea59f361ef2a5516c84b6eab675
2264 # removed struct vm_area_struct as an argument for vm_operations since
2265 # in the same kernel version struct vma_area_struct was folded into
2266 # struct vm_fault.
2267 #
2268 AC_DEFUN([LC_SRC_VM_OPERATIONS_REMOVE_VMF_ARG], [
2269         LB2_LINUX_TEST_SRC([vm_operations_no_vm_area_struct], [
2270                 #include <linux/mm.h>
2271         ],[
2272                 struct vm_fault vmf;
2273
2274                 ((struct vm_operations_struct *)0)->fault(&vmf);
2275                 ((struct vm_operations_struct *)0)->page_mkwrite(&vmf);
2276         ])
2277 ])
2278 AC_DEFUN([LC_VM_OPERATIONS_REMOVE_VMF_ARG], [
2279         AC_MSG_CHECKING([if 'struct vm_operations' removed struct vm_area_struct])
2280         LB2_LINUX_TEST_RESULT([vm_operations_no_vm_area_struct], [
2281                 AC_DEFINE(HAVE_VM_OPS_USE_VM_FAULT_ONLY, 1,
2282                         ['struct vm_operations' remove struct vm_area_struct argument])
2283         ])
2284 ]) # LC_VM_OPERATIONS_REMOVE_VMF_ARG
2285
2286 #
2287 # LC_HAVE_KEY_USAGE_REFCOUNT
2288 #
2289 # Kernel version 4.11 commit fff292914d3a2f1efd05ca71c2ba72a3c663201e
2290 # converted key.usage from atomic_t to refcount_t.
2291 #
2292 AC_DEFUN([LC_SRC_HAVE_KEY_USAGE_REFCOUNT], [
2293         LB2_LINUX_TEST_SRC([key_usage_refcount], [
2294                 #include <linux/key.h>
2295         ],[
2296                 struct key key = { };
2297
2298                 refcount_read(&key.usage);
2299         ])
2300 ])
2301 AC_DEFUN([LC_HAVE_KEY_USAGE_REFCOUNT], [
2302         AC_MSG_CHECKING([if 'key.usage' is refcount_t])
2303         LB2_LINUX_TEST_RESULT([key_usage_refcount], [
2304                 AC_DEFINE(HAVE_KEY_USAGE_REFCOUNT, 1,
2305                         [key.usage is of type refcount_t])
2306         ])
2307 ]) #LC_HAVE_KEY_USAGE_REFCOUNT
2308
2309 #
2310 # LC_HAVE_CRYPTO_MAX_ALG_NAME_128
2311 #
2312 # Kernel version 4.11 commit f437a3f477cce402dbec6537b29e9e33962c9f73
2313 # switched CRYPTO_MAX_ALG_NAME from 64 to 128.
2314 #
2315 AC_DEFUN([LC_SRC_HAVE_CRYPTO_MAX_ALG_NAME_128], [
2316         LB2_LINUX_TEST_SRC([crypto_max_alg_name], [
2317                 #include <linux/crypto.h>
2318         ],[
2319                 #if CRYPTO_MAX_ALG_NAME != 128
2320                 exit(1);
2321                 #endif
2322         ])
2323 ])
2324 AC_DEFUN([LC_HAVE_CRYPTO_MAX_ALG_NAME_128], [
2325         AC_MSG_CHECKING([if 'CRYPTO_MAX_ALG_NAME' is 128])
2326         LB2_LINUX_TEST_RESULT([crypto_max_alg_name], [
2327                 AC_DEFINE(HAVE_CRYPTO_MAX_ALG_NAME_128, 1,
2328                         ['CRYPTO_MAX_ALG_NAME' is 128])
2329         ])
2330 ]) # LC_HAVE_CRYPTO_MAX_ALG_NAME_128
2331
2332 #
2333 # Kernel version 4.12 commit 47f38c539e9a42344ff5a664942075bd4df93876
2334 # CURRENT_TIME is not 64 bit time safe so it was replaced with
2335 # current_time()
2336 #
2337 AC_DEFUN([LC_SRC_CURRENT_TIME], [
2338         LB2_LINUX_TEST_SRC([current_time], [
2339                 #include <linux/fs.h>
2340         ],[
2341                 struct iattr attr;
2342
2343                 attr.ia_atime = current_time(NULL);
2344         ])
2345 ])
2346 AC_DEFUN([LC_CURRENT_TIME], [
2347         AC_MSG_CHECKING([if CURRENT_TIME has been replaced with current_time])
2348         LB2_LINUX_TEST_RESULT([current_time], [
2349                 AC_DEFINE(HAVE_CURRENT_TIME, 1,
2350                         [current_time() has replaced CURRENT_TIME])
2351         ])
2352 ]) # LC_CURRENT_TIME
2353
2354 #
2355 # LC_HAVE_GET_INODE_USAGE
2356 #
2357 # Kernel version v4.12-rc2-43-g7a9ca53aea10
2358 #
2359 AC_DEFUN([LC_SRC_HAVE_GET_INODE_USAGE], [
2360         LB2_LINUX_TEST_SRC([get_inode_usage], [
2361                 struct inode;
2362                 #include <linux/quota.h>
2363         ],[
2364                 struct dquot_operations ops = { };
2365
2366                 ops.get_inode_usage(NULL, NULL);
2367         ])
2368 ])
2369 AC_DEFUN([LC_HAVE_GET_INODE_USAGE], [
2370         AC_MSG_CHECKING([if get_inode_usage exists])
2371         LB2_LINUX_TEST_RESULT([get_inode_usage], [
2372                 AC_DEFINE(HAVE_GET_INODE_USAGE, 1,
2373                         [get_inode_usage function exists])
2374         ])
2375 ]) # LC_HAVE_GET_INODE_USAGE
2376
2377 #
2378 # LC_SUPER_SETUP_BDI_NAME
2379 #
2380 # Kernel version 4.12 commit 9594caf216dc0fe3e318b34af0127276db661241
2381 # unified bdi handling
2382 #
2383 AC_DEFUN([LC_SRC_SUPER_SETUP_BDI_NAME], [
2384         LB2_LINUX_TEST_SRC([super_setup_bdi_name], [
2385                 #include <linux/fs.h>
2386         ],[
2387                 super_setup_bdi_name(NULL, "lustre");
2388         ])
2389 ])
2390 AC_DEFUN([LC_SUPER_SETUP_BDI_NAME], [
2391         AC_MSG_CHECKING([if 'super_setup_bdi_name' exist])
2392         LB2_LINUX_TEST_RESULT([super_setup_bdi_name], [
2393                 AC_DEFINE(HAVE_SUPER_SETUP_BDI_NAME, 1,
2394                         ['super_setup_bdi_name' is available])
2395         ])
2396 ]) # LC_SUPER_SETUP_BDI_NAME
2397
2398 #
2399 # LC_BI_STATUS
2400 #
2401 # 4.12 replace bi_error to bi_status
2402 #
2403 AC_DEFUN([LC_SRC_BI_STATUS], [
2404         LB2_LINUX_TEST_SRC([bi_status], [
2405                 #include <linux/blk_types.h>
2406         ],[
2407                 ((struct bio *)0)->bi_status = 0;
2408         ])
2409 ])
2410 AC_DEFUN([LC_BI_STATUS], [
2411         AC_MSG_CHECKING([if 'bi_status' exist])
2412         LB2_LINUX_TEST_RESULT([bi_status], [
2413                 AC_DEFINE(HAVE_BI_STATUS, 1, ['bi_status' is available])
2414         ])
2415 ]) # LC_BI_STATUS
2416
2417 #
2418 # LC_BIO_INTEGRITY_ENABLED
2419 #
2420 # 4.13 removed bio_integrity_enabled
2421 #
2422 AC_DEFUN([LC_SRC_BIO_INTEGRITY_ENABLED], [
2423         LB2_LINUX_TEST_SRC([bio_integrity_enabled], [
2424                 #include <linux/bio.h>
2425         ],[
2426                 bio_integrity_enabled(NULL);
2427         ])
2428 ])
2429 AC_DEFUN([LC_BIO_INTEGRITY_ENABLED], [
2430         AC_MSG_CHECKING([if 'bio_integrity_enabled' exist])
2431         LB2_LINUX_TEST_RESULT([bio_integrity_enabled], [
2432                 AC_DEFINE(HAVE_BIO_INTEGRITY_ENABLED, 1,
2433                         ['bio_integrity_enabled' is available])
2434         ])
2435 ]) # LC_BIO_INTEGRITY_ENABLED
2436
2437 #
2438 # LC_PAGEVEC_INIT_ONE_PARAM
2439 #
2440 # 4.14 pagevec_init takes one parameter
2441 #
2442 AC_DEFUN([LC_SRC_PAGEVEC_INIT_ONE_PARAM], [
2443         LB2_LINUX_TEST_SRC([pagevec_init], [
2444                 #include <linux/pagevec.h>
2445         ],[
2446                 pagevec_init(NULL);
2447         ])
2448 ])
2449 AC_DEFUN([LC_PAGEVEC_INIT_ONE_PARAM], [
2450         AC_MSG_CHECKING([if 'pagevec_init' takes one parameter])
2451         LB2_LINUX_TEST_RESULT([pagevec_init], [
2452                 AC_DEFINE(HAVE_PAGEVEC_INIT_ONE_PARAM, 1,
2453                         ['pagevec_init' takes one parameter])
2454         ])
2455 ]) # LC_PAGEVEC_INIT_ONE_PARAM
2456
2457 #
2458 # LC_BI_BDEV
2459 #
2460 # 4.14 replaced bi_bdev to bi_disk
2461 #
2462 AC_DEFUN([LC_SRC_BI_BDEV], [
2463         LB2_LINUX_TEST_SRC([bi_bdev], [
2464                 #include <linux/bio.h>
2465         ],[
2466                 ((struct bio *)0)->bi_bdev = NULL;
2467         ])
2468 ])
2469 AC_DEFUN([LC_BI_BDEV], [
2470         AC_MSG_CHECKING([if 'bi_bdev' exist])
2471         LB2_LINUX_TEST_RESULT([bi_bdev], [
2472                 AC_DEFINE(HAVE_BI_BDEV, 1, ['bi_bdev' is available])
2473         ])
2474 ]) # LC_BI_BDEV
2475
2476 #
2477 # LC_INTERVAL_TREE_CACHED
2478 #
2479 # 4.14 f808c13fd3738948e10196496959871130612b61
2480 # switched INTERVAL_TREE_DEFINE to use cached RB_Trees.
2481 #
2482 AC_DEFUN([LC_SRC_INTERVAL_TREE_CACHED], [
2483         LB2_LINUX_TEST_SRC([itree_cached], [
2484                 #include <linux/interval_tree_generic.h>
2485                 struct foo { struct rb_node rb; int last; int a,b;};
2486                 #define START(n) ((n)->a)
2487                 #define LAST(n) ((n)->b)
2488                 struct rb_root_cached tree;
2489                 INTERVAL_TREE_DEFINE(struct foo, rb, int, last,
2490                         START, LAST, , foo);
2491         ],[
2492                 foo_insert(NULL, &tree);
2493         ],[-Werror])
2494 ])
2495 AC_DEFUN([LC_INTERVAL_TREE_CACHED], [
2496         AC_MSG_CHECKING([if interval_trees use rb_tree_cached])
2497         LB2_LINUX_TEST_RESULT([itree_cached], [
2498                 AC_DEFINE(HAVE_INTERVAL_TREE_CACHED, 1,
2499                         [interval trees use rb_tree_cached])
2500         ])
2501 ]) # LC_INTERVAL_TREE_CACHED
2502
2503 #
2504 # LC_IS_ENCRYPTED
2505 #
2506 # 4.14 introduced IS_ENCRYPTED and S_ENCRYPTED
2507 #
2508 AC_DEFUN([LC_IS_ENCRYPTED], [
2509 LB_CHECK_COMPILE([if IS_ENCRYPTED is defined],
2510 is_encrypted, [
2511         #include <linux/fs.h>
2512 ],[
2513         (void)IS_ENCRYPTED((struct inode *)1);
2514 ],[
2515         has_is_encrypted="yes"
2516 ])
2517 ]) # LC_IS_ENCRYPTED used by LC_CONFIG_CRYPTO
2518
2519 #
2520 # LC_I_PAGES
2521 #
2522 # kernel 4.17 commit b93b016313b3ba8003c3b8bb71f569af91f19fc7
2523 #
2524 AC_DEFUN([LC_SRC_I_PAGES], [
2525         LB2_LINUX_TEST_SRC([i_pages], [
2526                 #include <linux/fs.h>
2527         ],[
2528                 struct address_space mapping = {};
2529                 void *i_pages;
2530
2531                 i_pages = &mapping.i_pages;
2532         ])
2533 ])
2534 AC_DEFUN([LC_I_PAGES], [
2535         AC_MSG_CHECKING([if struct address_space has i_pages])
2536         LB2_LINUX_TEST_RESULT([i_pages], [
2537                 AC_DEFINE(HAVE_I_PAGES, 1, [struct address_space has i_pages])
2538         ])
2539 ]) # LC_I_PAGES
2540
2541 #
2542 # LC_VM_FAULT_T
2543 #
2544 # kernel 4.17 commit 3d3539018d2cbd12e5af4a132636ee7fd8d43ef0
2545 # mm: create the new vm_fault_t type
2546 #
2547 AC_DEFUN([LC_SRC_VM_FAULT_T], [
2548         LB2_LINUX_TEST_SRC([vm_fault_t], [
2549                 #include <linux/mm_types.h>
2550         ],[
2551                 vm_fault_t x = VM_FAULT_SIGBUS;
2552                 (void)x
2553         ])
2554 ])
2555 AC_DEFUN([LC_VM_FAULT_T], [
2556         AC_MSG_CHECKING([if vm_fault_t type exists])
2557         LB2_LINUX_TEST_RESULT([vm_fault_t], [
2558                 AC_DEFINE(HAVE_VM_FAULT_T, 1, [if vm_fault_t type exists])
2559         ])
2560 ]) # LC_VM_FAULT_T
2561
2562 #
2563 # LC_VM_FAULT_RETRY
2564 #
2565 # kernel 4.17 commit 3d3539018d2cbd12e5af4a132636ee7fd8d43ef0
2566 # mm: VM_FAULT_RETRY is defined in enum vm_fault_reason
2567 #
2568 AC_DEFUN([LC_SRC_VM_FAULT_RETRY], [
2569         LB2_LINUX_TEST_SRC([VM_FAULT_RETRY], [
2570                 #include <linux/mm.h>
2571         ],[
2572                 #ifndef VM_FAULT_RETRY
2573                         vm_fault_t x;
2574                         x = VM_FAULT_RETRY;
2575                 #endif
2576         ])
2577 ])
2578 AC_DEFUN([LC_VM_FAULT_RETRY], [
2579         AC_MSG_CHECKING([if VM_FAULT_RETRY is defined])
2580         LB2_LINUX_TEST_RESULT([VM_FAULT_RETRY], [
2581                 AC_DEFINE(HAVE_VM_FAULT_RETRY, 1,
2582                         [if VM_FAULT_RETRY is defined])
2583         ])
2584 ]) # LC_VM_FAULT_RETRY
2585
2586 #
2587 # LC_ALLOC_FILE_PSEUDO
2588 #
2589 # kernel 4.18-rc1 commit d93aa9d82aea80b80f225dbf9c7986df444d8106
2590 # new wrapper: alloc_file_pseudo()
2591 #
2592 AC_DEFUN([LC_SRC_ALLOC_FILE_PSEUDO], [
2593         LB2_LINUX_TEST_SRC([alloc_file_pseudo], [
2594                 #include <linux/file.h>
2595         ],[
2596                 struct file *file;
2597                 file = alloc_file_pseudo(NULL, NULL, "[test]",
2598                                          00000002, NULL);
2599         ])
2600 ])
2601 AC_DEFUN([LC_ALLOC_FILE_PSEUDO], [
2602         AC_MSG_CHECKING([if 'alloc_file_pseudo' is defined])
2603         LB2_LINUX_TEST_RESULT([alloc_file_pseudo], [
2604                 AC_DEFINE(HAVE_ALLOC_FILE_PSEUDO, 1,
2605                         ['alloc_file_pseudo' exist])
2606         ])
2607 ]) # LC_ALLOC_FILE_PSEUDO
2608
2609 #
2610 # LC_INODE_TIMESPEC64
2611 #
2612 # kernel 4.17-rc7 commit 8efd6894ff089adeeac7cb9f32125b85d963d1bc
2613 # fs: add timespec64_truncate()
2614 # kernel 4.18 commit 95582b00838837fc07e042979320caf917ce3fe6
2615 # inode timestamps switched to timespec64
2616 # kernel 4.19-rc2 commit 976516404ff3fab2a8caa8bd6f5efc1437fed0b8
2617 # y2038: remove unused time interfaces
2618 # ...
2619 #  timespec_trunc
2620 # ...
2621 # When inode times are timespec64 stop using the deprecated
2622 # time interfaces.
2623 #
2624 # kernel v5.5-rc1-6-gba70609d5ec6 ba70609d5ec664a8f36ba1c857fcd97a478adf79
2625 # fs: Delete timespec64_trunc()
2626 #
2627 AC_DEFUN([LC_SRC_INODE_TIMESPEC64], [
2628         LB2_LINUX_TEST_SRC([inode_timespec64], [
2629                 #include <linux/fs.h>
2630         ],[
2631                 struct inode *inode = NULL;
2632                 struct timespec64 ts = {0, 1};
2633
2634                 inode->i_atime = ts;
2635                 (void)inode;
2636         ],[-Werror])
2637 ])
2638 AC_DEFUN([LC_INODE_TIMESPEC64], [
2639         AC_MSG_CHECKING([if inode timestamps are struct timespec64])
2640         LB2_LINUX_TEST_RESULT([inode_timespec64], [
2641                 AC_DEFINE(HAVE_INODE_TIMESPEC64, 1,
2642                         [inode times are using timespec64])
2643         ])
2644 ]) # LC_INODE_TIMESPEC64
2645
2646 #
2647 # LC_RADIX_TREE_TAG_SET
2648 #
2649 # kernel 4.20 commit v4.19-rc5-248-g9b89a0355144
2650 # xarray: Add XArray marks - replaced radix_tree_tag_set
2651 #
2652 AC_DEFUN([LC_SRC_RADIX_TREE_TAG_SET], [
2653         LB2_LINUX_TEST_SRC([radix_tree_tag_set], [
2654                 #include <linux/fs.h>
2655                 #include <linux/radix-tree.h>
2656         ],[
2657                 radix_tree_tag_set(NULL, 0, PAGECACHE_TAG_DIRTY);
2658         ],[-Werror])
2659 ])
2660 AC_DEFUN([LC_RADIX_TREE_TAG_SET], [
2661         AC_MSG_CHECKING([if 'radix_tree_tag_set' exists])
2662         LB2_LINUX_TEST_RESULT([radix_tree_tag_set], [
2663                 AC_DEFINE(HAVE_RADIX_TREE_TAG_SET, 1,
2664                         [radix_tree_tag_set exists])
2665         ])
2666 ]) # LC_RADIX_TREE_TAG_SET
2667
2668 #
2669 # LC_UAPI_LINUX_MOUNT_H
2670 #
2671 # kernel 4.20 commit e262e32d6bde0f77fb0c95d977482fc872c51996
2672 # vfs: Suppress MS_* flag defs within the kernel ...
2673 #
2674 AC_DEFUN([LC_SRC_UAPI_LINUX_MOUNT_H], [
2675         LB2_LINUX_TEST_SRC([uapi_linux_mount], [
2676                 #include <uapi/linux/mount.h>
2677         ],[
2678                 int x = MS_RDONLY;
2679                 (void)x;
2680         ],[-Werror])
2681 ])
2682 AC_DEFUN([LC_UAPI_LINUX_MOUNT_H], [
2683         AC_MSG_CHECKING([if MS_RDONLY was moved to uapi/linux/mount.h])
2684         LB2_LINUX_TEST_RESULT([uapi_linux_mount], [
2685                 AC_DEFINE(HAVE_UAPI_LINUX_MOUNT_H, 1,
2686                         [if MS_RDONLY was moved to uapi/linux/mount.h])
2687         ])
2688 ]) # LC_UAPI_LINUX_MOUNT_H
2689
2690 #
2691 # LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
2692 #
2693 # kernel 4.20 commit 1863d77f15da0addcd293a1719fa5d3ef8cde3ca
2694 # SUNRPC: Replace the cache_detail->hash_lock with a regular spinlock
2695 #
2696 # Now that the reader functions are all RCU protected, use a regular
2697 # spinlock rather than a reader/writer lock.
2698 #
2699 AC_DEFUN([LC_SRC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK], [
2700         LB2_LINUX_TEST_SRC([hash_lock_isa_spinlock_t], [
2701                 #include <linux/sunrpc/cache.h>
2702         ],[
2703                 spinlock_t *lock = &(((struct cache_detail *)0)->hash_lock);
2704                 spin_lock(lock);
2705         ],[-Werror])
2706 ])
2707 AC_DEFUN([LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK], [
2708         AC_MSG_CHECKING([if cache_detail->hash_lock is a spinlock])
2709         LB2_LINUX_TEST_RESULT([hash_lock_isa_spinlock_t], [
2710                 AC_DEFINE(HAVE_CACHE_HASH_SPINLOCK, 1,
2711                         [if cache_detail->hash_lock is a spinlock])
2712         ])
2713 ]) # LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
2714
2715 #
2716 # LC_GENL_FAMILY_HAS_RESV_START_OP
2717 #
2718 # Linux v5.0-11693-g3b0f31f2b8c9
2719 #   genetlink: make policy common to family
2720 #
2721 AC_DEFUN([LC_SRC_GENL_FAMILY_HAS_RESV_START_OP], [
2722         LB2_LINUX_TEST_SRC([genl_family_has_resv_start_op], [
2723                 #include <net/genetlink.h>
2724         ],[
2725                 static const struct genl_family family = {
2726                         .resv_start_op = 42,
2727                 };
2728                 (void)family;
2729         ],[-Werror])
2730 ])
2731 AC_DEFUN([LC_GENL_FAMILY_HAS_RESV_START_OP], [
2732         AC_MSG_CHECKING([if struct genl_family has resv_start_op member])
2733         LB2_LINUX_TEST_RESULT([genl_family_has_resv_start_op], [
2734                 AC_DEFINE(GENL_FAMILY_HAS_RESV_START_OP, 1,
2735                         [struct genl_family has resv_start_op member])
2736         ])
2737 ]) # LC_GENL_FAMILY_HAS_RESV_START_OP
2738
2739 #
2740 # LC_HAVE_BVEC_ITER_ALL
2741 #
2742 # kernel 5.1 commit 6dc4f100c175dd0511ae8674786e7c9006cdfbfa
2743 # block: allow bio_for_each_segment_all() to iterate over multi-page bvec
2744 #
2745 AC_DEFUN([LC_SRC_HAVE_BVEC_ITER_ALL], [
2746         LB2_LINUX_TEST_SRC([struct_bvec_iter_all], [
2747                 #include <linux/bvec.h>
2748         ],[
2749                 struct bvec_iter_all iter;
2750                 (void)iter;
2751         ],[-Werror])
2752 ])
2753 AC_DEFUN([LC_HAVE_BVEC_ITER_ALL], [
2754         AC_MSG_CHECKING([if bvec_iter_all exists for multi-page bvec iternation])
2755         LB2_LINUX_TEST_RESULT([struct_bvec_iter_all], [
2756                 AC_DEFINE(HAVE_BVEC_ITER_ALL, 1,
2757                         [if bvec_iter_all exists for multi-page bvec iternation])
2758         ])
2759 ]) # LC_HAVE_BVEC_ITER_ALL
2760
2761 #
2762 # LC_ACCOUNT_PAGE_DIRTIED
2763 #
2764 # After 5.2 kernel page dirtied is not exported
2765 #
2766 AC_DEFUN([LC_ACCOUNT_PAGE_DIRTIED], [
2767 LB_CHECK_EXPORT([account_page_dirtied], [mm/page-writeback.c],
2768         [AC_DEFINE(HAVE_ACCOUNT_PAGE_DIRTIED_EXPORT, 1,
2769                         [account_page_dirtied is exported])])
2770 ]) # LC_ACCOUNT_PAGE_DIRTIED
2771
2772 #
2773 # LC_KEYRING_SEARCH_4ARGS
2774 #
2775 # Kernel 5.2 commit dcf49dbc8077
2776 # keys: Add a 'recurse' flag for keyring searches
2777 #
2778 AC_DEFUN([LC_SRC_KEYRING_SEARCH_4ARGS], [
2779         LB2_LINUX_TEST_SRC([keyring_search_4args], [
2780                 #include <linux/key.h>
2781         ],[
2782                 key_ref_t keyring;
2783                 keyring_search(keyring, NULL, NULL, false);
2784         ])
2785 ])
2786 AC_DEFUN([LC_KEYRING_SEARCH_4ARGS], [
2787         AC_MSG_CHECKING([if 'keyring_search' has 4 args])
2788         LB2_LINUX_TEST_RESULT([keyring_search_4args], [
2789                 AC_DEFINE(HAVE_KEYRING_SEARCH_4ARGS, 1,
2790                         [keyring_search has 4 args])
2791         ])
2792 ]) # LC_KEYRING_SEARCH_4ARGS
2793
2794 #
2795 # LC_BIO_BI_PHYS_SEGMENTS
2796 #
2797 # kernel 5.3-rc1 commit 14ccb66b3f585b2bc21e7256c96090abed5a512c
2798 # block: remove the bi_phys_segments field in struct bio
2799 #
2800 AC_DEFUN([LC_SRC_BIO_BI_PHYS_SEGMENTS], [
2801         LB2_LINUX_TEST_SRC([bye_bio_bi_phys_segments], [
2802                 #include <linux/bio.h>
2803         ],[
2804                 struct bio *bio = NULL;
2805                 bio->bi_phys_segments++;
2806         ],[-Werror])
2807 ])
2808 AC_DEFUN([LC_BIO_BI_PHYS_SEGMENTS], [
2809         AC_MSG_CHECKING([if struct bio has bi_phys_segments member])
2810         LB2_LINUX_TEST_RESULT([bye_bio_bi_phys_segments], [
2811                 AC_DEFINE(HAVE_BIO_BI_PHYS_SEGMENTS, 1,
2812                         [struct bio has bi_phys_segments member])
2813         ])
2814 ]) # LC_BIO_BI_PHYS_SEGMENTS
2815
2816 #
2817 # LC_LM_COMPARE_OWNER_EXISTS
2818 #
2819 # kernel 5.3-rc3 commit f85d93385e9fe6886a751f647f6812a89bf6bee3
2820 # locks: Cleanup lm_compare_owner and lm_owner_key
2821 # removed lm_compare_owner
2822 #
2823 AC_DEFUN([LC_SRC_LM_COMPARE_OWNER_EXISTS], [
2824         LB2_LINUX_TEST_SRC([lock_manager_ops_lm_compare_owner], [
2825                 #include <linux/fs.h>
2826         ],[
2827                 struct lock_manager_operations lm_ops;
2828                 lm_ops.lm_compare_owner = NULL;
2829         ],[-Werror])
2830 ])
2831 AC_DEFUN([LC_LM_COMPARE_OWNER_EXISTS], [
2832         AC_MSG_CHECKING([if lock_manager_operations has lm_compare_owner])
2833         LB2_LINUX_TEST_RESULT([lock_manager_ops_lm_compare_owner], [
2834                 AC_DEFINE(HAVE_LM_COMPARE_OWNER, 1,
2835                         [lock_manager_operations has lm_compare_owner])
2836         ])
2837 ]) # LC_LM_COMPARE_OWNER_EXISTS
2838
2839 #
2840 # LC_FSCRYPT_SUPPORT
2841 #
2842 # 5.4 introduced fscrypt encryption policies v2
2843 #
2844 AC_DEFUN([LC_FSCRYPT_SUPPORT], [
2845 LB_CHECK_COMPILE([for fscrypt in-kernel support],
2846 fscrypt_support, [
2847         #define __FS_HAS_ENCRYPTION 0
2848         #include <linux/fscrypt.h>
2849 ],[
2850         fscrypt_ioctl_get_policy_ex(NULL, NULL);
2851 ],[
2852         has_fscrypt_support="yes"
2853 ])
2854 ]) # LC_FSCRYPT_SUPPORT used by LC_CONFIG_CRYPTO
2855
2856 #
2857 # LC_FSCRYPT_DIGESTED_NAME
2858 #
2859 # Kernel 5.5-rc4 edc440e3d27fb31e6f9663cf413fad97d714c060
2860 # improved the format of no-key names. This results in the
2861 # removal of FSCRYPT_FNAME_DIGEST and FSCRYPT_FNAME_DIGEST_SIZE.
2862 #
2863 AC_DEFUN([LC_SRC_FSCRYPT_DIGESTED_NAME], [
2864         LB2_LINUX_TEST_SRC([fscrypt_digested_name], [
2865                 #include <linux/fscrypt.h>
2866         ],[
2867                 struct fscrypt_digested_name fname;
2868
2869                 fname.hash = 0;
2870         ],[-Werror])
2871 ])
2872 AC_DEFUN([LC_FSCRYPT_DIGESTED_NAME], [
2873         AC_MSG_CHECKING([if fscrypt has 'struct fscrypt_digested_name'])
2874         LB2_LINUX_TEST_RESULT([fscrypt_digested_name], [
2875                 AC_DEFINE(HAVE_FSCRYPT_DIGESTED_NAME, 1,
2876                         ['struct fscrypt_digested_name' exists])
2877         ])
2878 ]) # LC_FSCRYPT_DIGESTED_NAME
2879
2880 #
2881 # LC_FSCRYPT_DUMMY_CONTEXT_ENABLED
2882 #
2883 # Kernel 5.7-rc7 ed318a6cc0b620440e65f48eb527dc3df7269ce4
2884 # replaces fscrypt_dummy_context_enabled() with
2885 # fscrypt_get_dummy_context(). Later kernels rename
2886 # fscrypt_get_dummy_context() to fscrypt_get_dummy_policy()
2887 # which is why we test fscrypt_dummy_context_enabled().
2888 #
2889 AC_DEFUN([LC_SRC_FSCRYPT_DUMMY_CONTEXT_ENABLED], [
2890         LB2_LINUX_TEST_SRC([fscrypt_dummy_context_enabled], [
2891                 #include <linux/fscrypt.h>
2892         ],[
2893                 fscrypt_dummy_context_enabled(NULL);
2894         ],[-Werror])
2895 ])
2896 AC_DEFUN([LC_FSCRYPT_DUMMY_CONTEXT_ENABLED], [
2897         AC_MSG_CHECKING([if fscrypt_dummy_context_enabled() exists])
2898         LB2_LINUX_TEST_RESULT([fscrypt_dummy_context_enabled], [
2899                 AC_DEFINE(HAVE_FSCRYPT_DUMMY_CONTEXT_ENABLED, 1,
2900                         [fscrypt_dummy_context_enabled() exists])
2901         ])
2902 ]) # LC_FSCRYPT_DUMMY_CONTEXT_ENABLED
2903
2904 #
2905 # LC_FSCRYPT_FNAME_ALLOC_BUFFER
2906 #
2907 # Kernel 5.9-rc4 8b10fe68985278de4926daa56ad6af701839e40a
2908 # removed the inode parameter for the fscrypt function
2909 # fscrypt_fname_alloc_buffer()
2910 #
2911 AC_DEFUN([LC_SRC_FSCRYPT_FNAME_ALLOC_BUFFER], [
2912         LB2_LINUX_TEST_SRC([fscrypt_fname_alloc_buffer], [
2913                 #include <linux/fscrypt.h>
2914         ],[
2915                 fscrypt_fname_alloc_buffer(0, NULL);
2916         ],[-Werror])
2917 ])
2918 AC_DEFUN([LC_FSCRYPT_FNAME_ALLOC_BUFFER], [
2919         AC_MSG_CHECKING([if fscrypt_fname_alloc_buffer() removed inode parameter])
2920         LB2_LINUX_TEST_RESULT([fscrypt_fname_alloc_buffer], [
2921         AC_DEFINE(HAVE_FSCRYPT_FNAME_ALLOC_BUFFER_NO_INODE, 1,
2922                 [fscrypt_fname_alloc_buffer() does not have inode parameter])
2923         ])
2924 ]) # LC_FSCRYPT_FNAME_ALLOC_BUFFER
2925
2926 #
2927 # LC_FSCRYPT_SET_CONTEXT
2928 #
2929 # Kernel 5.9-rc4 a992b20cd4ee360dbbe6f69339cb07146e4304d6
2930 # fscrypt_get_encryption_info() is not GFP_NOFS safe which
2931 # is used by fscrypt_inherit_context. Replace fscrypt_inherit_context,
2932 # with two new functions, fscrypt_prepare_new_inode() and
2933 # fscrypt_set_context()
2934 #
2935 AC_DEFUN([LC_SRC_FSCRYPT_SET_CONTEXT], [
2936         LB2_LINUX_TEST_SRC([fscrypt_set_context], [
2937                 #include <linux/fscrypt.h>
2938         ],[
2939                 fscrypt_set_context(NULL, NULL);
2940                 fscrypt_prepare_new_inode(NULL, NULL, NULL);
2941         ])
2942 ])
2943 AC_DEFUN([LC_FSCRYPT_SET_CONTEXT], [
2944         AC_MSG_CHECKING([if 'fscrypt_set_context()' exists])
2945         LB2_LINUX_TEST_RESULT([fscrypt_set_context], [
2946                 AC_DEFINE(HAVE_FSCRYPT_SET_CONTEXT, 1,
2947                         [fscrypt_set_context() does exist])
2948         ])
2949 ]) # LC_FSCRYPT_SET_CONTEXT
2950
2951 #
2952 # LC_FSCRYPT_D_REVALIDATE
2953 #
2954 # kernel 5.9-rc4 5b2a828b98ec1872799b1b4d82113c76a12d594f
2955 # exported fscrypt_d_revalidate()
2956 #
2957 AC_DEFUN([LC_FSCRYPT_D_REVALIDATE], [
2958 LB_CHECK_EXPORT([fscrypt_d_revalidate], [fs/crypto/fname.c],
2959         [AC_DEFINE(HAVE_FSCRYPT_D_REVALIDATE, 1,
2960                    [fscrypt_d_revalidate() is exported by the kernel])])
2961 ]) # LC_FSCRYPT_D_REVALIDATE
2962
2963 #
2964 # LC_FSCRYPT_NOKEY_NAME
2965 #
2966 # kernel 5.9-rc4 70fb2612aab62d47e03f82eaa7384a8d30ca175d
2967 # renamed is_ciphertext_name to is_nokey_name
2968 #
2969 AC_DEFUN([LC_SRC_FSCRYPT_NOKEY_NAME], [
2970         LB2_LINUX_TEST_SRC([fname_is_nokey_name], [
2971                 #include <linux/fscrypt.h>
2972         ],[
2973                 struct fscrypt_name fname;
2974
2975                 fname.is_nokey_name = true;
2976         ],[-Werror])
2977 ])
2978 AC_DEFUN([LC_FSCRYPT_NOKEY_NAME], [
2979         AC_MSG_CHECKING([if struct fscrypt_name has is_nokey_name field])
2980         LB2_LINUX_TEST_RESULT([fname_is_nokey_name], [
2981                 AC_DEFINE(HAVE_FSCRYPT_NOKEY_NAME, 1,
2982                         [struct fscrypt_name has is_nokey_name field])
2983         ])
2984 ]) # LC_FSCRYPT_NOKEY_NAME
2985
2986 #
2987 # LC_FSCRYPT_SET_TEST_DUMMY_ENC_CHAR_ARG
2988 # Kernel 5.9-rc4 c8c868abc91ff23f6f5c4444c419de7c277d77e1
2989 # changed fscrypt_set_test_dummy_encryption() take a 'const char *
2990 #
2991 AC_DEFUN([LC_SRC_FSCRYPT_SET_TEST_DUMMY_ENC_CHAR_ARG], [
2992         LB2_LINUX_TEST_SRC([fscrypt_set_test_dummy_encryption], [
2993                 #include <linux/fscrypt.h>
2994         ],[
2995                 char *arg = "arg";
2996                 fscrypt_set_test_dummy_encryption(NULL, arg, NULL);
2997         ],[-Werror])
2998 ])
2999 AC_DEFUN([LC_FSCRYPT_SET_TEST_DUMMY_ENC_CHAR_ARG], [
3000         AC_MSG_CHECKING([if fscrypt_set_test_dummy_encryption() take 'const char' parameter])
3001         LB2_LINUX_TEST_RESULT([fscrypt_set_test_dummy_encryption], [
3002                 AC_DEFINE(HAVE_FSCRYPT_SET_TEST_DUMMY_ENC_CHAR_ARG, 1,
3003                         [fscrypt_set_test_dummy_encryption() take 'const char' parameter])
3004         ])
3005 ]) # LC_FSCRYPT_SET_TEST_DUMMY_ENC_CHAR_ARG
3006
3007 #
3008 # LC_FSCRYPT_DUMMY_POLICY
3009 #
3010 # Kernel 5.9-rc4 ac4acb1f4b2b6b7e8d913537cccec8789903e164
3011 # move the test dummy context for fscrypt_policy which is
3012 # also used by the user land interface.
3013 #
3014 AC_DEFUN([LC_SRC_FSCRYPT_DUMMY_POLICY], [
3015         LB2_LINUX_TEST_SRC([fscrypt_free_dummy_policy], [
3016                 #include <linux/fscrypt.h>
3017         ],[
3018                 fscrypt_free_dummy_policy(NULL);
3019         ],[-Werror])
3020 ])
3021 AC_DEFUN([LC_FSCRYPT_DUMMY_POLICY], [
3022         AC_MSG_CHECKING([if fscrypt_free_dummy_policy() exists])
3023         LB2_LINUX_TEST_RESULT([fscrypt_free_dummy_policy], [
3024                 AC_DEFINE(HAVE_FSCRYPT_DUMMY_POLICY, 1,
3025                         [fscrypt_free_dummy_policy() exists])
3026         ])
3027 ]) # LC_FSCRYPT_DUMMY_POLICY
3028
3029 #
3030 # LC_HAVE_ITER_FILE_SPLICE_WRITE
3031 #
3032 # Linux commit v5.9-rc1-6-g36e2c7421f02
3033 #  fs: don't allow splice read/write without explicit ops
3034 #
3035 AC_DEFUN([LC_SRC_HAVE_ITER_FILE_SPLICE_WRITE], [
3036         LB2_LINUX_TEST_SRC([iter_file_splice_write], [
3037                 #include <linux/fs.h>
3038         ],[
3039                 (void)iter_file_splice_write(NULL, NULL, NULL, 1, 0);
3040         ],[-Werror])
3041 ])
3042 AC_DEFUN([LC_HAVE_ITER_FILE_SPLICE_WRITE], [
3043         AC_MSG_CHECKING([if iter_file_splice_write() exists])
3044         LB2_LINUX_TEST_RESULT([iter_file_splice_write], [
3045                 AC_DEFINE(HAVE_ITER_FILE_SPLICE_WRITE, 1,
3046                         ['iter_file_splice_write' exists])
3047         ])
3048 ]) # LC_HAVE_ITER_FILE_SPLICE_WRITE
3049
3050 #
3051 # LC_FSCRYPT_IS_NOKEY_NAME
3052 #
3053 # Kernel 5.10-rc4 159e1de201b6fca10bfec50405a3b53a561096a8
3054 # introduced fscrypt_is_nokey_name() inline macro. While
3055 # introduced for 5.10 kernels it was backported to earlier
3056 # Ubuntu kernels. Also it hides the change introduced due
3057 # to git commit 501e43fbe for kernel 5.9 which also was
3058 # backported to earlier Ubuntu kernels.
3059 #
3060 AC_DEFUN([LC_SRC_FSCRYPT_IS_NOKEY_NAME], [
3061         LB2_LINUX_TEST_SRC([fscrypt_is_no_key_name], [
3062                 #include <linux/fscrypt.h>
3063         ],[
3064                 fscrypt_is_nokey_name(NULL);
3065         ],[-Werror])
3066 ])
3067 AC_DEFUN([LC_FSCRYPT_IS_NOKEY_NAME], [
3068         AC_MSG_CHECKING([if fscrypt_is_no_key_name() exists])
3069         LB2_LINUX_TEST_RESULT([fscrypt_is_no_key_name], [
3070                 AC_DEFINE(HAVE_FSCRYPT_IS_NOKEY_NAME, 1,
3071                         [fscrypt_is_nokey_name() exists])
3072         ])
3073 ]) # LC_FSCRYPT_IS_NOKEY_NAME
3074
3075 #
3076 # LC_FSCRYPT_PREPARE_READDIR
3077 #
3078 # Kernel 5.10-rc4 ec0caa974cd092549ab282deb8ec7ea73b36eba0
3079 # replaced fscrypt_get_encryption_info() with
3080 # fscrypt_prepare_readdir()
3081 #
3082 AC_DEFUN([LC_SRC_FSCRYPT_PREPARE_READDIR], [
3083         LB2_LINUX_TEST_SRC([fscrypt_prepare_readdir], [
3084                 #include <linux/fscrypt.h>
3085         ],[
3086                 fscrypt_prepare_readdir(NULL);
3087         ],[-Werror])
3088 ])
3089 AC_DEFUN([LC_FSCRYPT_PREPARE_READDIR], [
3090         AC_MSG_CHECKING([if fscrypt_prepare_readdir() exists])
3091         LB2_LINUX_TEST_RESULT([fscrypt_prepare_readdir], [
3092                 AC_DEFINE(HAVE_FSCRYPT_PREPARE_READDIR, 1,
3093                         [fscrypt_prepare_readdir() exists])
3094         ])
3095 ]) # LC_FSCRYPT_PREPARE_READDIR
3096
3097 #
3098 # LC_BIO_SET_DEV
3099 #
3100 # Linux: v5.11-rc5-9-g309dca309fc3
3101 #   block: store a block_device pointer in struct bio
3102 # created bio_set_dev macro
3103 # Linux: v5.15-rc6-127-gcf6d6238cdd3
3104 #   block: turn macro helpers into inline functions
3105 # created inline function(s).
3106 #
3107 # Only provide a bio_set_dev it is is not proveded by the kernel
3108 #
3109 AC_DEFUN([LC_SRC_BIO_SET_DEV], [
3110         LB2_LINUX_TEST_SRC([bio_set_dev], [
3111                 #include <linux/bio.h>
3112         ],[
3113                 struct bio *bio = NULL;
3114                 struct block_device *bdev = NULL;
3115
3116                 bio_set_dev(bio, bdev);
3117         ],[-Werror])
3118 ])
3119 AC_DEFUN([LC_BIO_SET_DEV], [
3120         AC_MSG_CHECKING([if 'bio_set_dev' is available])
3121         LB2_LINUX_TEST_RESULT([bio_set_dev], [
3122                 AC_DEFINE(HAVE_BIO_SET_DEV, 1, ['bio_set_dev' is available])
3123         ])
3124 ]) # LC_BIO_SET_DEV
3125
3126 #
3127 # LC_HAVE_USER_NAMESPACE_ARG
3128 #
3129 # kernel 5.12 commit 549c7297717c32ee53f156cd949e055e601f67bb
3130 # fs: make helpers idmap mount aware
3131 # Extend some inode methods with an additional user namespace argument.
3132 #
3133 AC_DEFUN([LC_SRC_HAVE_USER_NAMESPACE_ARG], [
3134         LB2_LINUX_TEST_SRC([inode_ops_has_user_namespace_argument], [
3135                 #include <linux/fs.h>
3136         ],[
3137                 ((struct inode_operations *)1)->getattr((struct user_namespace *)NULL,
3138                                                         NULL, NULL, 0, 0);
3139         ],[-Werror])
3140 ])
3141 AC_DEFUN([LC_HAVE_USER_NAMESPACE_ARG], [
3142         AC_MSG_CHECKING([if 'inode_operations' members have user namespace argument])
3143         LB2_LINUX_TEST_RESULT([inode_ops_has_user_namespace_argument], [
3144                 AC_DEFINE(HAVE_USER_NAMESPACE_ARG, 1,
3145                         ['inode_operations' members have user namespace argument])
3146         ])
3147 ]) # LC_HAVE_USER_NAMESPACE_ARG
3148
3149 #
3150 # LC_HAVE_GET_ACL_RCU_ARG
3151 #
3152 # kernel 5.15 commit 0cad6246621b5887d5b33fea84219d2a71f2f99a
3153 # vfs: add rcu argument to ->get_acl() callback
3154 # Add a rcu argument to the ->get_acl() callback to allow
3155 # get_cached_acl_rcu() to call the ->get_acl() method.
3156 #
3157 AC_DEFUN([LC_SRC_HAVE_GET_ACL_RCU_ARG], [
3158         LB2_LINUX_TEST_SRC([get_acl_rcu_argument], [
3159                 #include <linux/fs.h>
3160         ],[
3161                 ((struct inode_operations *)1)->get_acl((struct inode *)NULL, 0, false);
3162         ],[-Werror])
3163 ])
3164 AC_DEFUN([LC_HAVE_GET_ACL_RCU_ARG], [
3165         AC_MSG_CHECKING([if 'get_acl' has a rcu argument])
3166         LB2_LINUX_TEST_RESULT([get_acl_rcu_argument], [
3167                 AC_DEFINE(HAVE_GET_ACL_RCU_ARG, 1,
3168                         ['get_acl' has a rcu argument])
3169         ])
3170 ]) # LC_HAVE_GET_ACL_RCU_ARG
3171
3172 #
3173 # LC_HAVE_SECURITY_DENTRY_INIT_WITH_XATTR_NAME_ARG
3174 #
3175 # Linux v5.15-rc1-20-g15bf32398ad4
3176 # security: Return xattr name from security_dentry_init_security()
3177 #
3178 AC_DEFUN([LC_SRC_HAVE_SECURITY_DENTRY_INIT_WITH_XATTR_NAME_ARG], [
3179         LB2_LINUX_TEST_SRC([security_dentry_init_security_xattr_name_arg], [
3180                 #include <linux/security.h>
3181         ],[
3182                 struct dentry *dentry = NULL;
3183                 int mode = 0;
3184                 const struct qstr *name = NULL;
3185                 const char *xattr_name = NULL;
3186                 void **ctx = NULL;
3187                 u32 *ctxlen = 0;
3188                 int rc = security_dentry_init_security(dentry, mode, name, &xattr_name,
3189                                                        ctx, ctxlen);
3190                 (void)rc;
3191
3192         ],[-Werror])
3193 ])
3194 AC_DEFUN([LC_HAVE_SECURITY_DENTRY_INIT_WITH_XATTR_NAME_ARG], [
3195         AC_MSG_CHECKING([if security_dentry_init_security() returns xattr name])
3196         LB2_LINUX_TEST_RESULT([security_dentry_init_security_xattr_name_arg], [
3197                 AC_DEFINE(HAVE_SECURITY_DENTRY_INIT_WITH_XATTR_NAME_ARG, 1,
3198                         [security_dentry_init_security() returns xattr name])
3199         ])
3200 ]) # LC_HAVE_SECURITY_DENTRY_INIT_WITH_XATTR_NAME_ARG
3201
3202 #
3203 # LC_HAVE_KIOCB_COMPLETE_2ARGS
3204 #
3205 # kernel v5.15-rc6-145-g6b19b766e8f0
3206 # fs: get rid of the res2 iocb->ki_complete argument
3207 #
3208 AC_DEFUN([LC_SRC_HAVE_KIOCB_COMPLETE_2ARGS], [
3209         LB2_LINUX_TEST_SRC([kiocb_ki_complete_2args], [
3210                 #include <linux/fs.h>
3211
3212                 static void complete_fn(struct kiocb *iocb, long ret)
3213                 {
3214                         (void)iocb;
3215                         (void)ret;
3216                 }
3217         ],[
3218                 struct kiocb *kio = NULL;
3219
3220                 kio->ki_complete = complete_fn;
3221         ],[-Werror])
3222 ])
3223 AC_DEFUN([LC_HAVE_KIOCB_COMPLETE_2ARGS], [
3224         AC_MSG_CHECKING([if kiocb->ki_complete() has 2 arguments])
3225         LB2_LINUX_TEST_RESULT([kiocb_ki_complete_2args], [
3226                 AC_DEFINE(HAVE_KIOCB_COMPLETE_2ARGS, 1,
3227                         [kiocb->ki_complete() has 2 arguments])
3228         ])
3229 ]) # LC_HAVE_KIOCB_COMPLETE_2ARGS
3230
3231 #
3232 # LC_EXPORTS_DELETE_FROM_PAGE_CACHE
3233 #
3234 # Linux commit v5.16-rc4-44-g452e9e6992fe
3235 # filemap: Add filemap_remove_folio and __filemap_remove_folio
3236 #
3237 # Also removes the export of delete_from_page_cache
3238 #
3239 AC_DEFUN([LC_EXPORTS_DELETE_FROM_PAGE_CACHE], [
3240 LB_CHECK_EXPORT([delete_from_page_cache], [mm/filemap.c],
3241         [AC_DEFINE(HAVE_DELETE_FROM_PAGE_CACHE, 1,
3242                         [delete_from_page_cache is exported])])
3243 ]) # LC_EXPORTS_DELETE_FROM_PAGE_CACHE
3244
3245 #
3246 # LC_HAVE_INVALIDATE_FOLIO
3247 #
3248 # linux commit v5.17-rc4-10-g128d1f8241d6
3249 # fs: Add invalidate_folio() aops method
3250 #
3251 AC_DEFUN([LC_SRC_HAVE_INVALIDATE_FOLIO], [
3252         LB2_LINUX_TEST_SRC([address_spaace_operaions_invalidate_folio], [
3253                 #include <linux/fs.h>
3254         ],[
3255                 struct address_space_operations *aops = NULL;
3256                 struct folio *folio = NULL;
3257                 aops->invalidate_folio(folio, 0, PAGE_SIZE);
3258
3259         ],[-Werror])
3260 ])
3261 AC_DEFUN([LC_HAVE_INVALIDATE_FOLIO], [
3262         AC_MSG_CHECKING([if have address_spaace_operaions->invalidate_folio() member])
3263         LB2_LINUX_TEST_RESULT([address_spaace_operaions_invalidate_folio], [
3264                 AC_DEFINE(HAVE_INVALIDATE_FOLIO, 1,
3265                         [address_spaace_operaions->invalidate_folio() member exists])
3266         ])
3267 ]) # LC_HAVE_INVALIDATE_FOLIO
3268
3269 #
3270 # LC_HAVE_DIRTY_FOLIO
3271 #
3272 # linux commit v5.17-rc4-38-g6f31a5a261db
3273 # fs: Add aops->dirty_folio
3274 # ... replaces ->set_page_dirty() with ->dirty_folio()
3275 #
3276 AC_DEFUN([LC_SRC_HAVE_DIRTY_FOLIO], [
3277         LB2_LINUX_TEST_SRC([address_spaace_operaions_dirty_folio], [
3278                 #include <linux/fs.h>
3279         ],[
3280                 struct address_space_operations *aops = NULL;
3281                 struct address_space *mapping = NULL;
3282                 struct folio *folio = NULL;
3283                 bool dirty = aops->dirty_folio(mapping, folio);
3284                 (void) dirty;
3285         ],[-Werror])
3286 ])
3287 AC_DEFUN([LC_HAVE_DIRTY_FOLIO], [
3288         AC_MSG_CHECKING([if have address_spaace_operaions->dirty_folio() member])
3289         LB2_LINUX_TEST_RESULT([address_spaace_operaions_dirty_folio], [
3290                 AC_DEFINE(HAVE_DIRTY_FOLIO, 1,
3291                         [address_spaace_operaions->dirty_folio() member exists])
3292         ])
3293 ]) # LC_HAVE_DIRTY_FOLIO
3294
3295 #
3296 # LC_HAVE_ALLOC_INODE_SB
3297 #
3298 # linux commit v5.17-49-g8b9f3ac5b01d
3299 #   fs: introduce alloc_inode_sb() to allocate filesystems specific inode
3300 #
3301 AC_DEFUN([LC_SRC_HAVE_ALLOC_INODE_SB], [
3302         LB2_LINUX_TEST_SRC([alloc_inode_sb], [
3303                 #include <linux/fs.h>
3304         ],[
3305                 struct super_block *sb = NULL;
3306                 struct kmem_cache *cache = NULL;
3307
3308                 (void)alloc_inode_sb(sb, cache, GFP_NOFS);
3309         ],[-Werror])
3310 ])
3311 AC_DEFUN([LC_HAVE_ALLOC_INODE_SB], [
3312         AC_MSG_CHECKING([if alloc_inode_sb() exists])
3313         LB2_LINUX_TEST_RESULT([alloc_inode_sb], [
3314                 AC_DEFINE(HAVE_ALLOC_INODE_SB, 1,
3315                         [alloc_inode_sb() exists])
3316         ])
3317 ]) # LC_HAVE_ALLOC_INODE_SB
3318
3319 #
3320 # LC_GRAB_CACHE_PAGE_WRITE_BEGIN_WITH_FLAGS
3321 #
3322 # Linux commit v5.18-rc5-221-gb7446e7cf15f
3323 #   fs: Remove aop flags parameter from grab_cache_page_write_begin()
3324 #
3325 AC_DEFUN([LC_SRC_GRAB_CACHE_PAGE_WRITE_BEGIN_WITH_FLAGS], [
3326         LB2_LINUX_TEST_SRC([grab_cache_page_write_begin_with_flags], [
3327                 #include <linux/pagemap.h>
3328         ],[
3329                 struct address_space *mapping = NULL;
3330                 (void)grab_cache_page_write_begin(mapping, 0, 1);
3331         ],[-Werror])
3332 ]) 
3333 AC_DEFUN([LC_GRAB_CACHE_PAGE_WRITE_BEGIN_WITH_FLAGS], [
3334         AC_MSG_CHECKING([if grab_cache_page_write_begin() has flags argument])
3335         LB2_LINUX_TEST_RESULT([grab_cache_page_write_begin_with_flags], [
3336                 AC_DEFINE(HAVE_GRAB_CACHE_PAGE_WRITE_BEGIN_WITH_FLAGS, 1,
3337                         [grab_cache_page_write_begin() has flags argument])
3338         ])
3339 ]) # LC_GRAB_CACHE_PAGE_WRITE_BEGIN_WITH_FLAGS
3340
3341 #
3342 # LC_HAVE_ADDRESS_SPACE_OPERATIONS_READ_FOLIO
3343 #
3344 # Linux commit v5.18-rc5-241-g5efe7448a142
3345 #   fs: Introduce aops->read_folio
3346 #
3347 AC_DEFUN([LC_SRC_HAVE_ADDRESS_SPACE_OPERATIONS_READ_FOLIO], [
3348         LB2_LINUX_TEST_SRC([address_space_operations_read_folio], [
3349                 #include <linux/fs.h>
3350         ],[
3351                 struct address_space_operations *aops = NULL;
3352                 struct file *file = NULL;
3353                 struct folio *folio = NULL;
3354                 int err = aops->read_folio(file, folio);
3355                 (void)err;
3356         ],[-Werror])
3357 ])
3358 AC_DEFUN([LC_HAVE_ADDRESS_SPACE_OPERATIONS_READ_FOLIO], [
3359         AC_MSG_CHECKING([if struct address_space_operations() has read_folio()])
3360         LB2_LINUX_TEST_RESULT([address_space_operations_read_folio], [
3361                 AC_DEFINE(HAVE_AOPS_READ_FOLIO, 1,
3362                         [struct address_space_operations() has read_folio()])
3363         ])
3364 ]) # LC_HAVE_ADDRESS_SPACE_OPERATIONS_READ_FOLIO
3365
3366 #
3367 # LC_HAVE_READ_CACHE_PAGE_FILLER_WITH_FILE
3368 #
3369 # Linux commit v5.18-rc5-280-ge9b5b23e957e
3370 #   fs: Change the type of filler_t
3371 #
3372 AC_DEFUN([LC_SRC_HAVE_READ_CACHE_PAGE_FILLER_WITH_FILE], [
3373         LB2_LINUX_TEST_SRC([read_cache_page_filler_with_file], [
3374                 #include <linux/pagemap.h>
3375                 static inline int _filler(struct file *file, struct folio *f)
3376                 {
3377                         return 0;
3378                 }
3379         ],[
3380                 struct address_space *mapping = NULL;
3381                 struct file *file = NULL;
3382                 struct page *page = read_cache_page(mapping, 0, _filler, file);
3383                 (void)page;
3384         ],[-Werror])
3385 ])
3386 AC_DEFUN([LC_HAVE_READ_CACHE_PAGE_FILLER_WITH_FILE], [
3387         AC_MSG_CHECKING([if read_cache_page() filler_t needs struct file])
3388         LB2_LINUX_TEST_RESULT([read_cache_page_filler_with_file], [
3389                 AC_DEFINE(HAVE_READ_CACHE_PAGE_WANTS_FILE, 1,
3390                         [read_cache_page() filler_t needs struct file])
3391         ])
3392 ]) # LC_HAVE_READ_CACHE_PAGE_FILLER_WITH_FILE
3393
3394 #
3395 # LC_HAVE_ADDRESS_SPACE_OPERATIONS_RELEASE_FOLIO
3396 #
3397 # Linux commit v5.18-rc5-282-gfa29000b6b26
3398 #  fs: Add aops->release_folio
3399 #
3400 AC_DEFUN([LC_SRC_HAVE_ADDRESS_SPACE_OPERATIONS_RELEASE_FOLIO], [
3401         LB2_LINUX_TEST_SRC([address_space_operations_release_folio], [
3402                 #include <linux/fs.h>
3403         ],[
3404                 struct address_space_operations *aops = NULL;
3405                 struct folio *folio = NULL;
3406                 int err = aops->release_folio(folio, GFP_KERNEL);
3407                 (void)err;
3408         ],[-Werror])
3409 ])
3410 AC_DEFUN([LC_HAVE_ADDRESS_SPACE_OPERATIONS_RELEASE_FOLIO], [
3411         AC_MSG_CHECKING([if struct address_space_operations() has release_folio()])
3412         LB2_LINUX_TEST_RESULT([address_space_operations_release_folio], [
3413                 AC_DEFINE(HAVE_AOPS_RELEASE_FOLIO, 1,
3414                         [struct address_space_operations() has release_folio()])
3415         ])
3416 ]) # LC_HAVE_ADDRESS_SPACE_OPERATIONS_RELEASE_FOLIO
3417
3418 #
3419 # LC_HAVE_LSMCONTEXT_INIT
3420 #
3421 # repo: git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/jammy
3422 # kernel linux-hwe-5.19 commit fef1deb99dad87dd700afae76b35c5b5750e33a8
3423 # LSM: Removed scaffolding function lsmcontext_init
3424 #
3425 AC_DEFUN([LC_SRC_HAVE_LSMCONTEXT_INIT], [
3426         LB2_LINUX_TEST_SRC([lsmcontext_init], [
3427                 #include <linux/security.h>
3428         ],[
3429                 struct lsmcontext ctx = {};
3430
3431                 lsmcontext_init(&ctx, "", 0, 0);
3432         ],[])
3433 ])
3434 AC_DEFUN([LC_HAVE_LSMCONTEXT_INIT], [
3435         AC_MSG_CHECKING([if lsmcontext_init is available])
3436         LB2_LINUX_TEST_RESULT([lsmcontext_init], [
3437                 AC_DEFINE(HAVE_LSMCONTEXT_INIT, 1,
3438                         [lsmcontext_init is available])
3439         ])
3440 ]) # LC_HAVE_LSMCONTEXT_INIT
3441
3442 #
3443 # LC_SECURITY_DENTRY_INIT_SECURTY_WITH_CTX
3444 #
3445 # repo: git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/jammy
3446 # kernel linux-hwe-5.19 commit 57d0004bc811254916be30f94c86d9607867deb0
3447 # LSM: Use lsmcontext in security_dentry_init_security
3448 #
3449 AC_DEFUN([LC_SRC_SECURITY_DENTRY_INIT_SECURTY_WITH_CTX], [
3450         LB2_LINUX_TEST_SRC([security_dentry_init_security_with_ctx], [
3451                 #include <linux/security.h>
3452         ],[
3453                 struct dentry *dentry = NULL;
3454                 const struct qstr *name = NULL;
3455                 struct lsmcontext *ctx = NULL;
3456                 const char *xattr_name = "";
3457
3458                 (void)security_dentry_init_security(dentry, 0, name,
3459                                                     &xattr_name, ctx);
3460         ],[-Werror])
3461 ])
3462 AC_DEFUN([LC_SECURITY_DENTRY_INIT_SECURTY_WITH_CTX], [
3463         AC_MSG_CHECKING([if security_dentry_init_security needs lsmcontext])
3464         LB2_LINUX_TEST_RESULT([security_dentry_init_security_with_ctx], [
3465                 AC_DEFINE(HAVE_SECURITY_DENTRY_INIT_SECURTY_WITH_CTX, 1,
3466                         [security_dentry_init_security needs lsmcontext])
3467         ])
3468 ]) # LC_SECURITY_DENTRY_INIT_SECURTY_WITH_CTX
3469
3470 #
3471 # LC_HAVE_NO_LLSEEK
3472 #
3473 # Linux commit v5.19-rc2-6-g868941b14441
3474 #   fs: remove no_llseek
3475 #
3476 AC_DEFUN([LC_SRC_HAVE_NO_LLSEEK], [
3477         LB2_LINUX_TEST_SRC([no_llseek], [
3478                 #include <linux/fs.h>
3479         ],[
3480                 static const struct file_operations fops = {
3481                         .llseek = &no_llseek,
3482                 };
3483                 (void)fops;
3484         ],[-Werror])
3485 ])
3486 AC_DEFUN([LC_HAVE_NO_LLSEEK], [
3487         AC_MSG_CHECKING([if no_llseek() is available])
3488         LB2_LINUX_TEST_RESULT([no_llseek], [
3489                 AC_DEFINE(HAVE_NO_LLSEEK, 1, [no_llseek() is available])
3490         ])
3491 ]) # LC_HAVE_NO_LLSEEK
3492
3493 #
3494 # LC_DQUOT_TRANSFER_WITH_USER_NS
3495 #
3496 # Linux commit v5.19-rc3-6-g71e7b535b890
3497 #  quota: port quota helpers mount ids
3498 #
3499 AC_DEFUN([LC_SRC_DQUOT_TRANSFER_WITH_USER_NS], [
3500         LB2_LINUX_TEST_SRC([dquot_transfer], [
3501                 #include <linux/quotaops.h>
3502         ],[
3503                 struct user_namespace *userns = NULL;
3504                 struct inode *inode = NULL;
3505                 struct iattr *iattr = NULL;
3506                 int err __attribute__ ((unused));
3507
3508                 err = dquot_transfer(userns, inode, iattr);
3509         ],[-Werror])
3510 ])
3511 AC_DEFUN([LC_DQUOT_TRANSFER_WITH_USER_NS], [
3512         AC_MSG_CHECKING([if dquot_transfer() has user_ns argument])
3513         LB2_LINUX_TEST_RESULT([dquot_transfer], [
3514                 AC_DEFINE(HAVE_DQUOT_TRANSFER_WITH_USER_NS, 1,
3515                         [dquot_transfer() has user_ns argument])
3516         ])
3517 ]) # LC_DQUOT_TRANSFER_WITH_USER_NS
3518
3519 #
3520 # LC_HAVE_ADDRESS_SPACE_OPERATIONS_MIGRATE_FOLIO
3521 #
3522 # Linux commit v5.19-rc3-392-g5490da4f06d1
3523 #  fs: Add aops->migrate_folio
3524 #
3525 AC_DEFUN([LC_SRC_HAVE_ADDRESS_SPACE_OPERATIONS_MIGRATE_FOLIO], [
3526         LB2_LINUX_TEST_SRC([address_space_operations_migrate_folio], [
3527                 #include <linux/fs.h>
3528         ],[
3529                 struct address_space_operations *aops = NULL;
3530                 struct address_space *m = NULL;
3531                 struct folio *src = NULL;
3532                 struct folio *dst = NULL;
3533                 int err = aops->migrate_folio(m, dst, src, MIGRATE_ASYNC);
3534                 (void)err;
3535         ],[-Werror])
3536 ])
3537 AC_DEFUN([LC_HAVE_ADDRESS_SPACE_OPERATIONS_MIGRATE_FOLIO], [
3538         AC_MSG_CHECKING([if struct address_space_operations() has migrate_folio()])
3539         LB2_LINUX_TEST_RESULT([address_space_operations_migrate_folio], [
3540                 AC_DEFINE(HAVE_AOPS_MIGRATE_FOLIO, 1,
3541                         [struct address_space_operations() has migrate_folio()])
3542         ])
3543 ]) # LC_HAVE_ADDRESS_SPACE_OPERATIONS_MIGRATE_FOLIO
3544
3545 #
3546 # LC_REGISTER_SHRINKER_FORMAT_NAMED
3547 #
3548 # Linux commit v5.19-rc4-52-ge33c267ab70d
3549 #   mm: shrinkers: provide shrinkers with names
3550 #
3551 AC_DEFUN([LC_SRC_REGISTER_SHRINKER_FORMAT_NAMED], [
3552         LB2_LINUX_TEST_SRC([register_shrinker_format], [
3553                 #include <linux/mm.h>
3554         ],[
3555                 if (register_shrinker(NULL, "lustre-%ps", __func__))
3556                         unregister_shrinker(NULL);
3557         ],[-Werror])
3558 ])
3559 AC_DEFUN([LC_REGISTER_SHRINKER_FORMAT_NAMED], [
3560         AC_MSG_CHECKING([if register_shrinker() returns status])
3561         LB2_LINUX_TEST_RESULT([address_space_operations_migrate_folio], [
3562                 AC_DEFINE(HAVE_REGISTER_SHRINKER_FORMAT_NAMED, 1,
3563                         [register_shrinker() returns status])
3564         ])
3565 ]) # LC_REGISTER_SHRINKER_FORMAT_NAMED
3566
3567 #
3568 # LC_HAVE_VFS_SETXATTR_NON_CONST_VALUE
3569 #
3570 # From Linux commit v5.19-rc5-17-g0c5fd887d2bb
3571 #   acl: move idmapped mount fixup into vfs_{g,s}etxattr()
3572 # Until Linux commit v6.0-rc3-6-g6344e66970c6
3573 #   xattr: constify value argument in vfs_setxattr()
3574 #
3575 AC_DEFUN([LC_SRC_HAVE_VFS_SETXATTR_NON_CONST_VALUE], [
3576         LB2_LINUX_TEST_SRC([vfs_setxattr_non_const_value_arg], [
3577                 #include <linux/xattr.h>
3578         ],[
3579                 struct dentry *de = NULL;
3580                 const char *name = "an.xattr";
3581                 const void *value = NULL;
3582                 int err = vfs_setxattr(&init_user_ns, de, name, value, 0, 0);
3583                 (void)err;
3584         ],[-Werror])
3585 ]) # LC_HAVE_VFS_SETXATTR_NON_CONST_VALUE
3586 AC_DEFUN([LC_HAVE_VFS_SETXATTR_NON_CONST_VALUE], [
3587         AC_MSG_CHECKING([if vfs_setxattr() value argument is non-const])
3588         LB2_LINUX_TEST_RESULT([vfs_setxattr_non_const_value_arg], [
3589                 AC_DEFINE([VFS_SETXATTR_VALUE(value)],
3590                           [(value)],
3591                           [vfs_setxattr() value argument is const void *])
3592         ],[
3593                 AC_DEFINE([VFS_SETXATTR_VALUE(value)],
3594                           [((void *)(value))],
3595                           [vfs_setxattr() value argument is non-const])
3596         ])
3597 ]) # LC_HAVE_VFS_SETXATTR_NON_CONST_VALUE
3598
3599 #
3600 # LC_HAVE_IOV_ITER_GET_PAGES_ALLOC2
3601 #
3602 # Linux commit v5.19-10313-geba2d3d79829
3603 #   get rid of non-advancing variants
3604 #
3605 AC_DEFUN([LC_SRC_HAVE_IOV_ITER_GET_PAGES_ALLOC2], [
3606         LB2_LINUX_TEST_SRC([iov_iter_get_pages_alloc2], [
3607                 #include <linux/uio.h>
3608         ],[
3609                 struct iov_iter *iter = NULL;
3610                 struct page ***pages = NULL;
3611                 size_t maxsize = 1;
3612                 size_t start;
3613                 size_t result __attribute__ ((unused));
3614                 result = iov_iter_get_pages_alloc2(iter, pages, maxsize, &start);
3615         ],[-Werror])
3616 ])
3617 AC_DEFUN([LC_HAVE_IOV_ITER_GET_PAGES_ALLOC2], [
3618         AC_MSG_CHECKING([if iov_iter_get_pages_alloc2() is available])
3619         LB2_LINUX_TEST_RESULT([iov_iter_get_pages_alloc2], [
3620                 AC_DEFINE(HAVE_IOV_ITER_GET_PAGES_ALLOC2, 1,
3621                         [iov_iter_get_pages_alloc2() is available])
3622         ])
3623 ]) # LC_HAVE_IOV_ITER_GET_PAGES_ALLOC2
3624
3625 #
3626 # LC_HAVE_GET_RANDOM_U32_AND_U64
3627 #
3628 # Linux commit v4.10-rc3-6-gc440408cf690
3629 #   random: convert get_random_int/long into get_random_u32/u64
3630 # Linux commit v6.0-11338-gde492c83cae0
3631 #   prandom: remove unused functions
3632 #
3633 AC_DEFUN([LC_SRC_HAVE_GET_RANDOM_U32_AND_U64], [
3634         LB2_LINUX_TEST_SRC([get_random_u32_and_u64], [
3635                 #include <linux/random.h>
3636         ],[
3637                 u32 rand32 = get_random_u32();
3638                 u64 rand64 = get_random_u64();
3639                 (void)rand32;
3640                 (void)rand64;
3641         ],[-Werror])
3642 ])
3643 AC_DEFUN([LC_HAVE_GET_RANDOM_U32_AND_U64], [
3644         AC_MSG_CHECKING([if get_random_u32() and get_random_u64() are available])
3645         LB2_LINUX_TEST_RESULT([get_random_u32_and_u64], [
3646                 AC_DEFINE(HAVE_GET_RANDOM_U32_AND_U64, 1,
3647                         [get_random_[u32|u64] are available])
3648         ],[
3649                 AC_DEFINE([get_random_u32()], [prandom_u32()],
3650                         [get_random_u32() is not available, use prandom_u32])
3651         ])
3652 ]) # LC_HAVE_GET_RANDOM_U32_AND_U64
3653
3654 #
3655 # LC_NFS_FILLDIR_USE_CTX_RETURN_BOOL
3656 #
3657 # Linux commit v6.0-rc1-2-g25885a35a720
3658 #  Change calling conventions for filldir_t
3659 #
3660 AC_DEFUN([LC_SRC_NFS_FILLDIR_USE_CTX_RETURN_BOOL], [
3661         LB2_LINUX_TEST_SRC([filldir_ctx_return_bool], [
3662                 #include <linux/fs.h>
3663         ],[
3664                 bool filldir(struct dir_context *ctx, const char* name,
3665                              int i, loff_t off, u64 tmp, unsigned temp)
3666                 {
3667                         return 0;
3668                 }
3669
3670                 struct dir_context ctx = {
3671                         .actor = filldir,
3672                 };
3673
3674                 ctx.actor(NULL, "test", 0, (loff_t) 0, 0, 0);
3675         ],[-Werror])
3676 ])
3677 AC_DEFUN([LC_NFS_FILLDIR_USE_CTX_RETURN_BOOL], [
3678         AC_MSG_CHECKING([if filldir_t uses struct dir_context and returns bool])
3679         LB2_LINUX_TEST_RESULT([filldir_ctx_return_bool], [
3680                 AC_DEFINE(HAVE_FILLDIR_USE_CTX_RETURN_BOOL, 1,
3681                         [filldir_t needs struct dir_context and returns bool])
3682                 AC_DEFINE(HAVE_FILLDIR_USE_CTX, 1,
3683                         [filldir_t needs struct dir_context as argument])
3684                 AC_DEFINE(FILLDIR_TYPE, bool,
3685                         [filldir_t return type is bool or int])
3686         ],[
3687                 AC_DEFINE(FILLDIR_TYPE, int,
3688                         [filldir_t return type is bool or int])
3689         ])
3690 ]) # LC_NFS_FILLDIR_USE_CTX_RETURN_BOOL
3691
3692 #
3693 # LC_HAVE_FILEMAP_GET_FOLIOS_CONTIG
3694 #
3695 # Linux commit v6.0-rc3-94-g35b471467f88
3696 #   filemap: add filemap_get_folios_contig()
3697 #
3698 AC_DEFUN([LC_SRC_HAVE_FILEMAP_GET_FOLIOS_CONTIG], [
3699         LB2_LINUX_TEST_SRC([filemap_get_folios_contig], [
3700                 #include <linux/pagemap.h>
3701         ],[
3702                 struct address_space *m = NULL;
3703                 pgoff_t start = 0;
3704                 struct folio_batch *fbatch = NULL;
3705                 (void)filemap_get_folios_contig(m, &start, ULONG_MAX, fbatch);
3706         ],[-Werror])
3707 ])
3708 AC_DEFUN([LC_HAVE_FILEMAP_GET_FOLIOS_CONTIG], [
3709         AC_MSG_CHECKING([if filemap_get_folios_contig() is available])
3710         LB2_LINUX_TEST_RESULT([filldir_ctx_return_bool], [
3711                 AC_DEFINE(HAVE_FILEMAP_GET_FOLIOS_CONTIG, 1,
3712                         [filemap_get_folios_contig() is available])
3713         ])
3714 ]) # LC_HAVE_FILEMAP_GET_FOLIOS_CONTIG
3715
3716 #
3717 # LC_PROG_LINUX
3718 #
3719 # Lustre linux kernel checks
3720 #
3721 AC_DEFUN([LC_PROG_LINUX_SRC], [
3722         AS_IF([test "x$enable_gss" != xno], [
3723                 LC_SRC_KEY_TYPE_INSTANTIATE_2ARGS
3724                 LB2_SRC_CHECK_CONFIG_IM([CRYPTO_MD5])
3725                 LB2_SRC_CHECK_CONFIG_IM([CRYPTO_SHA1])
3726                 LB2_SRC_CHECK_CONFIG_IM([CRYPTO_SHA256])
3727                 LB2_SRC_CHECK_CONFIG_IM([CRYPTO_SHA512])
3728         ])
3729         AS_IF([test "x$enable_server" != xno], [
3730                 LC_SRC_CONFIG_QUOTA
3731                 LC_SRC_STACK_SIZE
3732         ])
3733         LC_SRC_CONFIG_FHANDLE
3734         LC_SRC_POSIX_ACL_CONFIG
3735         LC_SRC_HAVE_PROJECT_QUOTA
3736
3737         # 3.11
3738         LC_SRC_INVALIDATE_RANGE
3739         LC_SRC_HAVE_DIR_CONTEXT
3740         LC_SRC_D_COMPARE_5ARGS
3741         LC_SRC_HAVE_DCOUNT
3742         LC_SRC_PID_NS_FOR_CHILDREN
3743
3744         # 3.12
3745         LC_SRC_OLDSIZE_TRUNCATE_PAGECACHE
3746         LC_SRC_PTR_ERR_OR_ZERO_MISSING
3747         LC_SRC_HAVE_DENTRY_D_U_D_ALIAS_LIST
3748         LC_SRC_HAVE_DENTRY_D_U_D_ALIAS_HLIST
3749         LC_SRC_HAVE_DENTRY_D_CHILD
3750         LC_SRC_KIOCB_KI_LEFT
3751         LC_SRC_REGISTER_SHRINKER_RET
3752
3753         # 3.13
3754         LC_SRC_VFS_RENAME_5ARGS
3755         LC_SRC_VFS_UNLINK_3ARGS
3756         LC_SRC_HAVE_D_IS_POSITIVE
3757
3758         # 3.14
3759         LC_SRC_HAVE_BVEC_ITER
3760         LC_SRC_HAVE_TRUNCATE_IPAGES_FINAL
3761         LC_SRC_IOPS_RENAME_WITH_FLAGS
3762         LC_SRC_IOP_SET_ACL
3763
3764         # 3.15
3765         LC_SRC_VFS_RENAME_6ARGS
3766
3767         # 3.16
3768         LC_SRC_DIRECTIO_USE_ITER
3769         LC_SRC_HAVE_IOV_ITER_INIT_DIRECTION
3770         LC_SRC_HAVE_IOV_ITER_TRUNCATE
3771         LC_SRC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
3772         LC_SRC_PAGECACHE_GET_PAGE
3773
3774         # 3.17
3775         LC_SRC_HAVE_INTERVAL_BLK_INTEGRITY
3776         LC_SRC_KEY_MATCH_DATA
3777         LC_SRC_HAVE_BLK_INTEGRITY_ITER
3778
3779         # 3.18
3780         LC_SRC_NFS_FILLDIR_USE_CTX
3781         LC_SRC_PERCPU_COUNTER_INIT
3782
3783         # 3.19
3784         LC_SRC_KIOCB_HAS_NBYTES
3785         LC_SRC_HAVE_DQUOT_QC_DQBLK
3786         LC_SRC_HAVE_AIO_COMPLETE
3787         LC_SRC_HAVE_IS_ROOT_INODE
3788
3789         # 3.20
3790         LC_SRC_BACKING_DEV_INFO_REMOVAL
3791         LC_SRC_HAVE_BDI_CAP_MAP_COPY
3792
3793         # 4.1.0
3794         LC_SRC_IOV_ITER_RW
3795         LC_SRC_HAVE___BI_CNT
3796
3797         # 4.2
3798         LC_SRC_BIO_ENDIO_USES_ONE_ARG
3799         LC_SRC_SYMLINK_OPS_USE_NAMEIDATA
3800         LC_SRC_ACCOUNT_PAGE_DIRTIED_3ARGS
3801         LC_SRC_HAVE_CRYPTO_ALLOC_SKCIPHER
3802
3803         # 4.3
3804         LC_SRC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
3805         LC_SRC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
3806         LC_SRC_HAVE_CACHE_HEAD_HLIST
3807         LC_SRC_HAVE_XATTR_HANDLER_SIMPLIFIED
3808
3809         # 4.4
3810         LC_SRC_HAVE_LOCKS_LOCK_FILE_WAIT
3811         LC_SRC_HAVE_KEY_PAYLOAD_DATA_ARRAY
3812         LC_SRC_HAVE_XATTR_HANDLER_NAME
3813         LC_SRC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL
3814         LC_SRC_HAVE_BI_OPF
3815         LC_SRC_HAVE_SUBMIT_BIO_2ARGS
3816         LC_SRC_HAVE_CLEAN_BDEV_ALIASES
3817
3818         # 4.5
3819         LC_SRC_HAVE_FILE_DENTRY
3820
3821         # 4.6
3822         LC_SRC_HAVE_INODE_LOCK
3823         LC_SRC_HAVE_IOP_GET_LINK
3824         LC_SRC_HAVE_IN_COMPAT_SYSCALL
3825         LC_SRC_HAVE_XATTR_HANDLER_INODE_PARAM
3826         LC_SRC_LOCK_PAGE_MEMCG
3827         LC_SRC_HAVE_DOWN_WRITE_KILLABLE
3828
3829         # 4.7
3830         LC_SRC_D_IN_LOOKUP
3831         LC_SRC_D_INIT
3832         LC_SRC_DIRECTIO_2ARGS
3833         LC_SRC_GENERIC_WRITE_SYNC_2ARGS
3834         LC_SRC_FOP_ITERATE_SHARED
3835
3836         # 4.8
3837         LC_SRC_HAVE_POSIX_ACL_VALID_USER_NS
3838         LC_SRC_D_COMPARE_4ARGS
3839         LC_SRC_FULL_NAME_HASH_3ARGS
3840         LC_SRC_STRUCT_POSIX_ACL_XATTR
3841         LC_SRC_IOP_XATTR
3842
3843         # 4.9
3844         LC_SRC_GROUP_INFO_GID
3845         LC_SRC_VFS_SETXATTR
3846         LC_SRC_POSIX_ACL_UPDATE_MODE
3847         LC_SRC_HAVE_BDI_IO_PAGES
3848
3849         # 4.10
3850         LC_SRC_IOP_GENERIC_READLINK
3851         LC_SRC_HAVE_VM_FAULT_ADDRESS
3852
3853         # 4.11
3854         LC_SRC_INODEOPS_ENHANCED_GETATTR
3855         LC_SRC_VM_OPERATIONS_REMOVE_VMF_ARG
3856         LC_SRC_HAVE_KEY_USAGE_REFCOUNT
3857         LC_SRC_HAVE_CRYPTO_MAX_ALG_NAME_128
3858
3859         # 4.12
3860         LC_SRC_CURRENT_TIME
3861         LC_SRC_SUPER_SETUP_BDI_NAME
3862         LC_SRC_BI_STATUS
3863
3864         # 4.13
3865         LC_SRC_BIO_INTEGRITY_ENABLED
3866         LC_SRC_HAVE_GET_INODE_USAGE
3867
3868         # 4.14
3869         LC_SRC_PAGEVEC_INIT_ONE_PARAM
3870         LC_SRC_BI_BDEV
3871         LC_SRC_INTERVAL_TREE_CACHED
3872
3873         # 4.17
3874         LC_SRC_VM_FAULT_T
3875         LC_SRC_VM_FAULT_RETRY
3876         LC_SRC_I_PAGES
3877
3878         # 4.18
3879         LC_SRC_INODE_TIMESPEC64
3880         LC_SRC_ALLOC_FILE_PSEUDO
3881
3882         # 4.20
3883         LC_SRC_RADIX_TREE_TAG_SET
3884         LC_SRC_UAPI_LINUX_MOUNT_H
3885         LC_SRC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
3886
3887         # 5.0
3888         LC_SRC_GENL_FAMILY_HAS_RESV_START_OP
3889
3890         # 5.1
3891         LC_SRC_HAVE_BVEC_ITER_ALL
3892
3893         # 5.2
3894         LC_SRC_KEYRING_SEARCH_4ARGS
3895
3896         # 5.3
3897         LC_SRC_BIO_BI_PHYS_SEGMENTS
3898         LC_SRC_LM_COMPARE_OWNER_EXISTS
3899
3900         # 5.5
3901         LC_SRC_FSCRYPT_DIGESTED_NAME
3902
3903         # 5.7
3904         LC_SRC_FSCRYPT_DUMMY_CONTEXT_ENABLED
3905
3906         # 5.9
3907         LC_SRC_FSCRYPT_FNAME_ALLOC_BUFFER
3908         LC_SRC_FSCRYPT_SET_CONTEXT
3909         LC_SRC_FSCRYPT_NOKEY_NAME
3910         LC_SRC_FSCRYPT_SET_TEST_DUMMY_ENC_CHAR_ARG
3911         LC_SRC_FSCRYPT_DUMMY_POLICY
3912         LC_SRC_HAVE_ITER_FILE_SPLICE_WRITE
3913
3914         # 5.10
3915         LC_SRC_FSCRYPT_IS_NOKEY_NAME
3916         LC_SRC_FSCRYPT_PREPARE_READDIR
3917
3918         # 5.11
3919         LC_SRC_BIO_SET_DEV
3920
3921         # 5.12
3922         LC_SRC_HAVE_USER_NAMESPACE_ARG
3923
3924         # 5.15
3925         LC_SRC_HAVE_GET_ACL_RCU_ARG
3926
3927         # 5.16
3928         LC_SRC_HAVE_SECURITY_DENTRY_INIT_WITH_XATTR_NAME_ARG
3929         LC_SRC_HAVE_KIOCB_COMPLETE_2ARGS
3930
3931         # 5.17
3932         LC_SRC_HAVE_INVALIDATE_FOLIO
3933         LC_SRC_HAVE_DIRTY_FOLIO
3934
3935         # 5.18
3936         LC_SRC_HAVE_ALLOC_INODE_SB
3937
3938         # 5.19
3939         LC_SRC_GRAB_CACHE_PAGE_WRITE_BEGIN_WITH_FLAGS
3940         LC_SRC_HAVE_ADDRESS_SPACE_OPERATIONS_READ_FOLIO
3941         LC_SRC_HAVE_READ_CACHE_PAGE_FILLER_WITH_FILE
3942         LC_SRC_HAVE_ADDRESS_SPACE_OPERATIONS_RELEASE_FOLIO
3943         LC_SRC_HAVE_LSMCONTEXT_INIT
3944         LC_SRC_SECURITY_DENTRY_INIT_SECURTY_WITH_CTX
3945
3946         # 6.0
3947         LC_SRC_HAVE_NO_LLSEEK
3948         LC_SRC_DQUOT_TRANSFER_WITH_USER_NS
3949         LC_SRC_HAVE_ADDRESS_SPACE_OPERATIONS_MIGRATE_FOLIO
3950         LC_SRC_REGISTER_SHRINKER_FORMAT_NAMED
3951         LC_SRC_HAVE_VFS_SETXATTR_NON_CONST_VALUE
3952         LC_SRC_HAVE_IOV_ITER_GET_PAGES_ALLOC2
3953
3954         # 6.1
3955         LC_SRC_HAVE_GET_RANDOM_U32_AND_U64
3956         LC_SRC_NFS_FILLDIR_USE_CTX_RETURN_BOOL
3957         LC_SRC_HAVE_FILEMAP_GET_FOLIOS_CONTIG
3958
3959         # kernel patch to extend integrity interface
3960         LC_SRC_BIO_INTEGRITY_PREP_FN
3961 ])
3962
3963 AC_DEFUN([LC_PROG_LINUX_RESULTS], [
3964         AS_IF([test "x$enable_gss" != xno], [
3965                 LC_KEY_TYPE_INSTANTIATE_2ARGS
3966
3967                 LB2_TEST_CHECK_CONFIG_IM([CRYPTO_MD5], [],
3968                         [AC_MSG_WARN(
3969                         [kernel MD5 support is recommended by using GSS.])])
3970                 LB2_TEST_CHECK_CONFIG_IM([CRYPTO_SHA1], [],
3971                         [AC_MSG_WARN(
3972                         [kernel SHA1 support is recommended by using GSS.])])
3973                 LB2_TEST_CHECK_CONFIG_IM([CRYPTO_SHA256], [],
3974                         [AC_MSG_WARN(
3975                         [kernel SHA256 support is recommended by using GSS.])])
3976                 LB2_TEST_CHECK_CONFIG_IM([CRYPTO_SHA512], [],
3977                         [AC_MSG_WARN(
3978                         [kernel SHA512 support is recommended by using GSS.])])
3979         ])
3980         AS_IF([test "x$enable_server" != xno], [
3981                 LC_CONFIG_QUOTA
3982                 LC_STACK_SIZE
3983         ])
3984         LC_CONFIG_FHANDLE
3985         LC_POSIX_ACL_CONFIG
3986         LC_HAVE_PROJECT_QUOTA
3987
3988         # 3.11
3989         LC_INVALIDATE_RANGE
3990         LC_HAVE_DIR_CONTEXT
3991         LC_D_COMPARE_5ARGS
3992         LC_HAVE_DCOUNT
3993         LC_HAVE_DENTRY_D_U_D_ALIAS_LIST
3994         LC_HAVE_DENTRY_D_U_D_ALIAS_HLIST
3995         LC_HAVE_DENTRY_D_CHILD
3996         LC_PID_NS_FOR_CHILDREN
3997
3998         # 3.12
3999         LC_OLDSIZE_TRUNCATE_PAGECACHE
4000         LC_PTR_ERR_OR_ZERO_MISSING
4001         LC_KIOCB_KI_LEFT
4002         LC_REGISTER_SHRINKER_RET
4003
4004         # 3.13
4005         LC_VFS_RENAME_5ARGS
4006         LC_VFS_UNLINK_3ARGS
4007         LC_HAVE_D_IS_POSITIVE
4008
4009         # 3.14
4010         LC_HAVE_BVEC_ITER
4011         LC_HAVE_TRUNCATE_IPAGES_FINAL
4012         LC_IOPS_RENAME_WITH_FLAGS
4013         LC_IOP_SET_ACL
4014
4015         # 3.15
4016         LC_VFS_RENAME_6ARGS
4017
4018         # 3.16
4019         LC_DIRECTIO_USE_ITER
4020         LC_HAVE_IOV_ITER_INIT_DIRECTION
4021         LC_HAVE_IOV_ITER_TRUNCATE
4022         LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
4023         LC_PAGECACHE_GET_PAGE
4024
4025         # 3.17
4026         LC_HAVE_INTERVAL_BLK_INTEGRITY
4027         LC_KEY_MATCH_DATA
4028         LC_HAVE_BLK_INTEGRITY_ITER
4029
4030         # 3.18
4031         LC_PERCPU_COUNTER_INIT
4032         LC_NFS_FILLDIR_USE_CTX
4033
4034         # 3.19
4035         LC_KIOCB_HAS_NBYTES
4036         LC_HAVE_DQUOT_QC_DQBLK
4037         LC_HAVE_AIO_COMPLETE
4038         LC_HAVE_IS_ROOT_INODE
4039
4040         # 3.20
4041         LC_BACKING_DEV_INFO_REMOVAL
4042         LC_HAVE_BDI_CAP_MAP_COPY
4043
4044         # 4.1.0
4045         LC_IOV_ITER_RW
4046         LC_HAVE___BI_CNT
4047
4048         # 4.2
4049         LC_BIO_ENDIO_USES_ONE_ARG
4050         LC_SYMLINK_OPS_USE_NAMEIDATA
4051         LC_ACCOUNT_PAGE_DIRTIED_3ARGS
4052         LC_HAVE_CRYPTO_ALLOC_SKCIPHER
4053
4054         # 4.3
4055         LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
4056         LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
4057         LC_HAVE_CACHE_HEAD_HLIST
4058         LC_HAVE_XATTR_HANDLER_SIMPLIFIED
4059
4060         # 4.4
4061         LC_HAVE_LOCKS_LOCK_FILE_WAIT
4062         LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
4063         LC_HAVE_XATTR_HANDLER_NAME
4064         LC_HAVE_BI_OPF
4065         LC_HAVE_SUBMIT_BIO_2ARGS
4066         LC_HAVE_CLEAN_BDEV_ALIASES
4067
4068         # 4.5
4069         LC_HAVE_FILE_DENTRY
4070
4071         # 4.5
4072         LC_HAVE_INODE_LOCK
4073         LC_HAVE_IOP_GET_LINK
4074
4075         # 4.6
4076         LC_HAVE_IN_COMPAT_SYSCALL
4077         LC_HAVE_XATTR_HANDLER_INODE_PARAM
4078         LC_LOCK_PAGE_MEMCG
4079         LC_HAVE_DOWN_WRITE_KILLABLE
4080
4081         # 4.7
4082         LC_D_IN_LOOKUP
4083         LC_D_INIT
4084         LC_DIRECTIO_2ARGS
4085         LC_GENERIC_WRITE_SYNC_2ARGS
4086         LC_FOP_ITERATE_SHARED
4087
4088         # 4.8
4089         LC_HAVE_POSIX_ACL_VALID_USER_NS
4090         LC_D_COMPARE_4ARGS
4091         LC_FULL_NAME_HASH_3ARGS
4092         LC_STRUCT_POSIX_ACL_XATTR
4093         LC_IOP_XATTR
4094
4095         # 4.9
4096         LC_GROUP_INFO_GID
4097         LC_VFS_SETXATTR
4098         LC_POSIX_ACL_UPDATE_MODE
4099         LC_HAVE_BDI_IO_PAGES
4100
4101         # 4.10
4102         LC_IOP_GENERIC_READLINK
4103         LC_HAVE_VM_FAULT_ADDRESS
4104
4105         # 4.11
4106         LC_INODEOPS_ENHANCED_GETATTR
4107         LC_VM_OPERATIONS_REMOVE_VMF_ARG
4108         LC_HAVE_KEY_USAGE_REFCOUNT
4109         LC_HAVE_CRYPTO_MAX_ALG_NAME_128
4110
4111         # 4.12
4112         LC_CURRENT_TIME
4113         LC_SUPER_SETUP_BDI_NAME
4114         LC_BI_STATUS
4115
4116         # 4.13
4117         LC_BIO_INTEGRITY_ENABLED
4118         LC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL
4119         LC_HAVE_GET_INODE_USAGE
4120
4121         # 4.14
4122         LC_PAGEVEC_INIT_ONE_PARAM
4123         LC_BI_BDEV
4124         LC_INTERVAL_TREE_CACHED
4125
4126         # 4.17
4127         LC_VM_FAULT_T
4128         LC_VM_FAULT_RETRY
4129         LC_I_PAGES
4130
4131         # 4.18
4132         LC_ALLOC_FILE_PSEUDO
4133         LC_INODE_TIMESPEC64
4134
4135         # 4.20
4136         LC_RADIX_TREE_TAG_SET
4137         LC_UAPI_LINUX_MOUNT_H
4138         LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
4139
4140         # 5.0
4141         LC_GENL_FAMILY_HAS_RESV_START_OP
4142
4143         # 5.1
4144         LC_HAVE_BVEC_ITER_ALL
4145
4146         # 5.2
4147         LC_KEYRING_SEARCH_4ARGS
4148
4149         # 5.3
4150         LC_BIO_BI_PHYS_SEGMENTS
4151         LC_LM_COMPARE_OWNER_EXISTS
4152
4153         # 5.5
4154         LC_FSCRYPT_DIGESTED_NAME
4155
4156         # 5.7
4157         LC_FSCRYPT_DUMMY_CONTEXT_ENABLED
4158
4159         # 5.9
4160         LC_HAVE_ITER_FILE_SPLICE_WRITE
4161
4162         # 5.9
4163         LC_FSCRYPT_FNAME_ALLOC_BUFFER
4164         LC_FSCRYPT_SET_CONTEXT
4165         LC_FSCRYPT_D_REVALIDATE
4166         LC_FSCRYPT_NOKEY_NAME
4167         LC_FSCRYPT_SET_TEST_DUMMY_ENC_CHAR_ARG
4168         LC_FSCRYPT_DUMMY_POLICY
4169
4170         # 5.10
4171         LC_FSCRYPT_IS_NOKEY_NAME
4172         LC_FSCRYPT_PREPARE_READDIR
4173
4174         # 5.11
4175         LC_BIO_SET_DEV
4176
4177         # 5.12
4178         LC_HAVE_USER_NAMESPACE_ARG
4179
4180         # 5.15
4181         LC_HAVE_GET_ACL_RCU_ARG
4182
4183         # 5.16
4184         LC_HAVE_SECURITY_DENTRY_INIT_WITH_XATTR_NAME_ARG
4185         LC_HAVE_KIOCB_COMPLETE_2ARGS
4186         LC_EXPORTS_DELETE_FROM_PAGE_CACHE
4187
4188         # 5.17
4189         LC_HAVE_INVALIDATE_FOLIO
4190         LC_HAVE_DIRTY_FOLIO
4191
4192         # 5.18
4193         LC_HAVE_ALLOC_INODE_SB
4194
4195         # 5.19
4196         LC_GRAB_CACHE_PAGE_WRITE_BEGIN_WITH_FLAGS
4197         LC_HAVE_ADDRESS_SPACE_OPERATIONS_READ_FOLIO
4198         LC_HAVE_READ_CACHE_PAGE_FILLER_WITH_FILE
4199         LC_HAVE_ADDRESS_SPACE_OPERATIONS_RELEASE_FOLIO
4200         LC_HAVE_LSMCONTEXT_INIT
4201         LC_SECURITY_DENTRY_INIT_SECURTY_WITH_CTX
4202
4203         # 6.0
4204         LC_HAVE_NO_LLSEEK
4205         LC_DQUOT_TRANSFER_WITH_USER_NS
4206         LC_HAVE_ADDRESS_SPACE_OPERATIONS_MIGRATE_FOLIO
4207         LC_REGISTER_SHRINKER_FORMAT_NAMED
4208         LC_HAVE_VFS_SETXATTR_NON_CONST_VALUE
4209         LC_HAVE_IOV_ITER_GET_PAGES_ALLOC2
4210
4211         # 6.1
4212         LC_HAVE_GET_RANDOM_U32_AND_U64
4213         LC_NFS_FILLDIR_USE_CTX_RETURN_BOOL
4214         LC_HAVE_FILEMAP_GET_FOLIOS_CONTIG
4215
4216         # kernel patch to extend integrity interface
4217         LC_BIO_INTEGRITY_PREP_FN
4218 ])
4219
4220 #
4221 # LC_PROG_LINUX
4222 #
4223 # Lustre linux kernel checks
4224 #
4225 AC_DEFUN([LC_PROG_LINUX], [
4226         AC_MSG_NOTICE([Lustre kernel checks
4227 ==============================================================================])
4228
4229         LC_CONFIG_PINGER
4230         LC_CONFIG_CHECKSUM
4231         LC_CONFIG_FLOCK
4232         LC_CONFIG_HEALTH_CHECK_WRITE
4233         LC_CONFIG_LRU_RESIZE
4234         LC_CONFIG_GSS
4235
4236         LC_GLIBC_SUPPORT_FHANDLES
4237         LC_GLIBC_SUPPORT_COPY_FILE_RANGE
4238         LC_OPENSSL_SSK
4239         LC_OPENSSL_GETSEPOL
4240
4241         # 4.1.0 - Check export
4242         LC_HAVE_SYNC_READ_WRITE
4243
4244         # 4.8 - Check export
4245         LC_EXPORT_DEFAULT_FILE_SPLICE_READ
4246
4247         # 5.2 - Check export
4248         LC_ACCOUNT_PAGE_DIRTIED
4249
4250 ]) # LC_PROG_LINUX
4251
4252 #
4253 # LC_CONFIG_CLIENT
4254 #
4255 # Check whether to build the client side of Lustre
4256 #
4257 AC_DEFUN([LC_CONFIG_CLIENT], [
4258 AC_MSG_CHECKING([whether to build Lustre client support])
4259 AC_ARG_ENABLE([client],
4260         AS_HELP_STRING([--disable-client],
4261                 [disable Lustre client support]),
4262         [], [enable_client="yes"])
4263 AC_MSG_RESULT([$enable_client])
4264 ]) # LC_CONFIG_CLIENT
4265
4266 #
4267 # --enable-mpitests
4268 #
4269 AC_DEFUN([LB_CONFIG_MPITESTS], [
4270 AC_ARG_ENABLE([mpitests],
4271         AS_HELP_STRING([--enable-mpitests=<yes|no|mpicc wrapper>],
4272                        [include mpi tests]), [
4273                 enable_mpitests="yes"
4274                 case $enableval in
4275                 yes)
4276                         MPICC_WRAPPER="mpicc"
4277                         MPI_BIN=$(eval which $MPICC_WRAPPER | xargs dirname)
4278                         ;;
4279                 no)
4280                         enable_mpitests="no"
4281                         MPI_BIN=""
4282                         ;;
4283                 *)
4284                         MPICC_WRAPPER=$enableval
4285                         MPI_BIN=$(eval echo $MPICC_WRAPPER | xargs dirname)
4286                         ;;
4287                 esac
4288         ], [
4289                 enable_mpitests="yes"
4290                 MPICC_WRAPPER="mpicc"
4291                 MPI_BIN=$(eval which $MPICC_WRAPPER | xargs dirname)
4292         ])
4293
4294         if test "x$enable_mpitests" != "xno"; then
4295                 oldcc=$CC
4296                 CC=$MPICC_WRAPPER
4297                 AC_CACHE_CHECK([whether mpitests can be built],
4298                 lb_cv_mpi_tests, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([
4299                         #include <mpi.h>
4300                         int main(void) {
4301                                 int flag;
4302                                 MPI_Initialized(&flag);
4303                                 return 0;
4304                         }
4305                 ])], [lb_cv_mpi_tests="yes"], [lb_cv_mpi_tests="no"])
4306                 ])
4307                 enable_mpitests=$lb_cv_mpi_tests
4308                 CC=$oldcc
4309         fi
4310         AC_SUBST(MPI_BIN)
4311         AC_SUBST(MPICC_WRAPPER)
4312 ]) # LB_CONFIG_MPITESTS
4313
4314 #
4315 # LC_ENABLE_QUOTA
4316 #
4317 # whether to enable quota support global control
4318 #
4319 AC_DEFUN([LC_ENABLE_QUOTA], [
4320 AC_MSG_CHECKING([whether to enable quota support global control])
4321 AC_ARG_ENABLE([quota],
4322         AS_HELP_STRING([--enable-quota],
4323                 [enable quota support]),
4324         [], [enable_quota="yes"])
4325 AS_IF([test "x$enable_quota" = xyes],
4326         [AC_MSG_RESULT([yes])],
4327         [AC_MSG_RESULT([no])])
4328 ]) # LC_ENABLE_QUOTA
4329
4330 #
4331 # LC_QUOTA
4332 #
4333 AC_DEFUN([LC_QUOTA], [
4334 #check global
4335 LC_ENABLE_QUOTA
4336 #check for utils
4337 AS_IF([test "x$enable_quota" != xno -a "x$enable_utils" != xno], [
4338         AC_CHECK_HEADER([sys/quota.h],
4339                 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1,
4340                         [Define to 1 if you have <sys/quota.h>.])],
4341                 [AC_MSG_ERROR([did not find <sys/quota.h> on your system])])
4342 ])
4343 ]) # LC_QUOTA
4344
4345 #
4346 # LC_OSD_ADDON
4347 #
4348 # configure support for optional OSD implementation
4349 #
4350 AC_DEFUN([LC_OSD_ADDON], [
4351 AC_MSG_CHECKING([whether to use OSD addon])
4352 AC_ARG_WITH([osd],
4353         AS_HELP_STRING([--with-osd=path],
4354                 [set path to optional osd]),
4355         [
4356         case "$with_osd" in
4357         no)
4358                 ENABLEOSDADDON=0
4359                 ;;
4360         *)
4361                 OSDADDON="$with_osd"
4362                 ENABLEOSDADDON=1
4363                 ;;
4364         esac
4365         ], [
4366                 ENABLEOSDADDON=0
4367         ])
4368 AS_IF([test $ENABLEOSDADDON -eq 0], [
4369         AC_MSG_RESULT([no])
4370         OSDADDON=""
4371 ], [
4372         OSDMODNAME=$(basename $OSDADDON)
4373         AS_IF([test -e $LUSTRE/$OSDMODNAME], [
4374                 AC_MSG_RESULT([cannot link])
4375                 OSDADDON=""
4376         ], [ln -s $OSDADDON $LUSTRE/$OSDMODNAME], [
4377                 AC_MSG_RESULT([$OSDMODNAME])
4378                 OSDADDON="obj-m += $OSDMODNAME/"
4379         ], [
4380                 AC_MSG_RESULT([cannot link])
4381                 OSDADDON=""
4382         ])
4383 ])
4384 AC_SUBST(OSDADDON)
4385 ]) # LC_OSD_ADDON
4386
4387 #
4388 # LC_CONFIG_CRYPTO
4389 #
4390 # Check whether to enable Lustre client crypto
4391 #
4392 AC_DEFUN([LC_CONFIG_CRYPTO], [
4393 AC_MSG_CHECKING([whether to enable Lustre client crypto])
4394 AC_ARG_ENABLE([crypto],
4395         AS_HELP_STRING([--enable-crypto=yes|no|in-kernel],
4396                 [enable Lustre client crypto (default is yes), use 'in-kernel' to force use of in-kernel fscrypt instead of embedded llcrypt]),
4397         [], [enable_crypto="auto"])
4398 AS_IF([test "x$enable_crypto" != xno -a "x$enable_dist" = xno], [
4399         AC_MSG_RESULT(
4400         )
4401         LC_IS_ENCRYPTED
4402         LC_FSCRYPT_SUPPORT])
4403 AS_IF([test "x$enable_crypto" = xin-kernel], [
4404         AS_IF([test "x$has_fscrypt_support" = xyes], [
4405               AC_DEFINE(HAVE_LUSTRE_CRYPTO, 1, [Enable Lustre client crypto via in-kernel fscrypt])], [
4406               AC_MSG_ERROR([Lustre client crypto cannot be enabled via in-kernel fscrypt.])
4407               enable_crypto=no])],
4408         [AS_IF([test "x$has_is_encrypted" = xyes], [
4409               AC_DEFINE(HAVE_LUSTRE_CRYPTO, 1, [Enable Lustre client crypto via embedded llcrypt])
4410               AC_DEFINE(CONFIG_LL_ENCRYPTION, 1, [embedded llcrypt])
4411               AC_DEFINE(HAVE_FSCRYPT_DUMMY_CONTEXT_ENABLED, 1, [embedded llcrypt uses llcrypt_dummy_context_enabled()])
4412               enable_crypto="embedded-llcrypt"
4413               enable_llcrypt=yes], [
4414               AS_IF([test "x$enable_crypto" = xyes],
4415                     [AC_MSG_ERROR([Lustre client crypto cannot be enabled because of lack of encryption support in your kernel.])])
4416               AS_IF([test "x$enable_crypto" != xno -a "x$enable_dist" = xno],
4417                     [AC_MSG_WARN(Lustre client crypto cannot be enabled because of lack of encryption support in your kernel.)])
4418               enable_crypto=no])])
4419 AS_IF([test "x$enable_dist" != xno], [
4420         enable_crypto=yes
4421         enable_llcrypt=yes])
4422 AC_MSG_RESULT([$enable_crypto])
4423 ]) # LC_CONFIG_CRYPTO
4424
4425 #
4426 # LC_CONFIGURE
4427 #
4428 # other configure checks
4429 #
4430 AC_DEFUN([LC_CONFIGURE], [
4431 AC_MSG_NOTICE([Lustre core checks
4432 ==============================================================================])
4433
4434 AS_IF([test $target_cpu == "i686" -o $target_cpu == "x86_64"],
4435         [CFLAGS="$CFLAGS -Wall -Werror"])
4436
4437 # maximum MDS thread count
4438 LC_MDS_MAX_THREADS
4439
4440 # lustre/utils/gss/gss_util.c
4441 # lustre/utils/gss/gssd_proc.c
4442 # lustre/utils/gss/krb5_util.c
4443 # lustre/utils/llog_reader.c
4444 # lustre/utils/create_iam.c
4445 # lustre/utils/libiam.c
4446 AC_CHECK_HEADERS([netdb.h endian.h])
4447 AC_CHECK_FUNCS([gethostbyname])
4448
4449 # lustre/utils/llverfs.c lustre/utils/libmount_utils_ldiskfs.c
4450 AC_CHECK_HEADERS([ext2fs/ext2fs.h], [], [
4451         AS_IF([test "x$enable_utils" = xyes -a "x$enable_ldiskfs" = xyes], [
4452                 AC_MSG_ERROR([
4453 ext2fs.h not found. Please install e2fsprogs development package.
4454                 ])
4455         ])
4456 ])
4457
4458 # lustre/tests/statx_test.c
4459 AC_CHECK_FUNCS([statx])
4460
4461 # lustre/utils/lfs.c
4462 AS_IF([test "$enable_dist" = "no"], [
4463                 AC_CHECK_LIB([z], [crc32], [
4464                                  AC_CHECK_HEADER([zlib.h], [], [
4465                                                  AC_MSG_ERROR([zlib.h not found.])])
4466                                  ], [
4467                                  AC_MSG_ERROR([
4468                 zlib library not found. Please install zlib development package.])
4469                 ])
4470 ])
4471
4472 SELINUX=""
4473
4474 AC_CHECK_LIB([selinux], [is_selinux_enabled],
4475         [AC_CHECK_HEADERS([selinux/selinux.h],
4476                         [SELINUX="-lselinux"
4477                         AC_DEFINE([HAVE_SELINUX], 1,
4478                                 [support for selinux ])],
4479                         [AC_MSG_WARN([
4480
4481 No libselinux-devel package found, unable to build selinux enabled tools
4482 ])
4483 ])],
4484         [AC_MSG_WARN([
4485
4486 No selinux package found, unable to build selinux enabled tools
4487 ])
4488 ])
4489 AC_SUBST(SELINUX)
4490
4491 AC_CHECK_LIB([keyutils], [add_key])
4492
4493 # Super safe df
4494 AC_MSG_CHECKING([whether to report minimum OST free space])
4495 AC_ARG_ENABLE([mindf],
4496         AS_HELP_STRING([--enable-mindf],
4497                 [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
4498         [], [enable_mindf="no"])
4499 AC_MSG_RESULT([$enable_mindf])
4500 AS_IF([test "$enable_mindf" = "yes"],
4501         [AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])])
4502
4503 AC_MSG_CHECKING([whether to randomly failing memory alloc])
4504 AC_ARG_ENABLE([fail_alloc],
4505         AS_HELP_STRING([--disable-fail-alloc],
4506                 [disable randomly alloc failure]),
4507         [], [enable_fail_alloc="yes"])
4508 AC_MSG_RESULT([$enable_fail_alloc])
4509 AS_IF([test "x$enable_fail_alloc" != xno],
4510         [AC_DEFINE([RANDOM_FAIL_ALLOC], 1,
4511                 [enable randomly alloc failure])])
4512
4513 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
4514 AC_ARG_ENABLE([invariants],
4515         AS_HELP_STRING([--enable-invariants],
4516                 [enable invariant checking (cpu intensive)]),
4517         [], [enable_invariants="no"])
4518 AC_MSG_RESULT([$enable_invariants])
4519 AS_IF([test "x$enable_invariants" = xyes],
4520         [AC_DEFINE([CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK], 1,
4521                 [enable invariant checking])])
4522
4523 AC_MSG_CHECKING([whether to track references with lu_ref])
4524 AC_ARG_ENABLE([lu_ref],
4525         AS_HELP_STRING([--enable-lu_ref],
4526                 [enable lu_ref reference tracking code]),
4527         [], [enable_lu_ref="no"])
4528 AC_MSG_RESULT([$enable_lu_ref])
4529 AS_IF([test "x$enable_lu_ref" = xyes],
4530         [AC_DEFINE([CONFIG_LUSTRE_DEBUG_LU_REF], 1,
4531                 [enable lu_ref reference tracking code])])
4532
4533 AC_MSG_CHECKING([whether to enable page state tracking])
4534 AC_ARG_ENABLE([pgstate-track],
4535         AS_HELP_STRING([--enable-pgstate-track],
4536                 [enable page state tracking]),
4537         [], [enable_pgstat_track="no"])
4538 AC_MSG_RESULT([$enable_pgstat_track])
4539 AS_IF([test "x$enable_pgstat_track" = xyes],
4540         [AC_DEFINE([CONFIG_DEBUG_PAGESTATE_TRACKING], 1,
4541                 [enable page state tracking code])])
4542
4543 PKG_PROG_PKG_CONFIG
4544 AC_MSG_CHECKING([systemd unit file directory])
4545 AC_ARG_WITH([systemdsystemunitdir],
4546         [AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
4547                 [Directory for systemd service files])],
4548         [], [with_systemdsystemunitdir=auto])
4549 AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"],
4550         [def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
4551         AS_IF([test "x$def_systemdsystemunitdir" = "x"],
4552                 [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
4553                 [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
4554                 with_systemdsystemunitdir=no],
4555         [with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
4556 AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
4557         [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
4558 AC_MSG_RESULT([$with_systemdsystemunitdir])
4559
4560 AC_MSG_CHECKING([bash-completion directory])
4561 AC_ARG_WITH([bash-completion-dir],
4562         AS_HELP_STRING([--with-bash-completion-dir[=PATH]],
4563                 [Install the bash auto-completion script in this directory.]),
4564         [],
4565         [with_bash_completion_dir=yes])
4566 AS_IF([test "x$with_bash_completion_dir" = "xyes"], [
4567         BASH_COMPLETION_DIR="`pkg-config --variable=completionsdir bash-completion`"
4568         AS_IF([test "x$BASH_COMPLETION_DIR" = "x"], [
4569                 [BASH_COMPLETION_DIR="/usr/share/bash-completion/completions"]
4570         ])
4571 ], [
4572         BASH_COMPLETION_DIR="$with_bash_completion_dir"
4573 ])
4574 AC_SUBST([BASH_COMPLETION_DIR])
4575 AC_MSG_RESULT([$BASH_COMPLETION_DIR])
4576 ]) # LC_CONFIGURE
4577
4578 #
4579 # LC_CONDITIONALS
4580 #
4581 # AM_CONDITIONALS for lustre
4582 #
4583 AC_DEFUN([LC_CONDITIONALS], [
4584 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
4585 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
4586 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
4587 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
4588 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
4589 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
4590 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
4591 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
4592 AM_CONDITIONAL(GSS_SSK, test x$enable_ssk = xyes)
4593 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
4594 AM_CONDITIONAL(HAVE_SYSTEMD, test "x$with_systemdsystemunitdir" != "xno")
4595 AM_CONDITIONAL(ENABLE_BASH_COMPLETION, test "x$with_bash_completion_dir" != "xno")
4596 AM_CONDITIONAL(XATTR_HANDLER, test "x$lb_cv_compile_xattr_handler_flags" = xyes)
4597 AM_CONDITIONAL(SELINUX, test "$SELINUX" = "-lselinux")
4598 AM_CONDITIONAL(GETSEPOL, test x$enable_getsepol = xyes)
4599 AM_CONDITIONAL(LLCRYPT, test x$enable_llcrypt = xyes)
4600 AM_CONDITIONAL(LIBAIO, test x$enable_libaio = xyes)
4601 ]) # LC_CONDITIONALS
4602
4603 #
4604 # LC_CONFIG_FILES
4605 #
4606 # files that should be generated with AC_OUTPUT
4607 #
4608 AC_DEFUN([LC_CONFIG_FILES],
4609 [AC_CONFIG_FILES([
4610 lustre/Makefile
4611 lustre/autoMakefile
4612 lustre/autoconf/Makefile
4613 lustre/conf/Makefile
4614 lustre/conf/resource/Makefile
4615 lustre/contrib/Makefile
4616 lustre/doc/Makefile
4617 lustre/include/Makefile
4618 lustre/include/lustre/Makefile
4619 lustre/include/uapi/linux/lustre/Makefile
4620 lustre/kernel_patches/targets/5.14-rhel9.2.target
4621 lustre/kernel_patches/targets/5.14-rhel9.1.target
4622 lustre/kernel_patches/targets/5.14-rhel9.0.target
4623 lustre/kernel_patches/targets/4.18-rhel8.8.target
4624 lustre/kernel_patches/targets/4.18-rhel8.7.target
4625 lustre/kernel_patches/targets/4.18-rhel8.6.target
4626 lustre/kernel_patches/targets/4.18-rhel8.5.target
4627 lustre/kernel_patches/targets/4.18-rhel8.4.target
4628 lustre/kernel_patches/targets/4.18-rhel8.3.target
4629 lustre/kernel_patches/targets/4.18-rhel8.2.target
4630 lustre/kernel_patches/targets/4.18-rhel8.1.target
4631 lustre/kernel_patches/targets/4.18-rhel8.target
4632 lustre/kernel_patches/targets/3.10-rhel7.9.target
4633 lustre/kernel_patches/targets/3.10-rhel7.8.target
4634 lustre/kernel_patches/targets/3.10-rhel7.7.target
4635 lustre/kernel_patches/targets/3.10-rhel7.6.target
4636 lustre/kernel_patches/targets/3.10-rhel7.5.target
4637 lustre/kernel_patches/targets/4.14-rhel7.5.target
4638 lustre/kernel_patches/targets/4.14-rhel7.6.target
4639 lustre/kernel_patches/targets/4.12-sles12sp4.target
4640 lustre/kernel_patches/targets/4.12-sles12sp5.target
4641 lustre/kernel_patches/targets/4.12-sles15sp1.target
4642 lustre/kernel_patches/targets/5.3-sles15sp2.target
4643 lustre/kernel_patches/targets/5.3-sles15sp3.target
4644 lustre/kernel_patches/targets/5.14-sles15sp4.target
4645 lustre/kernel_patches/targets/3.x-fc18.target
4646 lustre/kernel_patches/targets/5.10-oe2203.target
4647 lustre/ldlm/Makefile
4648 lustre/ldlm/autoMakefile
4649 lustre/ec/autoMakefile
4650 lustre/ec/Makefile
4651 lustre/fid/Makefile
4652 lustre/fid/autoMakefile
4653 lustre/llite/Makefile
4654 lustre/llite/autoMakefile
4655 lustre/lov/Makefile
4656 lustre/lov/autoMakefile
4657 lustre/mdc/Makefile
4658 lustre/mdc/autoMakefile
4659 lustre/lmv/Makefile
4660 lustre/lmv/autoMakefile
4661 lustre/lfsck/Makefile
4662 lustre/lfsck/autoMakefile
4663 lustre/mdt/Makefile
4664 lustre/mdt/autoMakefile
4665 lustre/mdd/Makefile
4666 lustre/mdd/autoMakefile
4667 lustre/fld/Makefile
4668 lustre/fld/autoMakefile
4669 lustre/obdclass/Makefile
4670 lustre/obdclass/autoMakefile
4671 lustre/obdecho/Makefile
4672 lustre/obdecho/autoMakefile
4673 lustre/ofd/Makefile
4674 lustre/ofd/autoMakefile
4675 lustre/osc/Makefile
4676 lustre/osc/autoMakefile
4677 lustre/ost/Makefile
4678 lustre/ost/autoMakefile
4679 lustre/osd-ldiskfs/Makefile
4680 lustre/osd-ldiskfs/autoMakefile
4681 lustre/osd-zfs/Makefile
4682 lustre/osd-zfs/autoMakefile
4683 lustre/mgc/Makefile
4684 lustre/mgc/autoMakefile
4685 lustre/mgs/Makefile
4686 lustre/mgs/autoMakefile
4687 lustre/target/Makefile
4688 lustre/target/autoMakefile
4689 lustre/ptlrpc/Makefile
4690 lustre/ptlrpc/autoMakefile
4691 lustre/ptlrpc/gss/Makefile
4692 lustre/ptlrpc/gss/autoMakefile
4693 lustre/quota/Makefile
4694 lustre/quota/autoMakefile
4695 lustre/scripts/Makefile
4696 lustre/scripts/systemd/Makefile
4697 lustre/tests/Makefile
4698 lustre/tests/mpi/Makefile
4699 lustre/tests/iabf/Makefile
4700 lustre/tests/lutf/Makefile
4701 lustre/tests/lutf/src/Makefile
4702 lustre/tests/kernel/Makefile
4703 lustre/tests/kernel/autoMakefile
4704 lustre/utils/Makefile
4705 lustre/utils/gss/Makefile
4706 lustre/osp/Makefile
4707 lustre/osp/autoMakefile
4708 lustre/lod/Makefile
4709 lustre/lod/autoMakefile
4710 ])
4711 ]) # LC_CONFIG_FILES