From d5daf7187a392788dce9a99ba74187e22e250c90 Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Thu, 1 May 2014 16:08:03 +0400 Subject: [PATCH] test_librbd_fsx: add a flag to disable randomized striping In preparation for krbd mode support, introduce an option to disable randomized striping. The kernel as of 3.15 does not support "fancy" striping and will not map images with non-default striping values. Signed-off-by: Ilya Dryomov --- src/test/librbd/fsx.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/test/librbd/fsx.c b/src/test/librbd/fsx.c index 09212242b5b51..c34e8ce95a001 100644 --- a/src/test/librbd/fsx.c +++ b/src/test/librbd/fsx.c @@ -149,7 +149,7 @@ int mapped_writes = 0; /* -W flag disables */ int fallocate_calls = 0; /* -F flag disables */ int punch_hole_calls = 1; /* -H flag disables */ int clone_calls = 1; /* -C flag disables */ -int randomize_striping = 1; +int randomize_striping = 1; /* -U flag disables */ int mapped_reads = 0; /* -R flag disables it */ int fsxgoodfd = 0; int o_direct; /* -Z */ @@ -1111,7 +1111,7 @@ void usage(void) { fprintf(stdout, "usage: %s", - "fsx [-dfnqxyACFHLORWZ] [-b opnum] [-c Prob] [-h holebdy] [-l flen] [-m start:end] [-o oplen] [-p progressinterval] [-r readbdy] [-s style] [-t truncbdy] [-w writebdy] [-D startingop] [-N numops] [-P dirpath] [-S seed] pname iname\n\ + "fsx [-dfnqxyACFHLORUWZ] [-b opnum] [-c Prob] [-h holebdy] [-l flen] [-m start:end] [-o oplen] [-p progressinterval] [-r readbdy] [-s style] [-t truncbdy] [-w writebdy] [-D startingop] [-N numops] [-P dirpath] [-S seed] pname iname\n\ -b opnum: beginning operation number (default 1)\n\ -c P: 1 in P chance of file close+open at each op (default infinity)\n\ -d: debug output for all operations\n\ @@ -1145,6 +1145,7 @@ usage(void) -P dirpath: save .fsxlog and .fsxgood files in dirpath (default ./)\n\ -R: read() system calls only (mapped reads disabled)\n\ -S seed: for random # generator (default 1) 0 gets timestamp\n\ + -U: disable randomized striping\n\ -W: mapped write operations DISabled\n\ -Z: O_DIRECT (use -R, -W, -r and -w too)\n\ poolname: this is REQUIRED (no default)\n\ @@ -1324,7 +1325,7 @@ main(int argc, char **argv) setvbuf(stdout, (char *)0, _IOLBF, 0); /* line buffered stdout */ - while ((ch = getopt(argc, argv, "b:c:dfh:l:m:no:p:qr:s:t:w:xyACD:FHLN:OP:RS:WZ")) + while ((ch = getopt(argc, argv, "b:c:dfh:l:m:no:p:qr:s:t:w:xyACD:FHLN:OP:RS:UWZ")) != EOF) switch (ch) { case 'b': @@ -1464,6 +1465,9 @@ main(int argc, char **argv) if (seed < 0) usage(); break; + case 'U': + randomize_striping = 0; + break; case 'W': mapped_writes = 0; if (!quiet) -- 2.39.5