Whamcloud - gitweb
Branch b1_8
[fs/lustre-release.git] / lustre / autoconf / lustre-core.m4
1 #* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 #* vim:expandtab:shiftwidth=8:tabstop=8:
3 #
4 # LC_CONFIG_SRCDIR
5 #
6 # Wrapper for AC_CONFIG_SUBDIR
7 #
8 AC_DEFUN([LC_CONFIG_SRCDIR],
9 [AC_CONFIG_SRCDIR([lustre/obdclass/obdo.c])
10 ])
11
12 #
13 # LC_PATH_DEFAULTS
14 #
15 # lustre specific paths
16 #
17 AC_DEFUN([LC_PATH_DEFAULTS],
18 [# ptlrpc kernel build requires this
19 LUSTRE="$PWD/lustre"
20 AC_SUBST(LUSTRE)
21
22 # mount.lustre
23 rootsbindir='/sbin'
24 AC_SUBST(rootsbindir)
25
26 demodir='$(docdir)/demo'
27 AC_SUBST(demodir)
28
29 pkgexampledir='${pkgdatadir}/examples'
30 AC_SUBST(pkgexampledir)
31 ])
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_EXT3
51 #
52 # that ext3 is enabled in the kernel
53 #
54 AC_DEFUN([LC_CONFIG_EXT3],
55 [LB_LINUX_CONFIG([EXT3_FS],[],[
56         LB_LINUX_CONFIG([EXT3_FS_MODULE],[],[$2])
57 ])
58 LB_LINUX_CONFIG([EXT3_FS_XATTR],[$1],[$3])
59 ])
60
61 #
62 # LC_FSHOOKS
63 #
64 # If we have (and can build) fshooks.h
65 #
66 AC_DEFUN([LC_FSHOOKS],
67 [LB_CHECK_FILE([$LINUX/include/linux/fshooks.h],[
68         AC_MSG_CHECKING([if fshooks.h can be compiled])
69         LB_LINUX_TRY_COMPILE([
70                 #include <linux/fshooks.h>
71         ],[],[
72                 AC_MSG_RESULT([yes])
73         ],[
74                 AC_MSG_RESULT([no])
75                 AC_MSG_WARN([You might have better luck with gcc 3.3.x.])
76                 AC_MSG_WARN([You can set CC=gcc33 before running configure.])
77                 AC_MSG_ERROR([Your compiler cannot build fshooks.h.])
78         ])
79 $1
80 ],[
81 $2
82 ])
83 ])
84
85 #
86
87 #
88 # LC_FUNC_RELEASEPAGE_WITH_GFP
89 #
90 # if ->releasepage() takes a gfp_t arg in 2.6.9
91 # This kernel defines gfp_t (HAS_GFP_T) but doesn't use it for this function,
92 # while others either don't have gfp_t or pass gfp_t as the parameter.
93 #
94 AC_DEFUN([LC_FUNC_RELEASEPAGE_WITH_GFP],
95 [AC_MSG_CHECKING([if releasepage has a gfp_t parameter])
96 RELEASEPAGE_WITH_GFP="`grep -c 'releasepage.*gfp_t' $LINUX/include/linux/fs.h`"
97 if test "$RELEASEPAGE_WITH_GFP" != 0 ; then
98         AC_DEFINE(HAVE_RELEASEPAGE_WITH_GFP, 1,
99                   [releasepage with gfp_t parameter])
100         AC_MSG_RESULT([yes])
101 else
102         AC_MSG_RESULT([no])
103 fi
104 ])
105
106 # LC_FUNC_FILEMAP_FDATASYNC
107 #
108 # if filemap_fdatasync() exists
109 #
110 AC_DEFUN([LC_FUNC_FILEMAP_FDATAWRITE],
111 [AC_MSG_CHECKING([whether filemap_fdatawrite() is defined])
112 LB_LINUX_TRY_COMPILE([
113         #include <linux/fs.h>
114 ],[
115         int (*foo)(struct address_space *)= filemap_fdatawrite;
116 ],[
117         AC_MSG_RESULT([yes])
118         AC_DEFINE(HAVE_FILEMAP_FDATAWRITE, 1, [filemap_fdatawrite() found])
119 ],[
120         AC_MSG_RESULT([no])
121 ])
122 ])
123
124 #
125 # LC_HEADER_MM_INLINE
126 #
127 # RHEL kernels define page_count in mm_inline.h
128 #
129 AC_DEFUN([LC_HEADER_MM_INLINE],
130 [AC_MSG_CHECKING([if kernel has mm_inline.h header])
131 LB_LINUX_TRY_COMPILE([
132         #include <linux/mm_inline.h>
133 ],[
134         #ifndef page_count
135         #error mm_inline.h does not define page_count
136         #endif
137 ],[
138         AC_MSG_RESULT([yes])
139         AC_DEFINE(HAVE_MM_INLINE, 1, [mm_inline found])
140 ],[
141         AC_MSG_RESULT([no])
142 ])
143 ])
144
145 #
146 # LC_STRUCT_INODE
147 #
148 # if inode->i_alloc_sem exists
149 #
150 AC_DEFUN([LC_STRUCT_INODE],
151 [AC_MSG_CHECKING([if struct inode has i_alloc_sem])
152 LB_LINUX_TRY_COMPILE([
153         #include <linux/fs.h>
154         #include <linux/version.h>
155 ],[
156         struct inode i;
157         return (char *)&i.i_alloc_sem - (char *)&i;
158 ],[
159         AC_MSG_RESULT([yes])
160         AC_DEFINE(HAVE_I_ALLOC_SEM, 1, [struct inode has i_alloc_sem])
161 ],[
162         AC_MSG_RESULT([no])
163 ])
164 ])
165
166 #
167 # LC_FUNC_REGISTER_CACHE
168 #
169 # if register_cache() is defined by kernel
170
171 # There are two ways to shrink one customized cache in linux kernels. For the
172 # kernels are prior than 2.6.5(?), register_cache() is used, and for latest 
173 # kernels, set_shrinker() is used instead.
174 #
175 AC_DEFUN([LC_FUNC_REGISTER_CACHE],
176 [AC_MSG_CHECKING([if kernel defines cache pressure hook])
177 LB_LINUX_TRY_COMPILE([
178         #include <linux/mm.h>
179 ],[
180         shrinker_t shrinker;
181
182         set_shrinker(1, shrinker);
183 ],[
184         AC_MSG_RESULT([set_shrinker])
185         AC_DEFINE(HAVE_SHRINKER_CACHE, 1, [shrinker_cache found])
186         AC_DEFINE(HAVE_CACHE_RETURN_INT, 1, [shrinkers should return int])
187 ],[
188         LB_LINUX_TRY_COMPILE([
189                 #include <linux/list.h>
190                 #include <linux/cache_def.h>
191         ],[
192                 struct cache_definition cache;
193         ],[
194                 AC_MSG_RESULT([register_cache])
195                 AC_DEFINE(HAVE_REGISTER_CACHE, 1, [register_cache found])
196                 AC_MSG_CHECKING([if kernel expects return from cache shrink ])
197                 tmp_flags="$EXTRA_KCFLAGS"
198                 EXTRA_KCFLAGS="-Werror"
199                 LB_LINUX_TRY_COMPILE([
200                         #include <linux/list.h>
201                         #include <linux/cache_def.h>
202                 ],[
203                         struct cache_definition c;
204                         c.shrinker = (int (*)(int, unsigned int))1;
205                 ],[
206                         AC_DEFINE(HAVE_CACHE_RETURN_INT, 1,
207                                   [kernel expects return from shrink_cache])
208                         AC_MSG_RESULT(yes)
209                 ],[
210                         AC_MSG_RESULT(no)
211                 ])
212                 EXTRA_KCFLAGS="$tmp_flags"
213         ],[
214                 AC_MSG_RESULT([no])
215         ])
216 ])
217 ])
218
219 #
220 # LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP
221 #
222 # check for our patched grab_cache_page_nowait_gfp() function
223 #
224 AC_DEFUN([LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP],
225 [AC_MSG_CHECKING([if kernel defines grab_cache_page_nowait_gfp()])
226 HAVE_GCPN_GFP="`grep -c 'grab_cache_page_nowait_gfp' $LINUX/include/linux/pagemap.h`"
227 if test "$HAVE_GCPN_GFP" != 0 ; then
228         AC_DEFINE(HAVE_GRAB_CACHE_PAGE_NOWAIT_GFP, 1,
229                 [kernel has grab_cache_page_nowait_gfp()])
230         AC_MSG_RESULT(yes)
231 else
232         AC_MSG_RESULT(no)
233 fi
234 ])
235
236 #
237 # LC_FUNC_DEV_SET_RDONLY
238 #
239 # check for the old-style dev_set_rdonly which took an extra "devno" param
240 # and can only set a single device to discard writes at one time
241 #
242 AC_DEFUN([LC_FUNC_DEV_SET_RDONLY],
243 [AC_MSG_CHECKING([if kernel has new dev_set_rdonly])
244 LB_LINUX_TRY_COMPILE([
245         #include <linux/fs.h>
246 ],[
247         #ifndef HAVE_CLEAR_RDONLY_ON_PUT
248         #error needs to be patched by lustre kernel patches from Lustre version 1.4.3 or above.
249         #endif
250 ],[
251         AC_MSG_RESULT([yes])
252         AC_DEFINE(HAVE_DEV_SET_RDONLY, 1, [kernel has new dev_set_rdonly])
253 ],[
254         AC_MSG_RESULT([no, Linux kernel source needs to be patches by lustre 
255 kernel patches from Lustre version 1.4.3 or above.])
256 ])
257 ])
258
259 #
260 # LC_CONFIG_BACKINGFS
261 #
262 # setup, check the backing filesystem
263 #
264 AC_DEFUN([LC_CONFIG_BACKINGFS],
265 [
266 BACKINGFS="ldiskfs"
267
268 if test x$with_ldiskfs = xno ; then
269         BACKINGFS="ext3"
270
271         if test x$enable_server = xyes ; then
272                 AC_MSG_ERROR([ldiskfs is required for 2.6-based servers.])
273         fi
274
275         # --- Check that ext3 and ext3 xattr are enabled in the kernel
276         LC_CONFIG_EXT3([],[
277                 AC_MSG_ERROR([Lustre requires that ext3 is enabled in the kernel])
278         ],[
279                 AC_MSG_WARN([Lustre requires that extended attributes for ext3 are enabled in the kernel])
280                 AC_MSG_WARN([This build may fail.])
281         ])
282 else
283         # ldiskfs is enabled
284         LB_DEFINE_LDISKFS_OPTIONS
285 fi #ldiskfs
286
287 AC_MSG_CHECKING([which backing filesystem to use])
288 AC_MSG_RESULT([$BACKINGFS])
289 AC_SUBST(BACKINGFS)
290 ])
291
292 #
293 # LC_CONFIG_PINGER
294 #
295 # the pinger is temporary, until we have the recovery node in place
296 #
297 AC_DEFUN([LC_CONFIG_PINGER],
298 [AC_MSG_CHECKING([whether to enable pinger support])
299 AC_ARG_ENABLE([pinger],
300         AC_HELP_STRING([--disable-pinger],
301                         [disable recovery pinger support]),
302         [],[enable_pinger='yes'])
303 AC_MSG_RESULT([$enable_pinger])
304 if test x$enable_pinger != xno ; then
305   AC_DEFINE(ENABLE_PINGER, 1, Use the Pinger)
306 fi
307 ])
308
309 #
310 # LC_CONFIG_CHECKSUM
311 #
312 # do checksum of bulk data between client and OST
313 #
314 AC_DEFUN([LC_CONFIG_CHECKSUM],
315 [AC_MSG_CHECKING([whether to enable data checksum support])
316 AC_ARG_ENABLE([checksum],
317        AC_HELP_STRING([--disable-checksum],
318                        [disable data checksum support]),
319        [],[enable_checksum='yes'])
320 AC_MSG_RESULT([$enable_checksum])
321 if test x$enable_checksum != xno ; then
322   AC_DEFINE(ENABLE_CHECKSUM, 1, do data checksums)
323 fi
324 ])
325
326 #
327 # LC_CONFIG_HEALTH_CHECK_WRITE
328 #
329 # Turn on the actual write to the disk
330 #
331 AC_DEFUN([LC_CONFIG_HEALTH_CHECK_WRITE],
332 [AC_MSG_CHECKING([whether to enable a write with the health check])
333 AC_ARG_ENABLE([health-write],
334         AC_HELP_STRING([--enable-health-write],
335                         [enable disk writes when doing health check]),
336         [],[enable_health_write='no'])
337 AC_MSG_RESULT([$enable_health_write])
338 if test x$enable_health_write == xyes ; then
339   AC_DEFINE(USE_HEALTH_CHECK_WRITE, 1, Write when Checking Health)
340 fi
341 ])
342
343 #
344 # LC_CONFIG_LIBLUSTRE_RECOVERY
345 #
346 AC_DEFUN([LC_CONFIG_LIBLUSTRE_RECOVERY],
347 [AC_MSG_CHECKING([whether to enable liblustre recovery support])
348 AC_ARG_ENABLE([liblustre-recovery],
349         AC_HELP_STRING([--disable-liblustre-recovery],
350                         [disable liblustre recovery support]),
351         [],[enable_liblustre_recovery='yes'])
352 AC_MSG_RESULT([$enable_liblustre_recovery])
353 if test x$enable_liblustre_recovery != xno ; then
354   AC_DEFINE(ENABLE_LIBLUSTRE_RECOVERY, 1, Liblustre Can Recover)
355 fi
356 ])
357
358 #
359 # LC_CONFIG_OBD_BUFFER_SIZE
360 #
361 # the maximum buffer size of lctl ioctls
362 #
363 AC_DEFUN([LC_CONFIG_OBD_BUFFER_SIZE],
364 [AC_MSG_CHECKING([maximum OBD ioctl size])
365 AC_ARG_WITH([obd-buffer-size],
366         AC_HELP_STRING([--with-obd-buffer-size=[size]],
367                         [set lctl ioctl maximum bytes (default=8192)]),
368         [
369                 OBD_BUFFER_SIZE=$with_obd_buffer_size
370         ],[
371                 OBD_BUFFER_SIZE=8192
372         ])
373 AC_MSG_RESULT([$OBD_BUFFER_SIZE bytes])
374 AC_DEFINE_UNQUOTED(OBD_MAX_IOCTL_BUFFER, $OBD_BUFFER_SIZE, [IOCTL Buffer Size])
375 ])
376
377 #
378 # LC_STRUCT_STATFS
379 #
380 # AIX does not have statfs.f_namelen
381 #
382 AC_DEFUN([LC_STRUCT_STATFS],
383 [AC_MSG_CHECKING([if struct statfs has a f_namelen field])
384 LB_LINUX_TRY_COMPILE([
385         #include <linux/vfs.h>
386 ],[
387         struct statfs sfs;
388         sfs.f_namelen = 1;
389 ],[
390         AC_MSG_RESULT([yes])
391         AC_DEFINE(HAVE_STATFS_NAMELEN, 1, [struct statfs has a namelen field])
392 ],[
393         AC_MSG_RESULT([no])
394 ])
395 ])
396
397 #
398 # LC_READLINK_SSIZE_T
399 #
400 AC_DEFUN([LC_READLINK_SSIZE_T],
401 [AC_MSG_CHECKING([if readlink returns ssize_t])
402 AC_TRY_COMPILE([
403         #include <unistd.h>
404 ],[
405         ssize_t readlink(const char *, char *, size_t);
406 ],[
407         AC_MSG_RESULT([yes])
408         AC_DEFINE(HAVE_POSIX_1003_READLINK, 1, [readlink returns ssize_t])
409 ],[
410         AC_MSG_RESULT([no])
411 ])
412 ])
413
414 AC_DEFUN([LC_FUNC_PAGE_MAPPED],
415 [AC_MSG_CHECKING([if kernel offers page_mapped])
416 LB_LINUX_TRY_COMPILE([
417         #include <linux/mm.h>
418 ],[
419         page_mapped(NULL);
420 ],[
421         AC_MSG_RESULT([yes])
422         AC_DEFINE(HAVE_PAGE_MAPPED, 1, [page_mapped found])
423 ],[
424         AC_MSG_RESULT([no])
425 ])
426 ])
427
428 AC_DEFUN([LC_STRUCT_FILE_OPS_UNLOCKED_IOCTL],
429 [AC_MSG_CHECKING([if struct file_operations has an unlocked_ioctl field])
430 LB_LINUX_TRY_COMPILE([
431         #include <linux/fs.h>
432 ],[
433         struct file_operations fops;
434         &fops.unlocked_ioctl;
435 ],[
436         AC_MSG_RESULT([yes])
437         AC_DEFINE(HAVE_UNLOCKED_IOCTL, 1, [struct file_operations has an unlock ed_ioctl field])
438 ],[
439         AC_MSG_RESULT([no])
440 ])
441 ])
442
443 AC_DEFUN([LC_FILEMAP_POPULATE],
444 [AC_MSG_CHECKING([for exported filemap_populate])
445 LB_LINUX_TRY_COMPILE([
446         #include <asm/page.h>
447         #include <linux/mm.h>
448 ],[
449         filemap_populate(NULL, 0, 0, __pgprot(0), 0, 0);
450 ],[
451         AC_MSG_RESULT([yes])
452         AC_DEFINE(HAVE_FILEMAP_POPULATE, 1, [Kernel exports filemap_populate])
453 ],[
454         AC_MSG_RESULT([no])
455 ])
456 ])
457
458 AC_DEFUN([LC_D_ADD_UNIQUE],
459 [AC_MSG_CHECKING([for d_add_unique])
460 LB_LINUX_TRY_COMPILE([
461         #include <linux/dcache.h>
462 ],[
463        d_add_unique(NULL, NULL);
464 ],[
465         AC_MSG_RESULT([yes])
466         AC_DEFINE(HAVE_D_ADD_UNIQUE, 1, [Kernel has d_add_unique])
467 ],[
468         AC_MSG_RESULT([no])
469 ])
470 ])
471
472 AC_DEFUN([LC_BIT_SPINLOCK_H],
473 [LB_CHECK_FILE([$LINUX/include/linux/bit_spinlock.h],[
474         AC_MSG_CHECKING([if bit_spinlock.h can be compiled])
475         LB_LINUX_TRY_COMPILE([
476                 #include <asm/processor.h>
477                 #include <linux/spinlock.h>
478                 #include <linux/bit_spinlock.h>
479         ],[],[
480                 AC_MSG_RESULT([yes])
481                 AC_DEFINE(HAVE_BIT_SPINLOCK_H, 1, [Kernel has bit_spinlock.h])
482         ],[
483                 AC_MSG_RESULT([no])
484         ])
485 ],
486 [])
487 ])
488
489 #
490 # LC_POSIX_ACL_XATTR
491 #
492 # If we have xattr_acl.h 
493 #
494 AC_DEFUN([LC_XATTR_ACL],
495 [LB_CHECK_FILE([$LINUX/include/linux/xattr_acl.h],[
496         AC_MSG_CHECKING([if xattr_acl.h can be compiled])
497         LB_LINUX_TRY_COMPILE([
498                 #include <linux/xattr_acl.h>
499         ],[],[
500                 AC_MSG_RESULT([yes])
501                 AC_DEFINE(HAVE_XATTR_ACL, 1, [Kernel has xattr_acl])
502         ],[
503                 AC_MSG_RESULT([no])
504         ])
505 ],
506 [])
507 ])
508
509 #
510 # LC_LINUX_FIEMAP_H
511 #
512 # If we have fiemap.h
513 # after 2.6.27 use fiemap.h in include/linux
514 #
515 AC_DEFUN([LC_LINUX_FIEMAP_H],
516 [LB_CHECK_FILE([$LINUX/include/linux/fiemap.h],[
517         AC_MSG_CHECKING([if fiemap.h can be compiled])
518         LB_LINUX_TRY_COMPILE([
519                 #include <linux/fiemap.h>
520         ],[],[
521                 AC_MSG_RESULT([yes])
522                 AC_DEFINE(HAVE_LINUX_FIEMAP_H, 1, [Kernel has fiemap.h])
523         ],[
524                 AC_MSG_RESULT([no])
525         ])
526 ],
527 [])
528 ])
529
530
531 AC_DEFUN([LC_STRUCT_INTENT_FILE],
532 [AC_MSG_CHECKING([if struct open_intent has a file field])
533 LB_LINUX_TRY_COMPILE([
534         #include <linux/fs.h>
535         #include <linux/namei.h>
536 ],[
537         struct open_intent intent;
538         &intent.file;
539 ],[
540         AC_MSG_RESULT([yes])
541         AC_DEFINE(HAVE_FILE_IN_STRUCT_INTENT, 1, [struct open_intent has a file field])
542 ],[
543         AC_MSG_RESULT([no])
544 ])
545 ])
546
547
548 AC_DEFUN([LC_POSIX_ACL_XATTR_H],
549 [LB_CHECK_FILE([$LINUX/include/linux/posix_acl_xattr.h],[
550         AC_MSG_CHECKING([if linux/posix_acl_xattr.h can be compiled])
551         LB_LINUX_TRY_COMPILE([
552                 #include <linux/posix_acl_xattr.h>
553         ],[],[
554                 AC_MSG_RESULT([yes])
555                 AC_DEFINE(HAVE_LINUX_POSIX_ACL_XATTR_H, 1, [linux/posix_acl_xattr.h found])
556
557         ],[
558                 AC_MSG_RESULT([no])
559         ])
560 $1
561 ],[
562 AC_MSG_RESULT([no])
563 ])
564 ])
565
566 #
567 # LC_EXPORT___IGET
568 # starting from 2.6.19 linux kernel exports __iget()
569 #
570 AC_DEFUN([LC_EXPORT___IGET],
571 [LB_CHECK_SYMBOL_EXPORT([__iget],
572 [fs/inode.c],[
573         AC_DEFINE(HAVE_EXPORT___IGET, 1, [kernel exports __iget])
574 ],[
575 ])
576 ])
577
578
579 AC_DEFUN([LC_LUSTRE_VERSION_H],
580 [LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],[
581         rm -f "$LUSTRE/include/linux/lustre_version.h"
582 ],[
583         touch "$LUSTRE/include/linux/lustre_version.h"
584         if test x$enable_server = xyes ; then
585                 AC_MSG_WARN([Unpatched kernel detected.])
586                 AC_MSG_WARN([Lustre servers cannot be built with an unpatched kernel;])
587                 AC_MSG_WARN([disabling server build])
588                 enable_server='no'
589         fi
590 ])
591 ])
592
593 #
594 # check for FS_RENAME_DOES_D_MOVE flag
595 #
596 AC_DEFUN([LC_FS_RENAME_DOES_D_MOVE],
597 [AC_MSG_CHECKING([if kernel has FS_RENAME_DOES_D_MOVE flag])
598 LB_LINUX_TRY_COMPILE([
599         #include <linux/fs.h>
600 ],[
601         int v = FS_RENAME_DOES_D_MOVE;
602 ],[
603         AC_MSG_RESULT([yes])
604         AC_DEFINE(HAVE_FS_RENAME_DOES_D_MOVE, 1, [kernel has FS_RENAME_DOES_D_MOVE flag])
605 ],[
606         AC_MSG_RESULT([no])
607 ])
608 ])
609
610 #
611 # LC_FUNC_MS_FLOCK_LOCK
612 #
613 # SLES9 kernel has MS_FLOCK_LOCK sb flag
614 #
615 AC_DEFUN([LC_FUNC_MS_FLOCK_LOCK],
616 [AC_MSG_CHECKING([if kernel has MS_FLOCK_LOCK sb flag])
617 LB_LINUX_TRY_COMPILE([
618         #include <linux/fs.h>
619 ],[
620         int flags = MS_FLOCK_LOCK;
621 ],[
622         AC_DEFINE(HAVE_MS_FLOCK_LOCK, 1,
623                 [kernel has MS_FLOCK_LOCK flag])
624         AC_MSG_RESULT([yes])
625 ],[
626         AC_MSG_RESULT([no])
627 ])
628 ])
629
630 #
631 # LC_FUNC_HAVE_CAN_SLEEP_ARG
632 #
633 # SLES9 kernel has third arg can_sleep
634 # in fs/locks.c: flock_lock_file_wait()
635 #
636 AC_DEFUN([LC_FUNC_HAVE_CAN_SLEEP_ARG],
637 [AC_MSG_CHECKING([if kernel has third arg can_sleep in fs/locks.c: flock_lock_file_wait()])
638 LB_LINUX_TRY_COMPILE([
639         #include <linux/fs.h>
640 ],[
641         int cansleep;
642         struct file *file;
643         struct file_lock *file_lock;
644         flock_lock_file_wait(file, file_lock, cansleep);
645 ],[
646         AC_DEFINE(HAVE_CAN_SLEEP_ARG, 1,
647                 [kernel has third arg can_sleep in fs/locks.c: flock_lock_file_wait()])
648         AC_MSG_RESULT([yes])
649 ],[
650         AC_MSG_RESULT([no])
651 ])
652 ])
653
654 #
655 # LC_FUNC_F_OP_FLOCK
656 #
657 # rhel4.2 kernel has f_op->flock field
658 #
659 AC_DEFUN([LC_FUNC_F_OP_FLOCK],
660 [AC_MSG_CHECKING([if struct file_operations has flock field])
661 LB_LINUX_TRY_COMPILE([
662         #include <linux/fs.h>
663 ],[
664         struct file_operations ll_file_operations_flock;
665         ll_file_operations_flock.flock = NULL;
666 ],[
667         AC_DEFINE(HAVE_F_OP_FLOCK, 1,
668                 [struct file_operations has flock field])
669         AC_MSG_RESULT([yes])
670 ],[
671         AC_MSG_RESULT([no])
672 ])
673 ])
674
675 #
676 # LC_FUNC_MS_FLOCK_LOCK
677 #
678 # SLES9 kernel has MS_FLOCK_LOCK sb flag
679 #
680 AC_DEFUN([LC_FUNC_MS_FLOCK_LOCK],
681 [AC_MSG_CHECKING([if kernel has MS_FLOCK_LOCK sb flag])
682 LB_LINUX_TRY_COMPILE([
683         #include <linux/fs.h>
684 ],[
685         int flags = MS_FLOCK_LOCK;
686 ],[
687         AC_DEFINE(HAVE_MS_FLOCK_LOCK, 1,
688                 [kernel has MS_FLOCK_LOCK flag])
689         AC_MSG_RESULT([yes])
690 ],[
691         AC_MSG_RESULT([no])
692 ])
693 ])
694
695 #
696 # LC_FUNC_HAVE_CAN_SLEEP_ARG
697 #
698 # SLES9 kernel has third arg can_sleep
699 # in fs/locks.c: flock_lock_file_wait()
700 #
701 AC_DEFUN([LC_FUNC_HAVE_CAN_SLEEP_ARG],
702 [AC_MSG_CHECKING([if kernel has third arg can_sleep in fs/locks.c: flock_lock_file_wait()])
703 LB_LINUX_TRY_COMPILE([
704         #include <linux/fs.h>
705 ],[
706         int cansleep;
707         struct file *file;
708         struct file_lock *file_lock;
709         flock_lock_file_wait(file, file_lock, cansleep);
710 ],[
711         AC_DEFINE(HAVE_CAN_SLEEP_ARG, 1,
712                 [kernel has third arg can_sleep in fs/locks.c: flock_lock_file_wait()])
713         AC_MSG_RESULT([yes])
714 ],[
715         AC_MSG_RESULT([no])
716 ])
717 ])
718
719 #
720 # LC_TASK_PPTR
721 #
722 # task struct has p_pptr instead of parent
723 #
724 AC_DEFUN([LC_TASK_PPTR],
725 [AC_MSG_CHECKING([task p_pptr found])
726 LB_LINUX_TRY_COMPILE([
727         #include <linux/sched.h>
728 ],[
729         struct task_struct *p;
730         
731         p = p->p_pptr;
732 ],[
733         AC_MSG_RESULT([yes])
734         AC_DEFINE(HAVE_TASK_PPTR, 1, [task p_pptr found])
735 ],[
736         AC_MSG_RESULT([no])
737 ])
738 ])
739
740 #
741 # LC_FUNC_F_OP_FLOCK
742 #
743 # rhel4.2 kernel has f_op->flock field
744 #
745 AC_DEFUN([LC_FUNC_F_OP_FLOCK],
746 [AC_MSG_CHECKING([if struct file_operations has flock field])
747 LB_LINUX_TRY_COMPILE([
748         #include <linux/fs.h>
749 ],[
750         struct file_operations ll_file_operations_flock;
751         ll_file_operations_flock.flock = NULL;
752 ],[
753         AC_DEFINE(HAVE_F_OP_FLOCK, 1,
754                 [struct file_operations has flock field])
755         AC_MSG_RESULT([yes])
756 ],[
757         AC_MSG_RESULT([no])
758 ])
759 ])
760
761 # LC_EXPORT_SYNCHRONIZE_RCU
762 # after 2.6.12 synchronize_rcu is preferred over synchronize_kernel
763 AC_DEFUN([LC_EXPORT_SYNCHRONIZE_RCU],
764 [LB_CHECK_SYMBOL_EXPORT([synchronize_rcu],
765 [kernel/rcupdate.c],[
766         AC_DEFINE(HAVE_SYNCHRONIZE_RCU, 1,
767                 [in 2.6.12 synchronize_rcu preferred over synchronize_kernel])
768 ],[
769 ])
770 ])
771
772 # LC_INODE_I_MUTEX
773 # after 2.6.15 inode have i_mutex intead of i_sem
774 AC_DEFUN([LC_INODE_I_MUTEX],
775 [AC_MSG_CHECKING([if inode has i_mutex ])
776 LB_LINUX_TRY_COMPILE([
777         #include <linux/mutex.h>
778         #include <linux/fs.h>
779         #undef i_mutex
780 ],[
781         struct inode i;
782
783         mutex_unlock(&i.i_mutex);
784 ],[
785         AC_MSG_RESULT(yes)
786         AC_DEFINE(HAVE_INODE_I_MUTEX, 1,
787                 [after 2.6.15 inode have i_mutex intead of i_sem])
788 ],[
789         AC_MSG_RESULT(no)
790 ])
791 ])
792
793 # LC_DQUOTOFF_MUTEX
794 # after 2.6.17 dquote use mutex instead if semaphore
795 AC_DEFUN([LC_DQUOTOFF_MUTEX],
796 [AC_MSG_CHECKING([use dqonoff_mutex])
797 LB_LINUX_TRY_COMPILE([
798         #include <linux/mutex.h>
799         #include <linux/fs.h>
800         #include <linux/quota.h>
801 ],[
802         struct quota_info dq;
803
804         mutex_unlock(&dq.dqonoff_mutex);
805 ],[
806         AC_MSG_RESULT(yes)
807         AC_DEFINE(HAVE_DQUOTOFF_MUTEX, 1,
808                 [after 2.6.17 dquote use mutex instead if semaphore])
809 ],[
810         AC_MSG_RESULT(no)
811 ])
812 ])
813
814 #
815 # LC_STATFS_DENTRY_PARAM
816 # starting from 2.6.18 linux kernel uses dentry instead of
817 # super_block for first vfs_statfs argument
818 #
819 AC_DEFUN([LC_STATFS_DENTRY_PARAM],
820 [AC_MSG_CHECKING([first vfs_statfs parameter is dentry])
821 LB_LINUX_TRY_COMPILE([
822         #include <linux/fs.h>
823 ],[
824         int vfs_statfs(struct dentry *, struct kstatfs *);
825 ],[
826         AC_DEFINE(HAVE_STATFS_DENTRY_PARAM, 1,
827                 [first parameter of vfs_statfs is dentry])
828         AC_MSG_RESULT([yes])
829 ],[
830         AC_MSG_RESULT([no])
831 ])
832 ])
833
834 #
835 # LC_VFS_KERN_MOUNT
836 # starting from 2.6.18 kernel don't export do_kern_mount
837 # and want to use vfs_kern_mount instead.
838 #
839 AC_DEFUN([LC_VFS_KERN_MOUNT],
840 [AC_MSG_CHECKING([vfs_kern_mount exist in kernel])
841 LB_LINUX_TRY_COMPILE([
842         #include <linux/mount.h>
843 ],[
844         vfs_kern_mount(NULL, 0, NULL, NULL);
845 ],[
846         AC_DEFINE(HAVE_VFS_KERN_MOUNT, 1,
847                 [vfs_kern_mount exist in kernel])
848         AC_MSG_RESULT([yes])
849 ],[
850         AC_MSG_RESULT([no])
851 ])
852 ])
853
854
855 # LC_INVALIDATEPAGE_RETURN_INT
856 # more 2.6 api changes.  return type for the invalidatepage
857 # address_space_operation is 'void' in new kernels but 'int' in old
858 #
859 AC_DEFUN([LC_INVALIDATEPAGE_RETURN_INT],
860 [AC_MSG_CHECKING([invalidatepage has return int])
861 LB_LINUX_TRY_COMPILE([
862         #include <linux/buffer_head.h>
863 ],[
864         int rc = block_invalidatepage(NULL, 0);
865 ],[
866         AC_MSG_RESULT(yes)
867         AC_DEFINE(HAVE_INVALIDATEPAGE_RETURN_INT, 1,
868                 [Define if return type of invalidatepage should be int])
869 ],[
870         AC_MSG_RESULT(no)
871 ])
872 ])
873
874 # LC_UMOUNTBEGIN_HAS_VFSMOUNT
875 # more 2.6 API changes. 2.6.18 umount_begin has different parameters
876 AC_DEFUN([LC_UMOUNTBEGIN_HAS_VFSMOUNT],
877 [AC_MSG_CHECKING([if umount_begin needs vfsmount parameter instead of super_block])
878 tmp_flags="$EXTRA_KCFLAGS"
879 EXTRA_KCFLAGS="-Werror"
880 LB_LINUX_TRY_COMPILE([
881         #include <linux/fs.h>
882
883         struct vfsmount;
884         static void cfg_umount_begin (struct vfsmount *v, int flags)
885         {
886                 ;
887         }
888
889         static struct super_operations cfg_super_operations = {
890                 .umount_begin   = cfg_umount_begin,
891         };
892 ],[
893         cfg_super_operations.umount_begin(NULL,0);
894 ],[
895         AC_MSG_RESULT(yes)
896         AC_DEFINE(HAVE_UMOUNTBEGIN_VFSMOUNT, 1,
897                 [Define umount_begin need second argument])
898 ],[
899         AC_MSG_RESULT(no)
900 ])
901 EXTRA_KCFLAGS="$tmp_flags"
902 ])
903
904 # inode have i_private field since 2.6.17
905 AC_DEFUN([LC_INODE_IPRIVATE],
906 [AC_MSG_CHECKING([if inode has a i_private field])
907 LB_LINUX_TRY_COMPILE([
908 #include <linux/fs.h>
909 ],[
910         struct inode i;
911         i.i_private = NULL; 
912 ],[
913         AC_MSG_RESULT(yes)
914         AC_DEFINE(HAVE_INODE_IPRIVATE, 1,
915                 [struct inode has i_private field])
916 ],[
917         AC_MSG_RESULT(no)
918 ])
919 ])
920
921 # 2.6.19 API changes
922 # inode don't have i_blksize field
923 AC_DEFUN([LC_INODE_BLKSIZE],
924 [AC_MSG_CHECKING([inode has i_blksize field])
925 LB_LINUX_TRY_COMPILE([
926 #include <linux/fs.h>
927 ],[
928         struct inode i;
929         i.i_blksize = 0; 
930 ],[
931         AC_MSG_RESULT(yes)
932         AC_DEFINE(HAVE_INODE_BLKSIZE, 1,
933                 [struct inode has i_blksize field])
934 ],[
935         AC_MSG_RESULT(no)
936 ])
937 ])
938
939 # LC_VFS_READDIR_U64_INO
940 # 2.6.19 use u64 for inode number instead of inode_t
941 AC_DEFUN([LC_VFS_READDIR_U64_INO],
942 [AC_MSG_CHECKING([check vfs_readdir need 64bit inode number])
943 tmp_flags="$EXTRA_KCFLAGS"
944 EXTRA_KCFLAGS="-Werror"
945 LB_LINUX_TRY_COMPILE([
946 #include <linux/fs.h>
947         int fillonedir(void * __buf, const char * name, int namlen, loff_t offset,
948                       u64 ino, unsigned int d_type)
949         {
950                 return 0;
951         }
952 ],[
953         filldir_t filter;
954
955         filter = fillonedir;
956         return 1;
957 ],[
958         AC_MSG_RESULT(yes)
959         AC_DEFINE(HAVE_VFS_READDIR_U64_INO, 1,
960                 [if vfs_readdir need 64bit inode number])
961 ],[
962         AC_MSG_RESULT(no)
963 ])
964 EXTRA_KCFLAGS="$tmp_flags"
965 ])
966
967 # LC_FILE_WRITEV
968 # 2.6.19 replaced writev with aio_write
969 AC_DEFUN([LC_FILE_WRITEV],
970 [AC_MSG_CHECKING([writev in fops])
971 LB_LINUX_TRY_COMPILE([
972         #include <linux/fs.h>
973 ],[
974         struct file_operations *fops = NULL;
975         fops->writev = NULL;
976 ],[
977         AC_MSG_RESULT(yes)
978         AC_DEFINE(HAVE_FILE_WRITEV, 1,
979                 [use fops->writev])
980 ],[
981         AC_MSG_RESULT(no)
982 ])
983 ])
984
985 # LC_GENERIC_FILE_READ
986 # 2.6.19 replaced readv with aio_read
987 AC_DEFUN([LC_FILE_READV],
988 [AC_MSG_CHECKING([readv in fops])
989 LB_LINUX_TRY_COMPILE([
990         #include <linux/fs.h>
991 ],[
992         struct file_operations *fops = NULL;
993         fops->readv = NULL;
994 ],[
995         AC_MSG_RESULT(yes)
996         AC_DEFINE(HAVE_FILE_READV, 1,
997                 [use fops->readv])
998 ],[
999         AC_MSG_RESULT(no)
1000 ])
1001 ])
1002
1003 # LC_NR_PAGECACHE
1004 # 2.6.18 don't export nr_pagecahe
1005 AC_DEFUN([LC_NR_PAGECACHE],
1006 [AC_MSG_CHECKING([kernel export nr_pagecache])
1007 LB_LINUX_TRY_COMPILE([
1008         #include <linux/pagemap.h>
1009 ],[
1010         return atomic_read(&nr_pagecache);
1011 ],[
1012         AC_MSG_RESULT(yes)
1013         AC_DEFINE(HAVE_NR_PAGECACHE, 1,
1014                 [is kernel export nr_pagecache])
1015 ],[
1016         AC_MSG_RESULT(no)
1017 ])
1018 ])
1019
1020 # LC_CANCEL_DIRTY_PAGE
1021 # 2.6.20 introduse cancel_dirty_page instead of 
1022 # clear_page_dirty.
1023 AC_DEFUN([LC_CANCEL_DIRTY_PAGE],
1024 [AC_MSG_CHECKING([kernel has cancel_dirty_page])
1025 LB_LINUX_TRY_COMPILE([
1026         #include <linux/mm.h>
1027         #include <linux/page-flags.h>
1028 ],[
1029         /* tmp workaround for broken OFED 1.4.1 at SLES10 */
1030         #if defined(CONFIG_SLE_VERSION) && CONFIG_SLE_VERSION == 10 && defined(_BACKPORT_LINUX_MM_H_)
1031         #error badly implementation of cancel_dirty_pages
1032         #endif
1033         cancel_dirty_page(NULL, 0);
1034 ],[
1035         AC_MSG_RESULT(yes)
1036         AC_DEFINE(HAVE_CANCEL_DIRTY_PAGE, 1,
1037                   [kernel has cancel_dirty_page instead of clear_page_dirty])
1038 ],[
1039         AC_MSG_RESULT(no)
1040 ])
1041 ])
1042
1043 #
1044 # LC_PAGE_CONSTANT
1045 #
1046 # In order to support raid5 zerocopy patch, we have to patch the kernel to make
1047 # it support constant page, which means the page won't be modified during the
1048 # IO.
1049 #
1050 AC_DEFUN([LC_PAGE_CONSTANT],
1051 [AC_MSG_CHECKING([if kernel have PageConstant defined])
1052 LB_LINUX_TRY_COMPILE([
1053         #include <linux/mm.h>
1054         #include <linux/page-flags.h>
1055 ],[
1056         #ifndef PG_constant
1057         #error "Have no raid5 zcopy patch"
1058         #endif
1059 ],[
1060         AC_MSG_RESULT(yes)
1061         AC_DEFINE(HAVE_PAGE_CONSTANT, 1, [kernel have PageConstant supported])
1062 ],[
1063         AC_MSG_RESULT(no);
1064 ])
1065 ])
1066
1067 # RHEL5 in FS-cache patch rename PG_checked flag
1068 # into PG_fs_misc
1069 AC_DEFUN([LC_PG_FS_MISC],
1070 [AC_MSG_CHECKING([kernel has PG_fs_misc])
1071 LB_LINUX_TRY_COMPILE([
1072         #include <linux/mm.h>
1073         #include <linux/page-flags.h>
1074 ],[
1075         #ifndef PG_fs_misc
1076         #error PG_fs_misc not defined in kernel
1077         #endif
1078 ],[
1079         AC_MSG_RESULT(yes)
1080         AC_DEFINE(HAVE_PG_FS_MISC, 1,
1081                   [is kernel have PG_fs_misc])
1082 ],[
1083         AC_MSG_RESULT(no)
1084 ])
1085 ])
1086
1087 # RHEL5 PageChecked and SetPageChecked defined
1088 AC_DEFUN([LC_PAGE_CHECKED],
1089 [AC_MSG_CHECKING([kernel has PageChecked and SetPageChecked])
1090 LB_LINUX_TRY_COMPILE([
1091         #include <linux/autoconf.h>
1092 #ifdef HAVE_LINUX_MMTYPES_H
1093         #include <linux/mm_types.h>
1094 #endif
1095         #include <linux/page-flags.h>
1096 ],[
1097         struct page *p;
1098
1099         /* before 2.6.26 this define*/
1100         #ifndef PageChecked     
1101         /* 2.6.26 use function instead of define for it */
1102         SetPageChecked(p);
1103         PageChecked(p);
1104         #endif
1105 ],[
1106         AC_MSG_RESULT(yes)
1107         AC_DEFINE(HAVE_PAGE_CHECKED, 1,
1108                   [does kernel have PageChecked and SetPageChecked])
1109 ],[
1110         AC_MSG_RESULT(no)
1111 ])
1112 ])
1113
1114 AC_DEFUN([LC_EXPORT_TRUNCATE_COMPLETE_PAGE],
1115 [LB_CHECK_SYMBOL_EXPORT([truncate_complete_page],
1116 [mm/truncate.c],[
1117 AC_DEFINE(HAVE_TRUNCATE_COMPLETE_PAGE, 1,
1118             [kernel export truncate_complete_page])
1119 ],[
1120 ])
1121 ])
1122
1123 AC_DEFUN([LC_EXPORT_TRUNCATE_RANGE],
1124 [LB_CHECK_SYMBOL_EXPORT([truncate_inode_pages_range],
1125 [mm/truncate.c],[
1126 AC_DEFINE(HAVE_TRUNCATE_RANGE, 1,
1127             [kernel export truncate_inode_pages_range])
1128 ],[
1129 ])
1130 ])
1131
1132 AC_DEFUN([LC_EXPORT_D_REHASH_COND],
1133 [LB_CHECK_SYMBOL_EXPORT([d_rehash_cond],
1134 [fs/dcache.c],[
1135 AC_DEFINE(HAVE_D_REHASH_COND, 1,
1136             [d_rehash_cond is exported by the kernel])
1137 ],[
1138 ])
1139 ])
1140
1141 AC_DEFUN([LC_EXPORT___D_REHASH],
1142 [LB_CHECK_SYMBOL_EXPORT([__d_rehash],
1143 [fs/dcache.c],[
1144 AC_DEFINE(HAVE___D_REHASH, 1,
1145             [__d_rehash is exported by the kernel])
1146 ],[
1147 ])
1148 ])
1149
1150 AC_DEFUN([LC_EXPORT_D_MOVE_LOCKED],
1151 [LB_CHECK_SYMBOL_EXPORT([d_move_locked],
1152 [fs/dcache.c],[
1153 AC_DEFINE(HAVE_D_MOVE_LOCKED, 1,
1154             [d_move_locked is exported by the kernel])
1155 ],[
1156 ])
1157 ])
1158
1159 AC_DEFUN([LC_EXPORT___D_MOVE],
1160 [LB_CHECK_SYMBOL_EXPORT([__d_move],
1161 [fs/dcache.c],[
1162 AC_DEFINE(HAVE___D_MOVE, 1,
1163             [__d_move is exported by the kernel])
1164 ],[
1165 ])
1166 ])
1167
1168 #
1169 # LC_EXPORT_INVALIDATE_MAPPING_PAGES
1170 #
1171 # SLES9, RHEL4, RHEL5, vanilla 2.6.24 export invalidate_mapping_pages() but
1172 # SLES10 2.6.16 does not, for some reason.  For filter cache invalidation.
1173 #
1174 AC_DEFUN([LC_EXPORT_INVALIDATE_MAPPING_PAGES],
1175     [LB_CHECK_SYMBOL_EXPORT([invalidate_mapping_pages], [mm/truncate.c], [
1176          AC_DEFINE(HAVE_INVALIDATE_MAPPING_PAGES, 1,
1177                         [exported invalidate_mapping_pages])],
1178     [LB_CHECK_SYMBOL_EXPORT([invalidate_inode_pages], [mm/truncate.c], [
1179          AC_DEFINE(HAVE_INVALIDATE_INODE_PAGES, 1,
1180                         [exported invalidate_inode_pages])], [
1181        AC_MSG_ERROR([no way to invalidate pages])
1182   ])
1183     ],[])
1184 ])
1185
1186 #
1187 # LC_EXPORT_FILEMAP_FDATASYNC_RANGE
1188 #
1189 # No standard kernels export this
1190 #
1191 AC_DEFUN([LC_EXPORT_FILEMAP_FDATAWRITE_RANGE],
1192 [LB_CHECK_SYMBOL_EXPORT([filemap_fdatawrite_range],
1193 [mm/filemap.c],[
1194 AC_DEFINE(HAVE_FILEMAP_FDATAWRITE_RANGE, 1,
1195             [filemap_fdatawrite_range is exported by the kernel])
1196 ],[
1197 ])
1198 ])
1199
1200 # The actual symbol exported varies among architectures, so we need
1201 # to check many symbols (but only in the current architecture.)  No
1202 # matter what symbol is exported, the kernel #defines node_to_cpumask
1203 # to the appropriate function and that's what we use.
1204 AC_DEFUN([LC_EXPORT_NODE_TO_CPUMASK],
1205          [LB_CHECK_SYMBOL_EXPORT([node_to_cpumask],
1206                                  [arch/$LINUX_ARCH/mm/numa.c],
1207                                  [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1,
1208                                             [node_to_cpumask is exported by
1209                                              the kernel])]) # x86_64
1210           LB_CHECK_SYMBOL_EXPORT([node_to_cpu_mask],
1211                                  [arch/$LINUX_ARCH/kernel/smpboot.c],
1212                                  [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1,
1213                                             [node_to_cpumask is exported by
1214                                              the kernel])]) # ia64
1215           LB_CHECK_SYMBOL_EXPORT([node_2_cpu_mask],
1216                                  [arch/$LINUX_ARCH/kernel/smpboot.c],
1217                                  [AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1,
1218                                             [node_to_cpumask is exported by
1219                                              the kernel])]) # i386
1220           ])
1221
1222 #
1223 # LC_VFS_INTENT_PATCHES
1224 #
1225 # check if the kernel has the VFS intent patches
1226 AC_DEFUN([LC_VFS_INTENT_PATCHES],
1227 [AC_MSG_CHECKING([if the kernel has the VFS intent patches])
1228 LB_LINUX_TRY_COMPILE([
1229         #include <linux/fs.h>
1230         #include <linux/namei.h>
1231 ],[
1232         struct nameidata nd;
1233         struct lookup_intent *it;
1234
1235         it = &nd.intent;
1236         intent_init(it, IT_OPEN);
1237         it->d.lustre.it_disposition = 0;
1238         it->d.lustre.it_data = NULL;
1239 ],[
1240         AC_MSG_RESULT([yes])
1241         AC_DEFINE(HAVE_VFS_INTENT_PATCHES, 1, [VFS intent patches are applied])
1242 ],[
1243         AC_MSG_RESULT([no])
1244 ])
1245 ])
1246
1247 # 2.6.22 lost second parameter for invalidate_bdev
1248 AC_DEFUN([LC_INVALIDATE_BDEV_2ARG],
1249 [AC_MSG_CHECKING([if invalidate_bdev has second argument])
1250 LB_LINUX_TRY_COMPILE([
1251         #include <linux/buffer_head.h>
1252 ],[
1253         invalidate_bdev(NULL,0);
1254 ],[
1255         AC_MSG_RESULT([yes])
1256         AC_DEFINE(HAVE_INVALIDATE_BDEV_2ARG, 1,
1257                 [invalidate_bdev has second argument])
1258 ],[
1259         AC_MSG_RESULT([no])
1260 ])
1261 ])
1262
1263 # 2.6.12 merge patch from oracle to convert tree_lock from spinlock to rwlock
1264 AC_DEFUN([LC_RW_TREE_LOCK],
1265 [AC_MSG_CHECKING([if kernel has tree_lock as rwlock])
1266 tmp_flags="$EXTRA_KCFLAGS"
1267 EXTRA_KCFLAGS="-Werror"
1268 LB_LINUX_TRY_COMPILE([
1269         #include <linux/fs.h>
1270 ],[
1271         struct address_space a;
1272
1273         write_lock(&a.tree_lock);
1274 ],[
1275         AC_MSG_RESULT([yes])
1276         AC_DEFINE(HAVE_RW_TREE_LOCK, 1, [kernel has tree_lock as rw_lock])
1277 ],[
1278         AC_MSG_RESULT([no])
1279 ])
1280 EXTRA_KCFLAGS="$tmp_flags"
1281 ])
1282
1283 # 2.6.18
1284
1285
1286 # 2.6.23 have return type 'void' for unregister_blkdev
1287 AC_DEFUN([LC_UNREGISTER_BLKDEV_RETURN_INT],
1288 [AC_MSG_CHECKING([if unregister_blkdev return int])
1289 LB_LINUX_TRY_COMPILE([
1290         #include <linux/fs.h>
1291 ],[
1292         int i = unregister_blkdev(0,NULL);
1293 ],[
1294         AC_MSG_RESULT([yes])
1295         AC_DEFINE(HAVE_UNREGISTER_BLKDEV_RETURN_INT, 1, 
1296                 [unregister_blkdev return int])
1297 ],[
1298         AC_MSG_RESULT([no])
1299 ])
1300 ])
1301
1302 # 2.6.23 change .sendfile to .splice_read
1303 # RHEL4 (-92 kernel) have both sendfile and .splice_read API
1304 AC_DEFUN([LC_KERNEL_SENDFILE],
1305 [AC_MSG_CHECKING([if kernel has .sendfile])
1306 LB_LINUX_TRY_COMPILE([
1307         #include <linux/fs.h>
1308 ],[
1309         struct file_operations file;
1310
1311         file.sendfile = NULL;
1312 ], [
1313         AC_MSG_RESULT([yes])
1314         AC_DEFINE(HAVE_KERNEL_SENDFILE, 1,
1315                 [kernel has .sendfile])
1316 ],[
1317         AC_MSG_RESULT([no])
1318 ])
1319 ])
1320
1321 # 2.6.23 change .sendfile to .splice_read
1322 AC_DEFUN([LC_KERNEL_SPLICE_READ],
1323 [AC_MSG_CHECKING([if kernel has .splice_read])
1324 LB_LINUX_TRY_COMPILE([
1325         #include <linux/fs.h>
1326 ],[
1327         struct file_operations file;
1328
1329         file.splice_read = NULL;
1330 ], [
1331         AC_MSG_RESULT([yes])
1332         AC_DEFINE(HAVE_KERNEL_SPLICE_READ, 1,
1333                 [kernel has .slice_read])
1334 ],[
1335         AC_MSG_RESULT([no])
1336 ])
1337 ])
1338
1339 # 2.6.23 extract nfs export related data into exportfs.h
1340 AC_DEFUN([LC_HAVE_EXPORTFS_H],
1341 [LB_CHECK_FILE([$LINUX/include/linux/exportfs.h], [
1342         AC_DEFINE(HAVE_LINUX_EXPORTFS_H, 1,
1343                 [kernel has include/exportfs.h])
1344 ],[
1345         AC_MSG_RESULT([no])
1346 ])
1347 ])
1348
1349 # 2.6.23 have new page fault handling API
1350 AC_DEFUN([LC_VM_OP_FAULT],
1351 [AC_MSG_CHECKING([if kernel has .fault in vm_operation_struct])
1352 LB_LINUX_TRY_COMPILE([
1353         #include <linux/mm.h>
1354 ],[
1355         struct vm_operations_struct op;
1356
1357         op.fault = NULL;
1358 ], [
1359         AC_MSG_RESULT([yes])
1360         AC_DEFINE(HAVE_VM_OP_FAULT, 1,
1361                 [if kernel has .fault in vm_operation_struct])
1362 ],[
1363         AC_MSG_RESULT([no])
1364 ])
1365 ])
1366
1367 #2.6.23 has new shrinker API
1368 AC_DEFUN([LC_REGISTER_SHRINKER],
1369 [AC_MSG_CHECKING([if kernel has register_shrinker])
1370 LB_LINUX_TRY_COMPILE([
1371         #include <linux/mm.h>
1372 ],[
1373         register_shrinker(NULL);
1374 ], [
1375         AC_MSG_RESULT([yes])
1376         AC_DEFINE(HAVE_REGISTER_SHRINKER, 1,
1377                 [if kernel has register_shrinker])
1378 ],[
1379         AC_MSG_RESULT([no])
1380 ])
1381 ])
1382
1383 # 2.6.23 add code to wait other users to complete before removing procfs entry
1384 AC_DEFUN([LC_PROCFS_USERS],
1385 [AC_MSG_CHECKING([if kernel has pde_users member in procfs entry struct])
1386 LB_LINUX_TRY_COMPILE([
1387         #include <linux/proc_fs.h>
1388 ],[
1389         struct proc_dir_entry pde;
1390
1391         pde.pde_users   = 0;
1392 ],[
1393         AC_MSG_RESULT([yes])
1394         AC_DEFINE(HAVE_PROCFS_USERS, 1, 
1395                 [kernel has pde_users member in procfs entry struct])
1396 ],[
1397         AC_MSG_RESULT([no])
1398 ])
1399 ])
1400
1401 # 2.6.24 has bio_endio with 2 args
1402 AC_DEFUN([LC_BIO_ENDIO_2ARG],
1403 [AC_MSG_CHECKING([if kernel has bio_endio with 2 args])
1404 LB_LINUX_TRY_COMPILE([
1405         #include <linux/bio.h>
1406 ],[
1407         bio_endio(NULL, 0);
1408 ], [
1409         AC_MSG_RESULT([yes])
1410         AC_DEFINE(HAVE_BIO_ENDIO_2ARG, 1,
1411                 [if kernel has bio_endio with 2 args])
1412 ],[
1413         AC_MSG_RESULT([no])
1414 ])
1415 ])
1416
1417 # 2.6.24 has new members in exports struct.
1418 AC_DEFUN([LC_FH_TO_DENTRY],
1419 [AC_MSG_CHECKING([if kernel has .fh_to_dentry member in export_operations struct])
1420 LB_LINUX_TRY_COMPILE([
1421 #ifdef HAVE_LINUX_EXPORTFS_H
1422         #include <linux/exportfs.h>
1423 #else
1424         #include <linux/fs.h>
1425 #endif
1426 ],[
1427         struct export_operations exp;
1428
1429         exp.fh_to_dentry   = NULL;
1430 ], [
1431         AC_MSG_RESULT([yes])
1432         AC_DEFINE(HAVE_FH_TO_DENTRY, 1,
1433                 [kernel has .fh_to_dentry member in export_operations struct])
1434 ],[
1435         AC_MSG_RESULT([no])
1436 ])
1437 ])
1438
1439 # 2.6.24 need linux/mm_types.h included
1440 AC_DEFUN([LC_HAVE_MMTYPES_H],
1441 [LB_CHECK_FILE([$LINUX/include/linux/mm_types.h], [
1442         AC_DEFINE(HAVE_LINUX_MMTYPES_H, 1,
1443                 [kernel has include/mm_types.h])
1444 ],[
1445         AC_MSG_RESULT([no])
1446 ])
1447 ])
1448
1449 # 2.6.24 remove long aged procfs entry -> deleted member
1450 AC_DEFUN([LC_PROCFS_DELETED],
1451 [AC_MSG_CHECKING([if kernel has deleted member in procfs entry struct])
1452 LB_LINUX_TRY_COMPILE([
1453         #include <linux/proc_fs.h>
1454 ],[
1455         struct proc_dir_entry pde;
1456
1457         pde.deleted   = NULL;
1458 ], [
1459         AC_MSG_RESULT([yes])
1460         AC_DEFINE(HAVE_PROCFS_DELETED, 1,
1461                 [kernel has deleted member in procfs entry struct])
1462 ],[
1463         AC_MSG_RESULT([no])
1464 ])
1465 ])
1466
1467 # 2.6.25 change define to inline
1468 AC_DEFUN([LC_MAPPING_CAP_WRITEBACK_DIRTY],
1469 [AC_MSG_CHECKING([if kernel have mapping_cap_writeback_dirty])
1470 LB_LINUX_TRY_COMPILE([
1471         #include <linux/backing-dev.h>
1472 ],[
1473         #ifndef mapping_cap_writeback_dirty
1474         mapping_cap_writeback_dirty(NULL);
1475         #endif
1476 ],[
1477         AC_MSG_RESULT([yes])
1478         AC_DEFINE(HAVE_MAPPING_CAP_WRITEBACK_DIRTY, 1,
1479                 [kernel have mapping_cap_writeback_dirty])
1480 ],[
1481         AC_MSG_RESULT([no])
1482 ])
1483 ])
1484
1485
1486
1487 # 2.6.26 isn't export set_fs_pwd and change paramter in fs struct
1488 AC_DEFUN([LC_FS_STRUCT_USE_PATH],
1489 [AC_MSG_CHECKING([fs_struct use path structure])
1490 LB_LINUX_TRY_COMPILE([
1491         #include <asm/atomic.h>
1492         #include <linux/spinlock.h>
1493         #include <linux/fs_struct.h>
1494 ],[
1495         struct path path;
1496         struct fs_struct fs;
1497
1498         fs.pwd = path;
1499 ], [
1500         AC_MSG_RESULT([yes])
1501         AC_DEFINE(HAVE_FS_STRUCT_USE_PATH, 1,
1502                 [fs_struct use path structure])
1503 ],[
1504         AC_MSG_RESULT([no])
1505 ])
1506 ])
1507
1508 #2.6.27
1509 AC_DEFUN([LC_INODE_PERMISION_2ARGS],
1510 [AC_MSG_CHECKING([inode_operations->permission have two args])
1511 LB_LINUX_TRY_COMPILE([
1512         #include <linux/fs.h>
1513 ],[
1514         struct inode *inode;
1515
1516         inode->i_op->permission(NULL,0);
1517 ],[
1518         AC_DEFINE(HAVE_INODE_PERMISION_2ARGS, 1, 
1519                   [inode_operations->permission have two args])
1520         AC_MSG_RESULT([yes])
1521 ],[
1522         AC_MSG_RESULT([no])
1523 ])
1524 ])
1525
1526 # 2.6.27 have file_remove_suid instead of remove_suid
1527 AC_DEFUN([LC_FILE_REMOVE_SUID],
1528 [AC_MSG_CHECKING([kernel have file_remove_suid])
1529 LB_LINUX_TRY_COMPILE([
1530         #include <linux/fs.h>
1531 ],[
1532         file_remove_suid(NULL);
1533 ],[
1534         AC_DEFINE(HAVE_FILE_REMOVE_SUID, 1,
1535                   [kernel have file_remove_suid])
1536         AC_MSG_RESULT([yes])
1537 ],[
1538         AC_MSG_RESULT([no])
1539 ])
1540 ])
1541
1542 # 2.6.27 have new page locking API
1543 AC_DEFUN([LC_TRYLOCKPAGE],
1544 [AC_MSG_CHECKING([kernel use trylock_page for page lock])
1545 LB_LINUX_TRY_COMPILE([
1546         #include <linux/pagemap.h>
1547 ],[
1548         trylock_page(NULL);
1549 ],[
1550         AC_DEFINE(HAVE_TRYLOCK_PAGE, 1,
1551                   [kernel use trylock_page for page lock])
1552         AC_MSG_RESULT([yes])
1553 ],[
1554         AC_MSG_RESULT([no])
1555 ])
1556 ])
1557
1558 # 2.6.27 and some older have mapping->tree_lock as spin_lock
1559 AC_DEFUN([LC_RW_TREE_LOCK],
1560 [AC_MSG_CHECKING([mapping->tree_lock is rw_lock])
1561 tmp_flags="$EXTRA_KCFLAGS"
1562 EXTRA_KCFLAGS="-Werror"
1563 LB_LINUX_TRY_COMPILE([
1564         #include <linux/fs.h>
1565 ],[
1566         struct address_space *map = NULL;
1567
1568         write_lock_irq(&map->tree_lock);
1569 ],[
1570         AC_MSG_RESULT(yes)
1571         AC_DEFINE(HAVE_RW_TREE_LOCK, 1,
1572                 [mapping->tree_lock is rw_lock])
1573 ],[
1574         AC_MSG_RESULT(no)
1575 ])
1576 EXTRA_KCFLAGS="$tmp_flags"
1577 ])
1578
1579 # 2.6.5 sles9 hasn't define sysctl_vfs_cache_pressure
1580 AC_DEFUN([LC_HAVE_SYSCTL_VFS_CACHE_PRESSURE],
1581 [LB_CHECK_SYMBOL_EXPORT([sysctl_vfs_cache_pressure],
1582 [fs/dcache.c],[
1583         AC_DEFINE(HAVE_SYSCTL_VFS_CACHE_PRESSURE, 1, [kernel exports sysctl_vfs_cache_pressure])
1584 ],[
1585 ])
1586 ])
1587
1588 # vfs_symlink seems to have started out with 3 args until 2.6.7 where a
1589 # "mode" argument was added, but then again, in some later version it was
1590 # removed
1591 AC_DEFUN([LC_4ARGS_VFS_SYMLINK],
1592 [AC_MSG_CHECKING([if vfs_symlink wants 4 args])
1593 LB_LINUX_TRY_COMPILE([
1594         #include <linux/fs.h>
1595 ],[
1596         struct inode *dir;
1597         struct dentry *dentry;
1598         const char *oldname = NULL;
1599         int mode = 0;
1600
1601         vfs_symlink(dir, dentry, oldname, mode);
1602 ],[
1603         AC_MSG_RESULT(yes)
1604         AC_DEFINE(HAVE_4ARGS_VFS_SYMLINK, 1,
1605                   [vfs_symlink wants 4 args])
1606 ],[
1607         AC_MSG_RESULT(no)
1608 ])
1609 ])
1610
1611 # 2.6.27 sles11 remove the bi_hw_segments
1612 AC_DEFUN([LC_BI_HW_SEGMENTS],
1613 [AC_MSG_CHECKING([struct bio has a bi_hw_segments field])
1614 LB_LINUX_TRY_COMPILE([
1615         #include <linux/bio.h>
1616 ],[
1617         struct bio io;
1618         io.bi_hw_segments = 0;
1619 ],[
1620         AC_DEFINE(HAVE_BI_HW_SEGMENTS, 1,
1621                 [struct bio has a bi_hw_segments field])
1622         AC_MSG_RESULT([yes])
1623 ],[
1624         AC_MSG_RESULT([no])
1625 ])
1626 ])
1627
1628 # 2.6.27 sles11 move the quotaio_v1.h to fs
1629 AC_DEFUN([LC_HAVE_QUOTAIO_V1_H],
1630 [LB_CHECK_FILE([$LINUX/include/linux/quotaio_v1.h],[
1631         AC_DEFINE(HAVE_QUOTAIO_V1_H, 1,
1632                 [kernel has include/linux/quotaio_v1.h])
1633 ],[
1634         AC_MSG_RESULT([no])
1635 ])
1636 ])
1637
1638 # sles10 sp2 need 5 parameter for vfs_symlink
1639 AC_DEFUN([LC_VFS_SYMLINK_5ARGS],
1640 [AC_MSG_CHECKING([vfs_symlink need 5 parameter])
1641 LB_LINUX_TRY_COMPILE([
1642         #include <linux/fs.h>
1643 ],[
1644         struct inode *dir = NULL;
1645         struct dentry *dentry = NULL;
1646         struct vfsmount *mnt = NULL;
1647         const char * path = NULL;
1648         vfs_symlink(dir, dentry, mnt, path, 0);
1649 ],[
1650         AC_DEFINE(HAVE_VFS_SYMLINK_5ARGS, 1,
1651                 [vfs_symlink need 5 parameteres])
1652         AC_MSG_RESULT([yes])
1653 ],[
1654         AC_MSG_RESULT([no])
1655 ])
1656 ])
1657
1658 # 2.6.27 removed the read_inode from super_operations.
1659 AC_DEFUN([LC_READ_INODE_IN_SBOPS],
1660 [AC_MSG_CHECKING([super_operations has a read_inode field])
1661 LB_LINUX_TRY_COMPILE([
1662         #include <linux/fs.h>
1663 ],[
1664         struct super_operations *sop;
1665         sop->read_inode(NULL);
1666 ],[
1667         AC_DEFINE(HAVE_READ_INODE_IN_SBOPS, 1,
1668                 [super_operations has a read_inode])
1669         AC_MSG_RESULT([yes])
1670 ],[
1671         AC_MSG_RESULT([no])
1672 ])
1673 ])
1674
1675 # 2.6.27 sles11 has sb_any_quota_active
1676 AC_DEFUN([LC_SB_ANY_QUOTA_ACTIVE],
1677 [AC_MSG_CHECKING([Kernel has sb_any_quota_active])
1678 LB_LINUX_TRY_COMPILE([
1679         #include <linux/quotaops.h>
1680 ],[
1681         sb_any_quota_active(NULL);
1682 ],[
1683         AC_DEFINE(HAVE_SB_ANY_QUOTA_ACTIVE, 1,
1684                 [Kernel has a sb_any_quota_active])
1685         AC_MSG_RESULT([yes])
1686 ],[
1687         AC_MSG_RESULT([no])
1688 ])
1689 ])
1690
1691 # 2.6.27 sles11 has sb_has_quota_active
1692 AC_DEFUN([LC_SB_HAS_QUOTA_ACTIVE],
1693 [AC_MSG_CHECKING([Kernel has sb_has_quota_active])
1694 LB_LINUX_TRY_COMPILE([
1695         #include <linux/quotaops.h>
1696 ],[
1697         sb_has_quota_active(NULL, 0);
1698 ],[
1699         AC_DEFINE(HAVE_SB_HAS_QUOTA_ACTIVE, 1,
1700                 [Kernel has a sb_has_quota_active])
1701         AC_MSG_RESULT([yes])
1702 ],[
1703         AC_MSG_RESULT([no])
1704 ])
1705 ])
1706
1707 # 2.6.27 has inode_permission instead of permisson
1708 AC_DEFUN([LC_EXPORT_INODE_PERMISSION],
1709 [LB_CHECK_SYMBOL_EXPORT([inode_permission],
1710 [fs/namei.c],[
1711 AC_DEFINE(HAVE_EXPORT_INODE_PERMISSION, 1,
1712             [inode_permission is exported by the kernel])
1713 ],[
1714 ])
1715 ])
1716
1717 # 2.6.27 use 5th parameter in quota_on for remount.
1718 AC_DEFUN([LC_QUOTA_ON_5ARGS],
1719 [AC_MSG_CHECKING([quota_on needs 5 parameters])
1720 LB_LINUX_TRY_COMPILE([
1721         #include <linux/quota.h>
1722 ],[
1723         struct quotactl_ops *qop;
1724         qop->quota_on(NULL, 0, 0, NULL, 0);
1725 ],[
1726         AC_DEFINE(HAVE_QUOTA_ON_5ARGS, 1,
1727                 [quota_on needs 5 paramters])
1728         AC_MSG_RESULT([yes])
1729 ],[
1730         AC_MSG_RESULT([no])
1731 ])
1732 ])
1733
1734 # 2.6.27 use 3th parameter in quota_off for remount.
1735 AC_DEFUN([LC_QUOTA_OFF_3ARGS],
1736 [AC_MSG_CHECKING([quota_off needs 3 parameters])
1737 LB_LINUX_TRY_COMPILE([
1738         #include <linux/quota.h>
1739 ],[
1740         struct quotactl_ops *qop;
1741         qop->quota_off(NULL, 0, 0);
1742 ],[
1743         AC_DEFINE(HAVE_QUOTA_OFF_3ARGS, 1,
1744                 [quota_off needs 3 paramters])
1745         AC_MSG_RESULT([yes])
1746 ],[
1747         AC_MSG_RESULT([no])
1748 ])
1749 ])
1750
1751 # 2.6.27 has vfs_dq_off inline function.
1752 AC_DEFUN([LC_VFS_DQ_OFF],
1753 [AC_MSG_CHECKING([vfs_dq_off is defined])
1754 LB_LINUX_TRY_COMPILE([
1755         #include <linux/quotaops.h>
1756 ],[
1757         vfs_dq_off(NULL, 0);
1758 ],[
1759         AC_DEFINE(HAVE_VFS_DQ_OFF, 1, [vfs_dq_off is defined])
1760         AC_MSG_RESULT([yes])
1761 ],[
1762         AC_MSG_RESULT([no])
1763 ])
1764 ])
1765
1766 #
1767 # Ensure stack size big than 8k in Lustre server
1768 AC_DEFUN([LC_STACK_SIZE],
1769 [AC_MSG_CHECKING([stack size big than 8k])
1770 LB_LINUX_TRY_COMPILE([
1771         #include <linux/thread_info.h>
1772 ],[
1773         #if THREAD_SIZE < 8192
1774         #error "stack size < 8192"
1775         #endif
1776 ],[
1777         AC_MSG_RESULT(yes)
1778 ],[
1779         AC_MSG_ERROR([Lustre requires that Linux is configured with at least a 8KB stack.])
1780 ])
1781 ])
1782
1783 #
1784 # LC_PROG_LINUX
1785 #
1786 # Lustre linux kernel checks
1787 #
1788 AC_DEFUN([LC_PROG_LINUX],
1789          [LC_LUSTRE_VERSION_H
1790           if test x$enable_server = xyes ; then
1791               LC_CONFIG_BACKINGFS
1792               LC_STACK_SIZE
1793           fi
1794           LC_CONFIG_PINGER
1795           LC_CONFIG_CHECKSUM
1796           LC_CONFIG_LIBLUSTRE_RECOVERY
1797           LC_CONFIG_HEALTH_CHECK_WRITE
1798           LC_CONFIG_LRU_RESIZE
1799           LC_CONFIG_ADAPTIVE_TIMEOUTS
1800           LC_CONFIG_DELAYED_RECOVERY
1801           LC_QUOTA_MODULE
1802
1803           LC_TASK_PPTR
1804           # RHEL4 patches
1805           LC_EXPORT_TRUNCATE_COMPLETE_PAGE
1806           LC_EXPORT_TRUNCATE_RANGE
1807           LC_EXPORT_D_REHASH_COND
1808           LC_EXPORT___D_REHASH
1809           LC_EXPORT_D_MOVE_LOCKED
1810           LC_EXPORT___D_MOVE
1811           LC_EXPORT_NODE_TO_CPUMASK
1812
1813           LC_FUNC_RELEASEPAGE_WITH_GFP
1814           LC_HEADER_MM_INLINE
1815           LC_STRUCT_INODE
1816           LC_FUNC_REGISTER_CACHE
1817           LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP
1818           LC_FUNC_DEV_SET_RDONLY
1819           LC_FUNC_FILEMAP_FDATAWRITE
1820           LC_STRUCT_STATFS
1821           LC_FUNC_PAGE_MAPPED
1822           LC_STRUCT_FILE_OPS_UNLOCKED_IOCTL
1823           LC_FILEMAP_POPULATE
1824           LC_D_ADD_UNIQUE
1825           LC_BIT_SPINLOCK_H
1826           LC_XATTR_ACL
1827           LC_STRUCT_INTENT_FILE
1828           LC_POSIX_ACL_XATTR_H
1829           LC_EXPORT___IGET
1830           LC_FUNC_MS_FLOCK_LOCK
1831           LC_FUNC_HAVE_CAN_SLEEP_ARG
1832           LC_FUNC_F_OP_FLOCK
1833           LC_QUOTA_READ
1834           LC_COOKIE_FOLLOW_LINK
1835           LC_FUNC_RCU
1836           LC_PERCPU_COUNTER
1837           LC_QUOTA64
1838           LC_4ARGS_VFS_SYMLINK
1839
1840           # does the kernel have VFS intent patches?
1841           LC_VFS_INTENT_PATCHES
1842
1843           # 2.6.5 sles9
1844           LC_HAVE_SYSCTL_VFS_CACHE_PRESSURE
1845
1846           # 2.6.12
1847           LC_RW_TREE_LOCK
1848           LC_EXPORT_SYNCHRONIZE_RCU
1849
1850           # 2.6.15
1851           LC_INODE_I_MUTEX
1852
1853           # 2.6.16
1854           LC_SECURITY_PLUG  # for SLES10 SP2
1855
1856           # 2.6.17
1857           LC_DQUOTOFF_MUTEX
1858
1859           # 2.6.18
1860           LC_NR_PAGECACHE
1861           LC_STATFS_DENTRY_PARAM
1862           LC_VFS_KERN_MOUNT
1863           LC_INVALIDATEPAGE_RETURN_INT
1864           LC_UMOUNTBEGIN_HAS_VFSMOUNT
1865           LC_INODE_IPRIVATE
1866           LC_EXPORT_FILEMAP_FDATAWRITE_RANGE
1867           if test x$enable_server = xyes ; then
1868                 LC_EXPORT_INVALIDATE_MAPPING_PAGES
1869           fi
1870
1871           #2.6.18 + RHEL5 (fc6)
1872           LC_PG_FS_MISC
1873           LC_PAGE_CHECKED
1874
1875           # 2.6.19
1876           LC_INODE_BLKSIZE
1877           LC_VFS_READDIR_U64_INO
1878           LC_FILE_WRITEV
1879           LC_FILE_READV
1880
1881           # 2.6.20
1882           LC_CANCEL_DIRTY_PAGE
1883
1884           # raid5-zerocopy patch
1885           LC_PAGE_CONSTANT
1886
1887           # 2.6.22
1888           LC_INVALIDATE_BDEV_2ARG
1889           LC_FS_RENAME_DOES_D_MOVE
1890           # 2.6.23
1891           LC_UNREGISTER_BLKDEV_RETURN_INT
1892           LC_KERNEL_SENDFILE
1893           LC_KERNEL_SPLICE_READ
1894           LC_HAVE_EXPORTFS_H
1895           LC_VM_OP_FAULT
1896           LC_REGISTER_SHRINKER
1897           LC_PROCFS_USERS
1898
1899           # 2.6.25
1900           LC_MAPPING_CAP_WRITEBACK_DIRTY
1901
1902           # 2.6.24
1903           LC_HAVE_MMTYPES_H
1904           LC_BIO_ENDIO_2ARG
1905           LC_FH_TO_DENTRY
1906           LC_PROCFS_DELETED
1907
1908           # 2.6.26
1909           LC_FS_STRUCT_USE_PATH
1910           LC_RCU_LIST_SAFE
1911
1912           # 2.6.27
1913           LC_INODE_PERMISION_2ARGS
1914           LC_FILE_REMOVE_SUID
1915           LC_TRYLOCKPAGE
1916           LC_RW_TREE_LOCK
1917           LC_READ_INODE_IN_SBOPS
1918           LC_EXPORT_INODE_PERMISSION
1919           LC_QUOTA_ON_5ARGS
1920           LC_QUOTA_OFF_3ARGS
1921           LC_VFS_DQ_OFF
1922
1923           # 2.6.27.15-2 sles11
1924           LC_BI_HW_SEGMENTS
1925           LC_HAVE_QUOTAIO_V1_H
1926           LC_VFS_SYMLINK_5ARGS
1927           LC_SB_ANY_QUOTA_ACTIVE
1928           LC_SB_HAS_QUOTA_ACTIVE
1929 ])
1930
1931 #
1932 # LC_CONFIG_CLIENT_SERVER
1933 #
1934 # Build client/server sides of Lustre
1935 #
1936 AC_DEFUN([LC_CONFIG_CLIENT_SERVER],
1937 [AC_MSG_CHECKING([whether to build Lustre server support])
1938 AC_ARG_ENABLE([server],
1939         AC_HELP_STRING([--disable-server],
1940                         [disable Lustre server support]),
1941         [],[enable_server='yes'])
1942 AC_MSG_RESULT([$enable_server])
1943
1944 AC_MSG_CHECKING([whether to build Lustre client support])
1945 AC_ARG_ENABLE([client],
1946         AC_HELP_STRING([--disable-client],
1947                         [disable Lustre client support]),
1948         [],[enable_client='yes'])
1949 AC_MSG_RESULT([$enable_client])])
1950
1951 #
1952 # LC_CONFIG_LIBLUSTRE
1953 #
1954 # whether to build liblustre
1955 #
1956 AC_DEFUN([LC_CONFIG_LIBLUSTRE],
1957 [AC_MSG_CHECKING([whether to build Lustre library])
1958 AC_ARG_ENABLE([liblustre],
1959         AC_HELP_STRING([--disable-liblustre],
1960                         [disable building of Lustre library]),
1961         [],[enable_liblustre=$with_sysio])
1962 AC_MSG_RESULT([$enable_liblustre])
1963 # only build sysio if liblustre is built
1964 with_sysio="$enable_liblustre"
1965
1966 AC_MSG_CHECKING([whether to build liblustre tests])
1967 AC_ARG_ENABLE([liblustre-tests],
1968         AC_HELP_STRING([--enable-liblustre-tests],
1969                         [enable liblustre tests, if --disable-tests is used]),
1970         [],[enable_liblustre_tests=$enable_tests])
1971 if test x$enable_liblustre != xyes ; then
1972    enable_liblustre_tests='no'
1973 fi
1974 AC_MSG_RESULT([$enable_liblustre_tests])
1975
1976 AC_MSG_CHECKING([whether to enable liblustre acl])
1977 AC_ARG_ENABLE([liblustre-acl],
1978         AC_HELP_STRING([--disable-liblustre-acl],
1979                         [disable ACL support for liblustre]),
1980         [],[enable_liblustre_acl=yes])
1981 AC_MSG_RESULT([$enable_liblustre_acl])
1982 if test x$enable_liblustre_acl = xyes ; then
1983   AC_DEFINE(LIBLUSTRE_POSIX_ACL, 1, Liblustre Support ACL-enabled MDS)
1984 fi
1985
1986 #
1987 # --enable-mpitest
1988 #
1989 AC_ARG_ENABLE(mpitests,
1990         AC_HELP_STRING([--enable-mpitests=yes|no|mpicc wrapper],
1991                            [include mpi tests]),
1992         [
1993          enable_mpitests=yes
1994          case $enableval in
1995          yes)
1996                 MPICC_WRAPPER=mpicc
1997                 ;;
1998          no)
1999                 enable_mpitests=no
2000                 ;;
2001          *)
2002                 MPICC_WRAPPER=$enableval
2003                  ;;
2004          esac
2005         ],
2006         [
2007         MPICC_WRAPPER=mpicc
2008         enable_mpitests=yes
2009         ]
2010 )
2011
2012 if test x$enable_mpitests != xno; then
2013         AC_MSG_CHECKING([whether mpitests can be built])
2014         oldcc=$CC
2015         CC=$MPICC_WRAPPER
2016         AC_LINK_IFELSE(
2017             [AC_LANG_PROGRAM([[
2018                     #include <mpi.h>
2019                 ]],[[
2020                     int flag;
2021                     MPI_Initialized(&flag);
2022                 ]])],
2023             [
2024                     AC_MSG_RESULT([yes])
2025             ],[
2026                     AC_MSG_RESULT([no])
2027                     enable_mpitests=no
2028         ])
2029         CC=$oldcc
2030 fi
2031 AC_SUBST(MPICC_WRAPPER)
2032
2033 AC_MSG_NOTICE([Enabling Lustre configure options for libsysio])
2034 ac_configure_args="$ac_configure_args --with-lustre-hack --with-sockets"
2035
2036 LC_CONFIG_PINGER
2037 LC_CONFIG_LIBLUSTRE_RECOVERY
2038 ])
2039
2040 AC_DEFUN([LC_CONFIG_LRU_RESIZE],
2041 [AC_MSG_CHECKING([whether to enable lru self-adjusting])
2042 AC_ARG_ENABLE([lru_resize], 
2043         AC_HELP_STRING([--enable-lru-resize],
2044                         [enable lru resize support]),
2045         [],[enable_lru_resize='yes'])
2046 AC_MSG_RESULT([$enable_lru_resize])
2047 if test x$enable_lru_resize != xno; then
2048    AC_DEFINE(HAVE_LRU_RESIZE_SUPPORT, 1, [Enable lru resize support])
2049 fi
2050 ])
2051
2052 AC_DEFUN([LC_CONFIG_ADAPTIVE_TIMEOUTS],
2053 [AC_MSG_CHECKING([whether to enable ptlrpc adaptive timeouts support])
2054 AC_ARG_ENABLE([adaptive_timeouts],
2055         AC_HELP_STRING([--disable-adaptive-timeouts],
2056                         [disable ptlrpc adaptive timeouts support]),
2057         [],[enable_adaptive_timeouts='yes'])
2058 AC_MSG_RESULT([$enable_adaptive_timeouts])
2059 if test x$enable_adaptive_timeouts == xyes; then
2060    AC_DEFINE(HAVE_AT_SUPPORT, 1, [Enable adaptive timeouts support])
2061 fi
2062 ])
2063
2064 # config delayed recovery
2065 AC_DEFUN([LC_CONFIG_DELAYED_RECOVERY],
2066 [AC_MSG_CHECKING([whether to enable delayed recovery support])
2067 AC_ARG_ENABLE([delayed-recovery],
2068         AC_HELP_STRING([--enable-delayed-recovery],
2069                         [enable late recovery after main one]),
2070         [],[enable_delayed_recovery='no'])
2071 AC_MSG_RESULT([$enable_delayed_recovery])
2072 if test x$enable_delayed_recovery == xyes; then
2073    AC_DEFINE(HAVE_DELAYED_RECOVERY, 1, [Enable delayed recovery support])
2074 fi
2075 ])
2076
2077 #
2078 # LC_CONFIG_QUOTA
2079 #
2080 # whether to enable quota support global control
2081 #
2082 AC_DEFUN([LC_CONFIG_QUOTA],
2083 [AC_ARG_ENABLE([quota],
2084         AC_HELP_STRING([--enable-quota],
2085                         [enable quota support]),
2086         [],[enable_quota='yes'])
2087 ])
2088
2089 # whether to enable quota support(kernel modules)
2090 AC_DEFUN([LC_QUOTA_MODULE],
2091 [if test x$enable_quota != xno; then
2092     LB_LINUX_CONFIG([QUOTA],[
2093         enable_quota_module='yes'
2094         AC_DEFINE(HAVE_QUOTA_SUPPORT, 1, [Enable quota support])
2095     ],[
2096         enable_quota_module='no'
2097         AC_MSG_WARN([quota is not enabled because the kernel - lacks quota support])
2098     ])
2099 fi
2100 ])
2101
2102 AC_DEFUN([LC_QUOTA],
2103 [#check global
2104 LC_CONFIG_QUOTA
2105 #check for utils
2106 AC_CHECK_HEADER(sys/quota.h,
2107                 [AC_DEFINE(HAVE_SYS_QUOTA_H, 1, [Define to 1 if you have <sys/quota.h>.])],
2108                 [AC_MSG_ERROR([don't find <sys/quota.h> in your system])])
2109 ])
2110
2111 AC_DEFUN([LC_QUOTA_READ],
2112 [AC_MSG_CHECKING([if kernel supports quota_read])
2113 LB_LINUX_TRY_COMPILE([
2114         #include <linux/fs.h>
2115 ],[
2116         struct super_operations sp;
2117         void *i = (void *)sp.quota_read;
2118 ],[
2119         AC_MSG_RESULT([yes])
2120         AC_DEFINE(KERNEL_SUPPORTS_QUOTA_READ, 1, [quota_read found])
2121 ],[
2122         AC_MSG_RESULT([no])
2123 ])
2124 ])
2125
2126 #
2127 # LC_COOKIE_FOLLOW_LINK
2128 #
2129 # kernel 2.6.13+ ->follow_link returns a cookie
2130 #
2131
2132 AC_DEFUN([LC_COOKIE_FOLLOW_LINK],
2133 [AC_MSG_CHECKING([if inode_operations->follow_link returns a cookie])
2134 LB_LINUX_TRY_COMPILE([
2135         #include <linux/fs.h>
2136         #include <linux/namei.h>
2137 ],[
2138         struct dentry dentry;
2139         struct nameidata nd;
2140
2141         dentry.d_inode->i_op->put_link(&dentry, &nd, NULL);
2142 ],[
2143         AC_DEFINE(HAVE_COOKIE_FOLLOW_LINK, 1, [inode_operations->follow_link returns a cookie])
2144         AC_MSG_RESULT([yes])
2145 ],[
2146         AC_MSG_RESULT([no])
2147 ])
2148 ])
2149
2150 #
2151 # LC_FUNC_RCU
2152 #
2153 # kernels prior than 2.6.0(?) have no RCU supported; in kernel 2.6.5(SUSE), 
2154 # call_rcu takes three parameters.
2155 #
2156 AC_DEFUN([LC_FUNC_RCU],
2157 [AC_MSG_CHECKING([if kernel have RCU supported])
2158 LB_LINUX_TRY_COMPILE([
2159         #include <linux/rcupdate.h>
2160 ],[],[
2161         AC_DEFINE(HAVE_RCU, 1, [have RCU defined])
2162         AC_MSG_RESULT([yes])
2163
2164         AC_MSG_CHECKING([if call_rcu takes three parameters])
2165         LB_LINUX_TRY_COMPILE([
2166                 #include <linux/rcupdate.h>
2167         ],[
2168                 struct rcu_head rh;
2169                 call_rcu(&rh, (void (*)(struct rcu_head *))1, NULL);
2170         ],[
2171                 AC_DEFINE(HAVE_CALL_RCU_PARAM, 1, [call_rcu takes three parameters])
2172                 AC_MSG_RESULT([yes])
2173         ],[
2174                 AC_MSG_RESULT([no]) 
2175         ])
2176
2177 ],[
2178         AC_MSG_RESULT([no])
2179 ])
2180 ])
2181
2182 #
2183 # LC_QUOTA64
2184 # linux kernel may have 64-bit limits support
2185 #
2186 AC_DEFUN([LC_QUOTA64],
2187 if test x$enable_server = xyes ; then
2188 [AC_MSG_CHECKING([if kernel has 64-bit quota limits support])
2189 LB_LINUX_TRY_COMPILE([
2190         #include <linux/kernel.h>
2191         #include <linux/fs.h>
2192         #include <linux/quotaio_v2.h>
2193         int versions[] = V2_INITQVERSIONS_R1;
2194         struct v2_disk_dqblk_r1 dqblk_r1;
2195 ],[],[
2196         AC_DEFINE(HAVE_QUOTA64, 1, [have quota64])
2197         AC_MSG_RESULT([yes])
2198 ],[
2199         tmp_flags="$EXTRA_KCFLAGS"
2200         EXTRA_KCFLAGS="-I $LINUX/fs"
2201         LB_LINUX_TRY_COMPILE([
2202                 #include <linux/kernel.h>
2203                 #include <linux/fs.h>
2204                 #include <quotaio_v2.h>
2205                 struct v2r1_disk_dqblk dqblk_r1;
2206         ],[],[
2207                 AC_DEFINE(HAVE_QUOTA64, 1, [have quota64])
2208                 AC_MSG_RESULT([yes])
2209         ],[
2210                 AC_MSG_RESULT([no])
2211                 AC_MSG_WARN([4 TB (or larger) block quota limits can only be used with OSTs not larger than 4 TB.])
2212                 AC_MSG_WARN([Continuing with limited quota support.])
2213                 AC_MSG_WARN([quotacheck is needed for filesystems with recent quota versions.])
2214         ])
2215         EXTRA_KCFLAGS=$tmp_flags
2216 ])
2217 fi
2218 ])
2219
2220 # LC_SECURITY_PLUG  # for SLES10 SP2
2221 # check security plug in sles10 sp2 kernel
2222 AC_DEFUN([LC_SECURITY_PLUG],
2223 [AC_MSG_CHECKING([If kernel has security plug support])
2224 LB_LINUX_TRY_COMPILE([
2225         #include <linux/fs.h>
2226 ],[
2227         struct dentry   *dentry;
2228         struct vfsmount *mnt;
2229         struct iattr    *iattr;
2230
2231         notify_change(dentry, mnt, iattr);
2232 ],[
2233         AC_MSG_RESULT(yes)
2234         AC_DEFINE(HAVE_SECURITY_PLUG, 1,
2235                 [SLES10 SP2 use extra parameter in vfs])
2236 ],[
2237         AC_MSG_RESULT(no)
2238 ])
2239 ])
2240
2241 AC_DEFUN([LC_PERCPU_COUNTER],
2242 [AC_MSG_CHECKING([if have struct percpu_counter defined])
2243 LB_LINUX_TRY_COMPILE([
2244         #include <linux/percpu_counter.h>
2245 ],[],[
2246         AC_DEFINE(HAVE_PERCPU_COUNTER, 1, [percpu_counter found])
2247         AC_MSG_RESULT([yes])
2248
2249         AC_MSG_CHECKING([if percpu_counter_inc takes the 2nd argument])
2250         LB_LINUX_TRY_COMPILE([
2251                 #include <linux/percpu_counter.h>
2252         ],[
2253                 struct percpu_counter c;
2254                 percpu_counter_init(&c, 0);
2255         ],[
2256                 AC_DEFINE(HAVE_PERCPU_2ND_ARG, 1, [percpu_counter_init has two
2257                                                    arguments])
2258                 AC_MSG_RESULT([yes])
2259         ],[
2260                 AC_MSG_RESULT([no])
2261         ])
2262 ],[
2263         AC_MSG_RESULT([no])
2264 ])
2265 ])
2266
2267 #
2268 # LC_CONFIGURE
2269 #
2270 # other configure checks
2271 #
2272 AC_DEFUN([LC_CONFIGURE],
2273 [LC_CONFIG_OBD_BUFFER_SIZE
2274
2275 # include/liblustre.h
2276 AC_CHECK_HEADERS([asm/page.h sys/user.h sys/vfs.h stdint.h blkid/blkid.h])
2277
2278 # liblustre/llite_lib.h
2279 AC_CHECK_HEADERS([xtio.h file.h])
2280
2281 # liblustre/dir.c
2282 AC_CHECK_HEADERS([linux/types.h sys/types.h linux/unistd.h unistd.h])
2283
2284 # liblustre/lutil.c
2285 AC_CHECK_HEADERS([netinet/in.h arpa/inet.h catamount/data.h])
2286 AC_CHECK_FUNCS([inet_ntoa])
2287
2288 # libsysio/src/readlink.c
2289 LC_READLINK_SSIZE_T
2290
2291 # lvfs/prng.c - depends on linux/types.h from liblustre/dir.c
2292 AC_CHECK_HEADERS([linux/random.h], [], [],
2293                  [#ifdef HAVE_LINUX_TYPES_H
2294                   # include <linux/types.h>
2295                   #endif
2296                  ])
2297
2298 # utils/llverfs.c
2299 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
2300
2301 # check for -lz support
2302 ZLIB=""
2303 AC_CHECK_LIB([z],
2304              [adler32],
2305              [AC_CHECK_HEADERS([zlib.h],
2306                                [ZLIB="-lz"
2307                                 AC_DEFINE([HAVE_ADLER], 1,
2308                                           [support alder32 checksum type])],
2309                                [AC_MSG_WARN([No zlib-devel package found,
2310                                              unable to use adler32 checksum])])],
2311              [AC_MSG_WARN([No zlib package found, unable to use adler32 checksum])]
2312 )
2313 AC_SUBST(ZLIB)
2314
2315 # Super safe df
2316 AC_ARG_ENABLE([mindf],
2317       AC_HELP_STRING([--enable-mindf],
2318                       [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]),
2319       [],[])
2320 if test "$enable_mindf" = "yes" ;  then
2321       AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])
2322 fi
2323
2324 AC_ARG_ENABLE([fail_alloc],
2325         AC_HELP_STRING([--disable-fail-alloc],
2326                 [disable randomly alloc failure]),
2327         [],[enable_fail_alloc=yes])
2328 AC_MSG_CHECKING([whether to randomly failing memory alloc])
2329 AC_MSG_RESULT([$enable_fail_alloc])
2330 if test x$enable_fail_alloc != xno ; then
2331         AC_DEFINE([RANDOM_FAIL_ALLOC], 1, [enable randomly alloc failure])
2332 fi
2333
2334 ])
2335
2336 #
2337 # LC_CONDITIONALS
2338 #
2339 # AM_CONDITIONALS for lustre
2340 #
2341 AC_DEFUN([LC_CONDITIONALS],
2342 [AM_CONDITIONAL(LIBLUSTRE, test x$enable_liblustre = xyes)
2343 AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno)
2344 AM_CONDITIONAL(LIBLUSTRE_TESTS, test x$enable_liblustre_tests = xyes)
2345 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
2346 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
2347 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
2348 AM_CONDITIONAL(QUOTA, test x$enable_quota_module = xyes)
2349 AM_CONDITIONAL(BLKID, test x$ac_cv_header_blkid_blkid_h = xyes)
2350 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
2351 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
2352 ])
2353
2354 #
2355 # LC_CONFIG_FILES
2356 #
2357 # files that should be generated with AC_OUTPUT
2358 #
2359 AC_DEFUN([LC_CONFIG_FILES],
2360 [AC_CONFIG_FILES([
2361 lustre/Makefile
2362 lustre/autoMakefile
2363 lustre/autoconf/Makefile
2364 lustre/contrib/Makefile
2365 lustre/doc/Makefile
2366 lustre/include/Makefile
2367 lustre/include/lustre_ver.h
2368 lustre/include/linux/Makefile
2369 lustre/include/lustre/Makefile
2370 lustre/kernel_patches/targets/2.6-suse.target
2371 lustre/kernel_patches/targets/2.6-vanilla.target
2372 lustre/kernel_patches/targets/2.6-rhel4.target
2373 lustre/kernel_patches/targets/2.6-rhel5.target
2374 lustre/kernel_patches/targets/2.6-fc5.target
2375 lustre/kernel_patches/targets/2.6-patchless.target
2376 lustre/kernel_patches/targets/2.6-sles10.target
2377 lustre/kernel_patches/targets/2.6-sles11.target
2378 lustre/kernel_patches/targets/hp_pnnl-2.4.target
2379 lustre/kernel_patches/targets/rh-2.4.target
2380 lustre/kernel_patches/targets/rhel-2.4.target
2381 lustre/kernel_patches/targets/suse-2.4.21-2.target
2382 lustre/kernel_patches/targets/sles-2.4.target
2383 lustre/ldlm/Makefile
2384 lustre/liblustre/Makefile
2385 lustre/liblustre/tests/Makefile
2386 lustre/liblustre/tests/mpi/Makefile
2387 lustre/llite/Makefile
2388 lustre/llite/autoMakefile
2389 lustre/lov/Makefile
2390 lustre/lov/autoMakefile
2391 lustre/lvfs/Makefile
2392 lustre/lvfs/autoMakefile
2393 lustre/mdc/Makefile
2394 lustre/mdc/autoMakefile
2395 lustre/mds/Makefile
2396 lustre/mds/autoMakefile
2397 lustre/obdclass/Makefile
2398 lustre/obdclass/autoMakefile
2399 lustre/obdclass/linux/Makefile
2400 lustre/obdecho/Makefile
2401 lustre/obdecho/autoMakefile
2402 lustre/obdfilter/Makefile
2403 lustre/obdfilter/autoMakefile
2404 lustre/osc/Makefile
2405 lustre/osc/autoMakefile
2406 lustre/ost/Makefile
2407 lustre/ost/autoMakefile
2408 lustre/mgc/Makefile
2409 lustre/mgc/autoMakefile
2410 lustre/mgs/Makefile
2411 lustre/mgs/autoMakefile
2412 lustre/ptlrpc/Makefile
2413 lustre/ptlrpc/autoMakefile
2414 lustre/quota/Makefile
2415 lustre/quota/autoMakefile
2416 lustre/scripts/Makefile
2417 lustre/tests/Makefile
2418 lustre/tests/mpi/Makefile
2419 lustre/utils/Makefile
2420 ])
2421 case $lb_target_os in
2422         darwin)
2423                 AC_CONFIG_FILES([ lustre/obdclass/darwin/Makefile ])
2424                 ;;
2425 esac
2426
2427 ])