sprintf(engine_path, "%s/fio-%s.so", FIO_EXT_ENG_DIR, engine);
+ dprint(FD_IO, "dlopen external %s\n", engine_path);
dlhandle = dlopen(engine_path, RTLD_LAZY);
if (!dlhandle)
log_info("Engine %s not found; Either name is invalid, was not built, or fio-engine-%s package is missing.\n",
!strncmp(engine_lib, "aio", 3))
engine_lib = "libaio";
- dprint(FD_IO, "dload engine %s\n", engine_lib);
+ dprint(FD_IO, "dlopen engine %s\n", engine_lib);
dlerror();
dlhandle = dlopen(engine_lib, RTLD_LAZY);
* so as not to break job files not using the prefix.
*/
ops = __load_ioengine(td->o.ioengine);
- if (!ops)
+
+ /* We do re-dlopen existing handles, for reference counting */
+ if (!ops || ops->dlhandle)
ops = dlopen_ioengine(td, name);
/*
}
if (td->io_ops->dlhandle) {
+ dprint(FD_IO, "dlclose ioengine %s\n", td->io_ops->name);
dlclose(td->io_ops->dlhandle);
- td->io_ops->dlhandle = NULL;
}
td->io_ops = NULL;
if (!td->io_ops->commit) {
io_u_mark_submit(td, 1);
io_u_mark_complete(td, 1);
- zbd_put_io_u(td, io_u);
}
if (ret == FIO_Q_COMPLETED) {
}
td.o.ioengine = (char *)engine;
- io_ops = load_ioengine(&td);
+ td.io_ops = load_ioengine(&td);
- if (!io_ops) {
+ if (!td.io_ops) {
log_info("IO engine %s not found\n", engine);
return 1;
}
- if (io_ops->options)
- ret = show_cmd_help(io_ops->options, sep);
+ if (td.io_ops->options)
+ ret = show_cmd_help(td.io_ops->options, sep);
else
- log_info("IO engine %s has no options\n", io_ops->name);
+ log_info("IO engine %s has no options\n", td.io_ops->name);
free_ioengine(&td);
return ret;