fio: ioengine flag cleanup
[fio.git] / fio.h
diff --git a/fio.h b/fio.h
index 1322656fd4497501577804124438f38f55765e93..7d9927a006551af0bfb6080e06c36844aeb1fce0 100644 (file)
--- a/fio.h
+++ b/fio.h
 
 struct fio_sem;
 
+#define MAX_TRIM_RANGE 256
+
+/*
+ * Range for trim command
+ */
+struct trim_range {
+       unsigned long long start;
+       unsigned long long len;
+};
+
 /*
  * offset generator types
  */
@@ -609,6 +619,14 @@ static inline void fio_ro_check(const struct thread_data *td, struct io_u *io_u)
               !(io_u->ddir == DDIR_TRIM && !td_trim(td)));
 }
 
+static inline bool multi_range_trim(struct thread_data *td, struct io_u *io_u)
+{
+       if (io_u->ddir == DDIR_TRIM && td->o.num_range > 1)
+               return true;
+
+       return false;
+}
+
 static inline bool should_fsync(struct thread_data *td)
 {
        if (td->last_was_sync)
@@ -688,8 +706,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)
 {