close_ioengine() clears ->data after calling engine cleanup
Then we can remove that bit from io engines.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/engines/guasi.c b/engines/guasi.c
index b65061e..a7589dc 100644
--- a/engines/guasi.c
+++ b/engines/guasi.c
@@ -213,7 +213,6 @@
free(ld->reqs);
free(ld->io_us);
free(ld);
- td->io_ops->data = NULL;
}
GDBG_PRINT(("fio_guasi_cleanup(%p) DONE\n", ld));
}
diff --git a/engines/libaio.c b/engines/libaio.c
index 7e69c23..e6b926c 100644
--- a/engines/libaio.c
+++ b/engines/libaio.c
@@ -177,7 +177,6 @@
free(ld->iocbs);
free(ld->io_us);
free(ld);
- td->io_ops->data = NULL;
}
}
diff --git a/engines/net.c b/engines/net.c
index 0efd336..4591477 100644
--- a/engines/net.c
+++ b/engines/net.c
@@ -426,7 +426,6 @@
close(nd->pipes[1]);
free(nd);
- td->io_ops->data = NULL;
}
}
diff --git a/engines/null.c b/engines/null.c
index eb80501..f434550 100644
--- a/engines/null.c
+++ b/engines/null.c
@@ -83,7 +83,6 @@
if (nd->io_us)
free(nd->io_us);
free(nd);
- td->io_ops->data = NULL;
}
}
diff --git a/engines/posixaio.c b/engines/posixaio.c
index ddc75d1..acd215c 100644
--- a/engines/posixaio.c
+++ b/engines/posixaio.c
@@ -184,7 +184,6 @@
if (pd) {
free(pd->aio_events);
free(pd);
- td->io_ops->data = NULL;
}
}
diff --git a/engines/sg.c b/engines/sg.c
index cb44fa4..d7c0a6d 100644
--- a/engines/sg.c
+++ b/engines/sg.c
@@ -311,8 +311,6 @@
free(sd->pfds);
free(sd->sgbuf);
free(sd);
-
- td->io_ops->data = NULL;
}
}
diff --git a/engines/splice.c b/engines/splice.c
index 5a288b5..2753bfa 100644
--- a/engines/splice.c
+++ b/engines/splice.c
@@ -246,7 +246,6 @@
close(sd->pipe[0]);
close(sd->pipe[1]);
free(sd);
- td->io_ops->data = NULL;
}
}
diff --git a/engines/sync.c b/engines/sync.c
index 3b96ee1..4ca04d5 100644
--- a/engines/sync.c
+++ b/engines/sync.c
@@ -274,7 +274,6 @@
free(sd->iovecs);
free(sd->io_us);
free(sd);
- td->io_ops->data = NULL;
}
static struct ioengine_ops ioengine_rw = {
diff --git a/engines/syslet-rw.c b/engines/syslet-rw.c
index 0fdf752..47610a0 100644
--- a/engines/syslet-rw.c
+++ b/engines/syslet-rw.c
@@ -222,7 +222,6 @@
free(sd->events);
free(sd->ring);
free(sd);
- td->io_ops->data = NULL;
}
}
diff --git a/ioengines.c b/ioengines.c
index fb68763..662d55d 100644
--- a/ioengines.c
+++ b/ioengines.c
@@ -154,8 +154,10 @@
{
dprint(FD_IO, "close ioengine %s\n", td->io_ops->name);
- if (td->io_ops->cleanup)
+ if (td->io_ops->cleanup) {
td->io_ops->cleanup(td);
+ td->io_ops->data = NULL;
+ }
if (td->io_ops->dlhandle)
dlclose(td->io_ops->dlhandle);