Merge branch 'master' of https://github.com/dyniusz/fio
authorJens Axboe <axboe@kernel.dk>
Tue, 3 Oct 2017 17:19:26 +0000 (11:19 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 3 Oct 2017 17:19:26 +0000 (11:19 -0600)
1  2 
file.h
ioengines.c

diff --cc file.h
Simple merge
diff --cc ioengines.c
index 9638d8043753627f60ffc223b8308ca6f61d57af,04fd06ec6bb7f9200c699ac874883614c5fbf5d8..1bfc06f96d12bf15f07e8aded629e8fa9c7cc92d
@@@ -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);