[PATCH] Only the posixaio engine needs to link against -lrt
[fio.git] / fio.h
diff --git a/fio.h b/fio.h
index 4be037e933ce9b490810f3a9be21df6e8fe2043b..eed49503ba1367b57ed413c238fc8412969490cf 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -181,7 +181,6 @@ struct thread_data {
 
        unsigned char sequential;
        unsigned char odirect;
-       unsigned char create_file;
        unsigned char invalidate_cache;
        unsigned char create_serialize;
        unsigned char create_fsync;
@@ -189,6 +188,7 @@ struct thread_data {
        unsigned char sync_io;
        unsigned char verify;
        unsigned char use_thread;
+       unsigned char unlink;
        unsigned char do_disk_util;
        unsigned char override_sync;
        unsigned char rand_repeatable;
@@ -426,10 +426,12 @@ extern int setup_rate(struct thread_data *);
 /*
  * Time functions
  */
+extern void time_init(void);
 extern unsigned long utime_since(struct timeval *, 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);
@@ -445,6 +447,37 @@ extern int init_random_state(struct thread_data *);
  */
 extern void close_files(struct thread_data *);
 extern int setup_files(struct thread_data *);
+extern int 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 get_next_verify(struct thread_data *td, struct io_u *);
+extern int do_io_u_verify(struct thread_data *, struct io_u **);
 
 /*
  * This is a pretty crappy semaphore implementation, but with the use that fio
@@ -507,6 +540,6 @@ extern void close_ioengine(struct thread_data *);
 #define fio_unused     __attribute((__unused__))
 
 #define for_each_file(td, f, i)        \
-       for ((i) = 0, (f) = &(td)->files[0]; (i) < (td)->nr_files; (i)++, (f) = &(td)->files[(i)])
+       for ((i) = 0, (f) = &(td)->files[0]; (i) < (int) (td)->nr_files; (i)++, (f) = &(td)->files[(i)])
 
 #endif