[PATCH] Offset verification header by a user-specified distance

Offset verification header by user specified distance.

 - Implementation is somewhat simple and probably not ideal but it works. The
   header is just swapped with the bytes at offset after the chunk has been
   filled during populate. Everything is swapped back before verify.

 - Also fixes a bug where we were relying on a moving pointer for increment
   size in populate_verify_io_u (which was working until this patch).

 - Also cleans up a couple smalls things from the header_interval patch.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/options.c b/options.c
index 829b808..130dc8c 100644
--- a/options.c
+++ b/options.c
@@ -203,6 +203,17 @@
 	return add_dir_files(td, td->o.opendir);
 }
 
+static int str_header_offset_cb(void *data, unsigned int *off)
+{
+	struct thread_data *td = data;
+	if (*off && *off < sizeof(struct verify_header)) {
+		log_err("fio: header_offset too small\n");
+		return 1;
+	}
+	td->o.header_offset = *off;
+	return 0;
+}
+
 
 #define __stringify_1(x)	#x
 #define __stringify(x)		__stringify_1(x)
@@ -611,6 +622,13 @@
 		.def    = "0",
 	},
 	{
+		.name	= "header_offset",
+		.type	= FIO_OPT_STR_VAL_INT,
+		.help	= "Offset header location by N bytes",
+		.def	= "0",
+		.cb	= str_header_offset_cb,	
+	},
+	{
 		.name	= "write_iolog",
 		.type	= FIO_OPT_STR_STORE,
 		.off1	= td_var_offset(write_iolog_file),