Fix O_DIRECT memory alignment
[fio.git] / fio.h
diff --git a/fio.h b/fio.h
index 477b19a437613fda8037b09a77ab705ab25eea5d..b19101c20a4924892610bd78b0f6d645f3b93e9b 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -192,6 +192,7 @@ struct thread_options {
        unsigned int thinktime_spin;
        unsigned int thinktime_blocks;
        unsigned int fsync_blocks;
+       unsigned int fdatasync_blocks;
        unsigned int start_delay;
        unsigned long long timeout;
        unsigned long long ramp_time;
@@ -201,6 +202,7 @@ struct thread_options {
        unsigned long long zone_size;
        unsigned long long zone_skip;
        enum fio_memtype mem_type;
+       unsigned int mem_align;
 
        unsigned int stonewall;
        unsigned int new_group;
@@ -446,7 +448,7 @@ static inline void fio_ro_check(struct thread_data *td, struct io_u *io_u)
 
 #define MAX_JOBS       (1024)
 
-#define td_non_fatal_error(e)  ((e) == -EIO || (e) == EILSEQ)
+#define td_non_fatal_error(e)  ((e) == EIO || (e) == EILSEQ)
 
 static inline void update_error_count(struct thread_data *td, int err)
 {
@@ -654,4 +656,9 @@ static inline int should_check_rate(struct thread_data *td,
        return ret;
 }
 
+static inline int is_power_of_2(unsigned int val)
+{
+       return (val != 0 && ((val & (val - 1)) == 0));
+}
+
 #endif