From: Jens Axboe Date: Tue, 3 Oct 2017 17:19:26 +0000 (-0600) Subject: Merge branch 'master' of https://github.com/dyniusz/fio X-Git-Tag: fio-3.2~64 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=e6fe02651641fc64d2fa4fcfe9b1013b2947d11b Merge branch 'master' of https://github.com/dyniusz/fio --- e6fe02651641fc64d2fa4fcfe9b1013b2947d11b diff --cc ioengines.c index 9638d804,04fd06ec..1bfc06f9 --- a/ioengines.c +++ b/ioengines.c @@@ -133,33 -136,12 +133,35 @@@ static struct ioengine_ops *__load_ioen /* * linux libaio has alias names, so convert to what we want */ - if (!strncmp(engine, "linuxaio", 8) || !strncmp(engine, "aio", 3)) + if (!strncmp(engine, "linuxaio", 8) || !strncmp(engine, "aio", 3)) { + dprint(FD_IO, "converting ioengine name: %s -> libaio\n", name); strcpy(engine, "libaio"); + } - ops = find_ioengine(engine); + dprint(FD_IO, "load ioengine %s\n", engine); + return find_ioengine(engine); +} + +struct ioengine_ops *load_ioengine(struct thread_data *td) +{ + struct ioengine_ops *ops = NULL; + const char *name; + + /* + * Use ->ioengine_so_path if an external ioengine path is specified. + * In this case, ->ioengine is "external" which also means the prefix + * for external ioengines "external:" is properly used. + */ + name = td->o.ioengine_so_path ?: td->o.ioengine; + + /* + * Try to load ->ioengine first, and if failed try to dlopen(3) either + * ->ioengine or ->ioengine_so_path. This is redundant for an external + * ioengine with prefix, and also leaves the possibility of unexpected + * behavior (e.g. if the "external" ioengine exists), but we do this + * so as not to break job files not using the prefix. + */ + ops = __load_ioengine(td->o.ioengine); if (!ops) ops = dlopen_ioengine(td, name);