From: Jianpeng Ma Date: Mon, 14 May 2018 16:14:01 +0000 (+0800) Subject: This partly revert 97bb54c9606c(add __load_ioengine() to separate ioengine loading... X-Git-Tag: fio-3.7~6^2 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=d04f1d5b342e77333d7225ea9be74b0fa71bb228;ds=sidebyside This partly revert 97bb54c9606c(add __load_ioengine() to separate ioengine loading from td context) In commit 97bb54c9606c, it change load_ioengine to __load_ioengine in func fio_show_ioengine_help. The different between load_ioengine and __load_ioengine is load_ioengine include __load_ioengine and if __load_ioengine failed it will do dlopen_ioengine to find ioengine. For external ioengine, if no dlopen_ioengine it can't find, etc libfio_ceph_objectstore.so in Ceph project. Signed-off-by: Jianpeng Ma --- diff --git a/ioengines.c b/ioengines.c index 6ffd27f1..d579682f 100644 --- a/ioengines.c +++ b/ioengines.c @@ -574,6 +574,7 @@ int td_io_get_file_size(struct thread_data *td, struct fio_file *f) int fio_show_ioengine_help(const char *engine) { struct flist_head *entry; + struct thread_data td; struct ioengine_ops *io_ops; char *sep; int ret = 1; @@ -592,7 +593,10 @@ int fio_show_ioengine_help(const char *engine) sep++; } - io_ops = __load_ioengine(engine); + memset(&td, 0, sizeof(struct thread_data)); + td.o.ioengine = (char *)engine; + io_ops = load_ioengine(&td); + if (!io_ops) { log_info("IO engine %s not found\n", engine); return 1; @@ -603,5 +607,6 @@ int fio_show_ioengine_help(const char *engine) else log_info("IO engine %s has no options\n", io_ops->name); + free_ioengine(&td); return ret; }