cleanup ioengine_load() (for the next commit)
authorTomohiro Kusumi <tkusumi@tuxera.com>
Thu, 31 Aug 2017 20:13:06 +0000 (23:13 +0300)
committerJens Axboe <axboe@kernel.dk>
Thu, 31 Aug 2017 20:19:58 +0000 (14:19 -0600)
This commit removes name argument from ioengine_load(), as both
ioengine name and path are self contained in td.
No functional changes.

This makes the next commit's diff more clear by separating non
functional noise.

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
init.c
ioengines.c
ioengines.h

diff --git a/init.c b/init.c
index 2da64ba89e1c0005f15b80a792efddaf0636e510..cf5c646c3319147b1f60d522754eb74f875ccb44 100644 (file)
--- a/init.c
+++ b/init.c
@@ -1023,8 +1023,6 @@ void td_fill_rand_seeds(struct thread_data *td)
  */
 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;
@@ -1043,13 +1041,9 @@ int ioengine_load(struct thread_data *td)
                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;
        }
 
index 919781c4e8e11a78a62c0e4fa189fdc820a30902..54aa5a623aafd42541dd1affdd0498c6014dba80 100644 (file)
@@ -123,10 +123,13 @@ static struct ioengine_ops *dlopen_ioengine(struct thread_data *td,
        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);
 
@@ -573,7 +576,8 @@ int fio_show_ioengine_help(const char *engine)
 
        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;
index f24f4df5389ba691e248cb9598fdad83dcdb4362..177cbc053c33ba8aedf7dbb092d15bdc92b58ccb 100644 (file)
@@ -79,7 +79,7 @@ extern int td_io_close_file(struct thread_data *, struct fio_file *);
 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 *);