Add pread/pwrite support to sync engine
[fio.git] / fio.h
diff --git a/fio.h b/fio.h
index fe314bfde1eebd1e18ed6178103ce33ec9ff5f3d..0d57b608c3a29d49f0c8e8008b5c78388a73d110 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -13,6 +13,7 @@
 #include <string.h>
 #include <getopt.h>
 #include <inttypes.h>
+#include <assert.h>
 
 #include "compiler/compiler.h"
 #include "list.h"
@@ -175,11 +176,6 @@ struct io_u {
         * Callback for io completion
         */
        int (*end_io)(struct thread_data *, struct io_u *);
-
-       /*
-        * Called when io_u is about to be freed
-        */
-       void (*unmap)(struct thread_data *, struct io_u *);
 };
 
 /*
@@ -375,6 +371,7 @@ struct thread_stat {
        unsigned long usr_time;
        unsigned long sys_time;
        unsigned long ctx;
+       unsigned long minf, majf;
 
        /*
         * IO depth and latency stats
@@ -632,6 +629,15 @@ enum {
        FIO_FSERVICE_RR         = 2,
 };
 
+/*
+ * when should interactive ETA output be generated
+ */
+enum {
+       FIO_ETA_AUTO,
+       FIO_ETA_ALWAYS,
+       FIO_ETA_NEVER,
+};
+
 /*
  * 30 second per-io_u timeout, with 5 second intervals to avoid resetting
  * the timer on each queue operation.
@@ -665,6 +671,8 @@ extern FILE *f_err;
 extern int temp_stall_ts;
 extern unsigned long long mlock_size;
 extern unsigned long page_mask, page_size;
+extern int read_only;
+extern int eta_print;
 
 extern struct thread_data *threads;
 
@@ -673,6 +681,11 @@ extern struct thread_data *threads;
 #define td_rw(td)              (((td)->o.td_ddir & TD_DDIR_RW) == TD_DDIR_RW)
 #define td_random(td)          ((td)->o.td_ddir & TD_DDIR_RAND)
 
+static inline void fio_ro_check(struct thread_data *td, struct io_u *io_u)
+{
+       assert(!(io_u->ddir == DDIR_WRITE && !td_write(td)));
+}
+
 #define BLOCKS_PER_MAP         (8 * sizeof(long))
 #define TO_MAP_BLOCK(td, f, b) ((b) - ((f)->file_offset / (td)->o.rw_min_bs))
 #define RAND_MAP_IDX(td, f, b) (TO_MAP_BLOCK(td, f, b) / BLOCKS_PER_MAP)