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 da7529fc93f2767ff8a13d3088feb425ca63052b..60eab243caadf8c473166c0d56816adb5ffbc397 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
                        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,
 
                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 e8599eef0edffaf3dd1fe9cbee29ab588659f0db..25479b49c9c9f1a82b7d39bec3cb11d5a816327b 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;
 
           (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 */
         * 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)) ||
                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 2f72ab5fcb38ab91308a6d76e7e3bac15f35bad9..81bcf061d4768808559d65f77ce60b62d969fc9b 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 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
 .RE
 .P
 For mixed I/O, the default split is 50/50. For certain types of io the result
index b0d79ff7e14bf03ffccf7d8ee2b651e880ccf394..e5eff687d95d1b6ed91788804d14c32b5d67893f 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_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)
 };
 
 #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_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)
 {
 
 static inline int ddir_sync(enum fio_ddir ddir)
 {
diff --git a/io_u.c b/io_u.c
index b3e72e9d8969768b446335c1da647c2e6189c897..ebd75c1b6ebba517e617e004290713610b6f0608 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);
 
 {
        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;
                struct fio_file *f = io_u->file;
                if (f->last_pos[DDIR_WRITE] == f->last_pos[DDIR_TRIM])
                        ddir = DDIR_TRIM;
index 095e6fa16bd56e663a10e68b895192488a401a78..017920e14031357e9ae2aae6dca977b64ced62fc 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"
                          },
                            .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"
                          },
                },
        },
                          },
                },
        },