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