Rename header_offset and header_interval options
authorJens Axboe <jens.axboe@oracle.com>
Mon, 30 Jul 2007 06:53:27 +0000 (08:53 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 30 Jul 2007 06:53:27 +0000 (08:53 +0200)
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>
HOWTO
fio.h
options.c
verify.c

diff --git a/HOWTO b/HOWTO
index 8cb849c7c6edad0ddf70294d98f3084cd2894a5a..2fbbc1d2150e3e70a1512f83ea45b54c44c45977 100644 (file)
--- 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 e97caf18bc1bdbea46751be177639bd66cd44919..eb36d1cfd01a2e06a2305c96d76b460ee18c2d40 100644 (file)
--- 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;
index 01d23865a968952606006e3a57dd3e3a21d323d5..5a63f638ee74d4659aae9cd3558cd5196801d7e6 100644 (file)
--- 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",
index 6972fe3ff59a2a10604ba708c05c2524a562c83f..d98dfcf4c52b8bd5a43411bb2cf8397c6fd0952d 100644 (file)
--- 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));
        }
 }