Whamcloud - gitweb
LU-2987 llite: rcu-free inode
[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='$(CROSS_PATH)/sbin'
24 AC_SUBST(rootsbindir)
25
26 demodir='$(docdir)/demo'
27 AC_SUBST(demodir)
28
29 pkgexampledir='${pkgdatadir}/examples'
30 AC_SUBST(pkgexampledir)
31 ])
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* | darwin*)
41 $1
42                 ;;
43         *)
44 $2
45                 ;;
46 esac
47 ])
48
49 #
50 # LC_CONFIG_OBD_BUFFER_SIZE
51 #
52 # the maximum buffer size of lctl ioctls
53 #
54 AC_DEFUN([LC_CONFIG_OBD_BUFFER_SIZE],
55 [AC_MSG_CHECKING([maximum OBD ioctl size])
56 AC_ARG_WITH([obd-buffer-size],
57         AC_HELP_STRING([--with-obd-buffer-size=[size]],
58                         [set lctl ioctl maximum bytes (default=8192)]),
59         [
60                 OBD_BUFFER_SIZE=$with_obd_buffer_size
61         ],[
62                 OBD_BUFFER_SIZE=8192
63         ])
64 AC_MSG_RESULT([$OBD_BUFFER_SIZE bytes])
65 AC_DEFINE_UNQUOTED(CONFIG_LUSTRE_OBD_MAX_IOCTL_BUFFER, $OBD_BUFFER_SIZE, [IOCTL Buffer Size])
66 ])
67
68 #
69 # LC_READLINK_SSIZE_T
70 #
71 AC_DEFUN([LC_READLINK_SSIZE_T],
72 [AC_MSG_CHECKING([if readlink returns ssize_t])
73 AC_TRY_COMPILE([
74         #include <unistd.h>
75 ],[
76         ssize_t readlink(const char *, char *, size_t);
77 ],[
78         AC_MSG_RESULT([yes])
79         AC_DEFINE(HAVE_POSIX_1003_READLINK, 1, [readlink returns ssize_t])
80 ],[
81         AC_MSG_RESULT([no])
82 ])
83 ])
84
85 #
86 # LC_FUNC_DEV_SET_RDONLY
87 #
88 # check whether dev_set_rdonly is exported.  This is needed until we
89 # have another mechanism to fence IO from the underlying device.
90 #
91 AC_DEFUN([LC_FUNC_DEV_SET_RDONLY],
92 [LB_CHECK_SYMBOL_EXPORT([dev_set_rdonly],
93 [block/ll_rw_block.c,block/blk-core.c],[
94         AC_DEFINE(HAVE_DEV_SET_RDONLY, 1, [kernel exports dev_set_rdonly])
95 ],[
96         AC_MSG_WARN([kernel missing dev_set_rdonly patch for testing])
97 ])
98 ])
99
100 #
101 # Ensure stack size big than 8k in Lustre server (all kernels)
102 #
103 AC_DEFUN([LC_STACK_SIZE],
104 [AC_MSG_CHECKING([stack size big than 8k])
105 LB_LINUX_TRY_COMPILE([
106         #include <linux/thread_info.h>
107 ],[
108         #if THREAD_SIZE < 8192
109         #error "stack size < 8192"
110         #endif
111 ],[
112         AC_MSG_RESULT(yes)
113 ],[
114         AC_MSG_ERROR([Lustre requires that Linux is configured with at least a 8KB stack.])
115 ])
116 ])
117
118 #
119 # Allow the user to set the MDS thread upper limit
120 #
121 AC_DEFUN([LC_MDS_MAX_THREADS],
122 [
123         AC_ARG_WITH([mds_max_threads],
124         AC_HELP_STRING([--with-mds-max-threads=count],
125                        [maximum threads available on the MDS: (default=512)]),
126         [
127                 MDS_THREAD_COUNT=$with_mds_max_threads
128                 AC_DEFINE_UNQUOTED(MDS_MAX_THREADS, $MDS_THREAD_COUNT, [maximum number of MDS threads])
129         ])
130 ])
131
132 #
133 # LC_CONFIG_PINGER
134 #
135 # the pinger is temporary, until we have the recovery node in place
136 #
137 AC_DEFUN([LC_CONFIG_PINGER],
138 [AC_MSG_CHECKING([whether to enable pinger support])
139 AC_ARG_ENABLE([pinger],
140         AC_HELP_STRING([--disable-pinger],
141                         [disable recovery pinger support]),
142         [],[enable_pinger='yes'])
143 AC_MSG_RESULT([$enable_pinger])
144 if test x$enable_pinger != xno ; then
145   AC_DEFINE(ENABLE_PINGER, 1, Use the Pinger)
146 fi
147 ])
148
149 #
150 # LC_CONFIG_CHECKSUM
151 #
152 # do checksum of bulk data between client and OST
153 #
154 AC_DEFUN([LC_CONFIG_CHECKSUM],
155 [AC_MSG_CHECKING([whether to enable data checksum support])
156 AC_ARG_ENABLE([checksum],
157        AC_HELP_STRING([--disable-checksum],
158                        [disable data checksum support]),
159        [],[enable_checksum='yes'])
160 AC_MSG_RESULT([$enable_checksum])
161 if test x$enable_checksum != xno ; then
162   AC_DEFINE(ENABLE_CHECKSUM, 1, do data checksums)
163 fi
164 ])
165
166 #
167 # LC_CONFIG_LIBLUSTRE_RECOVERY
168 #
169 AC_DEFUN([LC_CONFIG_LIBLUSTRE_RECOVERY],
170 [AC_MSG_CHECKING([whether to enable liblustre recovery support])
171 AC_ARG_ENABLE([liblustre-recovery],
172         AC_HELP_STRING([--disable-liblustre-recovery],
173                         [disable liblustre recovery support]),
174         [],[enable_liblustre_recovery='yes'])
175 AC_MSG_RESULT([$enable_liblustre_recovery])
176 if test x$enable_liblustre_recovery != xno ; then
177   AC_DEFINE(ENABLE_LIBLUSTRE_RECOVERY, 1, Liblustre Can Recover)
178 fi
179 ])
180
181 #
182 # LC_CONFIG_HEALTH_CHECK_WRITE
183 #
184 # Turn off the actual write to the disk
185 #
186 AC_DEFUN([LC_CONFIG_HEALTH_CHECK_WRITE],
187 [AC_MSG_CHECKING([whether to enable a write with the health check])
188 AC_ARG_ENABLE([health_write],
189         AC_HELP_STRING([--enable-health_write],
190                         [enable disk writes when doing health check]),
191         [],[enable_health_write='no'])
192 AC_MSG_RESULT([$enable_health_write])
193 if test x$enable_health_write != xno ; then
194   AC_DEFINE(USE_HEALTH_CHECK_WRITE, 1, Write when Checking Health)
195 fi
196 ])
197
198 AC_DEFUN([LC_CONFIG_LRU_RESIZE],
199 [AC_MSG_CHECKING([whether to enable lru self-adjusting])
200 AC_ARG_ENABLE([lru_resize],
201         AC_HELP_STRING([--enable-lru-resize],
202                         [enable lru resize support]),
203         [],[enable_lru_resize='yes'])
204 AC_MSG_RESULT([$enable_lru_resize])
205 if test x$enable_lru_resize != xno; then
206    AC_DEFINE(HAVE_LRU_RESIZE_SUPPORT, 1, [Enable lru resize support])
207 fi
208 ])
209
210 #
211 # Quota support. The kernel must support CONFIG_QUOTA.
212 #
213 AC_DEFUN([LC_QUOTA_CONFIG],
214 [LB_LINUX_CONFIG_IM([QUOTA],[],[
215         AC_MSG_ERROR([Lustre quota requires that CONFIG_QUOTA is enabled in your kernel.])
216         ])
217 ])
218
219 # truncate_complete_page() was exported from RHEL5/SLES10, but not in SLES11 SP0 (2.6.27)
220 # remove_from_page_cache() was exported between 2.6.35 and 2.6.38
221 # delete_from_page_cache() is exported from 2.6.39
222 AC_DEFUN([LC_EXPORT_TRUNCATE_COMPLETE],
223          [LB_CHECK_SYMBOL_EXPORT([truncate_complete_page],
224                                  [mm/truncate.c],
225                                  [AC_DEFINE(HAVE_TRUNCATE_COMPLETE_PAGE, 1,
226                                             [kernel export truncate_complete_page])])
227           LB_CHECK_SYMBOL_EXPORT([remove_from_page_cache],
228                                  [mm/filemap.c],
229                                  [AC_DEFINE(HAVE_REMOVE_FROM_PAGE_CACHE, 1,
230                                             [kernel export remove_from_page_cache])])
231           LB_CHECK_SYMBOL_EXPORT([delete_from_page_cache],
232                                  [mm/filemap.c],
233                                  [AC_DEFINE(HAVE_DELETE_FROM_PAGE_CACHE, 1,
234                                             [kernel export delete_from_page_cache])])
235          ])
236
237 AC_DEFUN([LC_EXPORT_D_REHASH_COND],
238 [LB_CHECK_SYMBOL_EXPORT([d_rehash_cond],
239 [fs/dcache.c],[
240 AC_DEFINE(HAVE_D_REHASH_COND, 1,
241             [d_rehash_cond is exported by the kernel])
242 ],[
243 ])
244 ])
245
246 AC_DEFUN([LC_EXPORT___D_REHASH],
247 [LB_CHECK_SYMBOL_EXPORT([__d_rehash],
248 [fs/dcache.c],[
249 AC_DEFINE(HAVE___D_REHASH, 1,
250             [__d_rehash is exported by the kernel])
251 ],[
252 ])
253 ])
254
255 # The actual symbol exported varies among architectures, so we need
256 # to check many symbols (but only in the current architecture.)  No
257 # matter what symbol is exported, the kernel #defines node_to_cpumask
258 # to the appropriate function and that's what we use.
259 AC_DEFUN([LC_EXPORT_NODE_TO_CPUMASK],
260          [LB_CHECK_SYMBOL_EXPORT([node_to_cpumask],
261                                  [arch/$LINUX_ARCH/mm/numa.c],
262                                  [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1,
263                                             [node_to_cpumask is exported by
264                                              the kernel])]) # x86_64
265           LB_CHECK_SYMBOL_EXPORT([node_to_cpu_mask],
266                                  [arch/$LINUX_ARCH/kernel/smpboot.c],
267                                  [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1,
268                                             [node_to_cpumask is exported by
269                                              the kernel])]) # ia64
270           LB_CHECK_SYMBOL_EXPORT([node_2_cpu_mask],
271                                  [arch/$LINUX_ARCH/kernel/smpboot.c],
272                                  [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1,
273                                             [node_to_cpumask is exported by
274                                              the kernel])]) # i386
275           ])
276
277 #
278 #
279 # between 2.6.5 - 2.6.22 filemap_populate is exported in some kernels
280 #
281 AC_DEFUN([LC_FILEMAP_POPULATE],
282 [AC_MSG_CHECKING([for exported filemap_populate])
283 LB_LINUX_TRY_COMPILE([
284         #include <asm/page.h>
285         #include <linux/mm.h>
286 ],[
287        filemap_populate(NULL, 0, 0, __pgprot(0), 0, 0);
288 ],[
289         AC_MSG_RESULT([yes])
290         AC_DEFINE(HAVE_FILEMAP_POPULATE, 1, [Kernel exports filemap_populate])
291 ],[
292         AC_MSG_RESULT([no])
293 ])
294 ])
295
296 #
297 # added in 2.6.17
298 #
299 AC_DEFUN([LC_BIT_SPINLOCK_H],
300 [LB_CHECK_FILE([$LINUX/include/linux/bit_spinlock.h],[
301         AC_MSG_CHECKING([if bit_spinlock.h can be compiled])
302         LB_LINUX_TRY_COMPILE([
303                 #include <asm/processor.h>
304                 #include <linux/spinlock.h>
305                 #include <linux/bit_spinlock.h>
306         ],[],[
307                 AC_MSG_RESULT([yes])
308                 AC_DEFINE(HAVE_BIT_SPINLOCK_H, 1, [Kernel has bit_spinlock.h])
309         ],[
310                 AC_MSG_RESULT([no])
311         ])
312 ],
313 [])
314 ])
315
316 #
317 # LC_CAPA_CRYPTO
318 #
319 AC_DEFUN([LC_CAPA_CRYPTO],
320 [LB_LINUX_CONFIG_IM([CRYPTO],[],[
321         AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO is enabled in your kernel.])
322 ])
323 LB_LINUX_CONFIG_IM([CRYPTO_HMAC],[],[
324         AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_HMAC is enabled in your kernel.])
325 ])
326 LB_LINUX_CONFIG_IM([CRYPTO_SHA1],[],[
327         AC_MSG_ERROR([Lustre capability require that CONFIG_CRYPTO_SHA1 is enabled in your kernel.])
328 ])
329 ])
330
331 #
332 # LC_CONFIG_RMTCLIENT
333 #
334 dnl FIXME
335 dnl the AES symbol usually tied with arch, e.g. CRYPTO_AES_586
336 dnl FIXME
337 AC_DEFUN([LC_CONFIG_RMTCLIENT],
338 [LB_LINUX_CONFIG_IM([CRYPTO_AES],[],[
339         AC_MSG_WARN([Lustre remote client require that CONFIG_CRYPTO_AES is enabled in your kernel.])
340 ])
341 ])
342
343 #
344 # LC_CONFIG_GSS_KEYRING (default enabled, if gss is enabled)
345 #
346 AC_DEFUN([LC_CONFIG_GSS_KEYRING],
347 [AC_MSG_CHECKING([whether to enable gss keyring backend])
348  AC_ARG_ENABLE([gss_keyring],
349                [AC_HELP_STRING([--disable-gss-keyring],
350                                [disable gss keyring backend])],
351                [],[enable_gss_keyring='yes'])
352  AC_MSG_RESULT([$enable_gss_keyring])
353
354  if test x$enable_gss_keyring != xno; then
355         LB_LINUX_CONFIG_IM([KEYS],[],
356                            [AC_MSG_ERROR([GSS keyring backend require that CONFIG_KEYS be enabled in your kernel.])])
357
358         AC_CHECK_LIB([keyutils], [keyctl_search], [],
359                      [AC_MSG_ERROR([libkeyutils is not found, which is required by gss keyring backend])],)
360
361         AC_DEFINE([HAVE_GSS_KEYRING], [1],
362                   [Define this if you enable gss keyring backend])
363  fi
364 ])
365
366 AC_DEFUN([LC_CONFIG_SUNRPC],
367 [LB_LINUX_CONFIG_IM([SUNRPC],[],
368                     [AC_MSG_ERROR([kernel SUNRPC support is required by using GSS.])])
369 ])
370
371 #
372 # LC_CONFIG_GSS (default disabled)
373 #
374 # Build gss and related tools of Lustre. Currently both kernel and user space
375 # parts are depend on linux platform.
376 #
377 AC_DEFUN([LC_CONFIG_GSS],
378 [AC_MSG_CHECKING([whether to enable gss/krb5 support])
379  AC_ARG_ENABLE([gss],
380                [AC_HELP_STRING([--enable-gss], [enable gss/krb5 support])],
381                [],[enable_gss='no'])
382  AC_MSG_RESULT([$enable_gss])
383
384  if test x$enable_gss == xyes; then
385         LC_CONFIG_GSS_KEYRING
386         LC_CONFIG_SUNRPC
387
388         AC_DEFINE([HAVE_GSS], [1], [Define this if you enable gss])
389
390         LB_LINUX_CONFIG_IM([CRYPTO_MD5],[],
391                            [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
392         LB_LINUX_CONFIG_IM([CRYPTO_SHA1],[],
393                            [AC_MSG_WARN([kernel SHA1 support is recommended by using GSS.])])
394         LB_LINUX_CONFIG_IM([CRYPTO_SHA256],[],
395                            [AC_MSG_WARN([kernel SHA256 support is recommended by using GSS.])])
396         LB_LINUX_CONFIG_IM([CRYPTO_SHA512],[],
397                            [AC_MSG_WARN([kernel SHA512 support is recommended by using GSS.])])
398
399         AC_CHECK_LIB([gssapi], [gss_export_lucid_sec_context],
400                      [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi"],
401                      [AC_CHECK_LIB([gssglue], [gss_export_lucid_sec_context],
402                                    [GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssglue"],
403                                    [AC_MSG_ERROR([libgssapi or libgssglue is not found, which is required by GSS.])])],)
404
405         AC_SUBST(GSSAPI_LIBS)
406
407         AC_KERBEROS_V5
408  fi
409 ])
410
411 AC_DEFUN([LC_TASK_CLENV_STORE],
412 [
413         AC_MSG_CHECKING([if we can store cl_env in task_struct])
414         if test x$have_task_clenv_store != xyes ; then
415                 LC_TASK_CLENV_TUX_INFO
416         fi
417 ])
418
419 # 2.6.12
420
421 # ~2.6.12 merge patch from oracle to convert tree_lock from spinlock to rwlock
422 # yet tree_lock is converted from rwlock to spin_lock since v2.6.26
423 AC_DEFUN([LC_RW_TREE_LOCK],
424 [AC_MSG_CHECKING([if kernel has tree_lock as rwlock])
425 tmp_flags="$EXTRA_KCFLAGS"
426 EXTRA_KCFLAGS="-Werror"
427 LB_LINUX_TRY_COMPILE([
428         #include <linux/fs.h>
429 ],[
430         struct address_space a;
431
432         write_lock(&a.tree_lock);
433 ],[
434         AC_MSG_RESULT([yes])
435         AC_DEFINE(HAVE_RW_TREE_LOCK, 1, [kernel has tree_lock as rw_lock])
436 ],[
437         AC_MSG_RESULT([no])
438 ])
439 EXTRA_KCFLAGS="$tmp_flags"
440 ])
441
442 # 2.6.18
443
444 # LC_UMOUNTBEGIN_HAS_VFSMOUNT
445 # 2.6.18~2.6.25 umount_begin has different parameters
446 AC_DEFUN([LC_UMOUNTBEGIN_HAS_VFSMOUNT],
447 [AC_MSG_CHECKING([if umount_begin needs vfsmount parameter instead of super_block])
448 tmp_flags="$EXTRA_KCFLAGS"
449 EXTRA_KCFLAGS="-Werror"
450 LB_LINUX_TRY_COMPILE([
451         #include <linux/fs.h>
452
453         struct vfsmount;
454         static void cfg_umount_begin (struct vfsmount *v, int flags)
455         {
456                 ;
457         }
458
459         static struct super_operations cfg_super_operations = {
460                 .umount_begin   = cfg_umount_begin,
461         };
462 ],[
463         cfg_super_operations.umount_begin(NULL,0);
464 ],[
465         AC_MSG_RESULT(yes)
466         AC_DEFINE(HAVE_UMOUNTBEGIN_VFSMOUNT, 1,
467                 [Define umount_begin need second argument])
468 ],[
469         AC_MSG_RESULT(no)
470 ])
471 EXTRA_KCFLAGS="$tmp_flags"
472 ])
473
474 #2.6.18 + RHEL5 (fc6)
475
476 #
477 # LC_LINUX_FIEMAP_H
478 #
479 # fiemap.h is added since v2.6.28
480 # RHEL5 2.6.18 has it, while SLES10 2.6.27 does not
481 #
482 AC_DEFUN([LC_LINUX_FIEMAP_H],
483 [LB_CHECK_FILE([$LINUX/include/linux/fiemap.h],[
484         AC_MSG_CHECKING([if fiemap.h can be compiled])
485         LB_LINUX_TRY_COMPILE([
486                 #include <linux/types.h>
487                 #include <linux/fiemap.h>
488         ],[],[
489                 AC_MSG_RESULT([yes])
490                 AC_DEFINE(HAVE_LINUX_FIEMAP_H, 1, [Kernel has fiemap.h])
491         ],[
492                 AC_MSG_RESULT([no])
493         ])
494 ],
495 [])
496 ])
497
498 # 2.6.19
499
500 # LC_FILE_WRITEV
501 # 2.6.19 replaced writev with aio_write
502 AC_DEFUN([LC_FILE_WRITEV],
503 [AC_MSG_CHECKING([writev in fops])
504 LB_LINUX_TRY_COMPILE([
505         #include <linux/fs.h>
506 ],[
507         struct file_operations *fops = NULL;
508         fops->writev = NULL;
509 ],[
510         AC_MSG_RESULT(yes)
511         AC_DEFINE(HAVE_FILE_WRITEV, 1,
512                 [use fops->writev])
513 ],[
514         AC_MSG_RESULT(no)
515 ])
516 ])
517
518 # LC_FILE_READV
519 # 2.6.19 replaced readv with aio_read
520 AC_DEFUN([LC_FILE_READV],
521 [AC_MSG_CHECKING([readv in fops])
522 LB_LINUX_TRY_COMPILE([
523         #include <linux/fs.h>
524 ],[
525         struct file_operations *fops = NULL;
526         fops->readv = NULL;
527 ],[
528         AC_MSG_RESULT(yes)
529         AC_DEFINE(HAVE_FILE_READV, 1,
530                 [use fops->readv])
531 ],[
532         AC_MSG_RESULT(no)
533 ])
534 ])
535
536 # 2.6.20
537
538 # LC_CANCEL_DIRTY_PAGE
539 # 2.6.20 introduced cancel_dirty_page instead of clear_page_dirty.
540 AC_DEFUN([LC_CANCEL_DIRTY_PAGE],
541         [AC_MSG_CHECKING([kernel has cancel_dirty_page])
542         # the implementation of cancel_dirty_page in OFED 1.4.1's SLES10 SP2
543         # backport is broken, so ignore it
544         if test -f $OFED_BACKPORT_PATH/linux/mm.h &&
545            test "$(sed -ne '/^static inline void cancel_dirty_page(struct page \*page, unsigned int account_size)$/,/^}$/p' $OFED_BACKPORT_PATH/linux/mm.h | md5sum)" = "c518cb32d6394760c5bca14cb7538d3e  -"; then
546                 AC_MSG_RESULT(no)
547         else
548                 LB_LINUX_TRY_COMPILE([
549                         #include <linux/mm.h>
550                         #include <linux/page-flags.h>
551 ],[
552                         cancel_dirty_page(NULL, 0);
553 ],[
554                         AC_MSG_RESULT(yes)
555                         AC_DEFINE(HAVE_CANCEL_DIRTY_PAGE, 1,
556                                   [kernel has cancel_dirty_page instead of clear_page_dirty])
557 ],[
558                         AC_MSG_RESULT(no)
559 ])
560         fi
561 ])
562
563 # raid5-zerocopy patch
564
565 #
566 # LC_PAGE_CONSTANT
567 #
568 # In order to support raid5 zerocopy patch, we have to patch the kernel to make
569 # it support constant page, which means the page won't be modified during the
570 # IO.
571 #
572 AC_DEFUN([LC_PAGE_CONSTANT],
573 [AC_MSG_CHECKING([if kernel have PageConstant defined])
574 LB_LINUX_TRY_COMPILE([
575         #include <linux/mm.h>
576         #include <linux/page-flags.h>
577 ],[
578         #ifndef PG_constant
579         #error "Have no raid5 zcopy patch"
580         #endif
581 ],[
582         AC_MSG_RESULT(yes)
583         AC_DEFINE(HAVE_PAGE_CONSTANT, 1, [kernel have PageConstant supported])
584 ],[
585         AC_MSG_RESULT(no);
586 ])
587 ])
588
589 # 2.6.22
590
591 # 2.6.22 lost second parameter for invalidate_bdev
592 AC_DEFUN([LC_INVALIDATE_BDEV_2ARG],
593 [AC_MSG_CHECKING([if invalidate_bdev has second argument])
594 LB_LINUX_TRY_COMPILE([
595         #include <linux/buffer_head.h>
596 ],[
597         invalidate_bdev(NULL,0);
598 ],[
599         AC_MSG_RESULT([yes])
600         AC_DEFINE(HAVE_INVALIDATE_BDEV_2ARG, 1,
601                 [invalidate_bdev has second argument])
602 ],[
603         AC_MSG_RESULT([no])
604 ])
605 ])
606
607 #
608 # check for crypto API
609 #
610 AC_DEFUN([LC_ASYNC_BLOCK_CIPHER],
611 [AC_MSG_CHECKING([if kernel has block cipher support])
612 LB_LINUX_TRY_COMPILE([
613         #include <linux/err.h>
614         #include <linux/crypto.h>
615 ],[
616         struct crypto_blkcipher *tfm;
617         tfm = crypto_alloc_blkcipher("aes", 0, sizeof(tfm) );
618 ],[
619         AC_MSG_RESULT([yes])
620         AC_DEFINE(HAVE_ASYNC_BLOCK_CIPHER, 1, [kernel has block cipher support])
621 ],[
622         AC_MSG_RESULT([no])
623 ])
624 ])
625
626 #
627 # check for struct hash_desc
628 #
629 AC_DEFUN([LC_STRUCT_HASH_DESC],
630 [AC_MSG_CHECKING([if kernel has struct hash_desc])
631 LB_LINUX_TRY_COMPILE([
632         #include <linux/err.h>
633         #include <linux/crypto.h>
634 ],[
635         struct hash_desc foo __attribute__ ((unused));
636 ],[
637         AC_MSG_RESULT([yes])
638         AC_DEFINE(HAVE_STRUCT_HASH_DESC, 1, [kernel has struct hash_desc])
639 ],[
640         AC_MSG_RESULT([no])
641 ])
642 ])
643
644 #
645 # check for struct blkcipher_desc
646 #
647 AC_DEFUN([LC_STRUCT_BLKCIPHER_DESC],
648 [AC_MSG_CHECKING([if kernel has struct blkcipher_desc])
649 LB_LINUX_TRY_COMPILE([
650         #include <linux/err.h>
651         #include <linux/crypto.h>
652 ],[
653         struct blkcipher_desc foo __attribute__ ((unused));
654 ],[
655         AC_MSG_RESULT([yes])
656         AC_DEFINE(HAVE_STRUCT_BLKCIPHER_DESC, 1, [kernel has struct blkcipher_desc])
657 ],[
658         AC_MSG_RESULT([no])
659 ])
660 ])
661
662 #
663 # 2.6.19 check for FS_RENAME_DOES_D_MOVE flag
664 #
665 AC_DEFUN([LC_FS_RENAME_DOES_D_MOVE],
666 [AC_MSG_CHECKING([if kernel has FS_RENAME_DOES_D_MOVE flag])
667 LB_LINUX_TRY_COMPILE([
668         #include <linux/fs.h>
669 ],[
670         int v __attribute__ ((unused));
671         v = FS_RENAME_DOES_D_MOVE;
672 ],[
673         AC_MSG_RESULT([yes])
674         AC_DEFINE(HAVE_FS_RENAME_DOES_D_MOVE, 1, [kernel has FS_RENAME_DOES_D_MOVE flag])
675 ],[
676         AC_MSG_RESULT([no])
677 ])
678 ])
679
680 # 2.6.23
681
682 # 2.6.23 have return type 'void' for unregister_blkdev
683 AC_DEFUN([LC_UNREGISTER_BLKDEV_RETURN_INT],
684 [AC_MSG_CHECKING([if unregister_blkdev return int])
685 LB_LINUX_TRY_COMPILE([
686         #include <linux/fs.h>
687 ],[
688         int i __attribute__ ((unused));
689         i = unregister_blkdev(0,NULL);
690 ],[
691         AC_MSG_RESULT([yes])
692         AC_DEFINE(HAVE_UNREGISTER_BLKDEV_RETURN_INT, 1,
693                 [unregister_blkdev return int])
694 ],[
695         AC_MSG_RESULT([no])
696 ])
697 ])
698
699 # 2.6.23 change .sendfile to .splice_read
700 AC_DEFUN([LC_KERNEL_SPLICE_READ],
701 [AC_MSG_CHECKING([if kernel has .splice_read])
702 LB_LINUX_TRY_COMPILE([
703         #include <linux/fs.h>
704 ],[
705         struct file_operations file;
706
707         file.splice_read = NULL;
708 ], [
709         AC_MSG_RESULT([yes])
710         AC_DEFINE(HAVE_KERNEL_SPLICE_READ, 1,
711                 [kernel has .slice_read])
712 ],[
713         AC_MSG_RESULT([no])
714 ])
715 ])
716
717 # 2.6.23 change .sendfile to .splice_read
718 # RHEL4 (-92 kernel) have both sendfile and .splice_read API
719 AC_DEFUN([LC_KERNEL_SENDFILE],
720 [AC_MSG_CHECKING([if kernel has .sendfile])
721 LB_LINUX_TRY_COMPILE([
722         #include <linux/fs.h>
723 ],[
724         struct file_operations file;
725
726         file.sendfile = NULL;
727 ], [
728         AC_MSG_RESULT([yes])
729         AC_DEFINE(HAVE_KERNEL_SENDFILE, 1,
730                 [kernel has .sendfile])
731 ],[
732         AC_MSG_RESULT([no])
733 ])
734 ])
735
736 # 2.6.23 extract nfs export related data into exportfs.h
737 AC_DEFUN([LC_HAVE_EXPORTFS_H],
738 [LB_CHECK_FILE([$LINUX/include/linux/exportfs.h], [
739         AC_DEFINE(HAVE_LINUX_EXPORTFS_H, 1,
740                 [kernel has include/exportfs.h])
741 ],[
742         AC_MSG_RESULT([no])
743 ])
744 ])
745
746 # 2.6.23 has new page fault handling API
747 AC_DEFUN([LC_VM_OP_FAULT],
748 [AC_MSG_CHECKING([kernel has .fault in vm_operation_struct])
749 LB_LINUX_TRY_COMPILE([
750         #include <linux/mm.h>
751 ],[
752         struct vm_operations_struct op;
753
754         op.fault = NULL;
755 ], [
756         AC_MSG_RESULT([yes])
757         AC_DEFINE(HAVE_VM_OP_FAULT, 1,
758                 [kernel has .fault in vm_operation_struct])
759 ],[
760         AC_MSG_RESULT([no])
761 ])
762 ])
763
764 # 2.6.23 add code to wait other users to complete before removing procfs entry
765 AC_DEFUN([LC_PROCFS_USERS],
766 [AC_MSG_CHECKING([if kernel has pde_users member in procfs entry struct])
767 LB_LINUX_TRY_COMPILE([
768         #include <linux/proc_fs.h>
769 ],[
770         struct proc_dir_entry pde;
771
772         pde.pde_users   = 0;
773 ],[
774         AC_MSG_RESULT([yes])
775         AC_DEFINE(HAVE_PROCFS_USERS, 1,
776                 [kernel has pde_users member in procfs entry struct])
777 ],[
778         LB_LINUX_TRY_COMPILE([
779                 #include "$LINUX/fs/proc/internal.h"
780         ],[
781                 struct proc_dir_entry_aux pde_aux;
782
783                 pde_aux.pde_users = 0;
784         ],[
785                 AC_MSG_RESULT([yes])
786                 AC_DEFINE(HAVE_PROCFS_USERS, 1,
787                         [kernel has pde_users member in proc_dir_entry_aux])
788         ],[
789                 AC_MSG_RESULT([no])
790         ])
791 ])
792 ])
793
794 # 2.6.23 exports exportfs_decode_fh
795 AC_DEFUN([LC_EXPORTFS_DECODE_FH],
796 [LB_CHECK_SYMBOL_EXPORT([exportfs_decode_fh],
797 [fs/exportfs/expfs.c],[
798         AC_DEFINE(HAVE_EXPORTFS_DECODE_FH, 1,
799                 [exportfs_decode_fh has been export])
800 ],[
801 ])
802 ])
803
804 # 2.6.24
805
806 # 2.6.24 need linux/mm_types.h included
807 AC_DEFUN([LC_HAVE_MMTYPES_H],
808 [LB_CHECK_FILE([$LINUX/include/linux/mm_types.h], [
809         AC_DEFINE(HAVE_LINUX_MMTYPES_H, 1,
810                 [kernel has include/mm_types.h])
811 ],[
812         AC_MSG_RESULT([no])
813 ])
814 ])
815
816 # 2.6.24 has bio_endio with 2 args
817 AC_DEFUN([LC_BIO_ENDIO_2ARG],
818 [AC_MSG_CHECKING([if kernel has bio_endio with 2 args])
819 LB_LINUX_TRY_COMPILE([
820         #include <linux/bio.h>
821 ],[
822         bio_endio(NULL, 0);
823 ], [
824         AC_MSG_RESULT([yes])
825         AC_DEFINE(HAVE_BIO_ENDIO_2ARG, 1,
826                 [kernel has bio_endio with 2 args])
827 ],[
828         AC_MSG_RESULT([no])
829 ])
830 ])
831
832 # 2.6.24 has new members in exports struct.
833 AC_DEFUN([LC_FH_TO_DENTRY],
834 [AC_MSG_CHECKING([if kernel has .fh_to_dentry member in export_operations struct])
835 LB_LINUX_TRY_COMPILE([
836         #include <linux/fs.h>
837 #ifdef HAVE_LINUX_EXPORTFS_H
838         #include <linux/exportfs.h>
839 #endif
840 ],[
841         do{ }while(sizeof(((struct export_operations *)0)->fh_to_dentry));
842 ], [
843         AC_MSG_RESULT([yes])
844         AC_DEFINE(HAVE_FH_TO_DENTRY, 1,
845                 [kernel has .fh_to_dentry member in export_operations struct])
846 ],[
847         AC_MSG_RESULT([no])
848 ])
849 ])
850
851 # 2.6.24 removes long aged procfs entry -> deleted member
852 AC_DEFUN([LC_PROCFS_DELETED],
853 [AC_MSG_CHECKING([if kernel has deleted member in procfs entry struct])
854 LB_LINUX_TRY_COMPILE([
855         #include <linux/proc_fs.h>
856 ],[
857         struct proc_dir_entry pde;
858
859         pde.deleted = sizeof(pde);
860 ], [
861         AC_MSG_RESULT([yes])
862         AC_DEFINE(HAVE_PROCFS_DELETED, 1,
863                 [kernel has deleted member in procfs entry struct])
864 ],[
865         AC_MSG_RESULT([no])
866 ])
867 ])
868
869 # 2.6.24 has bdi_init()/bdi_destroy() functions.
870 AC_DEFUN([LC_EXPORT_BDI_INIT],
871 [LB_CHECK_SYMBOL_EXPORT([bdi_init],
872 [mm/backing-dev.c],[
873         AC_DEFINE(HAVE_BDI_INIT, 1,
874                 [bdi_init/bdi_destroy functions are present])
875 ],[
876 ])
877 ])
878
879 # 2.6.26
880
881 # 2.6.26 isn't export set_fs_pwd and change paramter in fs struct
882 AC_DEFUN([LC_FS_STRUCT_USE_PATH],
883 [AC_MSG_CHECKING([fs_struct use path structure])
884 LB_LINUX_TRY_COMPILE([
885         #include <asm/atomic.h>
886         #include <linux/spinlock.h>
887         #include <linux/fs_struct.h>
888 ],[
889         struct fs_struct fs;
890
891         fs.pwd = *((struct path *)sizeof(fs));
892 ], [
893         AC_MSG_RESULT([yes])
894         AC_DEFINE(HAVE_FS_STRUCT_USE_PATH, 1,
895                 [fs_struct use path structure])
896 ],[
897         AC_MSG_RESULT([no])
898 ])
899 ])
900
901 #
902 # 2.6.27
903 #
904
905 # LC_SECURITY_PLUG  # for SLES10 SP2 (2.6.27)
906 # check security plug in sles10 sp2 kernel
907 AC_DEFUN([LC_SECURITY_PLUG],
908 [AC_MSG_CHECKING([If kernel has security plug support])
909 LB_LINUX_TRY_COMPILE([
910         #include <linux/fs.h>
911         #include <linux/stddef.h>
912 ],[
913         notify_change(NULL, NULL, NULL);
914 ],[
915         AC_MSG_RESULT(yes)
916         AC_DEFINE(HAVE_SECURITY_PLUG, 1,
917                 [SLES10 SP2 use extra parameter in vfs])
918 ],[
919         AC_MSG_RESULT(no)
920 ])
921 ])
922
923 AC_DEFUN([LC_PGMKWRITE_USE_VMFAULT],
924 [AC_MSG_CHECKING([kernel .page_mkwrite uses struct vm_fault *])
925 tmp_flags="$EXTRA_KCFLAGS"
926 EXTRA_KCFLAGS="-Werror"
927 LB_LINUX_TRY_COMPILE([
928         #include <linux/mm.h>
929 ],[
930         ((struct vm_operations_struct *)0)->page_mkwrite((struct vm_area_struct *)0, (struct vm_fault *)0);
931 ], [
932         AC_MSG_RESULT([yes])
933         AC_DEFINE(HAVE_PGMKWRITE_USE_VMFAULT, 1,
934                 [kernel vm_operation_struct.page_mkwrite uses struct vm_fault * as second parameter])
935 ],[
936         AC_MSG_RESULT([no])
937 ])
938 EXTRA_KCFLAGS="$tmp_flags"
939 ])
940
941 AC_DEFUN([LC_PGMKWRITE_COMPACT],
942 [AC_MSG_CHECKING([if kernel .page_mkwrite is located in vm_operation_struct._pmkw])
943 tmp_flags="$EXTRA_KCFLAGS"
944 EXTRA_KCFLAGS="-Werror"
945 LB_LINUX_TRY_COMPILE([
946         #include <linux/mm.h>
947 ],[
948         struct vm_operations_struct *vm_ops;
949
950         vm_ops = NULL;
951         vm_ops->_pmkw.page_mkwrite(NULL, NULL);
952 ], [
953         AC_MSG_RESULT([yes])
954         AC_DEFINE(HAVE_PGMKWRITE_COMPACT, 1,
955                 [kernel .page_mkwrite is located in vm_operation_struct._pmkw])
956 ],[
957         AC_MSG_RESULT([no])
958 ])
959 EXTRA_KCFLAGS="$tmp_flags"
960 ])
961
962 AC_DEFUN([LC_INODE_PERMISION_2ARGS],
963 [AC_MSG_CHECKING([inode_operations->permission has two args])
964 LB_LINUX_TRY_COMPILE([
965         #include <linux/fs.h>
966 ],[
967         struct inode *inode __attribute__ ((unused));
968
969         inode = NULL;
970         inode->i_op->permission(NULL, 0);
971 ],[
972         AC_DEFINE(HAVE_INODE_PERMISION_2ARGS, 1,
973                   [inode_operations->permission has two args])
974         AC_MSG_RESULT([yes])
975 ],[
976         AC_MSG_RESULT([no])
977 ])
978 ])
979
980 # 2.6.27 have new page locking API
981 AC_DEFUN([LC_TRYLOCKPAGE],
982 [AC_MSG_CHECKING([kernel uses trylock_page for page lock])
983 LB_LINUX_TRY_COMPILE([
984         #include <linux/pagemap.h>
985 ],[
986         trylock_page(NULL);
987 ],[
988         AC_DEFINE(HAVE_TRYLOCK_PAGE, 1,
989                   [kernel uses trylock_page for page lock])
990         AC_MSG_RESULT([yes])
991 ],[
992         AC_MSG_RESULT([no])
993 ])
994 ])
995
996 # 2.6.27 removed the read_inode from super_operations.
997 AC_DEFUN([LC_READ_INODE_IN_SBOPS],
998 [AC_MSG_CHECKING([super_operations has a read_inode field])
999 LB_LINUX_TRY_COMPILE([
1000         #include <linux/fs.h>
1001 ],[
1002         struct super_operations *sop;
1003         sop->read_inode(NULL);
1004 ],[
1005         AC_DEFINE(HAVE_READ_INODE_IN_SBOPS, 1,
1006                 [super_operations has a read_inode])
1007         AC_MSG_RESULT([yes])
1008 ],[
1009         AC_MSG_RESULT([no])
1010 ])
1011 ])
1012
1013 # 2.6.27 has inode_permission instead of permisson
1014 AC_DEFUN([LC_EXPORT_INODE_PERMISSION],
1015 [LB_CHECK_SYMBOL_EXPORT([inode_permission],
1016 [fs/namei.c],[
1017 AC_DEFINE(HAVE_EXPORT_INODE_PERMISSION, 1,
1018             [inode_permission is exported by the kernel])
1019 ],[
1020 ])
1021 ])
1022
1023 # 2.6.27 use 5th parameter in quota_on for remount.
1024 AC_DEFUN([LC_QUOTA_ON_5ARGS],
1025 [AC_MSG_CHECKING([quota_on needs 5 parameters])
1026 LB_LINUX_TRY_COMPILE([
1027         #include <linux/fs.h>
1028         #include <linux/quota.h>
1029 ],[
1030         struct quotactl_ops *qop = NULL;
1031         qop->quota_on(NULL, 0, 0, NULL, 0);
1032 ],[
1033         AC_DEFINE(HAVE_QUOTA_ON_5ARGS, 1,
1034                 [quota_on needs 5 paramters])
1035         AC_MSG_RESULT([yes])
1036 ],[
1037         AC_MSG_RESULT([no])
1038 ])
1039 ])
1040
1041 # 2.6.27 use 3th parameter in quota_off for remount.
1042 AC_DEFUN([LC_QUOTA_OFF_3ARGS],
1043 [AC_MSG_CHECKING([quota_off needs 3 parameters])
1044 LB_LINUX_TRY_COMPILE([
1045         #include <linux/fs.h>
1046         #include <linux/quota.h>
1047 ],[
1048         struct quotactl_ops *qop = NULL;
1049         qop->quota_off(NULL, 0, 0);
1050 ],[
1051         AC_DEFINE(HAVE_QUOTA_OFF_3ARGS, 1,
1052                 [quota_off needs 3 paramters])
1053         AC_MSG_RESULT([yes])
1054 ],[
1055         AC_MSG_RESULT([no])
1056 ])
1057 ])
1058
1059 # 2.6.27 has vfs_dq_off inline function.
1060 AC_DEFUN([LC_VFS_DQ_OFF],
1061 [AC_MSG_CHECKING([vfs_dq_off is defined])
1062 LB_LINUX_TRY_COMPILE([
1063         #include <linux/quotaops.h>
1064 ],[
1065         vfs_dq_off(NULL, 0);
1066 ],[
1067         AC_DEFINE(HAVE_VFS_DQ_OFF, 1, [vfs_dq_off is defined])
1068         AC_MSG_RESULT([yes])
1069 ],[
1070         AC_MSG_RESULT([no])
1071 ])
1072 ])
1073
1074 # 2.6.34 has quotactl_ops->[sg]et_dqblk that take struct fs_disk_quota
1075 AC_DEFUN([LC_HAVE_DQUOT_FS_DISK_QUOTA],
1076 tmp_flags="$EXTRA_KCFLAGS"
1077 EXTRA_KCFLAGS="-Werror"
1078 [AC_MSG_CHECKING([if quotactl_ops.set_dqblk takes struct fs_disk_quota])
1079 LB_LINUX_TRY_COMPILE([
1080         #include <linux/fs.h>
1081         #include <linux/quota.h>
1082 ],[
1083         struct quotactl_ops qops = {};
1084         struct fs_disk_quota fdq;
1085         qops.set_dqblk(NULL, 0, 0, &fdq);
1086 ],[
1087         AC_DEFINE(HAVE_DQUOT_FS_DISK_QUOTA, 1, [quotactl_ops.set_dqblk takes struct fs_disk_quota])
1088         AC_MSG_RESULT([yes])
1089 ],[
1090         AC_MSG_RESULT([no])
1091 ])
1092 EXTRA_KCFLAGS="$tmp_flags"
1093 ])
1094
1095 # 2.6.34 has renamed dquot options to dquot_*, check for dquot_suspend
1096 AC_DEFUN([LC_HAVE_DQUOT_SUSPEND],
1097 [AC_MSG_CHECKING([if dquot_suspend is defined])
1098 LB_LINUX_TRY_COMPILE([
1099         #include <linux/quotaops.h>
1100 ],[
1101         dquot_suspend(NULL, -1);
1102 ],[
1103         AC_DEFINE(HAVE_DQUOT_SUSPEND, 1, [dquot_suspend is defined])
1104         AC_MSG_RESULT([yes])
1105 ],[
1106         AC_MSG_RESULT([no])
1107 ])
1108 ])
1109
1110 # LC_LOCK_MAP_ACQUIRE
1111 # after 2.6.27 lock_map_acquire replaces lock_acquire
1112 AC_DEFUN([LC_LOCK_MAP_ACQUIRE],
1113 [AC_MSG_CHECKING([if lock_map_acquire is defined])
1114 LB_LINUX_TRY_COMPILE([
1115         #include <linux/lockdep.h>
1116 ],[
1117         lock_map_acquire(NULL);
1118 ],[
1119         AC_MSG_RESULT(yes)
1120         AC_DEFINE(HAVE_LOCK_MAP_ACQUIRE, 1,
1121                 [lock_map_acquire is defined])
1122 ],[
1123         AC_MSG_RESULT(no)
1124 ])
1125 ])
1126
1127 # 2.6.27.15-2 sles11
1128
1129 # 2.6.27 sles11 remove the bi_hw_segments
1130 AC_DEFUN([LC_BI_HW_SEGMENTS],
1131 [AC_MSG_CHECKING([struct bio has a bi_hw_segments field])
1132 LB_LINUX_TRY_COMPILE([
1133         #include <linux/bio.h>
1134 ],[
1135         struct bio io;
1136         io.bi_hw_segments = sizeof(io);
1137 ],[
1138         AC_DEFINE(HAVE_BI_HW_SEGMENTS, 1,
1139                 [struct bio has a bi_hw_segments field])
1140         AC_MSG_RESULT([yes])
1141 ],[
1142         AC_MSG_RESULT([no])
1143 ])
1144 ])
1145
1146 #
1147 # 2.6.27 sles11 move the quotaio_v1{2}.h from include/linux to fs
1148 # 2.6.32 move the quotaio_v1{2}.h from fs to fs/quota
1149 AC_DEFUN([LC_HAVE_QUOTAIO_H],
1150 [LB_CHECK_FILE([$LINUX/include/linux/quotaio_v2.h],[
1151         AC_DEFINE(HAVE_QUOTAIO_H, 1,
1152                 [kernel has include/linux/quotaio_v2.h])
1153 ],[LB_CHECK_FILE([$LINUX/fs/quotaio_v2.h],[
1154                AC_DEFINE(HAVE_FS_QUOTAIO_H, 1,
1155                 [kernel has fs/quotaio_v1.h])
1156 ],[LB_CHECK_FILE([$LINUX/fs/quota/quotaio_v2.h],[
1157                AC_DEFINE(HAVE_FS_QUOTA_QUOTAIO_H, 1,
1158                 [kernel has fs/quota/quotaio_v2.h])
1159 ],[
1160         AC_MSG_RESULT([no])
1161 ])
1162 ])
1163 ])
1164 ])
1165
1166 # 2.6.27 sles11 has sb_any_quota_active
1167 AC_DEFUN([LC_SB_ANY_QUOTA_ACTIVE],
1168 [AC_MSG_CHECKING([Kernel has sb_any_quota_active])
1169 LB_LINUX_TRY_COMPILE([
1170         #include <linux/quotaops.h>
1171 ],[
1172         sb_any_quota_active(NULL);
1173 ],[
1174         AC_DEFINE(HAVE_SB_ANY_QUOTA_ACTIVE, 1,
1175                 [Kernel has a sb_any_quota_active])
1176         AC_MSG_RESULT([yes])
1177 ],[
1178         AC_MSG_RESULT([no])
1179 ])
1180 ])
1181
1182 # 2.6.27 sles11 has sb_has_quota_active
1183 AC_DEFUN([LC_SB_HAS_QUOTA_ACTIVE],
1184 [AC_MSG_CHECKING([Kernel has sb_has_quota_active])
1185 LB_LINUX_TRY_COMPILE([
1186         #include <linux/quotaops.h>
1187 ],[
1188         sb_has_quota_active(NULL, 0);
1189 ],[
1190         AC_DEFINE(HAVE_SB_HAS_QUOTA_ACTIVE, 1,
1191                 [Kernel has a sb_has_quota_active])
1192         AC_MSG_RESULT([yes])
1193 ],[
1194         AC_MSG_RESULT([no])
1195 ])
1196 ])
1197
1198 # 2.6.27 exported add_to_page_cache_lru.
1199 AC_DEFUN([LC_EXPORT_ADD_TO_PAGE_CACHE_LRU],
1200 [LB_CHECK_SYMBOL_EXPORT([add_to_page_cache_lru],
1201 [mm/filemap.c],[
1202         AC_DEFINE(HAVE_ADD_TO_PAGE_CACHE_LRU, 1,
1203                 [add_to_page_cache_lru functions are present])
1204 ],[
1205 ])
1206 ])
1207
1208 #
1209 # 2.6.29 introduce sb_any_quota_loaded.
1210 #
1211 AC_DEFUN([LC_SB_ANY_QUOTA_LOADED],
1212 [AC_MSG_CHECKING([Kernel has sb_any_quota_loaded])
1213 LB_LINUX_TRY_COMPILE([
1214         #include <linux/quotaops.h>
1215 ],[
1216         sb_any_quota_loaded(NULL);
1217 ],[
1218         AC_DEFINE(HAVE_SB_ANY_QUOTA_LOADED, 1,
1219                 [Kernel has a sb_any_quota_loaded])
1220         AC_MSG_RESULT([yes])
1221 ],[
1222         AC_MSG_RESULT([no])
1223 ])
1224 ])
1225
1226 # 2.6.30 x86 node_to_cpumask has been removed. must use cpumask_of_node
1227 AC_DEFUN([LC_EXPORT_CPUMASK_OF_NODE],
1228          [LB_CHECK_SYMBOL_EXPORT([node_to_cpumask_map],
1229                                  [arch/$LINUX_ARCH/mm/numa.c],
1230                                  [AC_DEFINE(HAVE_CPUMASK_OF_NODE, 1,
1231                                             [node_to_cpumask_map is exported by
1232                                              the kernel])]) # x86_64
1233          ])
1234
1235
1236 # 2.6.31 replaces blk_queue_hardsect_size by blk_queue_logical_block_size function
1237 AC_DEFUN([LC_BLK_QUEUE_LOG_BLK_SIZE],
1238 [AC_MSG_CHECKING([if blk_queue_logical_block_size is defined])
1239 LB_LINUX_TRY_COMPILE([
1240         #include <linux/blkdev.h>
1241 ],[
1242         blk_queue_logical_block_size(NULL, 0);
1243 ],[
1244         AC_MSG_RESULT(yes)
1245         AC_DEFINE(HAVE_BLK_QUEUE_LOG_BLK_SIZE, 1,
1246                   [blk_queue_logical_block_size is defined])
1247 ],[
1248         AC_MSG_RESULT(no)
1249 ])
1250 ])
1251
1252 # 2.6.32
1253
1254 # 2.6.32 introduced inode_newsize_ok
1255 AC_DEFUN([LC_VFS_INODE_NEWSIZE_OK],
1256 [AC_MSG_CHECKING([if inode_newsize_ok is defined])
1257 LB_LINUX_TRY_COMPILE([
1258         #include <linux/fs.h>
1259 ],[
1260         return inode_newsize_ok(NULL, 0);
1261 ],[
1262         AC_MSG_RESULT(yes)
1263         AC_DEFINE(HAVE_VFS_INODE_NEWSIZE_OK, 1,
1264                   [inode_newsize_ok is defined])
1265 ],[
1266         AC_MSG_RESULT(no)
1267 ])
1268 ])
1269
1270 # 2.6.32 changes cache_detail's member cache_request to cache_upcall
1271 # in kernel commit bc74b4f5e63a09fb78e245794a0de1e5a2716bbe
1272 AC_DEFUN([LC_CACHE_UPCALL],
1273 [AC_MSG_CHECKING([if cache_detail has cache_upcall field])
1274         LB_LINUX_TRY_COMPILE([
1275                 #include <linux/sunrpc/cache.h>
1276         ],[
1277                 struct cache_detail cd;
1278                 cd.cache_upcall = NULL;
1279         ],[
1280                 AC_MSG_RESULT(yes)
1281                 AC_DEFINE(HAVE_CACHE_UPCALL, 1,
1282                           [cache_detail has cache_upcall field])
1283         ],[
1284                 AC_MSG_RESULT(no)
1285         ])
1286 ])
1287
1288 # 2.6.32 add a limits member in struct request_queue.
1289 AC_DEFUN([LC_REQUEST_QUEUE_LIMITS],
1290 [AC_MSG_CHECKING([if request_queue has a limits field])
1291 LB_LINUX_TRY_COMPILE([
1292         #include <linux/blkdev.h>
1293 ],[
1294         struct request_queue rq;
1295         rq.limits.io_min = 0;
1296 ],[
1297         AC_MSG_RESULT(yes)
1298         AC_DEFINE(HAVE_REQUEST_QUEUE_LIMITS, 1,
1299                   [request_queue has a limits field])
1300 ],[
1301         AC_MSG_RESULT(no)
1302 ])
1303 ])
1304
1305 # 2.6.32 has bdi_register() functions.
1306 AC_DEFUN([LC_EXPORT_BDI_REGISTER],
1307 [LB_CHECK_SYMBOL_EXPORT([bdi_register],
1308 [mm/backing-dev.c],[
1309         AC_DEFINE(HAVE_BDI_REGISTER, 1,
1310                 [bdi_register function is present])
1311 ],[
1312 ])
1313 ])
1314
1315 # 2.6.32 add s_bdi for super block
1316 AC_DEFUN([LC_SB_BDI],
1317 [AC_MSG_CHECKING([if super_block has s_bdi field])
1318 LB_LINUX_TRY_COMPILE([
1319         #include <linux/fs.h>
1320 ],[
1321         struct super_block sb;
1322         sb.s_bdi = NULL;
1323 ],[
1324         AC_MSG_RESULT(yes)
1325         AC_DEFINE(HAVE_SB_BDI, 1,
1326                   [super_block has s_bdi field])
1327 ],[
1328         AC_MSG_RESULT(no)
1329 ])
1330 ])
1331
1332 #  2.6.27.15-2 SuSE 11 sp0 kernels lack the name field for BDI
1333 AC_DEFUN([LC_BDI_NAME],
1334 [AC_MSG_CHECKING([if backing_device_info has name field])
1335 LB_LINUX_TRY_COMPILE([
1336         #include <linux/blkdev.h>
1337 ],[
1338         struct backing_dev_info bdi;
1339         bdi.name = NULL;
1340 ],[
1341         AC_MSG_RESULT(yes)
1342         AC_DEFINE(HAVE_BDI_NAME, 1,
1343                   [backing_device_info has name field])
1344 ],[
1345         AC_MSG_RESULT(no)
1346 ])
1347 ])
1348
1349 # 2.6.32 removes blk_queue_max_sectors and add blk_queue_max_hw_sectors
1350 # check blk_queue_max_sectors and use it until disappear.
1351 AC_DEFUN([LC_BLK_QUEUE_MAX_SECTORS],
1352 [AC_MSG_CHECKING([if blk_queue_max_sectors is defined])
1353 LB_LINUX_TRY_COMPILE([
1354         #include <linux/blkdev.h>
1355 ],[
1356         blk_queue_max_sectors(NULL, 0);
1357 ],[
1358         AC_MSG_RESULT(yes)
1359         AC_DEFINE(HAVE_BLK_QUEUE_MAX_SECTORS, 1,
1360                   [blk_queue_max_sectors is defined])
1361 ],[
1362         AC_MSG_RESULT(no)
1363 ])
1364 ])
1365
1366 # 2.6.32 replaces 2 functions blk_queue_max_phys_segments and blk_queue_max_hw_segments by blk_queue_max_segments
1367 AC_DEFUN([LC_BLK_QUEUE_MAX_SEGMENTS],
1368 [AC_MSG_CHECKING([if blk_queue_max_segments is defined])
1369 LB_LINUX_TRY_COMPILE([
1370         #include <linux/blkdev.h>
1371 ],[
1372         blk_queue_max_segments(NULL, 0);
1373 ],[
1374         AC_MSG_RESULT(yes)
1375         AC_DEFINE(HAVE_BLK_QUEUE_MAX_SEGMENTS, 1,
1376                   [blk_queue_max_segments is defined])
1377 ],[
1378         AC_MSG_RESULT(no)
1379 ])
1380 ])
1381
1382 #
1383 # LC_QUOTA64
1384 #
1385 # Check if kernel has been patched for 64-bit quota limits support.
1386 # The upstream version of this patch in RHEL6 2.6.32 kernels introduces
1387 # the constant QFMT_VFS_V1 in include/linux/quota.h, so we can check for
1388 # that in the absence of quotaio_v1.h in the kernel headers.
1389 #
1390 AC_DEFUN([LC_QUOTA64],[
1391         AC_MSG_CHECKING([if kernel has 64-bit quota limits support])
1392 tmp_flags="$EXTRA_KCFLAGS"
1393 EXTRA_KCFLAGS="-I$LINUX/fs"
1394         LB_LINUX_TRY_COMPILE([
1395                 #include <linux/kernel.h>
1396                 #include <linux/fs.h>
1397                 #ifdef HAVE_QUOTAIO_H
1398                 # include <linux/quotaio_v2.h>
1399                 int versions[] = V2_INITQVERSIONS_R1;
1400                 struct v2_disk_dqblk_r1 dqblk_r1;
1401                 #elif defined(HAVE_FS_QUOTA_QUOTAIO_H)
1402                 # include <quota/quotaio_v2.h>
1403                 struct v2r1_disk_dqblk dqblk_r1;
1404                 #elif defined(HAVE_FS_QUOTAIO_H)
1405                 # include <quotaio_v2.h>
1406                 struct v2r1_disk_dqblk dqblk_r1;
1407                 #else
1408                 #include <linux/quota.h>
1409                 int ver = QFMT_VFS_V1;
1410                 #endif
1411         ],[],[
1412                 AC_DEFINE(HAVE_QUOTA64, 1, [have quota64])
1413                 AC_MSG_RESULT([yes])
1414         ],[
1415                 LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],[
1416                         AC_MSG_ERROR([You have got no 64-bit kernel quota support.])
1417                 ],[])
1418                 AC_MSG_RESULT([no])
1419         ])
1420 EXTRA_KCFLAGS=$tmp_flags
1421 ])
1422
1423 # 2.6.32 set_cpus_allowed is no more defined if CONFIG_CPUMASK_OFFSTACK=yes
1424 AC_DEFUN([LC_SET_CPUS_ALLOWED],
1425          [AC_MSG_CHECKING([if kernel defines set_cpus_allowed])
1426           LB_LINUX_TRY_COMPILE(
1427                 [#include <linux/sched.h>],
1428                 [struct task_struct *p = NULL;
1429                  cpumask_t mask = { { 0 } };
1430                  (void) set_cpus_allowed(p, mask);],
1431                 [AC_MSG_RESULT([yes])
1432                  AC_DEFINE(HAVE_SET_CPUS_ALLOWED, 1,
1433                            [set_cpus_allowed is exported by the kernel])],
1434                 [AC_MSG_RESULT([no])] )])
1435
1436 # 2.6.32 introduces selinux_is_enabled()
1437 AC_DEFUN([LC_SELINUX_IS_ENABLED],
1438 [AC_MSG_CHECKING([if selinux_is_enabled is available])
1439 LB_LINUX_TRY_COMPILE([
1440         #include <linux/selinux.h>
1441 ],[
1442         selinux_is_enabled();
1443 ],[
1444         AC_MSG_RESULT([yes])
1445         AC_DEFINE(HAVE_SELINUX_IS_ENABLED, 1,
1446                 [selinux_is_enabled is defined])
1447 ],[
1448         AC_MSG_RESULT([no])
1449 ])
1450 ])
1451
1452 #
1453 # LC_D_OBTAIN_ALIAS
1454 # starting from 2.6.28 kernel replaces d_alloc_anon() with
1455 # d_obtain_alias() for getting anonymous dentries
1456 # RHEL5(2.6.18) has d_obtain_alias but SLES11SP0(2.6.27) not
1457 #
1458 AC_DEFUN([LC_D_OBTAIN_ALIAS],
1459 [AC_MSG_CHECKING([d_obtain_alias exist in kernel])
1460 LB_LINUX_TRY_COMPILE([
1461         #include <linux/dcache.h>
1462 ],[
1463         d_obtain_alias(NULL);
1464 ],[
1465         AC_DEFINE(HAVE_D_OBTAIN_ALIAS, 1,
1466                 [d_obtain_alias exist in kernel])
1467         AC_MSG_RESULT([yes])
1468 ],[
1469         AC_MSG_RESULT([no])
1470 ])
1471 ])
1472
1473 #
1474 # LC_EXPORT_GENERIC_ERROR_REMOVE_PAGE
1475 #
1476 AC_DEFUN([LC_EXPORT_GENERIC_ERROR_REMOVE_PAGE],
1477          [LB_CHECK_SYMBOL_EXPORT(
1478                         [generic_error_remove_page],
1479                         [mm/truncate.c],
1480                         [AC_DEFINE(HAS_GENERIC_ERROR_REMOVE_PAGE, 1,
1481                                 [kernel export generic_error_remove_page])],
1482                         [])
1483          ]
1484 )
1485
1486 # 2.6.32 if kernel export access_process_vm().
1487 AC_DEFUN([LC_EXPORT_ACCESS_PROCESS_VM],
1488         [LB_CHECK_SYMBOL_EXPORT([access_process_vm],
1489                         [mm/memory.c],
1490                         [AC_DEFINE(HAVE_ACCESS_PROCESS_VM, 1,
1491                                 [access_process_vm function is present])],
1492                         [])
1493         ]
1494 )
1495
1496 #
1497 # 2.6.36 fs_struct.lock use spinlock instead of rwlock.
1498 #
1499 AC_DEFUN([LC_FS_STRUCT_RWLOCK],
1500 [AC_MSG_CHECKING([if fs_struct.lock use rwlock])
1501 LB_LINUX_TRY_COMPILE([
1502         #include <asm/atomic.h>
1503         #include <linux/spinlock.h>
1504         #include <linux/fs_struct.h>
1505 ],[
1506         ((struct fs_struct *)0)->lock = (rwlock_t){ 0 };
1507 ],[
1508         AC_DEFINE(HAVE_FS_STRUCT_RWLOCK, 1,
1509                   [fs_struct.lock use rwlock])
1510         AC_MSG_RESULT([yes])
1511 ],[
1512         AC_MSG_RESULT([no])
1513 ])
1514 ])
1515
1516 #
1517 # 2.6.36 super_operations add evict_inode method. it hybird of
1518 # delete_inode & clear_inode.
1519 #
1520 AC_DEFUN([LC_SBOPS_EVICT_INODE],
1521 [AC_MSG_CHECKING([if super_operations.evict_inode exist])
1522 LB_LINUX_TRY_COMPILE([
1523         #include <linux/fs.h>
1524 ],[
1525         ((struct super_operations *)0)->evict_inode(NULL);
1526 ],[
1527         AC_DEFINE(HAVE_SBOPS_EVICT_INODE, 1,
1528                 [super_operations.evict_inode() is exist in kernel])
1529         AC_MSG_RESULT([yes])
1530 ],[
1531         AC_MSG_RESULT([no])
1532 ])
1533 ])
1534
1535 #
1536 # 2.6.35 file_operations.fsync taken 2 arguments.
1537 # 3.0.0 file_operations.fsync takes 4 arguments.
1538 #
1539 AC_DEFUN([LC_FILE_FSYNC],
1540 [AC_MSG_CHECKING([if file_operations.fsync takes 4 or 2 arguments])
1541 LB_LINUX_TRY_COMPILE([
1542         #include <linux/fs.h>
1543 ],[
1544         ((struct file_operations *)0)->fsync(NULL, 0, 0, 0);
1545 ],[
1546         AC_DEFINE(HAVE_FILE_FSYNC_4ARGS, 1,
1547                 [file_operations.fsync takes 4 arguments])
1548         AC_MSG_RESULT([yes, 4 args])
1549 ],[
1550         LB_LINUX_TRY_COMPILE([
1551                 #include <linux/fs.h>
1552         ],[
1553            ((struct file_operations *)0)->fsync(NULL, 0);
1554         ],[
1555                 AC_DEFINE(HAVE_FILE_FSYNC_2ARGS, 1,
1556                         [file_operations.fsync takes 2 arguments])
1557                 AC_MSG_RESULT([yes, 2 args])
1558         ],[
1559                 AC_MSG_RESULT([no])
1560         ])
1561 ])
1562 ])
1563
1564 #
1565 # 2.6.37 remove kernel_locked
1566 #
1567 AC_DEFUN([LC_KERNEL_LOCKED],
1568 [AC_MSG_CHECKING([if kernel_locked is defined])
1569 LB_LINUX_TRY_COMPILE([
1570         #include <linux/smp_lock.h>
1571 ],[
1572         kernel_locked();
1573 ],[
1574         AC_MSG_RESULT([yes])
1575         AC_DEFINE(HAVE_KERNEL_LOCKED, 1,
1576                 [kernel_locked is defined])
1577 ],[
1578         AC_MSG_RESULT([no])
1579 ])
1580 ])
1581
1582 #
1583 # 2.6.38 dentry_operations.d_compare() taken 7 arguments.
1584 #
1585 AC_DEFUN([LC_D_COMPARE_7ARGS],
1586 [AC_MSG_CHECKING([if d_compare taken 7 arguments])
1587 LB_LINUX_TRY_COMPILE([
1588         #include <linux/dcache.h>
1589 ],[
1590         ((struct dentry_operations*)0)->d_compare(NULL,NULL,NULL,NULL,0,NULL,NULL);
1591 ],[
1592         AC_DEFINE(HAVE_D_COMPARE_7ARGS, 1,
1593                 [d_compare need 7 arguments])
1594         AC_MSG_RESULT([yes])
1595 ],[
1596         AC_MSG_RESULT([no])
1597 ])
1598 ])
1599
1600 #
1601 # 2.6.38 dentry_operations.d_delete() defined 'const' for 1st parameter.
1602 #
1603 AC_DEFUN([LC_D_DELETE_CONST],
1604 [AC_MSG_CHECKING([if d_delete has const declare on first parameter])
1605 tmp_flags="$EXTRA_KCFLAGS"
1606 EXTRA_KCFLAGS="-Werror"
1607 LB_LINUX_TRY_COMPILE([
1608         #include <linux/dcache.h>
1609 ],[
1610         const struct dentry *d = NULL;
1611         ((struct dentry_operations*)0)->d_delete(d);
1612 ],[
1613         AC_DEFINE(HAVE_D_DELETE_CONST, const,
1614                 [d_delete first parameter declared const])
1615         AC_MSG_RESULT([yes])
1616 ],[
1617         AC_DEFINE(HAVE_D_DELETE_CONST, , [])
1618         AC_MSG_RESULT([no])
1619 ])
1620 EXTRA_KCFLAGS="$tmp_flags"
1621 ])
1622
1623 #
1624 # 2.6.38 dcache_lock removed. rcu-walk commited.
1625 #
1626 AC_DEFUN([LC_DCACHE_LOCK],
1627 [AC_MSG_CHECKING([if dcache_lock is exist])
1628 LB_LINUX_TRY_COMPILE([
1629         #include <linux/dcache.h>
1630 ],[
1631         spin_lock(&dcache_lock);
1632 ],[
1633         AC_DEFINE(HAVE_DCACHE_LOCK, 1,
1634                 [dcache_lock is exist])
1635         AC_MSG_RESULT([yes])
1636 ],[
1637         AC_MSG_RESULT([no])
1638 ])
1639 ])
1640
1641 #
1642 # 2.6.38 inode.i_rcu added.
1643 #
1644 AC_DEFUN([LC_INODE_I_RCU],
1645 [AC_MSG_CHECKING([if inode.i_rcu exists])
1646 LB_LINUX_TRY_COMPILE([
1647         #include <linux/fs.h>
1648 ],[
1649         struct inode ino;
1650         struct rcu_head rcu = {};
1651         ino.i_rcu = rcu;
1652 ],[
1653         AC_DEFINE(HAVE_INODE_I_RCU, 1,
1654                 [inode.i_rcu exists])
1655         AC_MSG_RESULT([yes])
1656 ],[
1657         AC_MSG_RESULT([no])
1658 ])
1659 ])
1660
1661 #
1662 # 2.6.38 export blkdev_get_by_dev
1663 #
1664 AC_DEFUN([LC_BLKDEV_GET_BY_DEV],
1665 [LB_CHECK_SYMBOL_EXPORT([blkdev_get_by_dev],
1666 [fs/block_dev.c],[
1667 AC_DEFINE(HAVE_BLKDEV_GET_BY_DEV, 1,
1668             [blkdev_get_by_dev is exported by the kernel])
1669 ],[
1670 ])
1671 ])
1672
1673 #
1674 # 2.6.38 use path as 4th parameter in quota_on.
1675 #
1676 AC_DEFUN([LC_QUOTA_ON_USE_PATH],
1677 [AC_MSG_CHECKING([quota_on use path as parameter])
1678 tmp_flags="$EXTRA_KCFLAGS"
1679 EXTRA_KCFLAGS="-Werror"
1680 LB_LINUX_TRY_COMPILE([
1681         #include <linux/fs.h>
1682         #include <linux/quota.h>
1683 ],[
1684         ((struct quotactl_ops *)0)->quota_on(NULL, 0, 0, ((struct path*)0));
1685 ],[
1686         AC_DEFINE(HAVE_QUOTA_ON_USE_PATH, 1,
1687                 [quota_on use path as 4th paramter])
1688         AC_MSG_RESULT([yes])
1689 ],[
1690         AC_MSG_RESULT([no])
1691 ])
1692 EXTRA_KCFLAGS="$tmp_flags"
1693 ])
1694
1695 #
1696 # 2.6.38 export simple_setattr
1697 #
1698 AC_DEFUN([LC_EXPORT_SIMPLE_SETATTR],
1699 [LB_CHECK_SYMBOL_EXPORT([simple_setattr],
1700 [fs/libfs.c],[
1701 AC_DEFINE(HAVE_SIMPLE_SETATTR, 1,
1702             [simple_setattr is exported by the kernel])
1703 ],[
1704 ])
1705 ])
1706
1707 #
1708 # 2.6.39 remove unplug_fn from request_queue.
1709 #
1710 AC_DEFUN([LC_REQUEST_QUEUE_UNPLUG_FN],
1711 [AC_MSG_CHECKING([if request_queue has unplug_fn field])
1712 LB_LINUX_TRY_COMPILE([
1713         #include <linux/blkdev.h>
1714 ],[
1715         do{ }while(sizeof(((struct request_queue *)0)->unplug_fn));
1716 ],[
1717         AC_DEFINE(HAVE_REQUEST_QUEUE_UNPLUG_FN, 1,
1718                   [request_queue has unplug_fn field])
1719         AC_MSG_RESULT([yes])
1720 ],[
1721         AC_MSG_RESULT([no])
1722 ])
1723 ])
1724
1725 #
1726 # 2.6.39 replace get_sb with mount in struct file_system_type
1727 #
1728 AC_DEFUN([LC_HAVE_FSTYPE_MOUNT],
1729 [AC_MSG_CHECKING([if file_system_type has mount field])
1730 LB_LINUX_TRY_COMPILE([
1731         #include <linux/fs.h>
1732 ],[
1733         struct file_system_type fst;
1734         void *i = (void *) fst.mount;
1735 ],[
1736         AC_DEFINE(HAVE_FSTYPE_MOUNT, 1,
1737                 [struct file_system_type has mount field])
1738         AC_MSG_RESULT([yes])
1739 ],[
1740         AC_MSG_RESULT([no])
1741 ])
1742 ])
1743
1744 #
1745 # 3.0 dirty_inode() has a flag parameter
1746 # see kernel commit aa38572954ade525817fe88c54faebf85e5a61c0
1747 #
1748 AC_DEFUN([LC_DIRTY_INODE_WITH_FLAG],
1749 [AC_MSG_CHECKING([if dirty_inode super_operation takes flag])
1750 LB_LINUX_TRY_COMPILE([
1751         #include <linux/fs.h>
1752 ],[
1753         struct inode *inode;
1754         inode->i_sb->s_op->dirty_inode(NULL, 0);
1755 ],[
1756         AC_DEFINE(HAVE_DIRTY_INODE_HAS_FLAG, 1,
1757                   [dirty_inode super_operation takes flag])
1758         AC_MSG_RESULT([yes])
1759 ],[
1760         AC_MSG_RESULT([no])
1761 ])
1762 ])
1763
1764 #
1765 # 2.6.38 generic_permission taken 4 parameters.
1766 # in fact, it means rcu-walk aware permission bring.
1767 #
1768 # 3.1 generic_permission taken 2 parameters.
1769 # see kernel commit 2830ba7f34ebb27c4e5b8b6ef408cd6d74860890
1770 #
1771 AC_DEFUN([LC_GENERIC_PERMISSION],
1772 [AC_MSG_CHECKING([if generic_permission take 2 or 4 arguments])
1773 LB_LINUX_TRY_COMPILE([
1774         #include <linux/fs.h>
1775 ],[
1776         generic_permission(NULL, 0);
1777 ],[
1778         AC_DEFINE(HAVE_GENERIC_PERMISSION_2ARGS, 1,
1779                   [generic_permission taken 2 arguments])
1780         AC_MSG_RESULT([yes, 2 args])
1781 ],[
1782         LB_LINUX_TRY_COMPILE([
1783                 #include <linux/fs.h>
1784         ],[
1785                 generic_permission(NULL, 0, 0, NULL);
1786         ],[
1787                 AC_DEFINE(HAVE_GENERIC_PERMISSION_4ARGS, 1,
1788                           [generic_permission taken 4 arguments])
1789                 AC_MSG_RESULT([yes, 4 args])
1790         ],[
1791                 AC_MSG_RESULT([no])
1792         ])
1793 ])
1794 ])
1795
1796 #
1797 # 3.1 renames lock-manager ops(lock_manager_operations) from fl_xxx to lm_xxx
1798 # see kernel commit 8fb47a4fbf858a164e973b8ea8ef5e83e61f2e50
1799 #
1800 AC_DEFUN([LC_LM_XXX_LOCK_MANAGER_OPS],
1801 [AC_MSG_CHECKING([if lock-manager ops renamed to lm_xxx])
1802 LB_LINUX_TRY_COMPILE([
1803         #include <linux/fs.h>
1804 ],[
1805         struct lock_manager_operations lm_ops;
1806         lm_ops.lm_compare_owner = NULL;
1807 ],[
1808         AC_DEFINE(HAVE_LM_XXX_LOCK_MANAGER_OPS, 1,
1809                   [lock-manager ops renamed to lm_xxx])
1810         AC_MSG_RESULT([yes])
1811 ],[
1812         AC_MSG_RESULT([no])
1813 ])
1814 ])
1815
1816 #
1817 # 3.1 kills inode->i_alloc_sem, use i_dio_count and inode_dio_wait/
1818 #     inode_dio_done instead.
1819 # see kernel commit bd5fe6c5eb9c548d7f07fe8f89a150bb6705e8e3
1820 #
1821 AC_DEFUN([LC_INODE_DIO_WAIT],
1822 [AC_MSG_CHECKING([if inode->i_alloc_sem is killed and use inode_dio_wait/done.])
1823 LB_LINUX_TRY_COMPILE([
1824         #include <linux/fs.h>
1825 ],[
1826         inode_dio_wait((struct inode *)0);
1827         inode_dio_done((struct inode *)0);
1828 ],[
1829         AC_DEFINE(HAVE_INODE_DIO_WAIT, 1,
1830                   [inode->i_alloc_sem is killed and use inode_dio_wait/done])
1831         AC_MSG_RESULT([yes])
1832 ],[
1833         AC_MSG_RESULT([no])
1834 ])
1835 ])
1836
1837 #
1838 # 3.1 adds get_acl method to inode_operations to read ACL from disk.
1839 # see kernel commit 4e34e719e457f2e031297175410fc0bd4016a085
1840 #
1841 AC_DEFUN([LC_IOP_GET_ACL],
1842 [AC_MSG_CHECKING([inode_operations has .get_acl member function])
1843 LB_LINUX_TRY_COMPILE([
1844         #include <linux/fs.h>
1845 ],[
1846         struct inode_operations iop;
1847         iop.get_acl = NULL;
1848 ],[
1849         AC_DEFINE(HAVE_IOP_GET_ACL, 1,
1850                   [inode_operations has .get_acl member function])
1851         AC_MSG_RESULT([yes])
1852 ],[
1853         AC_MSG_RESULT([no])
1854 ])
1855 ])
1856
1857 #
1858 # 3.1.1 has ext4_blocks_for_truncate
1859 #
1860 AC_DEFUN([LC_BLOCKS_FOR_TRUNCATE],
1861 [AC_MSG_CHECKING([if kernel has ext4_blocks_for_truncate])
1862 LB_LINUX_TRY_COMPILE([
1863         #include <linux/fs.h>
1864         #include "$LINUX/fs/ext4/ext4_jbd2.h"
1865         #include "$LINUX/fs/ext4/truncate.h"
1866 ],[
1867         ext4_blocks_for_truncate(NULL);
1868 ],[
1869         AC_MSG_RESULT([yes])
1870         AC_DEFINE(HAVE_BLOCKS_FOR_TRUNCATE, 1,
1871                   [kernel has ext4_blocks_for_truncate])
1872 ],[
1873         AC_MSG_RESULT([no])
1874 ])
1875 ])
1876
1877 #
1878 # 3.1 introduced generic_file_llseek_size()
1879 #
1880 AC_DEFUN([LC_FILE_LLSEEK_SIZE],
1881         [LB_CHECK_SYMBOL_EXPORT([generic_file_llseek_size],
1882         [fs/read_write.c],
1883         [AC_DEFINE(HAVE_FILE_LLSEEK_SIZE, 1,
1884                    [generic_file_llseek_size is exported by the kernel])])
1885 ])
1886
1887 #
1888 # 3.2 request_queue.make_request_fn defined as function returns with void
1889 # see kernel commit 5a7bbad27a410350e64a2d7f5ec18fc73836c14f
1890 #
1891 AC_DEFUN([LC_HAVE_VOID_MAKE_REQUEST_FN],
1892 [AC_MSG_CHECKING([if request_queue.make_request_fn returns void but not int])
1893 LB_LINUX_TRY_COMPILE([
1894         #include <linux/blkdev.h>
1895 ],[
1896         int ret;
1897         make_request_fn         *mrf;
1898         ret = mrf(NULL, NULL);
1899 ],[
1900         AC_MSG_RESULT([no])
1901 ],[
1902         AC_DEFINE(HAVE_VOID_MAKE_REQUEST_FN, 1,
1903                   [request_queue.make_request_fn returns void but not int])
1904         AC_MSG_RESULT([yes])
1905 ])
1906 ])
1907
1908 #
1909 # 3.2 protects inode->i_nlink from direct modification
1910 # see kernel commit a78ef704a8dd430225955f0709b22d4a6ba21deb
1911 # at the same time adds set_nlink(), so checks set_nlink() for it.
1912 #
1913 AC_DEFUN([LC_HAVE_PROTECT_I_NLINK],
1914 [AC_MSG_CHECKING([if inode->i_nlink is protected from direct modification])
1915 LB_LINUX_TRY_COMPILE([
1916         #include <linux/fs.h>
1917 ],[
1918         struct inode i;
1919         set_nlink(&i, 1);
1920 ],[
1921         AC_DEFINE(HAVE_PROTECT_I_NLINK, 1,
1922                   [inode->i_nlink is protected from direct modification])
1923         AC_MSG_RESULT([yes])
1924 ],[
1925         AC_MSG_RESULT([no])
1926 ])
1927 ])
1928
1929 #
1930 # 3.3 introduces migrate_mode.h and migratepage has 4 args
1931 #
1932 AC_DEFUN([LC_HAVE_MIGRATE_HEADER],
1933 [LB_CHECK_FILE([$LINUX/include/linux/migrate.h],[
1934                 AC_DEFINE(HAVE_MIGRATE_H, 1,
1935                 [kernel has include/linux/migrate.h])
1936 ],[LB_CHECK_FILE([$LINUX/include/linux/migrate_mode.h],[
1937                 AC_DEFINE(HAVE_MIGRATE_MODE_H, 1,
1938                         [kernel has include/linux/migrate_mode.h])
1939 ],[
1940         AC_MSG_RESULT([no])
1941 ])
1942 ])
1943 ])
1944
1945 AC_DEFUN([LC_MIGRATEPAGE_4ARGS],
1946 [AC_MSG_CHECKING([if address_space_operations.migratepage has 4 args])
1947 LB_LINUX_TRY_COMPILE([
1948         #include <linux/fs.h>
1949 #ifdef HAVE_MIGRATE_H
1950         #include <linux/migrate.h>
1951 #elif defined(HAVE_MIGRATE_MODE_H)
1952         #include <linux/migrate_mode.h>
1953 #endif
1954 ],[
1955         struct address_space_operations aops;
1956
1957         aops.migratepage(NULL, NULL, NULL, MIGRATE_ASYNC);
1958 ],[
1959         AC_DEFINE(HAVE_MIGRATEPAGE_4ARGS, 1,
1960                 [address_space_operations.migratepage has 4 args])
1961         AC_MSG_RESULT([yes])
1962 ],[
1963         AC_MSG_RESULT([no])
1964 ])
1965 ])
1966
1967 #
1968 # 3.3 switchs super_operations to use dentry as parameter (but not vfsmount)
1969 # see kernel commit 34c80b1d93e6e20ca9dea0baf583a5b5510d92d4
1970 #
1971 AC_DEFUN([LC_SUPEROPS_USE_DENTRY],
1972 [AC_MSG_CHECKING([if super_operations use dentry as parameter])
1973 tmp_flags="$EXTRA_KCFLAGS"
1974 EXTRA_KCFLAGS="-Werror"
1975 LB_LINUX_TRY_COMPILE([
1976         #include <linux/fs.h>
1977         int show_options(struct seq_file *seq, struct dentry *root){
1978                 return 0;
1979         }
1980 ],[
1981         struct super_operations ops;
1982         ops.show_options = show_options;
1983 ],[
1984         AC_DEFINE(HAVE_SUPEROPS_USE_DENTRY, 1,
1985                   [super_operations use dentry as parameter])
1986         AC_MSG_RESULT([yes])
1987 ],[
1988         AC_MSG_RESULT([no])
1989 ])
1990 EXTRA_KCFLAGS="$tmp_flags"
1991 ])
1992
1993 #
1994 # 3.3 switchs inode_operations to use umode_t as parameter (but not int)
1995 # see kernel commit 1a67aafb5f72a436ca044293309fa7e6351d6a35
1996 #
1997 AC_DEFUN([LC_INODEOPS_USE_UMODE_T],
1998 [AC_MSG_CHECKING([if inode_operations use umode_t as parameter])
1999 tmp_flags="$EXTRA_KCFLAGS"
2000 EXTRA_KCFLAGS="-Werror"
2001 LB_LINUX_TRY_COMPILE([
2002         #include <linux/fs.h>
2003         #include <linux/types.h>
2004         int my_mknod(struct inode *dir, struct dentry *dchild,
2005                      umode_t mode, dev_t dev)
2006         {
2007                 return 0;
2008         }
2009 ],[
2010         struct inode_operations ops;
2011         ops.mknod = my_mknod;
2012 ],[
2013         AC_DEFINE(HAVE_INODEOPS_USE_UMODE_T, 1,
2014                   [inode_operations use umode_t as parameter])
2015         AC_MSG_RESULT([yes])
2016 ],[
2017         AC_MSG_RESULT([no])
2018 ])
2019 EXTRA_KCFLAGS="$tmp_flags"
2020 ])
2021
2022 # 3.4 kmap_atomic removes second argument
2023 # see kernel commit 1ec9c5ddc17aa398f05646abfcbaf315b544e62f
2024 #
2025 AC_DEFUN([LC_KMAP_ATOMIC_HAS_1ARG],
2026 [AC_MSG_CHECKING([if kmap_atomic has only 1 argument])
2027 LB_LINUX_TRY_COMPILE([
2028         #include <linux/highmem.h>
2029 ],[
2030         kmap_atomic(NULL);
2031 ],[
2032         AC_DEFINE(HAVE_KMAP_ATOMIC_HAS_1ARG, 1,
2033                   [have kmap_atomic has only 1 argument])
2034         AC_MSG_RESULT([yes])
2035 ],[
2036         AC_MSG_RESULT([no])
2037 ])
2038 ])
2039
2040 #
2041 # 3.4 switchs touch_atime to struct path
2042 # see kernel commit 68ac1234fb949b66941d94dce4157742799fc581
2043 #
2044 AC_DEFUN([LC_TOUCH_ATIME_1ARG],
2045 [AC_MSG_CHECKING([if touch_atime use one argument])
2046 LB_LINUX_TRY_COMPILE([
2047         #include <linux/fs.h>
2048 ],[
2049         touch_atime((struct path *)NULL);
2050 ],[
2051         AC_DEFINE(HAVE_TOUCH_ATIME_1ARG, 1,
2052                   [touch_atime use one argument])
2053         AC_MSG_RESULT([yes])
2054 ],[
2055         AC_MSG_RESULT([no])
2056 ])
2057 ])
2058
2059 #
2060 # 3.4 converts d_alloc_root to d_make_root
2061 # see kernel commit 32991ab305ace7017c62f8eecbe5eb36dc32e13b
2062 #
2063 AC_DEFUN([LC_HAVE_D_MAKE_ROOT],
2064 [AC_MSG_CHECKING([if have d_make_root])
2065 LB_LINUX_TRY_COMPILE([
2066         #include <linux/fs.h>
2067 ],[
2068         d_make_root((struct inode *)NULL);
2069 ],[
2070         AC_DEFINE(HAVE_D_MAKE_ROOT, 1,
2071                   [have d_make_root])
2072         AC_MSG_RESULT([yes])
2073 ],[
2074         AC_MSG_RESULT([no])
2075 ])
2076 ])
2077
2078 #
2079 # 3.5 renames end_writeback() back to clear_inode()...
2080 # see kernel commit dbd5768f87ff6fb0a4fe09c4d7b6c4a24de99430
2081 #
2082 AC_DEFUN([LC_HAVE_CLEAR_INODE],
2083 [AC_MSG_CHECKING([if have clear_inode])
2084 LB_LINUX_TRY_COMPILE([
2085         #include <linux/fs.h>
2086 ],[
2087         clear_inode((struct inode *)NULL);
2088 ],[
2089         AC_DEFINE(HAVE_CLEAR_INODE, 1,
2090                   [have clear_inode])
2091         AC_MSG_RESULT([yes])
2092 ],[
2093         AC_MSG_RESULT([no])
2094 ])
2095 ])
2096
2097 #
2098 # 3.5 encode_fh has parent inode passed in directly
2099 # see kernel commit b0b0382b
2100 #
2101 AC_DEFUN([LC_HAVE_ENCODE_FH_PARENT],
2102 [AC_MSG_CHECKING([if encode_fh have parent inode as parameter])
2103 tmp_flags="$EXTRA_KCFLAGS"
2104 EXTRA_KCFLAGS="-Werror"
2105 LB_LINUX_TRY_COMPILE([
2106         #include <linux/exportfs.h>
2107         #include <linux/fs.h>
2108         #include <linux/types.h>
2109         int ll_encode_fh(struct inode *i, __u32 *a, int *b, struct inode *p)
2110         {
2111                 return 0;
2112         }
2113 ],[
2114         struct export_operations exp_op;
2115         exp_op.encode_fh = ll_encode_fh;
2116 ],[
2117         AC_DEFINE(HAVE_ENCODE_FH_PARENT, 1,
2118                   [have parent inode as parameter])
2119         AC_MSG_RESULT([yes])
2120 ],[
2121         AC_MSG_RESULT([no])
2122 ])
2123 EXTRA_KCFLAGS="$tmp_flags"
2124 ])
2125
2126 # 3.5 has generic_file_llseek_size with 5 args
2127 AC_DEFUN([LC_FILE_LLSEEK_SIZE_5ARG],
2128 [AC_MSG_CHECKING([if kernel has generic_file_llseek_size with 5 args])
2129 LB_LINUX_TRY_COMPILE([
2130         #include <linux/fs.h>
2131 ],[
2132         generic_file_llseek_size(NULL, 0, 0, 0, 0);
2133 ], [
2134         AC_MSG_RESULT([yes])
2135         AC_DEFINE(HAVE_FILE_LLSEEK_SIZE_5ARGS, 1,
2136                 [kernel has generic_file_llseek_size with 5 args])
2137 ],[
2138         AC_MSG_RESULT([no])
2139 ])
2140 ])
2141
2142 #
2143 # 3.6 switch i_dentry/d_alias from list to hlist
2144 #
2145 AC_DEFUN([LC_HAVE_DENTRY_D_ALIAS_HLIST],
2146 [AC_MSG_CHECKING([if i_dentry/d_alias uses hlist])
2147 tmp_flags="$EXTRA_KCFLAGS"
2148 EXTRA_KCFLAGS="-Werror"
2149 LB_LINUX_TRY_COMPILE([
2150         #include <linux/fs.h>
2151         #include <linux/list.h>
2152 ],[
2153         struct inode inode;
2154         struct dentry dentry;
2155         struct hlist_head head;
2156         struct hlist_node node;
2157         inode.i_dentry = head;
2158         dentry.d_alias = node;
2159 ],[
2160         AC_DEFINE(HAVE_DENTRY_D_ALIAS_HLIST, 1,
2161                   [have i_dentry/d_alias uses hlist])
2162         AC_MSG_RESULT([yes])
2163 ],[
2164         AC_MSG_RESULT([no])
2165 ])
2166 EXTRA_KCFLAGS="$tmp_flags"
2167 ])
2168
2169 #
2170 # 3.6 dentry_open uses struct path as first argument
2171 # see kernel commit 765927b2
2172 #
2173 AC_DEFUN([LC_DENTRY_OPEN_USE_PATH],
2174 [AC_MSG_CHECKING([if dentry_open uses struct path as first argument])
2175 tmp_flags="$EXTRA_KCFLAGS"
2176 EXTRA_KCFLAGS="-Werror"
2177 LB_LINUX_TRY_COMPILE([
2178         #include <linux/fs.h>
2179         #include <linux/path.h>
2180 ],[
2181         struct path path;
2182         dentry_open(&path, 0, NULL);
2183 ],[
2184         AC_DEFINE(HAVE_DENTRY_OPEN_USE_PATH, 1,
2185                   [dentry_open uses struct path as first argument])
2186         AC_MSG_RESULT([yes])
2187 ],[
2188         AC_MSG_RESULT([no])
2189 ])
2190 EXTRA_KCFLAGS="$tmp_flags"
2191 ])
2192
2193 #
2194 # 3.6 vfs adds iop->atomic_open
2195 #
2196 AC_DEFUN([LC_HAVE_IOP_ATOMIC_OPEN],
2197 [AC_MSG_CHECKING([if iop has atomic_open])
2198 LB_LINUX_TRY_COMPILE([
2199         #include <linux/fs.h>
2200 ],[
2201         struct inode_operations iop;
2202         iop.atomic_open = NULL;
2203 ],[
2204         AC_DEFINE(HAVE_IOP_ATOMIC_OPEN, 1,
2205                   [have iop atomic_open])
2206         AC_MSG_RESULT([yes])
2207 ],[
2208         AC_MSG_RESULT([no])
2209 ])
2210 ])
2211
2212 #
2213 # 3.7 posix_acl_{to,from}_xattr take struct user_namespace
2214 #
2215 AC_DEFUN([LC_HAVE_POSIXACL_USER_NS],
2216 [AC_MSG_CHECKING([if posix_acl_to_xattr takes struct user_namespace])
2217 LB_LINUX_TRY_COMPILE([
2218         #include <linux/fs.h>
2219         #include <linux/posix_acl_xattr.h>
2220 ],[
2221         posix_acl_to_xattr((struct user_namespace *)NULL, NULL, NULL, 0);
2222 ],[
2223         AC_DEFINE(HAVE_POSIXACL_USER_NS, 1,
2224                   [posix_acl_to_xattr takes struct user_namespace])
2225         AC_MSG_RESULT([yes])
2226 ],[
2227         AC_MSG_RESULT([no])
2228 ])
2229 ])
2230
2231 #
2232 # LC_PROG_LINUX
2233 #
2234 # Lustre linux kernel checks
2235 #
2236 AC_DEFUN([LC_PROG_LINUX],
2237          [
2238          LC_CONFIG_PINGER
2239          LC_CONFIG_CHECKSUM
2240          LC_CONFIG_LIBLUSTRE_RECOVERY
2241          LC_CONFIG_HEALTH_CHECK_WRITE
2242          LC_CONFIG_LRU_RESIZE
2243          LC_LLITE_LLOOP_MODULE
2244
2245          # RHEL4 patches
2246          LC_EXPORT_TRUNCATE_COMPLETE
2247          LC_EXPORT_D_REHASH_COND
2248          LC_EXPORT___D_REHASH
2249          LC_EXPORT_NODE_TO_CPUMASK
2250
2251          LC_FILEMAP_POPULATE
2252          LC_BIT_SPINLOCK_H
2253
2254          LC_CAPA_CRYPTO
2255          LC_CONFIG_RMTCLIENT
2256          LC_CONFIG_GSS
2257          LC_TASK_CLENV_STORE
2258
2259          # 2.6.12
2260          LC_RW_TREE_LOCK
2261
2262          # 2.6.18
2263          LC_UMOUNTBEGIN_HAS_VFSMOUNT
2264
2265          #2.6.18 + RHEL5 (fc6)
2266          LC_LINUX_FIEMAP_H
2267
2268          # 2.6.19
2269          LC_FILE_WRITEV
2270          LC_FILE_READV
2271
2272          # 2.6.20
2273          LC_CANCEL_DIRTY_PAGE
2274
2275          # raid5-zerocopy patch
2276          LC_PAGE_CONSTANT
2277
2278          # 2.6.22
2279          LC_INVALIDATE_BDEV_2ARG
2280          LC_ASYNC_BLOCK_CIPHER
2281          LC_STRUCT_HASH_DESC
2282          LC_STRUCT_BLKCIPHER_DESC
2283          LC_FS_RENAME_DOES_D_MOVE
2284
2285          # 2.6.23
2286          LC_UNREGISTER_BLKDEV_RETURN_INT
2287          LC_KERNEL_SPLICE_READ
2288          LC_KERNEL_SENDFILE
2289          LC_HAVE_EXPORTFS_H
2290          LC_VM_OP_FAULT
2291          LC_PROCFS_USERS
2292          LC_EXPORTFS_DECODE_FH
2293
2294          # 2.6.24
2295          LC_HAVE_MMTYPES_H
2296          LC_BIO_ENDIO_2ARG
2297          LC_FH_TO_DENTRY
2298          LC_PROCFS_DELETED
2299          LC_EXPORT_BDI_INIT
2300
2301          # 2.6.26
2302          LC_FS_STRUCT_USE_PATH
2303
2304          # 2.6.27
2305          LC_SECURITY_PLUG  # for SLES10 SP2
2306          LC_PGMKWRITE_USE_VMFAULT
2307          LC_PGMKWRITE_COMPACT
2308          LC_INODE_PERMISION_2ARGS
2309          LC_TRYLOCKPAGE
2310          LC_READ_INODE_IN_SBOPS
2311          LC_EXPORT_INODE_PERMISSION
2312          LC_QUOTA_ON_5ARGS
2313          LC_QUOTA_OFF_3ARGS
2314          LC_VFS_DQ_OFF
2315          LC_LOCK_MAP_ACQUIRE
2316
2317          # 2.6.27.15-2 sles11
2318          LC_BI_HW_SEGMENTS
2319          LC_HAVE_QUOTAIO_H
2320          LC_BDI_NAME
2321          LC_SB_ANY_QUOTA_ACTIVE
2322          LC_SB_HAS_QUOTA_ACTIVE
2323          LC_EXPORT_ADD_TO_PAGE_CACHE_LRU
2324
2325          # 2.6.29
2326          LC_SB_ANY_QUOTA_LOADED
2327
2328          # 2.6.30
2329          LC_EXPORT_CPUMASK_OF_NODE
2330
2331          # 2.6.31
2332          LC_BLK_QUEUE_LOG_BLK_SIZE
2333
2334          # 2.6.32
2335          LC_REQUEST_QUEUE_LIMITS
2336          LC_EXPORT_BDI_REGISTER
2337          LC_SB_BDI
2338          LC_BLK_QUEUE_MAX_SECTORS
2339          LC_BLK_QUEUE_MAX_SEGMENTS
2340          LC_SET_CPUS_ALLOWED
2341          LC_CACHE_UPCALL
2342          LC_EXPORT_GENERIC_ERROR_REMOVE_PAGE
2343          LC_SELINUX_IS_ENABLED
2344          LC_EXPORT_ACCESS_PROCESS_VM
2345          LC_VFS_INODE_NEWSIZE_OK
2346
2347          # 2.6.34
2348          LC_HAVE_DQUOT_FS_DISK_QUOTA
2349          LC_HAVE_DQUOT_SUSPEND
2350
2351          # 2.6.35, 3.0.0
2352          LC_FILE_FSYNC
2353          LC_EXPORT_SIMPLE_SETATTR
2354
2355          # 2.6.36
2356          LC_FS_STRUCT_RWLOCK
2357          LC_SBOPS_EVICT_INODE
2358
2359          # 2.6.37
2360          LC_KERNEL_LOCKED
2361
2362          # 2.6.38
2363          LC_BLKDEV_GET_BY_DEV
2364          LC_GENERIC_PERMISSION
2365          LC_QUOTA_ON_USE_PATH
2366          LC_DCACHE_LOCK
2367          LC_INODE_I_RCU
2368          LC_D_COMPARE_7ARGS
2369          LC_D_DELETE_CONST
2370
2371          # 2.6.39
2372          LC_REQUEST_QUEUE_UNPLUG_FN
2373          LC_HAVE_FSTYPE_MOUNT
2374
2375          # 3.0
2376          LC_DIRTY_INODE_WITH_FLAG
2377
2378          # 3.1
2379          LC_LM_XXX_LOCK_MANAGER_OPS
2380          LC_INODE_DIO_WAIT
2381          LC_IOP_GET_ACL
2382          LC_FILE_LLSEEK_SIZE
2383
2384          # 3.1.1
2385          LC_BLOCKS_FOR_TRUNCATE
2386
2387          # 3.2
2388          LC_HAVE_VOID_MAKE_REQUEST_FN
2389          LC_HAVE_PROTECT_I_NLINK
2390
2391          # 3.3
2392          LC_HAVE_MIGRATE_HEADER
2393          LC_MIGRATEPAGE_4ARGS
2394          LC_SUPEROPS_USE_DENTRY
2395          LC_INODEOPS_USE_UMODE_T
2396
2397          # 3.4
2398          LC_TOUCH_ATIME_1ARG
2399          LC_HAVE_D_MAKE_ROOT
2400          LC_KMAP_ATOMIC_HAS_1ARG
2401
2402          # 3.5
2403          LC_HAVE_CLEAR_INODE
2404          LC_HAVE_ENCODE_FH_PARENT
2405          LC_FILE_LLSEEK_SIZE_5ARG
2406
2407          # 3.6
2408          LC_HAVE_DENTRY_D_ALIAS_HLIST
2409          LC_DENTRY_OPEN_USE_PATH
2410          LC_HAVE_IOP_ATOMIC_OPEN
2411
2412          # 3.7
2413          LC_HAVE_POSIXACL_USER_NS
2414          #
2415          if test x$enable_server = xyes ; then
2416                 AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server])
2417                 LC_FUNC_DEV_SET_RDONLY
2418                 LC_STACK_SIZE
2419                 LC_QUOTA64
2420                 LC_QUOTA_CONFIG
2421          fi
2422 ])
2423
2424 #
2425 # LC_CONFIG_CLIENT_SERVER
2426 #
2427 # Build client/server sides of Lustre
2428 #
2429 AC_DEFUN([LC_CONFIG_CLIENT_SERVER],
2430 [AC_MSG_CHECKING([whether to build Lustre server support])
2431 AC_ARG_ENABLE([server],
2432         AC_HELP_STRING([--disable-server],
2433                         [disable Lustre server support]),
2434         [],[enable_server='yes'])
2435 AC_MSG_RESULT([$enable_server])
2436
2437 AC_MSG_CHECKING([whether to build Lustre client support])
2438 AC_ARG_ENABLE([client],
2439         AC_HELP_STRING([--disable-client],
2440                         [disable Lustre client support]),
2441         [],[enable_client='yes'])
2442 AC_MSG_RESULT([$enable_client])])
2443
2444 #
2445 # LC_CONFIG_LIBLUSTRE
2446 #
2447 # whether to build liblustre
2448 #
2449 AC_DEFUN([LC_CONFIG_LIBLUSTRE],
2450 [AC_MSG_CHECKING([whether to build Lustre library])
2451 AC_ARG_ENABLE([liblustre],
2452         AC_HELP_STRING([--disable-liblustre],
2453                         [disable building of Lustre library]),
2454         [],[enable_liblustre=$with_sysio])
2455 AC_MSG_RESULT([$enable_liblustre])
2456 # only build sysio if liblustre is built
2457 with_sysio="$enable_liblustre"
2458
2459 AC_MSG_CHECKING([whether to build liblustre tests])
2460 AC_ARG_ENABLE([liblustre-tests],
2461         AC_HELP_STRING([--enable-liblustre-tests],
2462                         [enable liblustre tests, if --disable-tests is used]),
2463         [],[enable_liblustre_tests=$enable_tests])
2464 if test x$enable_liblustre != xyes ; then
2465    enable_liblustre_tests='no'
2466 fi
2467 AC_MSG_RESULT([$enable_liblustre_tests])
2468
2469 AC_MSG_CHECKING([whether to enable liblustre acl])
2470 AC_ARG_ENABLE([liblustre-acl],
2471         AC_HELP_STRING([--disable-liblustre-acl],
2472                         [disable ACL support for liblustre]),
2473         [],[enable_liblustre_acl=yes])
2474 AC_MSG_RESULT([$enable_liblustre_acl])
2475 if test x$enable_liblustre_acl = xyes ; then
2476   AC_DEFINE(LIBLUSTRE_POSIX_ACL, 1, Liblustre Support ACL-enabled MDS)
2477 fi
2478
2479 # 2.6.29 change prepare/commit_write to write_begin/end
2480 AC_DEFUN([LC_WRITE_BEGIN_END],
2481 [AC_MSG_CHECKING([if kernel has .write_begin/end])
2482 LB_LINUX_TRY_COMPILE([
2483         #include <linux/fs.h>
2484         #include <linux/pagemap.h>
2485 #ifdef HAVE_LINUX_MMTYPES_H
2486         #include <linux/mm_types.h>
2487 #endif
2488 ],[
2489         struct address_space_operations aops;
2490         struct page *page;
2491
2492         aops.write_begin = NULL;
2493         aops.write_end = NULL;
2494         page = grab_cache_page_write_begin(NULL, 0, 0);
2495 ], [
2496         AC_MSG_RESULT([yes])
2497         AC_DEFINE(HAVE_KERNEL_WRITE_BEGIN_END, 1,
2498                 [kernel has .write_begin/end])
2499 ],[
2500         AC_MSG_RESULT([no])
2501 ])
2502 ])
2503
2504 # 2.6.29 blkdev_put has 2 arguments
2505 AC_DEFUN([LC_BLKDEV_PUT_2ARGS],
2506 [AC_MSG_CHECKING([blkdev_put needs 2 parameters])
2507 LB_LINUX_TRY_COMPILE([
2508         #include <linux/fs.h>
2509 ],[
2510         blkdev_put(NULL, 0);
2511 ],[
2512         AC_DEFINE(HAVE_BLKDEV_PUT_2ARGS, 1,
2513                 [blkdev_put needs 2 paramters])
2514         AC_MSG_RESULT([yes])
2515 ],[
2516         AC_MSG_RESULT([no])
2517 ])
2518 ])
2519
2520 # 2.6.29 dentry_open has 4 arguments
2521 AC_DEFUN([LC_DENTRY_OPEN_4ARGS],
2522 [AC_MSG_CHECKING([dentry_open needs 4 parameters])
2523 LB_LINUX_TRY_COMPILE([
2524         #include <linux/fs.h>
2525 ],[
2526         dentry_open(NULL, NULL, 0, NULL);
2527 ],[
2528         AC_DEFINE(HAVE_DENTRY_OPEN_4ARGS, 1,
2529                 [dentry_open needs 4 paramters])
2530         AC_MSG_RESULT([yes])
2531 ],[
2532         AC_MSG_RESULT([no])
2533 ])
2534 ])
2535
2536 # 2.6.29 split file and anonymous page queues
2537 AC_DEFUN([LC_PAGEVEC_LRU_ADD_FILE],
2538 [AC_MSG_CHECKING([if kernel has .pagevec_lru_add_file])
2539 LB_LINUX_TRY_COMPILE([
2540         #include <linux/mm.h>
2541         #include <linux/pagevec.h>
2542 ],[
2543         struct pagevec lru_pagevec;
2544
2545         pagevec_init(&lru_pagevec, 0);
2546         pagevec_lru_add_file(&lru_pagevec);
2547 ],[
2548         AC_MSG_RESULT([yes])
2549         AC_DEFINE(HAVE_PAGEVEC_LRU_ADD_FILE, 1,
2550                 [kernel has .pagevec_lru_add_file])
2551 ],[
2552         AC_MSG_RESULT([no])
2553 ])
2554 ])
2555
2556 #
2557 # --enable-mpitest
2558 #
2559 AC_ARG_ENABLE(mpitests,
2560         AC_HELP_STRING([--enable-mpitests=yes|no|mpicc wrapper],
2561                            [include mpi tests]),
2562         [
2563          enable_mpitests=yes
2564          case $enableval in
2565          yes)
2566                 MPICC_WRAPPER=mpicc
2567                 ;;
2568          no)
2569                 enable_mpitests=no
2570                 ;;
2571          *)
2572                 MPICC_WRAPPER=$enableval
2573                  ;;
2574          esac
2575         ],
2576         [
2577         MPICC_WRAPPER=mpicc
2578         enable_mpitests=yes
2579         ]
2580 )
2581
2582 if test x$enable_mpitests != xno; then
2583         AC_MSG_CHECKING([whether mpitests can be built])
2584         oldcc=$CC
2585         CC=$MPICC_WRAPPER
2586         AC_LINK_IFELSE(
2587             [AC_LANG_PROGRAM([[
2588                     #include <mpi.h>
2589                 ]],[[
2590                     int flag;
2591                     MPI_Initialized(&flag);
2592                 ]])],
2593             [
2594                     AC_MSG_RESULT([yes])
2595             ],[
2596                     AC_MSG_RESULT([no])
2597                     enable_mpitests=no
2598         ])
2599         CC=$oldcc
2600 fi
2601 AC_SUBST(MPICC_WRAPPER)
2602
2603 AC_MSG_NOTICE([Enabling Lustre configure options for libsysio])
2604 ac_configure_args="$ac_configure_args --with-lustre-hack --with-sockets"
2605
2606 LC_CONFIG_PINGER
2607 LC_CONFIG_LIBLUSTRE_RECOVERY
2608 ])
2609
2610 #
2611 # LC_CONFIG_QUOTA
2612 #
2613 # whether to enable quota support global control
2614 #
2615 AC_DEFUN([LC_CONFIG_QUOTA],
2616 [AC_ARG_ENABLE([quota],
2617         AC_HELP_STRING([--enable-quota],
2618                         [enable quota support]),
2619         [],[enable_quota='yes'])
2620 ])
2621
2622 AC_DEFUN([LC_QUOTA],
2623 [#check global
2624 LC_CONFIG_QUOTA
2625 #check for utils
2626 AC_CHECK_HEADER(sys/quota.h,
2627                 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1, [Define to 1 if you have <sys/quota.h>.])],
2628                 [AC_MSG_ERROR([don't find <sys/quota.h> in your system])])
2629 ])
2630
2631 #
2632 # LC_CONFIG_SPLIT
2633 #
2634 # whether to enable split support
2635 #
2636 AC_DEFUN([LC_CONFIG_SPLIT],
2637 [AC_MSG_CHECKING([whether to enable split support])
2638 AC_ARG_ENABLE([split],
2639         AC_HELP_STRING([--enable-split],
2640                         [enable split support]),
2641         [],[enable_split='no'])
2642 AC_MSG_RESULT([$enable_split])
2643 if test x$enable_split != xno; then
2644    AC_DEFINE(HAVE_SPLIT_SUPPORT, 1, [enable split support])
2645 fi
2646 ])
2647
2648 # RHEL5(2.6.18) has tux_info
2649 AC_DEFUN([LC_TASK_CLENV_TUX_INFO],
2650 [AC_MSG_CHECKING([tux_info])
2651 LB_LINUX_TRY_COMPILE([
2652         #include <linux/sched.h>
2653 ],[
2654         struct task_struct task;
2655         &task.tux_info;
2656 ],[
2657         AC_MSG_RESULT([yes])
2658         AC_DEFINE(LL_TASK_CL_ENV, tux_info, [have tux_info])
2659         have_task_clenv_store='yes'
2660 ],[
2661         AC_MSG_RESULT([no])
2662 ])
2663 ])
2664
2665 #
2666 # LC_LLITE_LLOOP_MODULE
2667 # lloop_llite.ko does not currently work with page sizes
2668 # of 64k or larger.
2669 #
2670 AC_DEFUN([LC_LLITE_LLOOP_MODULE],
2671 [AC_MSG_CHECKING([whether to enable llite_lloop module])
2672 LB_LINUX_TRY_COMPILE([
2673         #include <asm/page.h>
2674 ],[
2675         #if PAGE_SIZE >= 65536
2676         #error "PAGE_SIZE >= 65536"
2677         #endif
2678 ],[
2679         enable_llite_lloop_module='yes'
2680         AC_MSG_RESULT([yes])
2681 ],[
2682         enable_llite_lloop_module='no'
2683         AC_MSG_RESULT([no])
2684 ])
2685 ])
2686
2687 #
2688 # LC_OSD_ADDON
2689 #
2690 # configure support for optional OSD implementation
2691 #
2692 AC_DEFUN([LC_OSD_ADDON],
2693 [AC_MSG_CHECKING([for osd])
2694 AC_ARG_WITH([osd],
2695         AC_HELP_STRING([--with-osd=path],
2696                        [set path to optional osd]),
2697         [
2698                 case $with_osd in
2699                         no)     ENABLEOSDADDON=0
2700                                 ;;
2701                         *)      OSDADDON="${with_osd}"
2702                                 ENABLEOSDADDON=1
2703                                 ;;
2704                 esac
2705         ], [
2706                 ENABLEOSDADDON=0
2707         ])
2708 if test $ENABLEOSDADDON -eq 0; then
2709         AC_MSG_RESULT([no])
2710         OSDADDON=
2711 else
2712         OSDMODNAME=`basename $OSDADDON`
2713         if test -e $LUSTRE/$OSDMODNAME; then
2714                 AC_MSG_RESULT([can't link])
2715                 OSDADDON=
2716         elif ln -s $OSDADDON $LUSTRE/$OSDMODNAME; then
2717                 AC_MSG_RESULT([$OSDMODNAME])
2718                 OSDADDON="subdir-m += $OSDMODNAME"
2719         else
2720                 AC_MSG_RESULT([can't link])
2721                 OSDADDON=
2722         fi
2723 fi
2724 AC_SUBST(OSDADDON)
2725 ])
2726
2727 #
2728 # LC_CONFIGURE
2729 #
2730 # other configure checks
2731 #
2732 AC_DEFUN([LC_CONFIGURE],
2733 [LC_CONFIG_OBD_BUFFER_SIZE
2734
2735 if test $target_cpu == "i686" -o $target_cpu == "x86_64"; then
2736         CFLAGS="$CFLAGS -Werror"
2737 fi
2738
2739 # maximum MDS thread count
2740 LC_MDS_MAX_THREADS
2741
2742 # include/liblustre.h
2743 AC_CHECK_HEADERS([sys/user.h sys/vfs.h stdint.h blkid/blkid.h])
2744
2745 # liblustre/llite_lib.h
2746 AC_CHECK_HEADERS([xtio.h file.h])
2747
2748 # liblustre/dir.c
2749 AC_CHECK_HEADERS([linux/types.h sys/types.h linux/unistd.h unistd.h])
2750
2751 # liblustre/lutil.c
2752 AC_CHECK_HEADERS([netinet/in.h arpa/inet.h catamount/data.h])
2753 AC_CHECK_FUNCS([inet_ntoa])
2754
2755 # libsysio/src/readlink.c
2756 LC_READLINK_SSIZE_T
2757
2758 # lvfs/prng.c - depends on linux/types.h from liblustre/dir.c
2759 AC_CHECK_HEADERS([linux/random.h], [], [],
2760                  [#ifdef HAVE_LINUX_TYPES_H
2761                   # include <linux/types.h>
2762                   #endif
2763                  ])
2764
2765 # utils/llverfs.c
2766 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
2767
2768 # check for -lz support
2769 ZLIB=""
2770 AC_CHECK_LIB([z],
2771              [adler32],
2772              [AC_CHECK_HEADERS([zlib.h],
2773                                [ZLIB="-lz"
2774                                 AC_DEFINE([HAVE_ADLER], 1,
2775                                           [support alder32 checksum type])],
2776                                [AC_MSG_WARN([No zlib-devel package found,
2777                                              unable to use adler32 checksum])])],
2778              [AC_MSG_WARN([No zlib package found, unable to use adler32 checksum])]
2779 )
2780 AC_SUBST(ZLIB)
2781
2782 SELINUX=""
2783 AC_CHECK_LIB([selinux],
2784                 [is_selinux_enabled],
2785                 [AC_CHECK_HEADERS([selinux.h],
2786                                 [SELINUX="-lselinux"
2787                                 AC_DEFINE([HAVE_SELINUX], 1,
2788                                                 [support for selinux ])],
2789                                 [AC_MSG_WARN([No selinux-devel package found,
2790                                                 unable to build selinux enabled
2791                                                 tools])])],
2792                 [AC_MSG_WARN([No selinux package found, unable to build selinux
2793                                 enabled tools])]
2794 )
2795 AC_SUBST(SELINUX)
2796
2797 # Super safe df
2798 AC_ARG_ENABLE([mindf],
2799       AC_HELP_STRING([--enable-mindf],
2800                       [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
2801       [],[])
2802 if test "$enable_mindf" = "yes" ;  then
2803       AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])
2804 fi
2805
2806 AC_ARG_ENABLE([fail_alloc],
2807         AC_HELP_STRING([--disable-fail-alloc],
2808                 [disable randomly alloc failure]),
2809         [],[enable_fail_alloc=yes])
2810 AC_MSG_CHECKING([whether to randomly failing memory alloc])
2811 AC_MSG_RESULT([$enable_fail_alloc])
2812 if test x$enable_fail_alloc != xno ; then
2813         AC_DEFINE([RANDOM_FAIL_ALLOC], 1, [enable randomly alloc failure])
2814 fi
2815
2816 AC_ARG_ENABLE([invariants],
2817         AC_HELP_STRING([--enable-invariants],
2818                 [enable invariant checking (cpu intensive)]),
2819         [],[])
2820 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
2821 AC_MSG_RESULT([$enable_invariants])
2822 if test x$enable_invariants = xyes ; then
2823         AC_DEFINE([CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK], 1, [enable invariant checking])
2824 fi
2825
2826 AC_ARG_ENABLE([lu_ref],
2827         AC_HELP_STRING([--enable-lu_ref],
2828                 [enable lu_ref reference tracking code]),
2829         [],[])
2830 AC_MSG_CHECKING([whether to track references with lu_ref])
2831 AC_MSG_RESULT([$enable_lu_ref])
2832 if test x$enable_lu_ref = xyes ; then
2833         AC_DEFINE([USE_LU_REF], 1, [enable lu_ref reference tracking code])
2834 fi
2835
2836 AC_ARG_ENABLE([pgstate-track],
2837               AC_HELP_STRING([--enable-pgstate-track],
2838                              [enable page state tracking]),
2839               [enable_pgstat_track='yes'],[])
2840 AC_MSG_CHECKING([whether to enable page state tracking])
2841 AC_MSG_RESULT([$enable_pgstat_track])
2842 if test x$enable_pgstat_track = xyes ; then
2843         AC_DEFINE([CONFIG_DEBUG_PAGESTATE_TRACKING], 1,
2844                   [enable page state tracking code])
2845 fi
2846
2847          #2.6.29
2848          LC_WRITE_BEGIN_END
2849          LC_D_OBTAIN_ALIAS
2850          LC_BLKDEV_PUT_2ARGS
2851          LC_DENTRY_OPEN_4ARGS
2852          LC_PAGEVEC_LRU_ADD_FILE
2853
2854 ])
2855
2856 #
2857 # LC_CONDITIONALS
2858 #
2859 # AM_CONDITIONALS for lustre
2860 #
2861 AC_DEFUN([LC_CONDITIONALS],
2862 [AM_CONDITIONAL(LIBLUSTRE, test x$enable_liblustre = xyes)
2863 AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno)
2864 AM_CONDITIONAL(LIBLUSTRE_TESTS, test x$enable_liblustre_tests = xyes)
2865 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
2866 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
2867 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
2868 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
2869 AM_CONDITIONAL(BLKID, test x$ac_cv_header_blkid_blkid_h = xyes)
2870 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
2871 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
2872 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
2873 AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
2874 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
2875 AM_CONDITIONAL(LLITE_LLOOP, test x$enable_llite_lloop_module = xyes)
2876 ])
2877
2878 #
2879 # LC_CONFIG_FILES
2880 #
2881 # files that should be generated with AC_OUTPUT
2882 #
2883 AC_DEFUN([LC_CONFIG_FILES],
2884 [AC_CONFIG_FILES([
2885 lustre/Makefile
2886 lustre/autoMakefile
2887 lustre/autoconf/Makefile
2888 lustre/conf/Makefile
2889 lustre/contrib/Makefile
2890 lustre/doc/Makefile
2891 lustre/include/Makefile
2892 lustre/include/lustre_ver.h
2893 lustre/include/linux/Makefile
2894 lustre/include/darwin/Makefile
2895 lustre/include/lustre/Makefile
2896 lustre/kernel_patches/targets/2.6-rhel6.target
2897 lustre/kernel_patches/targets/2.6-rhel5.target
2898 lustre/kernel_patches/targets/2.6-sles11.target
2899 lustre/kernel_patches/targets/3.0-sles11.target
2900 lustre/kernel_patches/targets/2.6-fc11.target
2901 lustre/kernel_patches/targets/2.6-fc12.target
2902 lustre/kernel_patches/targets/2.6-fc15.target
2903 lustre/kernel_patches/targets/3.x-fc18.target
2904 lustre/ldlm/Makefile
2905 lustre/fid/Makefile
2906 lustre/fid/autoMakefile
2907 lustre/liblustre/Makefile
2908 lustre/liblustre/tests/Makefile
2909 lustre/liblustre/tests/mpi/Makefile
2910 lustre/llite/Makefile
2911 lustre/llite/autoMakefile
2912 lustre/lclient/Makefile
2913 lustre/lov/Makefile
2914 lustre/lov/autoMakefile
2915 lustre/lvfs/Makefile
2916 lustre/lvfs/autoMakefile
2917 lustre/mdc/Makefile
2918 lustre/mdc/autoMakefile
2919 lustre/lmv/Makefile
2920 lustre/lmv/autoMakefile
2921 lustre/lfsck/Makefile
2922 lustre/lfsck/autoMakefile
2923 lustre/mdt/Makefile
2924 lustre/mdt/autoMakefile
2925 lustre/mdd/Makefile
2926 lustre/mdd/autoMakefile
2927 lustre/fld/Makefile
2928 lustre/fld/autoMakefile
2929 lustre/obdclass/Makefile
2930 lustre/obdclass/autoMakefile
2931 lustre/obdclass/linux/Makefile
2932 lustre/obdecho/Makefile
2933 lustre/obdecho/autoMakefile
2934 lustre/ofd/Makefile
2935 lustre/ofd/autoMakefile
2936 lustre/osc/Makefile
2937 lustre/osc/autoMakefile
2938 lustre/ost/Makefile
2939 lustre/ost/autoMakefile
2940 lustre/osd-ldiskfs/Makefile
2941 lustre/osd-ldiskfs/autoMakefile
2942 lustre/osd-zfs/Makefile
2943 lustre/osd-zfs/autoMakefile
2944 lustre/mgc/Makefile
2945 lustre/mgc/autoMakefile
2946 lustre/mgs/Makefile
2947 lustre/mgs/autoMakefile
2948 lustre/target/Makefile
2949 lustre/ptlrpc/Makefile
2950 lustre/ptlrpc/autoMakefile
2951 lustre/ptlrpc/gss/Makefile
2952 lustre/ptlrpc/gss/autoMakefile
2953 lustre/quota/Makefile
2954 lustre/quota/autoMakefile
2955 lustre/scripts/Makefile
2956 lustre/tests/Makefile
2957 lustre/tests/mpi/Makefile
2958 lustre/utils/Makefile
2959 lustre/utils/gss/Makefile
2960 lustre/osp/Makefile
2961 lustre/osp/autoMakefile
2962 lustre/lod/Makefile
2963 lustre/lod/autoMakefile
2964 lustre/obdclass/darwin/Makefile
2965 ])
2966 ])