*/
int ioengine_load(struct thread_data *td)
{
- const char *engine;
-
if (!td->o.ioengine) {
log_err("fio: internal fault, no IO engine specified\n");
return 1;
free_ioengine(td);
}
- /*
- * Use ->ioengine_so_path if an external ioengine is specified.
- */
- engine = td->o.ioengine_so_path ?: td->o.ioengine;
- td->io_ops = load_ioengine(td, engine);
+ td->io_ops = load_ioengine(td);
if (!td->io_ops) {
- log_err("fio: failed to load engine %s\n", engine);
+ log_err("fio: failed to load engine\n");
return 1;
}
return ops;
}
-struct ioengine_ops *load_ioengine(struct thread_data *td, const char *name)
+struct ioengine_ops *load_ioengine(struct thread_data *td)
{
struct ioengine_ops *ops;
char engine[64];
+ char *name;
+
+ name = td->o.ioengine_so_path ?: td->o.ioengine;
dprint(FD_IO, "load ioengine %s\n", name);
memset(&td, 0, sizeof(td));
- io_ops = load_ioengine(&td, engine);
+ td.o.ioengine = (char *)engine;
+ io_ops = load_ioengine(&td);
if (!io_ops) {
log_info("IO engine %s not found\n", engine);
return 1;
extern int td_io_unlink_file(struct thread_data *, struct fio_file *);
extern int __must_check td_io_get_file_size(struct thread_data *, struct fio_file *);
-extern struct ioengine_ops *load_ioengine(struct thread_data *, const char *);
+extern struct ioengine_ops *load_ioengine(struct thread_data *);
extern void register_ioengine(struct ioengine_ops *);
extern void unregister_ioengine(struct ioengine_ops *);
extern void free_ioengine(struct thread_data *);