trim: add support for multiple ranges
[fio.git] / fio.h
diff --git a/fio.h b/fio.h
index 1322656fd4497501577804124438f38f55765e93..fc3e3ececa36ef02992f8037faff300f5e4e2892 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)