Change writetrim to trimwrite
authorJens Axboe <axboe@fb.com>
Wed, 15 Apr 2015 15:49:20 +0000 (09:49 -0600)
committerJens Axboe <axboe@fb.com>
Wed, 15 Apr 2015 15:49:20 +0000 (09:49 -0600)
This better explains what it does. Also add HOWTO and man page entries
for trimwrite.

Signed-off-by: Jens Axboe <axboe@fb.com>
HOWTO
backend.c
fio.1
io_ddir.h
io_u.c
options.c

diff --git a/HOWTO b/HOWTO
index da7529f..60eab24 100644 (file)
--- a/HOWTO
+++ b/HOWTO
@@ -387,6 +387,8 @@ rw=str              Type of io pattern. Accepted values are:
                        randread        Random reads
                        rw,readwrite    Sequential mixed reads and writes
                        randrw          Random mixed reads and writes
+                       trimwrite       Mixed trims and writes. Blocks will be
+                                       trimmed first, then written to.
 
                For the mixed io types, the default is to split them 50/50.
                For certain types of io the result may still be skewed a bit,
index e8599ee..25479b4 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -744,9 +744,9 @@ static uint64_t do_io(struct thread_data *td)
           (td_write(td) && td->o.verify_backlog))
                total_bytes += td->o.size;
 
-       /* In writetrim mode, each byte is trimmed and then written, so
+       /* In trimwrite mode, each byte is trimmed and then written, so
         * allow total_bytes to be twice as big */
-       if (td_writetrim(td))
+       if (td_trimwrite(td))
                total_bytes += td->total_io_size;
 
        while ((td->o.read_iolog_file && !flist_empty(&td->io_log_list)) ||
diff --git a/fio.1 b/fio.1
index 2f72ab5..81bcf06 100644 (file)
--- a/fio.1
+++ b/fio.1
@@ -286,6 +286,10 @@ Mixed sequential reads and writes.
 .TP
 .B randrw 
 Mixed random reads and writes.
+.TP
+.B trimwrite
+Trim and write mixed workload. Blocks will be trimmed first, then the same
+blocks will be written to.
 .RE
 .P
 For mixed I/O, the default split is 50/50. For certain types of io the result
index b0d79ff..e5eff68 100644 (file)
--- a/io_ddir.h
+++ b/io_ddir.h
@@ -35,7 +35,7 @@ enum td_ddir {
        TD_DDIR_RANDWRITE       = TD_DDIR_WRITE | TD_DDIR_RAND,
        TD_DDIR_RANDRW          = TD_DDIR_RW | TD_DDIR_RAND,
        TD_DDIR_RANDTRIM        = TD_DDIR_TRIM | TD_DDIR_RAND,
-       TD_DDIR_WRITETRIM       = TD_DDIR_TRIM | TD_DDIR_WRITE,
+       TD_DDIR_TRIMWRITE       = TD_DDIR_TRIM | TD_DDIR_WRITE,
 };
 
 #define td_read(td)            ((td)->o.td_ddir & TD_DDIR_READ)
@@ -44,8 +44,8 @@ enum td_ddir {
 #define td_rw(td)              (((td)->o.td_ddir & TD_DDIR_RW) == TD_DDIR_RW)
 #define td_random(td)          ((td)->o.td_ddir & TD_DDIR_RAND)
 #define file_randommap(td, f)  (!(td)->o.norandommap && fio_file_axmap((f)))
-#define td_writetrim(td)       (((td)->o.td_ddir & TD_DDIR_WRITETRIM) \
-                                       == TD_DDIR_WRITETRIM)
+#define td_trimwrite(td)       (((td)->o.td_ddir & TD_DDIR_TRIMWRITE) \
+                                       == TD_DDIR_TRIMWRITE)
 
 static inline int ddir_sync(enum fio_ddir ddir)
 {
diff --git a/io_u.c b/io_u.c
index b3e72e9..ebd75c1 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -670,7 +670,7 @@ static void set_rw_ddir(struct thread_data *td, struct io_u *io_u)
 {
        enum fio_ddir ddir = get_rw_ddir(td);
 
-       if (td_writetrim(td)) {
+       if (td_trimwrite(td)) {
                struct fio_file *f = io_u->file;
                if (f->last_pos[DDIR_WRITE] == f->last_pos[DDIR_TRIM])
                        ddir = DDIR_TRIM;
index 095e6fa..017920e 100644 (file)
--- a/options.c
+++ b/options.c
@@ -1420,9 +1420,9 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                            .oval = TD_DDIR_RANDRW,
                            .help = "Random read and write mix"
                          },
-                         { .ival = "writetrim",
-                           .oval = TD_DDIR_WRITETRIM,
-                           .help = "Write and trim mix, trims preceding writes"
+                         { .ival = "trimwrite",
+                           .oval = TD_DDIR_TRIMWRITE,
+                           .help = "Trim and write mix, trims preceding writes"
                          },
                },
        },