+#define DISK_UTIL_MSEC (250)
+
+#ifndef min
+#define min(a, b) ((a) < (b) ? (a) : (b))
+#endif
+#ifndef max
+#define max(a, b) ((a) > (b) ? (a) : (b))
+#endif
+
+/*
+ * Log exports
+ */
+extern int __must_check read_iolog_get(struct thread_data *, struct io_u *);
+extern void write_iolog_put(struct thread_data *, struct io_u *);
+extern int __must_check init_iolog(struct thread_data *td);
+extern void log_io_piece(struct thread_data *, struct io_u *);
+extern void prune_io_piece_log(struct thread_data *);
+extern void write_iolog_close(struct thread_data *);
+
+/*
+ * Logging
+ */
+extern void add_clat_sample(struct thread_data *, enum fio_ddir, unsigned long);
+extern void add_slat_sample(struct thread_data *, enum fio_ddir, unsigned long);
+extern void add_bw_sample(struct thread_data *, enum fio_ddir, struct timeval *);
+extern void show_run_stats(void);
+extern void init_disk_util(struct thread_data *);
+extern void update_rusage_stat(struct thread_data *);
+extern void update_io_ticks(void);
+extern void disk_util_timer_arm(void);
+extern void setup_log(struct io_log **);
+extern void finish_log(struct thread_data *, struct io_log *, const char *);
+extern void __finish_log(struct io_log *, const char *);
+extern int setup_rate(struct thread_data *);
+extern struct io_log *agg_io_log[2];
+extern int write_bw_log;
+extern void add_agg_sample(unsigned long, enum fio_ddir);
+
+/*
+ * Time functions
+ */
+extern unsigned long utime_since(struct timeval *, struct timeval *);
+extern unsigned long utime_since_now(struct timeval *);
+extern unsigned long mtime_since(struct timeval *, struct timeval *);
+extern unsigned long mtime_since_now(struct timeval *);
+extern unsigned long time_since_now(struct timeval *);
+extern unsigned long mtime_since_genesis(void);
+extern void __usec_sleep(unsigned int);
+extern void usec_sleep(struct thread_data *, unsigned long);
+extern void rate_throttle(struct thread_data *, unsigned long, unsigned int);
+extern void fill_start_time(struct timeval *);
+extern void fio_gettime(struct timeval *, void *);
+extern void set_genesis_time(void);
+
+/*
+ * Init functions
+ */
+extern int __must_check parse_options(int, char **);
+extern int __must_check init_random_state(struct thread_data *);
+
+/*
+ * File setup/shutdown
+ */
+extern void close_files(struct thread_data *);
+extern int __must_check setup_files(struct thread_data *);
+extern int __must_check open_files(struct thread_data *);
+extern int open_file(struct thread_data *, struct fio_file *, int, int);
+extern void close_file(struct thread_data *, struct fio_file *);
+extern int __must_check file_invalidate_cache(struct thread_data *, struct fio_file *);
+
+/*
+ * ETA/status stuff
+ */
+extern void print_thread_status(void);
+extern void print_status_init(int);
+
+/*
+ * Thread life cycle. Once a thread has a runstate beyond TD_INITIALIZED, it
+ * will never back again. It may cycle between running/verififying/fsyncing.
+ * Once the thread reaches TD_EXITED, it is just waiting for the core to
+ * reap it.
+ */
+enum {
+ TD_NOT_CREATED = 0,
+ TD_CREATED,
+ TD_INITIALIZED,
+ TD_RUNNING,
+ TD_VERIFYING,
+ TD_FSYNCING,
+ TD_EXITED,
+ TD_REAPED,
+};
+
+/*
+ * Verify helpers
+ */
+extern void populate_verify_io_u(struct thread_data *, struct io_u *);
+extern int __must_check get_next_verify(struct thread_data *td, struct io_u *);
+extern int __must_check verify_io_u(struct io_u *);