From: Alex Elder Date: Thu, 14 Oct 2010 14:50:00 +0000 (+0000) Subject: xfstests: randholes: document options a bit more X-Git-Tag: v1.1.0~131 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=803750d4751ebf8b74282512521324e1fcd3c58d;p=xfstests-dev.git xfstests: randholes: document options a bit more Reformat the usage message and provide a little more information about default values and units for options for the "randholes" command. Signed-off-by: Alex Elder Acked-by: Dave Chinner --- diff --git a/src/randholes.c b/src/randholes.c index 4610dfa5..985ad3c6 100644 --- a/src/randholes.c +++ b/src/randholes.c @@ -16,6 +16,8 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #include "global.h" unsigned char *valid; /* Bit-vector array showing which blocks have been written */ @@ -23,7 +25,11 @@ int nvalid; /* number of bytes in valid array */ #define SETBIT(ARRAY, N) ((ARRAY)[(N)/8] |= (1 << ((N)%8))) #define BITVAL(ARRAY, N) ((ARRAY)[(N)/8] & (1 << ((N)%8))) +#define DEFAULT_FILESIZE ((__uint64_t) (256 * 1024 * 1024)) +#define DEFAULT_BLOCKSIZE 512 + __uint64_t filesize; + unsigned int blocksize; int count; int verbose; @@ -31,7 +37,7 @@ int wsync; int direct; int alloconly; int rt; -int extsize; +int extsize; /* used only for real-time */ int preserve; int test; __uint64_t fileoffset; @@ -50,10 +56,18 @@ void usage(char *progname) { fprintf(stderr, - "usage: %s [-l filesize] [-b blocksize] [-c count]" - " [-o write offset] [-s seed] [-x extentsize]" - " [-w] [-v] [-d] [-r] [-a] [-p] filename\n", + "usage: %s [-l filesize] [-b blocksize] [-c count]\n" + "\t\t[-o write_offset] [-s seed] [-r [-x extentsize]]\n" + "\t\t[-w] [-v] [-d] [-a] [-p] [-t] filename\n\n", progname); + fprintf(stderr, "\tdefault filesize is %" PRIu64 " bytes\n", + DEFAULT_FILESIZE); + fprintf(stderr, "\tdefault blocksize is %u bytes\n", + DEFAULT_BLOCKSIZE); + fprintf(stderr, "\tdefault count is %d block-sized writes\n", + (int) (DEFAULT_FILESIZE / DEFAULT_BLOCKSIZE)); + fprintf(stderr, "\tdefault write_offset is %" PRIu64 " bytes\n", + (__uint64_t) 0); exit(1); } @@ -64,9 +78,9 @@ main(int argc, char *argv[]) char *filename = NULL; int r; - filesize = ((__uint64_t)256)*1024*1024; - blocksize = 512; - count = filesize/blocksize; + filesize = DEFAULT_FILESIZE; + blocksize = DEFAULT_BLOCKSIZE; + count = (int) filesize / blocksize; verbose = 0; wsync = 0; seed = time(NULL);