Explicitly check td_trim(td) for the direction of next io_u
authorTomohiro Kusumi <tkusumi@tuxera.com>
Wed, 15 Feb 2017 20:40:55 +0000 (22:40 +0200)
committerJens Axboe <axboe@fb.com>
Wed, 15 Feb 2017 20:52:24 +0000 (13:52 -0700)
This else case should explicitly check td_trim(td) since there is
a potential unused enum (e.g. DDIR_WAIT only used by iolog for now).

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
io_u.c

diff --git a/io_u.c b/io_u.c
index f1a3916..69bec4b 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -758,8 +758,10 @@ static enum fio_ddir get_rw_ddir(struct thread_data *td)
                ddir = DDIR_READ;
        else if (td_write(td))
                ddir = DDIR_WRITE;
-       else
+       else if (td_trim(td))
                ddir = DDIR_TRIM;
+       else
+               ddir = DDIR_INVAL;
 
        td->rwmix_ddir = rate_ddir(td, ddir);
        return td->rwmix_ddir;