Merge branch 'atomic-writes'
[fio.git] / fio.h
diff --git a/fio.h b/fio.h
index fc3e3ececa36ef02992f8037faff300f5e4e2892..4bb6cfa7f39e0b1152cd62bbadd03d3e4744f62c 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -258,8 +258,9 @@ struct thread_data {
        size_t orig_buffer_size;
        volatile int runstate;
        volatile bool terminate;
-       bool last_was_sync;
-       enum fio_ddir last_ddir;
+
+       enum fio_ddir last_ddir_completed;
+       enum fio_ddir last_ddir_issued;
 
        int mmapfd;
 
@@ -629,7 +630,7 @@ static inline bool multi_range_trim(struct thread_data *td, struct io_u *io_u)
 
 static inline bool should_fsync(struct thread_data *td)
 {
-       if (td->last_was_sync)
+       if (ddir_sync(td->last_ddir_issued))
                return false;
        if (td_write(td) || td->o.override_sync)
                return true;
@@ -706,8 +707,8 @@ enum {
        TD_NR,
 };
 
-#define TD_ENG_FLAG_SHIFT      18
-#define TD_ENG_FLAG_MASK       ((1ULL << 18) - 1)
+#define TD_ENG_FLAG_SHIFT      (__TD_F_LAST)
+#define TD_ENG_FLAG_MASK       ((1ULL << (__TD_F_LAST)) - 1)
 
 static inline void td_set_ioengine_flags(struct thread_data *td)
 {