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