fio: fix some struct alignment issues
[fio.git] / fio.h
diff --git a/fio.h b/fio.h
index 6b2b669d3ccc93ac4aafadb8b59da91c537d6102..ed631bc70ab0c490c98d3e5432b6eebc109139dc 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -149,7 +149,7 @@ struct thread_data {
        unsigned int thread_number;
        unsigned int subjob_number;
        unsigned int groupid;
-       struct thread_stat ts;
+       struct thread_stat ts __attribute__ ((aligned));
 
        int client_type;
 
@@ -596,7 +596,8 @@ static inline enum fio_ioengine_flags td_ioengine_flags(struct thread_data *td)
 
 static inline void td_set_ioengine_flags(struct thread_data *td)
 {
-       td->flags |= (td->io_ops->flags << TD_ENG_FLAG_SHIFT);
+       td->flags = (~(TD_ENG_FLAG_MASK << TD_ENG_FLAG_SHIFT) & td->flags) |
+                   (td->io_ops->flags << TD_ENG_FLAG_SHIFT);
 }
 
 static inline bool td_ioengine_flagged(struct thread_data *td,