options: get rid of more .cb option usage we don't need
[fio.git] / init.c
diff --git a/init.c b/init.c
index a04198f3e08c77a02a3d2286c350091106e9b086..742262867a3d51ecd529b033264789ee00c947d0 100644 (file)
--- a/init.c
+++ b/init.c
@@ -40,7 +40,6 @@ struct thread_data *threads = NULL;
 int exitall_on_terminate = 0;
 int terse_output = 0;
 int eta_print;
-unsigned long long mlock_size = 0;
 FILE *f_out = NULL;
 FILE *f_err = NULL;
 char **job_sections = NULL;
@@ -207,7 +206,7 @@ static struct option l_opts[FIO_NR_OPTIONS] = {
        },
 };
 
-static void free_shm(void)
+void free_threads_shm(void)
 {
        struct shmid_ds sbuf;
 
@@ -215,11 +214,19 @@ static void free_shm(void)
                void *tp = threads;
 
                threads = NULL;
+               shmdt(tp);
+               shmctl(shm_id, IPC_RMID, &sbuf);
+               shm_id = -1;
+       }
+}
+
+void free_shm(void)
+{
+       if (threads) {
                file_hash_exit();
                flow_exit();
                fio_debug_jobp = NULL;
-               shmdt(tp);
-               shmctl(shm_id, IPC_RMID, &sbuf);
+               free_threads_shm();
        }
 
        scleanup();
@@ -835,14 +842,14 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num,
        if (setup_rate(td))
                goto err;
 
-       if (td->o.write_lat_log) {
+       if (td->o.lat_log_file) {
                setup_log(&td->lat_log, td->o.log_avg_msec, IO_LOG_TYPE_LAT);
                setup_log(&td->slat_log, td->o.log_avg_msec, IO_LOG_TYPE_SLAT);
                setup_log(&td->clat_log, td->o.log_avg_msec, IO_LOG_TYPE_CLAT);
        }
-       if (td->o.write_bw_log)
+       if (td->o.bw_log_file)
                setup_log(&td->bw_log, td->o.log_avg_msec, IO_LOG_TYPE_BW);
-       if (td->o.write_iops_log)
+       if (td->o.iops_log_file)
                setup_log(&td->iops_log, td->o.log_avg_msec, IO_LOG_TYPE_IOPS);
 
        if (!td->o.name)