projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of https://github.com/bvanassche/fio
[fio.git]
/
ioengines.c
diff --git
a/ioengines.c
b/ioengines.c
index d08a511a0635eccc090528dfa2ff242fd5719209..e2316ee4e391d0d5899c960552fec4d19aa33ca2 100644
(file)
--- a/
ioengines.c
+++ b/
ioengines.c
@@
-24,6
+24,13
@@
static FLIST_HEAD(engine_list);
static FLIST_HEAD(engine_list);
+static inline bool async_ioengine_sync_trim(struct thread_data *td,
+ struct io_u *io_u)
+{
+ return td_ioengine_flagged(td, FIO_ASYNCIO_SYNC_TRIM) &&
+ io_u->ddir == DDIR_TRIM;
+}
+
static bool check_engine_ops(struct thread_data *td, struct ioengine_ops *ops)
{
if (ops->version != FIO_IOOPS_VERSION) {
static bool check_engine_ops(struct thread_data *td, struct ioengine_ops *ops)
{
if (ops->version != FIO_IOOPS_VERSION) {
@@
-223,6
+230,8
@@
struct ioengine_ops *load_ioengine(struct thread_data *td)
*/
void free_ioengine(struct thread_data *td)
{
*/
void free_ioengine(struct thread_data *td)
{
+ assert(td != NULL && td->io_ops != NULL);
+
dprint(FD_IO, "free ioengine %s\n", td->io_ops->name);
if (td->eo && td->io_ops->options) {
dprint(FD_IO, "free ioengine %s\n", td->io_ops->name);
if (td->eo && td->io_ops->options) {
@@
-348,17
+357,17
@@
enum fio_q_status td_io_queue(struct thread_data *td, struct io_u *io_u)
io_u->resid = 0;
if (td_ioengine_flagged(td, FIO_SYNCIO) ||
io_u->resid = 0;
if (td_ioengine_flagged(td, FIO_SYNCIO) ||
- (td_ioengine_flagged(td, FIO_ASYNCIO_SYNC_TRIM) &&
- io_u->ddir == DDIR_TRIM)) {
- if (fio_fill_issue_time(td))
+ async_ioengine_sync_trim(td, io_u)) {
+ if (fio_fill_issue_time(td)) {
fio_gettime(&io_u->issue_time, NULL);
fio_gettime(&io_u->issue_time, NULL);
- /*
- * only used for iolog
- */
- if (td->o.read_iolog_file)
- memcpy(&td->last_issue, &io_u->issue_time,
- sizeof(io_u->issue_time));
+ /*
+ * only used for iolog
+ */
+ if (td->o.read_iolog_file)
+ memcpy(&td->last_issue, &io_u->issue_time,
+ sizeof(io_u->issue_time));
+ }
}
}
@@
-433,17
+442,18
@@
enum fio_q_status td_io_queue(struct thread_data *td, struct io_u *io_u)
}
if (!td_ioengine_flagged(td, FIO_SYNCIO) &&
}
if (!td_ioengine_flagged(td, FIO_SYNCIO) &&
- (!td_ioengine_flagged(td, FIO_ASYNCIO_SYNC_TRIM) ||
- io_u->ddir != DDIR_TRIM)) {
- if (fio_fill_issue_time(td))
+ !async_ioengine_sync_trim(td, io_u)) {
+ if (fio_fill_issue_time(td) &&
+ !td_ioengine_flagged(td, FIO_ASYNCIO_SETS_ISSUE_TIME)) {
fio_gettime(&io_u->issue_time, NULL);
fio_gettime(&io_u->issue_time, NULL);
- /*
- * only used for iolog
- */
- if (td->o.read_iolog_file)
- memcpy(&td->last_issue, &io_u->issue_time,
- sizeof(io_u->issue_time));
+ /*
+ * only used for iolog
+ */
+ if (td->o.read_iolog_file)
+ memcpy(&td->last_issue, &io_u->issue_time,
+ sizeof(io_u->issue_time));
+ }
}
return ret;
}
return ret;