close_ioengine() clears ->data after calling engine cleanup
authorJens Axboe <jens.axboe@oracle.com>
Fri, 30 May 2008 20:07:12 +0000 (22:07 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Fri, 30 May 2008 20:07:12 +0000 (22:07 +0200)
Then we can remove that bit from io engines.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
engines/guasi.c
engines/libaio.c
engines/net.c
engines/null.c
engines/posixaio.c
engines/sg.c
engines/splice.c
engines/sync.c
engines/syslet-rw.c
ioengines.c

index b65061e92a4c27e9f07071888f95ddc6bda9b7c0..a7589dc8a9a0743971417f09dad7d8055f1bd0a7 100644 (file)
@@ -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));
 }
index 7e69c2368154543a55dd4fd1020e19a3b74a0c10..e6b926c35a53aa9ccf7e6e31e8d66c982fbaebb0 100644 (file)
@@ -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;
        }
 }
 
index 0efd3369ab3ae6b9caf4f327682a9d30ffcb71bd..45914776d0b9c47a4d5110d7c575c7f4f4ddf2c7 100644 (file)
@@ -426,7 +426,6 @@ static void fio_netio_cleanup(struct thread_data *td)
                        close(nd->pipes[1]);
 
                free(nd);
-               td->io_ops->data = NULL;
        }
 }
 
index eb805017457721808fc105a80db2bc264cc20eaa..f434550300e7a3d454c7561b808d1cfe24372f1c 100644 (file)
@@ -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;
        }
 }
 
index ddc75d1cfe54802c8c0ac09349930ed852e5a52a..acd215c2f9f01a27bce0fa2b4f3a0ea7a438e8d7 100644 (file)
@@ -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;
        }
 }
 
index cb44fa457700e34c5299921cf56becfcb01f3126..d7c0a6d5dc9a69a9774fb667ddcfcf6e1edccdcc 100644 (file)
@@ -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;
        }
 }
 
index 5a288b5532c013d7e3cb8d58a6c131b76c488d82..2753bfa0ca3b9d154f418c1c3260b0f492fc6e04 100644 (file)
@@ -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;
        }
 }
 
index 3b96ee1d4ba682949d3067a795b81f7728db0853..4ca04d5e9cbfad9c52f7c322920fc6dedde345c2 100644 (file)
@@ -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 = {
index 0fdf75227295540de9defc4976a8b2a84dfb8957..47610a0cb515e02b02b7350549824a58003ef640 100644 (file)
@@ -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;
        }
 }
 
index fb6876366904378e5ee3b3dadf5463958e120552..662d55d7cf9d1087750a209fee471de0203dc532 100644 (file)
@@ -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);