In multiple places fio needs to check whether it is carrying out overlap
checking in offload submission mode. Make this check a function to
improve code readability.
Reviewed-by: Sebastien Boisvert <sboisvert@gydle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
"perhaps try --debug=io option for details?\n",
td->o.name, td->io_ops->name);
- if (td->o.serialize_overlap && td->o.io_submit_mode == IO_MODE_OFFLOAD)
+ if (td_offload_overlap(td))
pthread_mutex_lock(&overlap_check);
td_set_runstate(td, TD_FINISHING);
- if (td->o.serialize_overlap && td->o.io_submit_mode == IO_MODE_OFFLOAD)
+ if (td_offload_overlap(td))
pthread_mutex_unlock(&overlap_check);
update_rusage_stat(td);
return (td->flags & TD_F_NEED_LOCK) != 0;
}
+static inline bool td_offload_overlap(struct thread_data *td)
+{
+ return td->o.serialize_overlap && td->o.io_submit_mode == IO_MODE_OFFLOAD;
+}
+
/*
* We currently only need to do locking if we have verifier threads
* accessing our internal structures too
assert((io_u->flags & IO_U_F_FLIGHT) == 0);
io_u_set(td, io_u, IO_U_F_FLIGHT);
- if (td->o.serialize_overlap && td->o.io_submit_mode == IO_MODE_OFFLOAD)
+ if (td_offload_overlap(td))
pthread_mutex_unlock(&overlap_check);
assert(fio_file_open(io_u->file));