Track io_u state (free or in-flight)
[fio.git] / fio.h
diff --git a/fio.h b/fio.h
index e6931619f64373abd06c9792d227d3549baef851..c168fe708bcb3e49a9dda7762a94975881159dc7 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -76,6 +76,11 @@ struct syslet_req {
 };
 #endif
 
+enum {
+       IO_U_F_FREE     = 1 << 0,
+       IO_U_F_FLIGHT   = 1 << 1,
+};
+
 /*
  * The io unit
  */
@@ -124,6 +129,8 @@ struct io_u {
                unsigned int seen;
        };
 
+       unsigned int flags;
+
        struct fio_file *file;
 
        struct list_head list;
@@ -425,6 +432,8 @@ struct thread_data {
 
 #define __td_verror(td, err, msg)                                      \
        do {                                                            \
+               if ((td)->error)                                        \
+                       break;                                          \
                int e = (err);                                          \
                (td)->error = e;                                        \
                snprintf(td->verror, sizeof(td->verror) - 1, "file:%s:%d, error=%s", __FILE__, __LINE__, (msg));        \
@@ -515,9 +524,9 @@ typedef int (endio_handler)(struct io_u *);
 /*
  * Log exports
  */
-extern int read_iolog_get(struct thread_data *, struct io_u *);
+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 init_iolog(struct thread_data *td);
+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 *);
@@ -559,8 +568,8 @@ extern void fio_gettime(struct timeval *, void *);
 /*
  * Init functions
  */
-extern int parse_options(int, char **);
-extern int init_random_state(struct thread_data *);
+extern int __must_check parse_options(int, char **);
+extern int __must_check init_random_state(struct thread_data *);
 
 /*
  * File setup/shutdown