Rename header_offset and header_interval options
Header doesn't really express that this has to do with io verification.
So rename the options to verify_offset and verify_interval.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/HOWTO b/HOWTO
index 8cb849c..2fbbc1d 100644
--- a/HOWTO
+++ b/HOWTO
@@ -603,11 +603,11 @@
fast IO where the red-black tree sorting CPU time becomes
significant.
-header_offset=siint Swap the verification header with data somewhere else
+verify_offset=siint Swap the verification header with data somewhere else
in the block before writing. Its swapped back before
verifying.
-header_interval=siint Write the verification header at a finer granularity
+verify_interval=siint Write the verification header at a finer granularity
than the blocksize. It will be written for chunks the
size of header_interval. blocksize should divide this
evenly.
diff --git a/fio.h b/fio.h
index e97caf1..eb36d1c 100644
--- a/fio.h
+++ b/fio.h
@@ -395,8 +395,8 @@
unsigned int sync_io;
unsigned int verify;
unsigned int verifysort;
- unsigned int header_interval;
- unsigned int header_offset;
+ unsigned int verify_interval;
+ unsigned int verify_offset;
unsigned int use_thread;
unsigned int unlink;
unsigned int do_disk_util;
diff --git a/options.c b/options.c
index 01d2386..5a63f63 100644
--- a/options.c
+++ b/options.c
@@ -203,14 +203,16 @@
return add_dir_files(td, td->o.opendir);
}
-static int str_header_offset_cb(void *data, unsigned int *off)
+static int str_verify_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");
+ log_err("fio: verify_offset too small\n");
return 1;
}
- td->o.header_offset = *off;
+
+ td->o.verify_offset = *off;
return 0;
}
@@ -615,18 +617,18 @@
.def = "1",
},
{
- .name = "header_interval",
+ .name = "verify_interval",
.type = FIO_OPT_STR_VAL_INT,
- .off1 = td_var_offset(header_interval),
+ .off1 = td_var_offset(verify_interval),
.minval = 2 * sizeof(struct verify_header),
- .help = "Store buffer header every N bytes",
+ .help = "Store verify buffer header every N bytes",
},
{
- .name = "header_offset",
+ .name = "verify_offset",
.type = FIO_OPT_STR_VAL_INT,
- .help = "Offset header location by N bytes",
+ .help = "Offset verify header location by N bytes",
.def = "0",
- .cb = str_header_offset_cb,
+ .cb = str_verify_offset_cb,
},
{
.name = "write_iolog",
diff --git a/verify.c b/verify.c
index 6972fe3..d98dfcf 100644
--- a/verify.c
+++ b/verify.c
@@ -171,12 +171,12 @@
return 0;
hdr_inc = io_u->buflen;
- if (td->o.header_interval)
- hdr_inc = td->o.header_interval;
+ if (td->o.verify_interval)
+ hdr_inc = td->o.verify_interval;
for (p = io_u->buf; p < io_u->buf + io_u->buflen; p += hdr_inc) {
- if (td->o.header_offset)
- memswp(p, p + td->o.header_offset, sizeof(*hdr));
+ if (td->o.verify_offset)
+ memswp(p, p + td->o.verify_offset, sizeof(*hdr));
hdr = p;
@@ -257,8 +257,8 @@
fill_random_bytes(td, p, io_u->buflen);
hdr_inc = io_u->buflen;
- if (td->o.header_interval)
- hdr_inc = td->o.header_interval;
+ if (td->o.verify_interval)
+ hdr_inc = td->o.verify_interval;
data_len = hdr_inc - sizeof(*hdr);
for (;p < io_u->buf + io_u->buflen; p += hdr_inc) {
@@ -289,8 +289,8 @@
log_err("fio: bad verify type: %d\n", td->o.verify);
assert(0);
}
- if (td->o.header_offset)
- memswp(p, p + td->o.header_offset, sizeof(*hdr));
+ if (td->o.verify_offset)
+ memswp(p, p + td->o.verify_offset, sizeof(*hdr));
}
}