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