Recent changes (master)

Jens Axboe
2017-07-21T12:00:12Z

The following changes since commit 785e49c659023df1735bff195ad4ba133ebd23a7:

build: Sort file list (2017-07-16 14:02:51 -0600)

are available in the git repository at:

git://git.kernel.dk/fio.git master

for you to fetch changes up to 800334db17a22029553488b41a5ede8af909c66d:

Correctly detect whether ioengine_load can exit early (2017-07-19 12:27:57 -0700)

----------------------------------------------------------------
Ben Walker (1):
Correctly detect whether ioengine_load can exit early

init.c | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)

---

Diff of recent changes:

diff --git a/init.c b/init.c
index 9b2b63d..90cc0bc 100644
--- a/init.c
+++ b/init.c
@@ -1000,16 +1000,24 @@ int ioengine_load(struct thread_data *td)
{
const char *engine;

- /*
- * Engine has already been loaded.
- */
- if (td->io_ops)
- return 0;
if (!td->o.ioengine) {
log_err("fio: internal fault, no IO engine specified\n");
return 1;
}

+ if (td->io_ops) {
+ /* An engine is loaded, but the requested ioengine
+ * may have changed.
+ */
+ if (!strcmp(td->io_ops->name, td->o.ioengine)) {
+ /* The right engine is already loaded */
+ return 0;
+ }
+
+ /* Unload the old engine. */
+ free_ioengine(td);
+ }
+
engine = get_engine_name(td->o.ioengine);
td->io_ops = load_ioengine(td, engine);
if (!td->io_ops) {
@@ -2530,7 +2538,6 @@ int parse_cmd_line(int argc, char *argv[], int client_type)
}

if (!ret && !strcmp(opt, "ioengine")) {
- free_ioengine(td);
if (ioengine_load(td)) {
put_job(td);
td = NULL;