diff --git a/configure.ac b/configure.ac index 18dc892..033050d 100644 --- a/configure.ac +++ b/configure.ac @@ -33,6 +33,19 @@ AC_SEARCH_LIBS([sqrt], [m], [], # Check for system capabilities AC_SYS_LARGEFILE +# Check for lustre availability +AC_ARG_WITH([lustre], + [AS_HELP_STRING([--with-lustre], + [support configurable Lustre striping values @<:@default=check@:>@])], + [], [with_lustre=check]) +AS_IF([test "x$with_lustre" != xno], [ + AC_CHECK_HEADERS([lustre/lustre_user.h], [], [ + if test "x$with_lustre" != xcheck; then + AC_MSG_FAILURE([--with-lustre was given, not found]) + fi + ]) +]) + # POSIX IO support AC_ARG_WITH([posix], [AS_HELP_STRING([--with-posix], diff --git a/src/aiori-POSIX.c b/src/aiori-POSIX.c index 4726ec2..7ec7662 100644 --- a/src/aiori-POSIX.c +++ b/src/aiori-POSIX.c @@ -21,9 +21,9 @@ #include /* only for fprintf() */ #include #include -#ifdef _MANUALLY_SET_LUSTRE_STRIPING +#ifdef HAVE_LUSTRE_LUSTRE_USER_H # include -#endif /* _MANUALLY_SET_LUSTRE_STRIPING */ +#endif /* HAVE_LUSTRE_LUSTRE_USER_H */ #ifndef open64 /* necessary for TRU64 -- */ # define open64 open /* unlikely, but may pose */ @@ -100,7 +100,7 @@ IOR_Create_POSIX(char * testFileName, fd_oflag |= O_DIRECT; } -#ifndef _MANUALLY_SET_LUSTRE_STRIPING +#ifndef HAVE_LUSTRE_LUSTRE_USER_H /* If the lustre striping parameters are not the defaults */ if (param->lustre_stripe_count != 0 || param->lustre_stripe_size != 0 @@ -111,7 +111,7 @@ IOR_Create_POSIX(char * testFileName, fd_oflag |= O_CREAT | O_RDWR; *fd = open64(testFileName, fd_oflag, 0664); if (*fd < 0) ERR("cannot open file"); -#else /* _MANUALLY_SET_LUSTRE_STRIPING */ +#else /* HAVE_LUSTRE_LUSTRE_USER_H */ /* If the lustre striping parameters are not the defaults */ if (param->lustre_stripe_count != 0 || param->lustre_stripe_size != 0 @@ -164,7 +164,7 @@ IOR_Create_POSIX(char * testFileName, if (ioctl(*fd, LL_IOC_SETFLAGS, &lustre_ioctl_flags) == -1) ERR("cannot set ioctl"); } -#endif /* not _MANUALLY_SET_LUSTRE_STRIPING */ +#endif /* not HAVE_LUSTRE_LUSTRE_USER_H */ return((void *)fd); } /* IOR_Create_POSIX() */ @@ -203,7 +203,7 @@ IOR_Open_POSIX(char * testFileName, *fd = open64(testFileName, fd_oflag); if (*fd < 0) ERR("cannot open file"); -#ifdef _MANUALLY_SET_LUSTRE_STRIPING +#ifdef HAVE_LUSTRE_LUSTRE_USER_H if (param->lustre_ignore_locks) { int lustre_ioctl_flags = LL_FILE_IGNORE_LOCK; if (verbose >= VERBOSE_1) { @@ -212,7 +212,7 @@ IOR_Open_POSIX(char * testFileName, if (ioctl(*fd, LL_IOC_SETFLAGS, &lustre_ioctl_flags) == -1) ERR("cannot set ioctl"); } -#endif /* _MANUALLY_SET_LUSTRE_STRIPING */ +#endif /* HAVE_LUSTRE_LUSTRE_USER_H */ return((void *)fd); } /* IOR_Open_POSIX() */ diff --git a/src/ior.c b/src/ior.c index 9dc8f57..1e1970a 100644 --- a/src/ior.c +++ b/src/ior.c @@ -1534,7 +1534,7 @@ ShowSetup(IOR_param_t * test) HumanReadable(test->blockSize, BASE_TWO)); fprintf(stdout, "\taggregate filesize = %s\n", HumanReadable(aggFileSizeForBW, BASE_TWO)); -#ifdef _MANUALLY_SET_LUSTRE_STRIPING +#ifdef HAVE_LUSTRE_LUSTRE_USER_H fprintf(stdout, "\tLustre stripe size = %s\n", ((test->lustre_stripe_size == 0) ? "Use default" : HumanReadable(test->lustre_stripe_size, BASE_TWO))); @@ -1544,7 +1544,7 @@ ShowSetup(IOR_param_t * test) fprintf(stdout, "\t stripe count = %d\n", test->lustre_stripe_count); } -#endif /* _MANUALLY_SET_LUSTRE_STRIPING */ +#endif /* HAVE_LUSTRE_LUSTRE_USER_H */ if (test->deadlineForStonewalling > 0) { fprintf(stdout, "\tUsing stonewalling = %d second(s)\n", test->deadlineForStonewalling);