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