filehash: fix init/exit
authorJens Axboe <axboe@fb.com>
Tue, 27 Sep 2016 16:28:29 +0000 (10:28 -0600)
committerJens Axboe <axboe@fb.com>
Tue, 27 Sep 2016 16:28:29 +0000 (10:28 -0600)
We do it too later, move it earlier.

Fixes: 63a26e05622b ("filehash: move to separate allocation")
Signed-off-by: Jens Axboe <axboe@fb.com>
init.c
libfio.c

diff --git a/init.c b/init.c
index 513f754492018792a92eeac0db68ba20138c1dcb..c556fa29ceaf26f90507068f2c9ec9aa37f690ac 100644 (file)
--- a/init.c
+++ b/init.c
@@ -298,7 +298,6 @@ void free_threads_shm(void)
 static void free_shm(void)
 {
        if (threads) {
-               file_hash_exit();
                flow_exit();
                fio_debug_jobp = NULL;
                free_threads_shm();
@@ -311,6 +310,7 @@ static void free_shm(void)
 
        options_free(fio_options, &def_thread.o);
        fio_filelock_exit();
+       file_hash_exit();
        scleanup();
 }
 
@@ -366,7 +366,6 @@ static int setup_thread_area(void)
        fio_debug_jobp = (void *) threads + max_jobs * sizeof(struct thread_data);
        *fio_debug_jobp = -1;
 
-       file_hash_init();
        flow_init();
 
        return 0;
index d88ed4ed2032ecccfad5435b0de10abc42157973..0f9f4e751b7476760049a73e3c5650a5e097ff1d 100644 (file)
--- a/libfio.c
+++ b/libfio.c
@@ -34,6 +34,7 @@
 #include "os/os.h"
 #include "filelock.h"
 #include "helper_thread.h"
+#include "filehash.h"
 
 /*
  * Just expose an empty list, if the OS does not support disk util stats
@@ -376,6 +377,8 @@ int initialize_fio(char *envp[])
                return 1;
        }
 
+       file_hash_init();
+
        /*
         * We need locale for number printing, if it isn't set then just
         * go with the US format.