dlerror();
dlhandle = dlopen(engine_lib, RTLD_LAZY);
if (!dlhandle) {
- td_vmsg(td, -1, dlerror());
+ td_vmsg(td, -1, dlerror(), "dlopen");
return NULL;
}
*/
ops = dlsym(dlhandle, "ioengine");
if (!ops) {
- td_vmsg(td, -1, dlerror());
+ td_vmsg(td, -1, dlerror(), "dlsym");
dlclose(dlhandle);
return NULL;
}
if (td->io_ops->dlhandle)
dlclose(td->io_ops->dlhandle);
+#if 0
+ /* we can't do this for threads, so just leak it, it's exiting */
free(td->io_ops);
+#endif
td->io_ops = NULL;
}
int td_io_getevents(struct thread_data *td, int min, int max,
struct timespec *t)
{
+ if (min > 0 && td->io_ops->commit) {
+ int r = td->io_ops->commit(td);
+
+ if (r < 0)
+ return r;
+ }
if (td->io_ops->getevents)
return td->io_ops->getevents(td, min, max, t);
ret = td->io_ops->queue(td, io_u);
+ if (ret == FIO_Q_QUEUED) {
+ int r;
+
+ td->io_u_queued++;
+ if (td->io_u_queued > td->iodepth_batch) {
+ r = td_io_commit(td);
+ if (r < 0)
+ return r;
+ }
+ }
+
if ((td->io_ops->flags & FIO_SYNCIO) == 0) {
fio_gettime(&io_u->issue_time, NULL);
int td_io_commit(struct thread_data *td)
{
+ if (!td->cur_depth)
+ return 0;
+
+ td->io_u_queued = 0;
if (td->io_ops->commit)
return td->io_ops->commit(td);