Skip to contentSkip to conversation

xfstests: fix fiemap-tester when build without fallocate

PATCH In review Christoph Hellwig 2 participants 2 messages Apr 29, 2010 – Apr 30, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfstests: fix fiemap-tester when build without fallocate

Make sure at least the tests passing -p0 like xfstests 225 can work when built without fallocate support.

src/fiemap-tester.c +3 -6
Index: xfstests-dev/src/fiemap-tester.c
===================================================================
@@ -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':

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Christoph Hellwig

Make sure at least the tests passing -p0 like xfstests 225 can work when built without fallocate support.

Thanks for doing that.

Quoted 33 lines

Index: xfstests-dev/src/fiemap-tester.c
===================================================================

src/fiemap-tester.c +3 -6
@@ -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':
Quoted 5 lines

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs