From a59e170d683f9ccbaa45648d7ae9a13b70e3822c Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 30 Jul 2007 08:53:27 +0200 Subject: [PATCH] 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 --- HOWTO | 4 ++-- fio.h | 4 ++-- options.c | 20 +++++++++++--------- verify.c | 16 ++++++++-------- 4 files changed, 23 insertions(+), 21 deletions(-) diff --git a/HOWTO b/HOWTO index 8cb849c7..2fbbc1d2 100644 --- a/HOWTO +++ b/HOWTO @@ -603,11 +603,11 @@ verifysort=bool If set, fio will sort written verify blocks when it deems 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 e97caf18..eb36d1cf 100644 --- a/fio.h +++ b/fio.h @@ -395,8 +395,8 @@ struct thread_options { 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 01d23865..5a63f638 100644 --- a/options.c +++ b/options.c @@ -203,14 +203,16 @@ static int str_opendir_cb(void *data, const char fio_unused *str) 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 @@ static struct fio_option options[] = { .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 6972fe3f..d98dfcf4 100644 --- a/verify.c +++ b/verify.c @@ -171,12 +171,12 @@ int verify_io_u(struct thread_data *td, struct io_u *io_u) 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 @@ void populate_verify_io_u(struct thread_data *td, struct io_u *io_u) 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 @@ void populate_verify_io_u(struct thread_data *td, struct io_u *io_u) 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)); } } -- 2.25.1