From d619275cfad893e37e8c59e5c9e0bc5ca4946b82 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 27 Sep 2016 10:28:29 -0600 Subject: [PATCH] filehash: fix init/exit We do it too later, move it earlier. Fixes: 63a26e05622b ("filehash: move to separate allocation") Signed-off-by: Jens Axboe --- init.c | 3 +-- libfio.c | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/init.c b/init.c index 513f7544..c556fa29 100644 --- 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; diff --git a/libfio.c b/libfio.c index d88ed4ed..0f9f4e75 100644 --- 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. -- 2.25.1