X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=ioengines.c;h=40fa75c382b4f99ff4a265f58a24e403b804a929;hp=7e5a50cc81ba328875b605a55f1fde8c16122cec;hb=36833fb04b5f9a734e96a571dfb52fc54b5b95e7;hpb=d9ed3e63e5280899e2e0bc7e55124c2a1acb30ca diff --git a/ioengines.c b/ioengines.c index 7e5a50cc..40fa75c3 100644 --- a/ioengines.c +++ b/ioengines.c @@ -125,8 +125,7 @@ static struct ioengine_ops *__load_ioengine(const char *name) { char engine[64]; - engine[sizeof(engine) - 1] = '\0'; - strncpy(engine, name, sizeof(engine) - 1); + snprintf(engine, sizeof(engine), "%s", name); /* * linux libaio has alias names, so convert to what we want @@ -308,7 +307,9 @@ enum fio_q_status td_io_queue(struct thread_data *td, struct io_u *io_u) io_u->error = 0; io_u->resid = 0; - 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)) fio_gettime(&io_u->issue_time, NULL); @@ -389,7 +390,9 @@ enum fio_q_status td_io_queue(struct thread_data *td, struct io_u *io_u) td_io_commit(td); } - 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)) fio_gettime(&io_u->issue_time, NULL);