xfstests: fix fiemap-tester when build without fallocate
authorChristoph Hellwig <hch@lst.de>
Sat, 1 May 2010 13:12:56 +0000 (15:12 +0200)
committerChristoph Hellwig <hch@lst.de>
Sat, 1 May 2010 13:12:56 +0000 (15:12 +0200)
Make sure at least the tests passing -p0 like xfstests 225 can work when
built without fallocate support.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
src/fiemap-tester.c

index 69016a9fd5e0a17c9536d0044c1f4e66e725b204..acec1b5563d8297925edd79a4a95be0d19fc0237 100644 (file)
@@ -37,14 +37,10 @@ static void
 usage(void)
 {
        printf("Usage: fiemap-tester [-m map] [-r number of runs] [-s seed] [-q]");
-#ifdef HAVE_FALLOCATE
        printf("[-p preallocate (1/0)] ");
-#endif
        printf("filename\n");
        printf("  -m map    : generate a file with the map given and test\n");
-#ifdef HAVE_FALLOCATE
        printf("  -p 0/1    : turn block preallocation on or off\n");
-#endif
        printf("  -r count  : number of runs to execute (default infinity)\n");
        printf("  -s seed   : seed for random map generator (default 1)\n");
        printf("  -q        : be quiet about non-errors\n");
@@ -513,9 +509,10 @@ main(int argc, char **argv)
                case 'p':
                        prealloc = atoi(optarg);;
 #ifndef HAVE_FALLOCATE
-                       if (prealloc)
+                       if (prealloc) {
                                printf("Not built with preallocation support\n");
-                       usage();
+                               usage();
+                       }
 #endif
                        break;
                case 'q':