summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-10-07 21:23:26 -0600
committerJens Axboe <axboe@kernel.dk>2019-10-07 21:23:26 -0600
commit998baa29f571df9d2e4b626bedd317a2fd28c68a (patch)
treed24101064f71ce15690d1f7a290f035bf219c3fd
parent58d68a0dad21fb8aed34bb987e00b9b7dee65296 (diff)
parent252928cb017bcbf5e56157d15458880624af7e8a (diff)
downloadfio-998baa29f571df9d2e4b626bedd317a2fd28c68a.tar.gz
fio-998baa29f571df9d2e4b626bedd317a2fd28c68a.tar.bz2
Merge branch 'replay-blktrace-fixes' of https://github.com/shimrot/fio
* 'replay-blktrace-fixes' of https://github.com/shimrot/fio: Fix assert error on blktrace replay containing trims
-rw-r--r--blktrace.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/blktrace.c b/blktrace.c
index efe9ce24..8a246613 100644
--- a/blktrace.c
+++ b/blktrace.c
@@ -544,16 +544,19 @@ bool load_blktrace(struct thread_data *td, const char *filename, int need_swap)
!ios[DDIR_SYNC]) {
log_err("fio: found no ios in blktrace data\n");
return false;
- } else if (ios[DDIR_READ] && !ios[DDIR_WRITE]) {
- td->o.td_ddir = TD_DDIR_READ;
- td->o.max_bs[DDIR_READ] = rw_bs[DDIR_READ];
- } else if (!ios[DDIR_READ] && ios[DDIR_WRITE]) {
- td->o.td_ddir = TD_DDIR_WRITE;
- td->o.max_bs[DDIR_WRITE] = rw_bs[DDIR_WRITE];
- } else {
- td->o.td_ddir = TD_DDIR_RW;
+ }
+
+ td->o.td_ddir = 0;
+ if (ios[DDIR_READ]) {
+ td->o.td_ddir |= TD_DDIR_READ;
td->o.max_bs[DDIR_READ] = rw_bs[DDIR_READ];
+ }
+ if (ios[DDIR_WRITE]) {
+ td->o.td_ddir |= TD_DDIR_WRITE;
td->o.max_bs[DDIR_WRITE] = rw_bs[DDIR_WRITE];
+ }
+ if (ios[DDIR_TRIM]) {
+ td->o.td_ddir |= TD_DDIR_TRIM;
td->o.max_bs[DDIR_TRIM] = rw_bs[DDIR_TRIM];
}