From: Jens Axboe Date: Fri, 30 May 2008 20:07:12 +0000 (+0200) Subject: close_ioengine() clears ->data after calling engine cleanup X-Git-Tag: fio-1.21-rc4~23 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=2992b059b8f54ac91e723a8bde629b4d8fed513e close_ioengine() clears ->data after calling engine cleanup Then we can remove that bit from io engines. Signed-off-by: Jens Axboe --- diff --git a/engines/guasi.c b/engines/guasi.c index b65061e9..a7589dc8 100644 --- a/engines/guasi.c +++ b/engines/guasi.c @@ -213,7 +213,6 @@ static void fio_guasi_cleanup(struct thread_data *td) 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 7e69c236..e6b926c3 100644 --- a/engines/libaio.c +++ b/engines/libaio.c @@ -177,7 +177,6 @@ static void fio_libaio_cleanup(struct thread_data *td) 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 0efd3369..45914776 100644 --- a/engines/net.c +++ b/engines/net.c @@ -426,7 +426,6 @@ static void fio_netio_cleanup(struct thread_data *td) close(nd->pipes[1]); free(nd); - td->io_ops->data = NULL; } } diff --git a/engines/null.c b/engines/null.c index eb805017..f4345503 100644 --- a/engines/null.c +++ b/engines/null.c @@ -83,7 +83,6 @@ static void fio_null_cleanup(struct thread_data *td) 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 ddc75d1c..acd215c2 100644 --- a/engines/posixaio.c +++ b/engines/posixaio.c @@ -184,7 +184,6 @@ static void fio_posixaio_cleanup(struct thread_data *td) if (pd) { free(pd->aio_events); free(pd); - td->io_ops->data = NULL; } } diff --git a/engines/sg.c b/engines/sg.c index cb44fa45..d7c0a6d5 100644 --- a/engines/sg.c +++ b/engines/sg.c @@ -311,8 +311,6 @@ static void fio_sgio_cleanup(struct thread_data *td) free(sd->pfds); free(sd->sgbuf); free(sd); - - td->io_ops->data = NULL; } } diff --git a/engines/splice.c b/engines/splice.c index 5a288b55..2753bfa0 100644 --- a/engines/splice.c +++ b/engines/splice.c @@ -246,7 +246,6 @@ static void fio_spliceio_cleanup(struct thread_data *td) 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 3b96ee1d..4ca04d5e 100644 --- a/engines/sync.c +++ b/engines/sync.c @@ -274,7 +274,6 @@ static void fio_vsyncio_cleanup(struct thread_data *td) 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 0fdf7522..47610a0c 100644 --- a/engines/syslet-rw.c +++ b/engines/syslet-rw.c @@ -222,7 +222,6 @@ static void fio_syslet_cleanup(struct thread_data *td) free(sd->events); free(sd->ring); free(sd); - td->io_ops->data = NULL; } } diff --git a/ioengines.c b/ioengines.c index fb687636..662d55d7 100644 --- a/ioengines.c +++ b/ioengines.c @@ -154,8 +154,10 @@ void close_ioengine(struct thread_data *td) { 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);