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