2 * The io parts of the fio tool, includes workers for sync and mmap'ed
3 * io, as well as both posix and linux libaio support.
5 * sync io is implemented on top of aio.
7 * This is not really specific to fio, if the get_io_u/put_io_u and
8 * structures was pulled into this as well it would be a perfectly
9 * generic io engine that could be used for other projects.
20 struct ioengine_ops *load_ioengine(struct thread_data *td, char *name)
22 char engine[16], engine_lib[256];
23 struct ioengine_ops *ops;
29 * linux libaio has alias names, so convert to what we want
31 if (!strncmp(engine, "linuxaio", 8) || !strncmp(engine, "aio", 3))
32 strcpy(engine, "libaio");
34 sprintf(engine_lib, "/usr/local/lib/fio/fio-engine-%s.o", engine);
36 dlhandle = dlopen(engine_lib, RTLD_LAZY);
38 printf("bla: %s\n", dlerror());
40 ops = dlsym(dlhandle, "ioengine");
42 printf("get ops failed\n");
44 ops->dlhandle = dlhandle;
48 void close_ioengine(struct thread_data *td)
50 if (td->io_ops->cleanup)
51 td->io_ops->cleanup(td);
53 dlclose(td->io_ops->dlhandle);