int main(int argc, char *argv[], char *envp[])
{
+ int ret = 1;
+
if (initialize_fio(envp))
return 1;
#endif
if (parse_options(argc, argv))
- return 1;
+ goto done;
fio_time_init();
set_genesis_time();
if (fio_start_all_clients())
- return 1;
- return fio_handle_clients(&fio_client_ops);
+ goto done;
+ ret = fio_handle_clients(&fio_client_ops);
} else
- return fio_backend();
+ ret = fio_backend();
+
+done:
+ deinitialize_fio();
+ return ret;
}
extern void clear_io_state(struct thread_data *);
extern int fio_options_parse(struct thread_data *, char **, int, int);
extern void fio_keywords_init(void);
+extern void fio_keywords_exit(void);
extern int fio_cmd_option_parse(struct thread_data *, const char *, char *);
extern int fio_cmd_ioengine_option_parse(struct thread_data *, const char *, char *);
extern void fio_fill_default_options(struct thread_data *);
extern uintptr_t page_mask;
extern uintptr_t page_size;
extern int initialize_fio(char *envp[]);
+extern void deinitialize_fio(void);
#define FIO_GETOPT_JOB 0x89000000
#define FIO_GETOPT_IOENGINE 0x98000000
},
};
+void fio_keywords_exit(void)
+{
+ struct fio_keyword *kw;
+
+ kw = &fio_keywords[0];
+ while (kw->word) {
+ free(kw->replace);
+ kw->replace = NULL;
+ kw++;
+ }
+}
+
void fio_keywords_init(void)
{
unsigned long long mb_memory;