Whamcloud - gitweb
cbd4f1dceb572107f4102ea515d4253f8c2c8ebd
[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_ACCOUNT_PAGE_DIRTIED_3ARGS
1878 #
1879 # 4.2 kernel page dirtied takes 3 arguments
1880 #
1881 AC_DEFUN([LC_ACCOUNT_PAGE_DIRTIED_3ARGS], [
1882 LB_CHECK_COMPILE([if 'account_page_dirtied' with 3 args exists],
1883 account_page_dirtied, [
1884         #include <linux/mm.h>
1885 ],[
1886         account_page_dirtied(NULL, NULL, NULL);
1887 ],[
1888         AC_DEFINE(HAVE_ACCOUNT_PAGE_DIRTIED_3ARGS, 1,
1889                 [account_page_dirtied takes three arguments])
1890 ])
1891 ]) # LC_ACCOUNT_PAGE_DIRTIED_3ARGS
1892
1893 #
1894 # LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
1895 #
1896 # 4.3 replace interval with interval_exp in 'struct blk_integrity'
1897 # 'struct blk_integrity_profile' is also added in this version,
1898 # thus use this to determine whether 'struct blk_integrity' has profile
1899 #
1900 AC_DEFUN([LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY], [
1901 LB_CHECK_COMPILE([if 'blk_integrity.interval_exp' exist],
1902 blk_integrity_interval_exp, [
1903         #include <linux/blkdev.h>
1904 ],[
1905         ((struct blk_integrity *)0)->interval_exp = 0;
1906 ],[
1907         AC_DEFINE(HAVE_INTERVAL_EXP_BLK_INTEGRITY, 1,
1908                 [blk_integrity.interval_exp exist])
1909 ])
1910 ]) # LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
1911
1912 #
1913 # LC_HAVE_LOOP_CTL_GET_FREE
1914 #
1915 # 4.x kernel have moved userspace APIs to
1916 # the separate directory and all of them
1917 # support LOOP_CTL_GET_FREE
1918 #
1919 AC_DEFUN([LC_HAVE_LOOP_CTL_GET_FREE], [
1920 LB_CHECK_FILE([$LINUX/include/linux/loop.h], [
1921         LB_CHECK_COMPILE([if have 'HAVE_LOOP_CTL_GET_FREE'],
1922         LOOP_CTL_GET_FREE, [
1923                 #include <linux/loop.h>
1924         ],[
1925                 int i;
1926
1927                 i = LOOP_CTL_GET_FREE;
1928         ],[
1929                 AC_DEFINE(HAVE_LOOP_CTL_GET_FREE, 1,
1930                         [LOOP_CTL_GET_FREE exist])
1931         ])
1932 ],[
1933         AC_DEFINE(HAVE_LOOP_CTL_GET_FREE, 1,
1934                 [kernel has LOOP_CTL_GET_FREE])
1935 ])
1936 ]) # LC_HAVE_LOOP_CTL_GET_FREE
1937
1938 #
1939 # LC_HAVE_CACHE_HEAD_HLIST
1940 #
1941 # 4.3 kernel swiched to hlist for cache_head
1942 #
1943 AC_DEFUN([LC_HAVE_CACHE_HEAD_HLIST], [
1944 LB_CHECK_COMPILE([if 'struct cache_head' has 'cache_list' field],
1945 cache_head_has_hlist, [
1946         #include <linux/sunrpc/cache.h>
1947 ],[
1948         do {} while(sizeof(((struct cache_head *)0)->cache_list));
1949 ],[
1950         AC_DEFINE(HAVE_CACHE_HEAD_HLIST, 1,
1951                 [cache_head has hlist cache_list])
1952 ])
1953 ]) # LC_HAVE_CACHE_HEAD_HLIST
1954
1955 #
1956 # LC_HAVE_XATTR_HANDLER_SIMPLIFIED
1957 #
1958 # Kernel version 4.3 commit e409de992e3ea3674393465f07cc71c948edd87a
1959 # simplified xattr_handler handling by passing in the handler pointer
1960 #
1961 AC_DEFUN([LC_HAVE_XATTR_HANDLER_SIMPLIFIED], [
1962 tmp_flags="$EXTRA_KCFLAGS"
1963 EXTRA_KCFLAGS="-Werror"
1964 LB_CHECK_COMPILE([if 'struct xattr_handler' functions pass in handler pointer],
1965 xattr_handler_simplified, [
1966         #include <linux/xattr.h>
1967 ],[
1968         struct xattr_handler handler;
1969
1970         ((struct xattr_handler *)0)->get(&handler, NULL, NULL, NULL, 0);
1971         ((struct xattr_handler *)0)->set(&handler, NULL, NULL, NULL, 0, 0);
1972 ],[
1973         AC_DEFINE(HAVE_XATTR_HANDLER_SIMPLIFIED, 1, [handler pointer is parameter])
1974 ])
1975 EXTRA_KCFLAGS="$tmp_flags"
1976 ]) # LC_HAVE_XATTR_HANDLER_SIMPLIFIED
1977
1978 #
1979 # LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
1980 #
1981 # 4.3 replace interval with interval_exp in 'struct blk_integrity'.
1982 #
1983 AC_DEFUN([LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD], [
1984 LB_CHECK_COMPILE([if 'bio_integrity_payload.bip_iter' exist],
1985 bio_integrity_payload_bip_iter, [
1986         #include <linux/bio.h>
1987 ],[
1988         ((struct bio_integrity_payload *)0)->bip_iter.bi_size = 0;
1989 ],[
1990         AC_DEFINE(HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD, 1,
1991                 [bio_integrity_payload.bip_iter exist])
1992 ])
1993 ]) # LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
1994
1995 #
1996 # LC_BIO_INTEGRITY_PREP_FN
1997 #
1998 # Lustre kernel patch extents bio_integrity_prep to accept optional
1999 # generate/verify_fn as extra args.
2000 #
2001 AC_DEFUN([LC_BIO_INTEGRITY_PREP_FN], [
2002 LB_CHECK_COMPILE([if 'bio_integrity_prep_fn' exists],
2003 bio_integrity_prep_fn, [
2004         #include <linux/bio.h>
2005 ],[
2006         bio_integrity_prep_fn(NULL, NULL, NULL);
2007 ],[
2008         AC_DEFINE(HAVE_BIO_INTEGRITY_PREP_FN, 1,
2009                 [kernel has bio_integrity_prep_fn])
2010         AC_SUBST(PATCHED_INTEGRITY_INTF)
2011 ],[
2012         AC_SUBST(PATCHED_INTEGRITY_INTF, [#])
2013 ])
2014 ]) # LC_BIO_INTEGRITY_PREP_FN
2015
2016 #
2017 # LC_HAVE_BI_OPF
2018 #
2019 # 4.4/4.8 redefined bi_rw as bi_opf (SLES12/kernel commit 4382e33ad37486)
2020 #
2021 AC_DEFUN([LC_HAVE_BI_OPF], [
2022 LB_CHECK_COMPILE([if Linux kernel has bi_opf in struct bio],
2023 have_bi_opf, [
2024         #include <linux/bio.h>
2025 ],[
2026         struct bio bio;
2027
2028         bio.bi_opf = 0;
2029 ], [
2030         AC_DEFINE(HAVE_BI_OPF, 1,
2031                 [struct bio has bi_opf])
2032 ])
2033 ]) # LC_HAVE_BI_OPF
2034
2035 #
2036 # LC_HAVE_SUBMIT_BIO_2ARGS
2037 #
2038 # 4.4 removed an argument from submit_bio
2039 #
2040 AC_DEFUN([LC_HAVE_SUBMIT_BIO_2ARGS], [
2041 LB_CHECK_COMPILE([if submit_bio takes two arguments],
2042 have_submit_bio_2args, [
2043         #include <linux/bio.h>
2044 ],[
2045         struct bio bio;
2046         submit_bio(READ, &bio);
2047 ], [
2048         AC_DEFINE(HAVE_SUBMIT_BIO_2ARGS, 1,
2049                 [submit_bio takes two arguments])
2050 ])
2051 ]) # LC_HAVE_SUBMIT_BIO_2_ARGS
2052
2053 #
2054 # LC_HAVE_CLEAN_BDEV_ALIASES
2055 #
2056 # 4.4/4.9 unmap_underlying_metadata was replaced by clean_bdev_aliases
2057 # (SLES12/kernel commit 29f3ad7d8380364c)
2058 #
2059 AC_DEFUN([LC_HAVE_CLEAN_BDEV_ALIASES], [
2060 LB_CHECK_COMPILE([if kernel has clean_bdev_aliases],
2061 have_clean_bdev_aliases, [
2062         #include <linux/buffer_head.h>
2063 ],[
2064         struct block_device bdev;
2065         clean_bdev_aliases(&bdev,1,1);
2066 ], [
2067         AC_DEFINE(HAVE_CLEAN_BDEV_ALIASES, 1,
2068                 [kernel has clean_bdev_aliases])
2069 ])
2070 ]) # LC_HAVE_CLEAN_BDEV_ALIASES
2071
2072 #
2073 # LC_HAVE_LOCKS_LOCK_FILE_WAIT
2074 #
2075 # 4.4 kernel have moved locks API users to
2076 # locks_lock_inode_wait()
2077 #
2078 AC_DEFUN([LC_HAVE_LOCKS_LOCK_FILE_WAIT], [
2079 LB_CHECK_COMPILE([if 'locks_lock_file_wait' exists],
2080 locks_lock_file_wait, [
2081         #include <linux/fs.h>
2082 ],[
2083         locks_lock_file_wait(NULL, NULL);
2084 ],[
2085         AC_DEFINE(HAVE_LOCKS_LOCK_FILE_WAIT, 1,
2086                 [kernel has locks_lock_file_wait])
2087 ])
2088 ]) # LC_HAVE_LOCKS_LOCK_FILE_WAIT
2089
2090 #
2091 # LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
2092 #
2093 # 4.4 kernel merged type-specific data with the payload data for keys
2094 #
2095 AC_DEFUN([LC_HAVE_KEY_PAYLOAD_DATA_ARRAY], [
2096 LB_CHECK_COMPILE([if 'struct key' has 'payload.data' as an array],
2097 key_payload_data_array, [
2098         #include <linux/key.h>
2099 ],[
2100         struct key key = { };
2101
2102         key.payload.data[0] = NULL;
2103 ],[
2104         AC_DEFINE(HAVE_KEY_PAYLOAD_DATA_ARRAY, 1, [payload.data is an array])
2105 ])
2106 ]) #LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
2107
2108 #
2109 # LC_HAVE_XATTR_HANDLER_NAME
2110 #
2111 # Kernel version 4.4 commit 98e9cb5711c68223f0e4d5201b9a6add255ec550
2112 # add a name member to struct xattr_handler
2113 #
2114 AC_DEFUN([LC_HAVE_XATTR_HANDLER_NAME], [
2115 tmp_flags="$EXTRA_KCFLAGS"
2116 EXTRA_KCFLAGS="-Werror"
2117 LB_CHECK_COMPILE([if 'struct xattr_handler' has a name member],
2118 xattr_handler_name, [
2119         #include <linux/xattr.h>
2120 ],[
2121         ((struct xattr_handler *)NULL)->name = NULL;
2122 ],[
2123         AC_DEFINE(HAVE_XATTR_HANDLER_NAME, 1, [xattr_handler has a name member])
2124 ])
2125 EXTRA_KCFLAGS="$tmp_flags"
2126 ]) # LC_HAVE_XATTR_HANDLER_NAME
2127
2128 #
2129 # LC_HAVE_FILE_DENTRY
2130 #
2131 # 4.5 adds wrapper file_dentry
2132 #
2133 AC_DEFUN([LC_HAVE_FILE_DENTRY], [
2134 LB_CHECK_COMPILE([if Linux kernel has 'file_dentry'],
2135 file_dentry, [
2136         #include <linux/fs.h>
2137 ],[
2138         file_dentry(NULL);
2139 ], [
2140         AC_DEFINE(HAVE_FILE_DENTRY, 1,
2141                 [kernel has file_dentry])
2142 ])
2143 ]) # LC_HAVE_FILE_DENTRY
2144
2145 #
2146 # LC_HAVE_INODE_LOCK
2147 #
2148 # 4.5 introduced inode_lock
2149 #
2150 AC_DEFUN([LC_HAVE_INODE_LOCK], [
2151 LB_CHECK_COMPILE([if 'inode_lock' is defined],
2152 inode_lock, [
2153         #include <linux/fs.h>
2154 ],[
2155         inode_lock(NULL);
2156 ], [
2157         AC_DEFINE(HAVE_INODE_LOCK, 1,
2158                   [inode_lock is defined])
2159 ])
2160 ]) # LC_HAVE_INODE_LOCK
2161
2162 #
2163 # LC_HAVE_IOP_GET_LINK
2164 #
2165 # 4.5 vfs replaced iop->follow_link with
2166 # iop->get_link
2167 #
2168 AC_DEFUN([LC_HAVE_IOP_GET_LINK], [
2169 LB_CHECK_COMPILE([if 'iop' has 'get_link'],
2170 inode_ops_get_link, [
2171         #include <linux/fs.h>
2172 ],[
2173         struct inode_operations iop;
2174         iop.get_link = NULL;
2175 ],[
2176         AC_DEFINE(HAVE_IOP_GET_LINK, 1,
2177                 [have iop get_link])
2178 ])
2179 ]) # LC_HAVE_IOP_GET_LINK
2180
2181 #
2182 # LC_HAVE_IN_COMPAT_SYSCALL
2183 #
2184 # 4.6 renamed is_compat_task to in_compat_syscall
2185 #
2186 AC_DEFUN([LC_HAVE_IN_COMPAT_SYSCALL], [
2187 LB_CHECK_COMPILE([if 'in_compat_syscall' is defined],
2188 in_compat_syscall, [
2189         #include <linux/compat.h>
2190 ],[
2191         in_compat_syscall();
2192 ],[
2193         AC_DEFINE(HAVE_IN_COMPAT_SYSCALL, 1,
2194                 [have in_compat_syscall])
2195 ])
2196 ]) # LC_HAVE_IN_COMPAT_SYSCALL
2197
2198 #
2199 # LC_HAVE_XATTR_HANDLER_INODE_PARAM
2200 #
2201 # Kernel version 4.6 commit b296821a7c42fa58baa17513b2b7b30ae66f3336
2202 # and commit 5930122683dff58f0846b0f0405b4bd598a3ba6a added inode parameter
2203 # to xattr_handler functions
2204 #
2205 AC_DEFUN([LC_HAVE_XATTR_HANDLER_INODE_PARAM], [
2206 tmp_flags="$EXTRA_KCFLAGS"
2207 EXTRA_KCFLAGS="-Werror"
2208 LB_CHECK_COMPILE([if 'struct xattr_handler' functions have inode parameter],
2209 xattr_handler_inode_param, [
2210         #include <linux/xattr.h>
2211 ],[
2212         const struct xattr_handler handler;
2213
2214         ((struct xattr_handler *)0)->get(&handler, NULL, NULL, NULL, NULL, 0);
2215         ((struct xattr_handler *)0)->set(&handler, NULL, NULL, NULL, NULL, 0, 0);
2216 ],[
2217         AC_DEFINE(HAVE_XATTR_HANDLER_INODE_PARAM, 1, [needs inode parameter])
2218 ])
2219 EXTRA_KCFLAGS="$tmp_flags"
2220 ]) # LC_HAVE_XATTR_HANDLER_INODE_PARAM
2221
2222 #
2223 # LC_D_IN_LOOKUP
2224 #
2225 # Kernel version 4.6 commit 85c7f81041d57cfe9dc97f4680d5586b54534a39
2226 # introduced parallel lookups in the VFS layer. The inline function
2227 # d_in_lookup was added to notify when the same item was being queried
2228 # at the same time.
2229 #
2230 AC_DEFUN([LC_D_IN_LOOKUP], [
2231 tmp_flags="$EXTRA_KCFLAGS"
2232 EXTRA_KCFLAGS="-Werror"
2233 LB_CHECK_COMPILE([if 'd_in_lookup' is defined],
2234 d_in_lookup, [
2235         #include <linux/dcache.h>
2236 ],[
2237         d_in_lookup(NULL);
2238 ],[
2239         AC_DEFINE(HAVE_D_IN_LOOKUP, 1, [d_in_lookup is defined])
2240 ])
2241 EXTRA_KCFLAGS="$tmp_flags"
2242 ]) # LC_D_IN_LOOKUP
2243
2244 #
2245 # LC_LOCK_PAGE_MEMCG
2246 #
2247 # Kernel version 4.6 adds lock_page_memcg
2248 #
2249 AC_DEFUN([LC_LOCK_PAGE_MEMCG], [
2250 LB_CHECK_COMPILE([if 'lock_page_memcg' is defined],
2251 lock_page_memcg, [
2252         #include <linux/memcontrol.h>
2253 ],[
2254         lock_page_memcg(NULL);
2255 ],[
2256         AC_DEFINE(HAVE_LOCK_PAGE_MEMCG, 1,
2257                 [lock_page_memcg is defined])
2258 ])
2259 ]) # LC_LOCK_PAGE_MEMCG
2260
2261 #
2262 # LC_DIRECTIO_2ARGS
2263 #
2264 # Kernel version 4.7 commit c8b8e32d700fe943a935e435ae251364d016c497
2265 # direct-io: eliminate the offset argument to ->direct_IO
2266 #
2267 AC_DEFUN([LC_DIRECTIO_2ARGS], [
2268 LB_CHECK_COMPILE([if '->direct_IO()' taken 2 arguments],
2269 direct_io_2args, [
2270         #include <linux/fs.h>
2271 ],[
2272         struct address_space_operations ops = { };
2273         struct iov_iter *iter = NULL;
2274         struct kiocb *iocb = NULL;
2275         int rc;
2276
2277         rc = ops.direct_IO(iocb, iter);
2278 ],[
2279         AC_DEFINE(HAVE_DIRECTIO_2ARGS, 1,
2280                 [direct_IO need 2 arguments])
2281 ])
2282 ]) # LC_DIRECTIO_2ARGS
2283
2284 #
2285 # LC_GENERIC_WRITE_SYNC_2ARGS
2286 #
2287 # Kernel version 4.7 commit dde0c2e79848298cc25621ad080d47f94dbd7cce
2288 # fs: add IOCB_SYNC and IOCB_DSYNC
2289 #
2290 AC_DEFUN([LC_GENERIC_WRITE_SYNC_2ARGS], [
2291 LB_CHECK_COMPILE([if 'generic_write_sync()' taken 2 arguments],
2292 generic_write_sync_2args, [
2293         #include <linux/fs.h>
2294 ],[
2295         struct kiocb *iocb = NULL;
2296         ssize_t rc;
2297
2298         rc = generic_write_sync(iocb, 0);
2299 ],[
2300         AC_DEFINE(HAVE_GENERIC_WRITE_SYNC_2ARGS, 1,
2301                 [generic_write_sync need 2 arguments])
2302 ])
2303 ]) # LC_GENERIC_WRITE_SYNC_2ARGS
2304
2305 #
2306 # LC_FOP_ITERATE_SHARED
2307 #
2308 # Kernel v4.6-rc3-29-g6192269 adds iterate_shared method to file_operations
2309 #
2310 AC_DEFUN([LC_FOP_ITERATE_SHARED], [
2311 LB_CHECK_COMPILE([if 'file_operations' has 'iterate_shared'],
2312 fop_iterate_shared, [
2313         #include <linux/fs.h>
2314 ],[
2315         struct file_operations fop;
2316         fop.iterate_shared = NULL;
2317 ],[
2318         AC_DEFINE(HAVE_FOP_ITERATE_SHARED, 1,
2319                 [file_operations has iterate_shared])
2320 ])
2321 ]) # LC_FOP_ITERATE_SHARED
2322
2323 #
2324 # LC_HAVE_POSIX_ACL_VALID_USER_NS
2325 #
2326 # 4.8 posix_acl_valid takes struct user_namespace
2327 #
2328 AC_DEFUN([LC_HAVE_POSIX_ACL_VALID_USER_NS], [
2329 LB_CHECK_COMPILE([if 'posix_acl_valid' takes 'struct user_namespace'],
2330 posix_acl_valid, [
2331         #include <linux/fs.h>
2332         #include <linux/posix_acl.h>
2333 ],[
2334         posix_acl_valid((struct user_namespace*)NULL, (const struct posix_acl*)NULL);
2335 ],[
2336         AC_DEFINE(HAVE_POSIX_ACL_VALID_USER_NS, 1,
2337                 [posix_acl_valid takes struct user_namespace])
2338 ])
2339 ]) # LC_HAVE_POSIX_ACL_VALID_USER_NS
2340
2341 #
2342 # LC_D_COMPARE_4ARGS
2343 #
2344 # Kernel version 4.8 commit 6fa67e707559303e086303aeecc9e8b91ef497d5
2345 # get rid of 'parent' argument of ->d_compare()
2346 #
2347 AC_DEFUN([LC_D_COMPARE_4ARGS], [
2348 LB_CHECK_COMPILE([if 'd_compare' taken 4 arguments],
2349 d_compare_4args, [
2350         #include <linux/dcache.h>
2351 ],[
2352         ((struct dentry_operations*)0)->d_compare(NULL,0,NULL,NULL);
2353 ],[
2354         AC_DEFINE(HAVE_D_COMPARE_4ARGS, 1,
2355                 [d_compare need 4 arguments])
2356 ])
2357 ]) # LC_D_COMPARE_4ARGS
2358
2359 #
2360 # LC_FULL_NAME_HASH_3ARGS
2361 #
2362 # Kernel version 4.8 commit 8387ff2577eb9ed245df9a39947f66976c6bcd02
2363 # vfs: make the string hashes salt the hash
2364 #
2365 AC_DEFUN([LC_FULL_NAME_HASH_3ARGS], [
2366 LB_CHECK_COMPILE([if 'full_name_hash' taken 3 arguments],
2367 full_name_hash_3args, [
2368         #include <linux/stringhash.h>
2369 ],[
2370         unsigned int hash;
2371         hash = full_name_hash(NULL,NULL,0);
2372 ],[
2373         AC_DEFINE(HAVE_FULL_NAME_HASH_3ARGS, 1,
2374                 [full_name_hash need 3 arguments])
2375 ])
2376 ]) # LC_FULL_NAME_HASH_3ARGS
2377
2378 #
2379 # LC_STRUCT_POSIX_ACL_XATTR
2380 #
2381 # Kernel version 4.8 commit 2211d5ba5c6c4e972ba6dbc912b2897425ea6621
2382 # posix_acl: xattr representation cleanups
2383 #
2384 AC_DEFUN([LC_STRUCT_POSIX_ACL_XATTR], [
2385 LB_CHECK_COMPILE([if 'struct posix_acl_xattr_{header,entry}' defined],
2386 struct_posix_acl_xattr, [
2387         #include <linux/fs.h>
2388         #include <linux/posix_acl_xattr.h>
2389 ],[
2390         struct posix_acl_xattr_header *h = NULL;
2391         struct posix_acl_xattr_entry  *e;
2392         e = (void *)(h + 1);
2393 ],[
2394         AC_DEFINE(HAVE_STRUCT_POSIX_ACL_XATTR, 1,
2395                 [struct posix_acl_xattr_{header,entry} defined])
2396 ])
2397 ]) # LC_STRUCT_POSIX_ACL_XATTR
2398
2399 #
2400 # LC_IOP_XATTR
2401 #
2402 # Kernel version 4.8 commit fd50ecaddf8372a1d96e0daeaac0f93cf04e4d42
2403 # removed {get,set,remove}xattr inode operations
2404 #
2405 AC_DEFUN([LC_IOP_XATTR], [
2406 LB_CHECK_COMPILE([if 'inode_operations' has {get,set,remove}xattr members],
2407 inode_ops_xattr, [
2408         #include <linux/fs.h>
2409 ],[
2410         struct inode_operations iop;
2411         iop.setxattr = NULL;
2412         iop.getxattr = NULL;
2413         iop.removexattr = NULL;
2414 ],[
2415         AC_DEFINE(HAVE_IOP_XATTR, 1,
2416                 [inode_operations has {get,set,remove}xattr members])
2417 ])
2418 ]) # LC_IOP_XATTR
2419
2420 #
2421 # LC_GROUP_INFO_GID
2422 #
2423 # Kernel version 4.9 commit 81243eacfa400f5f7b89f4c2323d0de9982bb0fb
2424 # cred: simpler, 1D supplementary groups
2425 #
2426 AC_DEFUN([LC_GROUP_INFO_GID], [
2427 LB_CHECK_COMPILE([if 'struct group_info' has member 'gid'],
2428 group_info_gid, [
2429         #include <linux/cred.h>
2430 ],[
2431         kgid_t *p;
2432         p = ((struct group_info *)0)->gid;
2433 ],[
2434         AC_DEFINE(HAVE_GROUP_INFO_GID, 1,
2435                 [struct group_info has member gid])
2436 ])
2437 ]) # LC_GROUP_INFO_GID
2438
2439 #
2440 # LC_VFS_SETXATTR
2441 #
2442 # Kernel version 4.9 commit 5d6c31910bc0713e37628dc0ce677dcb13c8ccf4
2443 # added __vfs_{get,set,remove}xattr helpers
2444 #
2445 AC_DEFUN([LC_VFS_SETXATTR], [
2446 LB_CHECK_COMPILE([if '__vfs_setxattr' helper is available],
2447 vfs_setxattr, [
2448         #include <linux/xattr.h>
2449 ],[
2450         __vfs_setxattr(NULL, NULL, NULL, NULL, 0, 0);
2451 ],[
2452         AC_DEFINE(HAVE_VFS_SETXATTR, 1,
2453                 ['__vfs_setxattr is available])
2454 ])
2455 ]) # LC_VFS_SETXATTR
2456
2457 #
2458 # LC_POSIX_ACL_UPDATE_MODE
2459 #
2460 # Kernel version 4.9 commit 073931017b49d9458aa351605b43a7e34598caef
2461 # posix_acl: Clear SGID bit when setting file permissions
2462 #
2463 AC_DEFUN([LC_POSIX_ACL_UPDATE_MODE], [
2464 LB_CHECK_COMPILE([if 'posix_acl_update_mode' exists],
2465 posix_acl_update_mode, [
2466         #include <linux/fs.h>
2467         #include <linux/posix_acl.h>
2468 ],[
2469         posix_acl_update_mode(NULL, NULL, NULL);
2470 ],[
2471         AC_DEFINE(HAVE_POSIX_ACL_UPDATE_MODE, 1,
2472                 ['posix_acl_update_mode' is available])
2473 ])
2474 ]) # LC_POSIX_ACL_UPDATE_MODE
2475
2476 #
2477 # LC_IOP_GENERIC_READLINK
2478 #
2479 # Kernel version 4.10 commit dfeef68862edd7d4bafe68ef7aeb5f658ef24bb5
2480 # removed generic_readlink from individual file systems
2481 #
2482 AC_DEFUN([LC_IOP_GENERIC_READLINK], [
2483 LB_CHECK_COMPILE([if 'generic_readlink' still exist],
2484 inode_ops_readlink, [
2485         #include <linux/fs.h>
2486 ],[
2487         struct inode_operations iop;
2488         iop.readlink = generic_readlink;
2489 ],[
2490         AC_DEFINE(HAVE_IOP_GENERIC_READLINK, 1,
2491                 [generic_readlink has been removed])
2492 ])
2493 ]) # LC_IOP_GENERIC_READLINK
2494
2495 #
2496 # LC_HAVE_VM_FAULT_ADDRESS
2497 #
2498 # Kernel version 4.10 commit 1a29d85eb0f19b7d8271923d8917d7b4f5540b3e
2499 # removed virtual_address field. Need to use address field instead
2500 #
2501 AC_DEFUN([LC_HAVE_VM_FAULT_ADDRESS], [
2502 LB_CHECK_COMPILE([if 'struct vm_fault' replaced virtual_address with address field],
2503 vm_fault_address, [
2504         #include <linux/mm.h>
2505 ],[
2506         struct vm_fault vmf;
2507         vmf.address = NULL;
2508 ],[
2509         AC_DEFINE(HAVE_VM_FAULT_ADDRESS, 1,
2510                 [virtual_address has been replaced by address field])
2511 ])
2512 ]) # LC_HAVE_VM_FAULT_ADDRESS
2513
2514 #
2515 # LC_INODEOPS_ENHANCED_GETATTR
2516 #
2517 # Kernel version 4.11 commit a528d35e8bfcc521d7cb70aaf03e1bd296c8493f
2518 # expanded getattr to be able to get more stat information.
2519 #
2520 AC_DEFUN([LC_INODEOPS_ENHANCED_GETATTR], [
2521 LB_CHECK_COMPILE([if 'inode_operations' getattr member can gather advance stats],
2522 getattr_path, [
2523         #include <linux/fs.h>
2524 ],[
2525         struct path path;
2526
2527         ((struct inode_operations *)1)->getattr(&path, NULL, 0, 0);
2528 ],[
2529         AC_DEFINE(HAVE_INODEOPS_ENHANCED_GETATTR, 1,
2530                 [inode_operations .getattr member function can gather advance stats])
2531 ])
2532 ]) # LC_INODEOPS_ENHANCED_GETATTR
2533
2534 #
2535 # LC_VM_OPERATIONS_REMOVE_VMF_ARG
2536 #
2537 # Kernel version 4.11 commit 11bac80004499ea59f361ef2a5516c84b6eab675
2538 # removed struct vm_area_struct as an argument for vm_operations since
2539 # in the same kernel version struct vma_area_struct was folded into
2540 # struct vm_fault.
2541 #
2542 AC_DEFUN([LC_VM_OPERATIONS_REMOVE_VMF_ARG], [
2543 LB_CHECK_COMPILE([if 'struct vm_operations' removed struct vm_area_struct],
2544 vm_operations_no_vm_area_struct, [
2545         #include <linux/mm.h>
2546 ],[
2547         struct vm_fault vmf;
2548
2549         ((struct vm_operations_struct *)0)->fault(&vmf);
2550         ((struct vm_operations_struct *)0)->page_mkwrite(&vmf);
2551 ],[
2552         AC_DEFINE(HAVE_VM_OPS_USE_VM_FAULT_ONLY, 1,
2553                 ['struct vm_operations' remove struct vm_area_struct argument])
2554 ])
2555 ]) # LC_VM_OPERATIONS_REMOVE_VMF_ARG
2556
2557 #
2558 # LC_HAVE_KEY_USAGE_REFCOUNT
2559 #
2560 # Kernel version 4.11 commit fff292914d3a2f1efd05ca71c2ba72a3c663201e
2561 # converted key.usage from atomic_t to refcount_t.
2562 #
2563 AC_DEFUN([LC_HAVE_KEY_USAGE_REFCOUNT], [
2564 LB_CHECK_COMPILE([if 'key.usage' is refcount_t],
2565 key_usage_refcount, [
2566         #include <linux/key.h>
2567 ],[
2568         struct key key = { };
2569
2570         refcount_read(&key.usage);
2571 ],[
2572         AC_DEFINE(HAVE_KEY_USAGE_REFCOUNT, 1, [key.usage is of type refcount_t])
2573 ])
2574 ]) #LC_HAVE_KEY_USAGE_REFCOUNT
2575
2576 #
2577 # LC_HAVE_CRYPTO_MAX_ALG_NAME_128
2578 #
2579 # Kernel version 4.11 commit f437a3f477cce402dbec6537b29e9e33962c9f73
2580 # switched CRYPTO_MAX_ALG_NAME from 64 to 128.
2581 #
2582 AC_DEFUN([LC_HAVE_CRYPTO_MAX_ALG_NAME_128], [
2583 LB_CHECK_COMPILE([if 'CRYPTO_MAX_ALG_NAME' is 128],
2584 crypto_max_alg_name, [
2585         #include <linux/crypto.h>
2586 ],[
2587         #if CRYPTO_MAX_ALG_NAME != 128
2588         exit(1);
2589         #endif
2590 ],[
2591         AC_DEFINE(HAVE_CRYPTO_MAX_ALG_NAME_128, 1,
2592                 ['CRYPTO_MAX_ALG_NAME' is 128])
2593 ])
2594 ]) # LC_HAVE_CRYPTO_MAX_ALG_NAME_128
2595
2596 #
2597 # Kernel version 4.12 commit 47f38c539e9a42344ff5a664942075bd4df93876
2598 # CURRENT_TIME is not 64 bit time safe so it was replaced with
2599 # current_time()
2600 #
2601 AC_DEFUN([LC_CURRENT_TIME], [
2602 LB_CHECK_COMPILE([if CURRENT_TIME has been replaced with current_time],
2603 current_time, [
2604         #include <linux/fs.h>
2605 ],[
2606         struct iattr attr;
2607
2608         attr.ia_atime = current_time(NULL);
2609 ],[
2610         AC_DEFINE(HAVE_CURRENT_TIME, 1,
2611                 [current_time() has replaced CURRENT_TIME])
2612 ])
2613 ]) # LIBCFS_CURRENT_TIME
2614
2615 #
2616 # Kernel version 4.12-rc3 85787090a21eb749d8b347eaf9ff1a455637473c
2617 # changed struct super_block s_uuid into a proper uuid_t
2618 #
2619 AC_DEFUN([LC_SUPER_BLOCK_S_UUID], [
2620 LB_CHECK_COMPILE([if 'struct super_block' s_uuid is uuid_t],
2621 super_block_s_uuid, [
2622         #include <linux/fs.h>
2623 ],[
2624         struct super_block sb;
2625
2626         uuid_parse(NULL, &sb.s_uuid);
2627 ],[
2628         AC_DEFINE(HAVE_S_UUID_AS_UUID_T, 1, ['s_uuid' is an uuid_t])
2629 ])
2630 ]) # LC_SUPER_BLOCK_S_UUID
2631
2632 #
2633 # LC_SUPER_SETUP_BDI_NAME
2634 #
2635 # Kernel version 4.12 commit 9594caf216dc0fe3e318b34af0127276db661241
2636 # unified bdi handling
2637 #
2638 AC_DEFUN([LC_SUPER_SETUP_BDI_NAME], [
2639 LB_CHECK_COMPILE([if 'super_setup_bdi_name' exist],
2640 super_setup_bdi_name, [
2641         #include <linux/fs.h>
2642 ],[
2643         super_setup_bdi_name(NULL, "lustre");
2644 ],[
2645         AC_DEFINE(HAVE_SUPER_SETUP_BDI_NAME, 1,
2646                 ['super_setup_bdi_name' is available])
2647 ])
2648 ]) # LC_SUPER_SETUP_BDI_NAME
2649
2650 #
2651 # LC_BI_STATUS
2652 #
2653 # 4.12 replace bi_error to bi_status
2654 #
2655 AC_DEFUN([LC_BI_STATUS], [
2656 LB_CHECK_COMPILE([if 'bi_status' exist],
2657 bi_status, [
2658         #include <linux/blk_types.h>
2659 ],[
2660         ((struct bio *)0)->bi_status = 0;
2661 ],[
2662         AC_DEFINE(HAVE_BI_STATUS, 1,
2663                 ['bi_status' is available])
2664 ])
2665 ]) # LC_BI_STATUS
2666
2667 #
2668 # LC_UAPI_LINUX_MOUNT_H
2669 #
2670 # kernel 4.20 commit e262e32d6bde0f77fb0c95d977482fc872c51996
2671 # vfs: Suppress MS_* flag defs within the kernel ...
2672 #
2673 AC_DEFUN([LC_UAPI_LINUX_MOUNT_H], [
2674 tmp_flags="$EXTRA_KCFLAGS"
2675 EXTRA_KCFLAGS="-Werror"
2676 LB_CHECK_COMPILE([if MS_RDONLY was moved to uapi/linux/mount.h],
2677 uapi_linux_mount, [
2678         #include <uapi/linux/mount.h>
2679 ],[
2680         int x = MS_RDONLY;
2681         (void)x;
2682 ],[
2683         AC_DEFINE(HAVE_UAPI_LINUX_MOUNT_H, 1,
2684                 [if MS_RDONLY was moved to uapi/linux/mount.h])
2685 ])
2686 EXTRA_KCFLAGS="$tmp_flags"
2687 ]) # LC_UAPI_LINUX_MOUNT_H
2688
2689 #
2690 # LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
2691 #
2692 # kernel 4.20 commit 1863d77f15da0addcd293a1719fa5d3ef8cde3ca
2693 # SUNRPC: Replace the cache_detail->hash_lock with a regular spinlock
2694 #
2695 # Now that the reader functions are all RCU protected, use a regular
2696 # spinlock rather than a reader/writer lock.
2697 #
2698 AC_DEFUN([LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK], [
2699 tmp_flags="$EXTRA_KCFLAGS"
2700 EXTRA_KCFLAGS="-Werror"
2701 LB_CHECK_COMPILE([if cache_detail->hash_lock is a spinlock],
2702 hash_lock_isa_spinlock_t, [
2703         #include <linux/sunrpc/cache.h>
2704 ],[
2705         spinlock_t *lock = &(((struct cache_detail *)0)->hash_lock);
2706         spin_lock(lock);
2707 ],[
2708         AC_DEFINE(HAVE_CACHE_HASH_SPINLOCK, 1,
2709                 [if cache_detail->hash_lock is a spinlock])
2710 ])
2711 EXTRA_KCFLAGS="$tmp_flags"
2712 ]) # LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
2713
2714 #
2715 # LC_BIO_INTEGRITY_ENABLED
2716 #
2717 # 4.13 removed bio_integrity_enabled
2718 #
2719 AC_DEFUN([LC_BIO_INTEGRITY_ENABLED], [
2720 LB_CHECK_COMPILE([if 'bio_integrity_enabled' exist],
2721 bio_integrity_enabled, [
2722         #include <linux/bio.h>
2723 ],[
2724         bio_integrity_enabled(NULL);
2725 ],[
2726         AC_DEFINE(HAVE_BIO_INTEGRITY_ENABLED, 1,
2727                 ['bio_integrity_enabled' is available])
2728 ])
2729 ]) # LC_BIO_INTEGRITY_ENABLED
2730
2731 #
2732 # LC_PAGEVEC_INIT_ONE_PARAM
2733 #
2734 # 4.14 pagevec_init takes one parameter
2735 #
2736 AC_DEFUN([LC_PAGEVEC_INIT_ONE_PARAM], [
2737 LB_CHECK_COMPILE([if 'pagevec_init' takes one parameter],
2738 pagevec_init, [
2739         #include <linux/pagevec.h>
2740 ],[
2741         pagevec_init(NULL);
2742 ],[
2743         AC_DEFINE(HAVE_PAGEVEC_INIT_ONE_PARAM, 1,
2744                 ['pagevec_init' takes one parameter])
2745 ])
2746 ]) # LC_PAGEVEC_INIT_ONE_PARAM
2747
2748 #
2749 # LC_BI_BDEV
2750 #
2751 # 4.14 replaced bi_bdev to bi_disk
2752 #
2753 AC_DEFUN([LC_BI_BDEV], [
2754 LB_CHECK_COMPILE([if 'bi_bdev' exist],
2755 bi_bdev, [
2756         #include <linux/bio.h>
2757 ],[
2758         ((struct bio *)0)->bi_bdev = NULL;
2759 ],[
2760         AC_DEFINE(HAVE_BI_BDEV, 1,
2761                 ['bi_bdev' is available])
2762 ])
2763 ]) # LC_BI_BDEV
2764
2765 #
2766 # LC_I_PAGES
2767 #
2768 # kernel 4.17 commit b93b016313b3ba8003c3b8bb71f569af91f19fc7
2769 #
2770 AC_DEFUN([LC_I_PAGES], [
2771 LB_CHECK_COMPILE([if struct address_space has i_pages],
2772 i_pages, [
2773         #include <linux/fs.h>
2774 ],[
2775         struct address_space mapping = {};
2776         void *i_pages;
2777
2778         i_pages = &mapping.i_pages;
2779 ],[
2780         AC_DEFINE(HAVE_I_PAGES, 1,
2781                 [struct address_space has i_pages])
2782 ])
2783 ]) # LC_I_PAGES
2784
2785 #
2786 # LC_VM_FAULT_T
2787 #
2788 # kernel 4.17 commit 3d3539018d2cbd12e5af4a132636ee7fd8d43ef0
2789 # mm: create the new vm_fault_t type
2790 #
2791 AC_DEFUN([LC_VM_FAULT_T], [
2792 LB_CHECK_COMPILE([if vm_fault_t type exists],
2793 vm_fault_t, [
2794         #include <linux/mm_types.h>
2795 ],[
2796         vm_fault_t x = VM_FAULT_SIGBUS;
2797         (void)x
2798 ],[
2799         AC_DEFINE(HAVE_VM_FAULT_T, 1,
2800                 [if vm_fault_t type exists])
2801 ])
2802 ]) # LC_VM_FAULT_T
2803
2804 #
2805 # LC_INODE_TIMESPEC64
2806 #
2807 # kernel 4.17-rc7 commit 8efd6894ff089adeeac7cb9f32125b85d963d1bc
2808 # fs: add timespec64_truncate()
2809 # kernel 4.18 commit 95582b00838837fc07e042979320caf917ce3fe6
2810 # inode timestamps switched to timespec64
2811 # kernel 4.19-rc2 commit 976516404ff3fab2a8caa8bd6f5efc1437fed0b8
2812 # y2038: remove unused time interfaces
2813 # ...
2814 #  timespec_trunc
2815 # ...
2816 # When inode times are timespec64 stop using the deprecated
2817 # time interfaces.
2818 #
2819 AC_DEFUN([LC_INODE_TIMESPEC64], [
2820 tmp_flags="$EXTRA_KCFLAGS"
2821 EXTRA_KCFLAGS="-Werror"
2822 LB_CHECK_COMPILE([if inode timestamps are struct timespec64],
2823 inode_timespec64, [
2824         #include <linux/fs.h>
2825 ],[
2826         struct inode *inode = NULL;
2827         struct timespec64 ts = {};
2828
2829         inode->i_atime = timespec64_trunc(ts, 1);
2830         (void)inode;
2831 ],[
2832         AC_DEFINE(HAVE_INODE_TIMESPEC64, 1,
2833                 [inode times are using timespec64])
2834 ])
2835 EXTRA_KCFLAGS="$tmp_flags"
2836 ]) # LC_INODE_TIMESPEC64
2837
2838 #
2839 # LC_HAS_LINUX_SELINUX_ENABLED
2840 #
2841 # kernel 5.1 commit 3d252529480c68bfd6a6774652df7c8968b28e41
2842 # SELinux: Remove unused selinux_is_enabled
2843 #
2844 AC_DEFUN([LC_HAS_LINUX_SELINUX_ENABLED], [
2845 tmp_flags="$EXTRA_KCFLAGS"
2846 EXTRA_KCFLAGS="-Werror"
2847 LB_CHECK_COMPILE([if linux/selinux.h exists],
2848 selinux_is_enabled, [
2849         #include <linux/selinux.h>
2850 ],[
2851         bool has_selinux = selinux_is_enabled();
2852         (void)has_selinux;
2853 ],[
2854         AC_DEFINE(HAVE_LINUX_SELINUX_IS_ENABLED, 1,
2855                 [if linux/selinux.h exists])
2856 ])
2857 EXTRA_KCFLAGS="$tmp_flags"
2858 ]) # LC_HAS_LINUX_SELINUX_ENABLED
2859
2860 #
2861 # LC_BIO_BI_PHYS_SEGMENTS
2862 #
2863 # kernel 5.3-rc1 commit 14ccb66b3f585b2bc21e7256c96090abed5a512c
2864 # block: remove the bi_phys_segments field in struct bio
2865 #
2866 AC_DEFUN([LC_BIO_BI_PHYS_SEGMENTS], [
2867 tmp_flags="$EXTRA_KCFLAGS"
2868 EXTRA_KCFLAGS="-Werror"
2869 LB_CHECK_COMPILE([if struct bio has bi_phys_segments member],
2870 bye_bio_bi_phys_segments, [
2871         #include <linux/bio.h>
2872 ],[
2873         struct bio *bio = NULL;
2874         bio->bi_phys_segments++;
2875 ],[
2876         AC_DEFINE(HAVE_BIO_BI_PHYS_SEGMENTS, 1,
2877                 [struct bio has bi_phys_segments member])
2878 ])
2879 EXTRA_KCFLAGS="$tmp_flags"
2880 ]) # LC_BIO_BI_PHYS_SEGMENTS
2881
2882 #
2883 # LC_LM_COMPARE_OWNER_EXISTS
2884 #
2885 # kernel 5.3-rc3 commit f85d93385e9fe6886a751f647f6812a89bf6bee3
2886 # locks: Cleanup lm_compare_owner and lm_owner_key
2887 # removed lm_compare_owner
2888 #
2889 AC_DEFUN([LC_LM_COMPARE_OWNER_EXISTS], [
2890 tmp_flags="$EXTRA_KCFLAGS"
2891 EXTRA_KCFLAGS="-Werror"
2892 LB_CHECK_COMPILE([if lock_manager_operations has lm_compare_owner],
2893 lock_manager_ops_lm_compare_owner, [
2894         #include <linux/fs.h>
2895 ],[
2896         struct lock_manager_operations lm_ops;
2897         lm_ops.lm_compare_owner = NULL;
2898 ],[
2899         AC_DEFINE(HAVE_LM_COMPARE_OWNER, 1,
2900                 [lock_manager_operations has lm_compare_owner])
2901 ])
2902 EXTRA_KCFLAGS="$tmp_flags"
2903 ]) # LC_LM_COMPARE_OWNER_EXISTS
2904
2905 #
2906 # LC_PROG_LINUX
2907 #
2908 # Lustre linux kernel checks
2909 #
2910 AC_DEFUN([LC_PROG_LINUX], [
2911         AC_MSG_NOTICE([Lustre kernel checks
2912 ==============================================================================])
2913
2914         LC_CONFIG_PINGER
2915         LC_CONFIG_CHECKSUM
2916         LC_CONFIG_FLOCK
2917         LC_CONFIG_HEALTH_CHECK_WRITE
2918         LC_CONFIG_LRU_RESIZE
2919
2920         LC_GLIBC_SUPPORT_FHANDLES
2921         LC_CONFIG_GSS
2922         LC_OPENSSL_SSK
2923         LC_OPENSSL_GETSEPOL
2924
2925         # 2.6.39
2926         LC_HAVE_FHANDLE_SYSCALLS
2927         LC_HAVE_FSTYPE_MOUNT
2928         LC_HAVE_INODE_OWNER_OR_CAPABLE
2929         LC_HAVE_SECURITY_IINITSEC
2930         LC_VFS_CREATE_USE_NAMEIDATA
2931
2932         # 3.0
2933         LC_DIRTY_INODE_WITH_FLAG
2934         LC_SETNS
2935
2936         # 3.1
2937         LC_LM_XXX_LOCK_MANAGER_OPS
2938         LC_INODE_DIO_WAIT
2939         LC_IOP_GET_ACL
2940         LC_FILE_LLSEEK_SIZE
2941         LC_INODE_PERMISION_2ARGS
2942         LC_RADIX_EXCEPTION_ENTRY
2943         LC_HAVE_LOOP_CTL_GET_FREE
2944
2945         # 3.2
2946         LC_HAVE_PROTECT_I_NLINK
2947
2948         # 3.3
2949         LC_HAVE_MIGRATE_HEADER
2950         LC_MIGRATEPAGE_4ARGS
2951         LC_SUPEROPS_USE_DENTRY
2952         LC_INODEOPS_USE_UMODE_T
2953         LC_HAVE_CACHE_REGISTER
2954
2955         # 3.4
2956         LC_HAVE_D_MAKE_ROOT
2957         LC_KMAP_ATOMIC_HAS_1ARG
2958
2959         # 3.5
2960         LC_HAVE_CLEAR_INODE
2961         LC_HAVE_ENCODE_FH_PARENT
2962         LC_FILE_LLSEEK_SIZE_5ARG
2963
2964         # 3.6
2965         LC_DATA_FOR_LLITE_IS_LIST
2966         LC_DENTRY_OPEN_USE_PATH
2967         LC_HAVE_IOP_ATOMIC_OPEN
2968         LC_HAVE_SB_START_WRITE
2969
2970         # 3.7
2971         LC_HAVE_POSIXACL_USER_NS
2972
2973         # 3.8
2974         LC_HAVE_FILE_F_INODE
2975         LC_HAVE_FILE_INODE
2976         LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS
2977
2978         # 3.9
2979         LC_HAVE_HLIST_FOR_EACH_3ARG
2980         LC_HAVE_BIO_END_SECTOR
2981         LC_HAVE_IS_SXID
2982         LC_HAVE_VFS_GETATTR_2ARGS
2983
2984         # 3.10
2985         LC_HAVE_REMOVE_PROC_SUBTREE
2986         LC_HAVE_PROC_REMOVE
2987         LC_HAVE_PROJECT_QUOTA
2988         LC_HAVE_SECURITY_DENTRY_INIT_SECURITY
2989         LC_HAVE_SECURITY_INODE_LISTSECURITY
2990
2991         # 3.11
2992         LC_INVALIDATE_RANGE
2993         LC_HAVE_DIR_CONTEXT
2994         LC_D_COMPARE_5ARGS
2995         LC_HAVE_DCOUNT
2996         LC_HAVE_DENTRY_D_U_D_ALIAS
2997         LC_HAVE_DENTRY_D_CHILD
2998         LC_PID_NS_FOR_CHILDREN
2999
3000         # 3.12
3001         LC_OLDSIZE_TRUNCATE_PAGECACHE
3002         LC_PTR_ERR_OR_ZERO_MISSING
3003         LC_KIOCB_KI_LEFT
3004         LC_INIT_LIST_HEAD_RCU
3005
3006         # 3.13
3007         LC_VFS_RENAME_5ARGS
3008         LC_VFS_UNLINK_3ARGS
3009         LC_HAVE_D_IS_POSITIVE
3010
3011         # 3.14
3012         LC_HAVE_BVEC_ITER
3013         LC_HAVE_TRUNCATE_IPAGES_FINAL
3014         LC_IOPS_RENAME_WITH_FLAGS
3015         LC_IOP_SET_ACL
3016
3017         # 3.15
3018         LC_VFS_RENAME_6ARGS
3019
3020         # 3.16
3021         LC_DIRECTIO_USE_ITER
3022         LC_HAVE_IOV_ITER_INIT_DIRECTION
3023         LC_HAVE_IOV_ITER_TRUNCATE
3024         LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
3025
3026         # 3.17
3027         LC_HAVE_INTERVAL_BLK_INTEGRITY
3028         LC_KEY_MATCH_DATA
3029
3030         # 3.18
3031         LC_PERCPU_COUNTER_INIT
3032         LC_NFS_FILLDIR_USE_CTX
3033
3034         # 3.19
3035         LC_KIOCB_HAS_NBYTES
3036         LC_HAVE_DQUOT_QC_DQBLK
3037
3038         # 3.20
3039         LC_BACKING_DEV_INFO_REMOVAL
3040         LC_HAVE_BDI_CAP_MAP_COPY
3041
3042         # 4.1.0
3043         LC_IOV_ITER_RW
3044         LC_HAVE_SYNC_READ_WRITE
3045         LC_HAVE___BI_CNT
3046
3047         # 4.2
3048         LC_BIO_ENDIO_USES_ONE_ARG
3049         LC_SYMLINK_OPS_USE_NAMEIDATA
3050         LC_ACCOUNT_PAGE_DIRTIED_3ARGS
3051
3052         # 4.3
3053         LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
3054         LC_HAVE_BIP_ITER_BIO_INTEGRITY_PAYLOAD
3055         LC_HAVE_CACHE_HEAD_HLIST
3056         LC_HAVE_XATTR_HANDLER_SIMPLIFIED
3057
3058         # 4.4
3059         LC_HAVE_LOCKS_LOCK_FILE_WAIT
3060         LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
3061         LC_HAVE_XATTR_HANDLER_NAME
3062         LC_HAVE_BI_OPF
3063         LC_HAVE_SUBMIT_BIO_2ARGS
3064         LC_HAVE_CLEAN_BDEV_ALIASES
3065
3066         # 4.5
3067         LC_HAVE_FILE_DENTRY
3068
3069         # 4.5
3070         LC_HAVE_INODE_LOCK
3071         LC_HAVE_IOP_GET_LINK
3072
3073         # 4.6
3074         LC_HAVE_IN_COMPAT_SYSCALL
3075         LC_HAVE_XATTR_HANDLER_INODE_PARAM
3076         LC_LOCK_PAGE_MEMCG
3077
3078         # 4.7
3079         LC_D_IN_LOOKUP
3080         LC_DIRECTIO_2ARGS
3081         LC_GENERIC_WRITE_SYNC_2ARGS
3082         LC_FOP_ITERATE_SHARED
3083
3084         # 4.8
3085         LC_HAVE_POSIX_ACL_VALID_USER_NS
3086         LC_D_COMPARE_4ARGS
3087         LC_FULL_NAME_HASH_3ARGS
3088         LC_STRUCT_POSIX_ACL_XATTR
3089         LC_IOP_XATTR
3090
3091         # 4.9
3092         LC_GROUP_INFO_GID
3093         LC_VFS_SETXATTR
3094         LC_POSIX_ACL_UPDATE_MODE
3095
3096         # 4.10
3097         LC_IOP_GENERIC_READLINK
3098         LC_HAVE_VM_FAULT_ADDRESS
3099
3100         # 4.11
3101         LC_INODEOPS_ENHANCED_GETATTR
3102         LC_VM_OPERATIONS_REMOVE_VMF_ARG
3103         LC_HAVE_KEY_USAGE_REFCOUNT
3104         LC_HAVE_CRYPTO_MAX_ALG_NAME_128
3105
3106         # 4.12
3107         LC_CURRENT_TIME
3108         LC_SUPER_BLOCK_S_UUID
3109         LC_SUPER_SETUP_BDI_NAME
3110         LC_BI_STATUS
3111
3112         # 4.13
3113         LC_BIO_INTEGRITY_ENABLED
3114
3115         # 4.14
3116         LC_PAGEVEC_INIT_ONE_PARAM
3117         LC_BI_BDEV
3118
3119         # 4.17
3120         LC_VM_FAULT_T
3121         LC_I_PAGES
3122
3123         # 4.18
3124         LC_INODE_TIMESPEC64
3125
3126         # 4.20
3127         LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
3128
3129         # 5.0
3130         LC_UAPI_LINUX_MOUNT_H
3131
3132         # 5.1
3133         LC_HAS_LINUX_SELINUX_ENABLED
3134
3135         # 5.3
3136         LC_BIO_BI_PHYS_SEGMENTS
3137         LC_LM_COMPARE_OWNER_EXISTS
3138
3139         # kernel patch to extend integrity interface
3140         LC_BIO_INTEGRITY_PREP_FN
3141
3142         #
3143         AS_IF([test "x$enable_server" != xno], [
3144                 LC_STACK_SIZE
3145                 LC_QUOTA_CONFIG
3146         ])
3147         LC_POSIX_ACL_CONFIG
3148 ]) # LC_PROG_LINUX
3149
3150 #
3151 # LC_CONFIG_CLIENT
3152 #
3153 # Check whether to build the client side of Lustre
3154 #
3155 AC_DEFUN([LC_CONFIG_CLIENT], [
3156 AC_MSG_CHECKING([whether to build Lustre client support])
3157 AC_ARG_ENABLE([client],
3158         AC_HELP_STRING([--disable-client],
3159                 [disable Lustre client support]),
3160         [], [enable_client="yes"])
3161 AC_MSG_RESULT([$enable_client])
3162 ]) # LC_CONFIG_CLIENT
3163
3164 #
3165 # --enable-mpitests
3166 #
3167 AC_DEFUN([LB_CONFIG_MPITESTS], [
3168 AC_ARG_ENABLE([mpitests],
3169         AC_HELP_STRING([--enable-mpitests=<yes|no|mpicc wrapper>],
3170                        [include mpi tests]), [
3171                 enable_mpitests="yes"
3172                 case $enableval in
3173                 yes)
3174                         MPICC_WRAPPER="mpicc"
3175                         MPI_BIN=$(eval which $MPICC_WRAPPER | xargs dirname)
3176                         ;;
3177                 no)
3178                         enable_mpitests="no"
3179                         MPI_BIN=""
3180                         ;;
3181                 *)
3182                         MPICC_WRAPPER=$enableval
3183                         MPI_BIN=$(eval echo $MPICC_WRAPPER | xargs dirname)
3184                         ;;
3185                 esac
3186         ], [
3187                 enable_mpitests="yes"
3188                 MPICC_WRAPPER="mpicc"
3189                 MPI_BIN=$(eval which $MPICC_WRAPPER | xargs dirname)
3190         ])
3191
3192         if test "x$enable_mpitests" != "xno"; then
3193                 oldcc=$CC
3194                 CC=$MPICC_WRAPPER
3195                 AC_CACHE_CHECK([whether mpitests can be built],
3196                 lb_cv_mpi_tests, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([
3197                         #include <mpi.h>
3198                         int main(void) {
3199                                 int flag;
3200                                 MPI_Initialized(&flag);
3201                                 return 0;
3202                         }
3203                 ])], [lb_cv_mpi_tests="yes"], [lb_cv_mpi_tests="no"])
3204                 ])
3205                 enable_mpitests=$lb_cv_mpi_tests
3206                 CC=$oldcc
3207         fi
3208         AC_SUBST(MPI_BIN)
3209         AC_SUBST(MPICC_WRAPPER)
3210 ]) # LB_CONFIG_MPITESTS
3211
3212 #
3213 # LC_CONFIG_QUOTA
3214 #
3215 # whether to enable quota support global control
3216 #
3217 AC_DEFUN([LC_CONFIG_QUOTA], [
3218 AC_MSG_CHECKING([whether to enable quota support global control])
3219 AC_ARG_ENABLE([quota],
3220         AC_HELP_STRING([--enable-quota],
3221                 [enable quota support]),
3222         [], [enable_quota="yes"])
3223 AS_IF([test "x$enable_quota" = xyes],
3224         [AC_MSG_RESULT([yes])],
3225         [AC_MSG_RESULT([no])])
3226 ]) # LC_CONFIG_QUOTA
3227
3228 #
3229 # LC_QUOTA
3230 #
3231 AC_DEFUN([LC_QUOTA], [
3232 #check global
3233 LC_CONFIG_QUOTA
3234 #check for utils
3235 AS_IF([test "x$enable_quota" != xno -a "x$enable_utils" != xno], [
3236         AC_CHECK_HEADER([sys/quota.h],
3237                 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1,
3238                         [Define to 1 if you have <sys/quota.h>.])],
3239                 [AC_MSG_ERROR([don't find <sys/quota.h> in your system])])
3240 ])
3241 ]) # LC_QUOTA
3242
3243 #
3244 # LC_OSD_ADDON
3245 #
3246 # configure support for optional OSD implementation
3247 #
3248 AC_DEFUN([LC_OSD_ADDON], [
3249 AC_MSG_CHECKING([whether to use OSD addon])
3250 AC_ARG_WITH([osd],
3251         AC_HELP_STRING([--with-osd=path],
3252                 [set path to optional osd]),
3253         [
3254         case "$with_osd" in
3255         no)
3256                 ENABLEOSDADDON=0
3257                 ;;
3258         *)
3259                 OSDADDON="$with_osd"
3260                 ENABLEOSDADDON=1
3261                 ;;
3262         esac
3263         ], [
3264                 ENABLEOSDADDON=0
3265         ])
3266 AS_IF([test $ENABLEOSDADDON -eq 0], [
3267         AC_MSG_RESULT([no])
3268         OSDADDON=""
3269 ], [
3270         OSDMODNAME=$(basename $OSDADDON)
3271         AS_IF([test -e $LUSTRE/$OSDMODNAME], [
3272                 AC_MSG_RESULT([can't link])
3273                 OSDADDON=""
3274         ], [ln -s $OSDADDON $LUSTRE/$OSDMODNAME], [
3275                 AC_MSG_RESULT([$OSDMODNAME])
3276                 OSDADDON="obj-m += $OSDMODNAME/"
3277         ], [
3278                 AC_MSG_RESULT([can't link])
3279                 OSDADDON=""
3280         ])
3281 ])
3282 AC_SUBST(OSDADDON)
3283 ]) # LC_OSD_ADDON
3284
3285 #
3286 # LC_CONFIGURE
3287 #
3288 # other configure checks
3289 #
3290 AC_DEFUN([LC_CONFIGURE], [
3291 AC_MSG_NOTICE([Lustre core checks
3292 ==============================================================================])
3293
3294 AS_IF([test $target_cpu == "i686" -o $target_cpu == "x86_64"],
3295         [CFLAGS="$CFLAGS -Wall -Werror"])
3296
3297 # maximum MDS thread count
3298 LC_MDS_MAX_THREADS
3299
3300 # lustre/utils/gss/gss_util.c
3301 # lustre/utils/gss/gssd_proc.c
3302 # lustre/utils/gss/krb5_util.c
3303 # lustre/utils/llog_reader.c
3304 # lustre/utils/create_iam.c
3305 # lustre/utils/libiam.c
3306 AC_CHECK_HEADERS([netdb.h endian.h])
3307 AC_CHECK_FUNCS([gethostbyname])
3308
3309 # lustre/utils/llverfs.c
3310 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
3311
3312 # lustre/utils/lfs.c
3313 AS_IF([test "$enable_dist" = "no"], [
3314                 AC_CHECK_LIB([z], [crc32], [
3315                                  AC_CHECK_HEADER([zlib.h], [], [
3316                                                  AC_MSG_ERROR([zlib.h not found.])])
3317                                  ], [
3318                                  AC_MSG_ERROR([
3319                 zlib library not found. Please install zlib development package.])
3320                 ])
3321 ])
3322
3323 SELINUX=""
3324
3325 AC_CHECK_LIB([selinux], [is_selinux_enabled],
3326         [AC_CHECK_HEADERS([selinux/selinux.h],
3327                         [SELINUX="-lselinux"
3328                         AC_DEFINE([HAVE_SELINUX], 1,
3329                                 [support for selinux ])],
3330                         [AC_MSG_WARN([
3331
3332 No libselinux-devel package found, unable to build selinux enabled tools
3333 ])
3334 ])],
3335         [AC_MSG_WARN([
3336
3337 No selinux package found, unable to build selinux enabled tools
3338 ])
3339 ])
3340 AC_SUBST(SELINUX)
3341
3342 # Super safe df
3343 AC_MSG_CHECKING([whether to report minimum OST free space])
3344 AC_ARG_ENABLE([mindf],
3345         AC_HELP_STRING([--enable-mindf],
3346                 [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
3347         [], [enable_mindf="no"])
3348 AC_MSG_RESULT([$enable_mindf])
3349 AS_IF([test "$enable_mindf" = "yes"],
3350         [AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])])
3351
3352 AC_MSG_CHECKING([whether to randomly failing memory alloc])
3353 AC_ARG_ENABLE([fail_alloc],
3354         AC_HELP_STRING([--disable-fail-alloc],
3355                 [disable randomly alloc failure]),
3356         [], [enable_fail_alloc="yes"])
3357 AC_MSG_RESULT([$enable_fail_alloc])
3358 AS_IF([test "x$enable_fail_alloc" != xno],
3359         [AC_DEFINE([RANDOM_FAIL_ALLOC], 1,
3360                 [enable randomly alloc failure])])
3361
3362 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
3363 AC_ARG_ENABLE([invariants],
3364         AC_HELP_STRING([--enable-invariants],
3365                 [enable invariant checking (cpu intensive)]),
3366         [], [enable_invariants="no"])
3367 AC_MSG_RESULT([$enable_invariants])
3368 AS_IF([test "x$enable_invariants" = xyes],
3369         [AC_DEFINE([CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK], 1,
3370                 [enable invariant checking])])
3371
3372 AC_MSG_CHECKING([whether to track references with lu_ref])
3373 AC_ARG_ENABLE([lu_ref],
3374         AC_HELP_STRING([--enable-lu_ref],
3375                 [enable lu_ref reference tracking code]),
3376         [], [enable_lu_ref="no"])
3377 AC_MSG_RESULT([$enable_lu_ref])
3378 AS_IF([test "x$enable_lu_ref" = xyes],
3379         [AC_DEFINE([USE_LU_REF], 1,
3380                 [enable lu_ref reference tracking code])])
3381
3382 AC_MSG_CHECKING([whether to enable page state tracking])
3383 AC_ARG_ENABLE([pgstate-track],
3384         AC_HELP_STRING([--enable-pgstate-track],
3385                 [enable page state tracking]),
3386         [], [enable_pgstat_track="no"])
3387 AC_MSG_RESULT([$enable_pgstat_track])
3388 AS_IF([test "x$enable_pgstat_track" = xyes],
3389         [AC_DEFINE([CONFIG_DEBUG_PAGESTATE_TRACKING], 1,
3390                 [enable page state tracking code])])
3391
3392 PKG_PROG_PKG_CONFIG
3393 AC_MSG_CHECKING([systemd unit file directory])
3394 AC_ARG_WITH([systemdsystemunitdir],
3395         [AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
3396                 [Directory for systemd service files])],
3397         [], [with_systemdsystemunitdir=auto])
3398 AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"],
3399         [def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
3400         AS_IF([test "x$def_systemdsystemunitdir" = "x"],
3401                 [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
3402                 [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
3403                 with_systemdsystemunitdir=no],
3404         [with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
3405 AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
3406         [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
3407 AC_MSG_RESULT([$with_systemdsystemunitdir])
3408
3409 AC_MSG_CHECKING([bash-completion directory])
3410 AC_ARG_WITH([bash-completion-dir],
3411         AS_HELP_STRING([--with-bash-completion-dir[=PATH]],
3412                 [Install the bash auto-completion script in this directory.]),
3413         [],
3414         [with_bash_completion_dir=yes])
3415 AS_IF([test "x$with_bash_completion_dir" = "xyes"], [
3416         BASH_COMPLETION_DIR="`pkg-config --variable=completionsdir bash-completion`"
3417         AS_IF([test "x$BASH_COMPLETION_DIR" = "x"], [
3418                 [BASH_COMPLETION_DIR="$datadir/bash-completion/completions"]
3419         ])
3420 ], [
3421         BASH_COMPLETION_DIR="$with_bash_completion_dir"
3422 ])
3423 AC_SUBST([BASH_COMPLETION_DIR])
3424 AC_MSG_RESULT([$BASH_COMPLETION_DIR])
3425 ]) # LC_CONFIGURE
3426
3427 #
3428 # LC_CONDITIONALS
3429 #
3430 # AM_CONDITIONALS for lustre
3431 #
3432 AC_DEFUN([LC_CONDITIONALS], [
3433 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
3434 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
3435 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
3436 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
3437 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
3438 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
3439 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
3440 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
3441 AM_CONDITIONAL(GSS_SSK, test x$enable_ssk = xyes)
3442 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
3443 AM_CONDITIONAL(HAVE_SYSTEMD, test "x$with_systemdsystemunitdir" != "xno")
3444 AM_CONDITIONAL(ENABLE_BASH_COMPLETION, test "x$with_bash_completion_dir" != "xno")
3445 AM_CONDITIONAL(XATTR_HANDLER, test "x$lb_cv_compile_xattr_handler_flags" = xyes)
3446 AM_CONDITIONAL(SELINUX, test "$SELINUX" = "-lselinux")
3447 AM_CONDITIONAL(GETSEPOL, test x$enable_getsepol = xyes)
3448 ]) # LC_CONDITIONALS
3449
3450 #
3451 # LC_CONFIG_FILES
3452 #
3453 # files that should be generated with AC_OUTPUT
3454 #
3455 AC_DEFUN([LC_CONFIG_FILES],
3456 [AC_CONFIG_FILES([
3457 lustre/Makefile
3458 lustre/autoMakefile
3459 lustre/autoconf/Makefile
3460 lustre/conf/Makefile
3461 lustre/conf/resource/Makefile
3462 lustre/contrib/Makefile
3463 lustre/doc/Makefile
3464 lustre/include/Makefile
3465 lustre/include/lustre/Makefile
3466 lustre/include/uapi/linux/lustre/Makefile
3467 lustre/kernel_patches/targets/4.18-rhel8.target
3468 lustre/kernel_patches/targets/3.10-rhel7.7.target
3469 lustre/kernel_patches/targets/3.10-rhel7.6.target
3470 lustre/kernel_patches/targets/3.10-rhel7.5.target
3471 lustre/kernel_patches/targets/4.14-rhel7.5.target
3472 lustre/kernel_patches/targets/4.14-rhel7.6.target
3473 lustre/kernel_patches/targets/3.0-sles11.target
3474 lustre/kernel_patches/targets/3.0-sles11sp3.target
3475 lustre/kernel_patches/targets/3.0-sles11sp4.target
3476 lustre/kernel_patches/targets/3.12-sles12.target
3477 lustre/kernel_patches/targets/4.4-sles12.target
3478 lustre/kernel_patches/targets/4.4-sles12sp3.target
3479 lustre/kernel_patches/targets/4.12-sles12sp4.target
3480 lustre/kernel_patches/targets/3.x-fc18.target
3481 lustre/ldlm/Makefile
3482 lustre/fid/Makefile
3483 lustre/fid/autoMakefile
3484 lustre/llite/Makefile
3485 lustre/llite/autoMakefile
3486 lustre/lov/Makefile
3487 lustre/lov/autoMakefile
3488 lustre/mdc/Makefile
3489 lustre/mdc/autoMakefile
3490 lustre/lmv/Makefile
3491 lustre/lmv/autoMakefile
3492 lustre/lfsck/Makefile
3493 lustre/lfsck/autoMakefile
3494 lustre/mdt/Makefile
3495 lustre/mdt/autoMakefile
3496 lustre/mdd/Makefile
3497 lustre/mdd/autoMakefile
3498 lustre/fld/Makefile
3499 lustre/fld/autoMakefile
3500 lustre/obdclass/Makefile
3501 lustre/obdclass/autoMakefile
3502 lustre/obdecho/Makefile
3503 lustre/obdecho/autoMakefile
3504 lustre/ofd/Makefile
3505 lustre/ofd/autoMakefile
3506 lustre/osc/Makefile
3507 lustre/osc/autoMakefile
3508 lustre/ost/Makefile
3509 lustre/ost/autoMakefile
3510 lustre/osd-ldiskfs/Makefile
3511 lustre/osd-ldiskfs/autoMakefile
3512 lustre/osd-zfs/Makefile
3513 lustre/osd-zfs/autoMakefile
3514 lustre/mgc/Makefile
3515 lustre/mgc/autoMakefile
3516 lustre/mgs/Makefile
3517 lustre/mgs/autoMakefile
3518 lustre/target/Makefile
3519 lustre/ptlrpc/Makefile
3520 lustre/ptlrpc/autoMakefile
3521 lustre/ptlrpc/gss/Makefile
3522 lustre/ptlrpc/gss/autoMakefile
3523 lustre/quota/Makefile
3524 lustre/quota/autoMakefile
3525 lustre/scripts/Makefile
3526 lustre/scripts/systemd/Makefile
3527 lustre/tests/Makefile
3528 lustre/tests/mpi/Makefile
3529 lustre/tests/kernel/Makefile
3530 lustre/tests/kernel/autoMakefile
3531 lustre/utils/Makefile
3532 lustre/utils/gss/Makefile
3533 lustre/osp/Makefile
3534 lustre/osp/autoMakefile
3535 lustre/lod/Makefile
3536 lustre/lod/autoMakefile
3537 ])
3538 ]) # LC_CONFIG_FILES