public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Elder <aelder@sgi.com>
To: xfs@oss.sgi.com
Subject: [PATCH 03/11] xfstests: randholes: document options a bit more
Date: Thu, 14 Oct 2010 09:50:00 -0500	[thread overview]
Message-ID: <1287067800.2362.215.camel@doink> (raw)

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 <aelder@sgi.com>

---
 src/randholes.c |   28 +++++++++++++++++++++-------
 1 file changed, 21 insertions(+), 7 deletions(-)

Index: b/src/randholes.c
===================================================================
--- a/src/randholes.c
+++ b/src/randholes.c
@@ -16,6 +16,8 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
  
+#include <inttypes.h>
+
 #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
 #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);


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

                 reply	other threads:[~2010-10-14 14:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1287067800.2362.215.camel@doink \
    --to=aelder@sgi.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox