[PATCH] Add for_each_td()
[fio.git] / fio.h
diff --git a/fio.h b/fio.h
index eed49503ba1367b57ed413c238fc8412969490cf..67c2ec2179a9d24113e1e86f09e16d7e086b1539 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -539,7 +539,9 @@ extern void close_ioengine(struct thread_data *);
  */
 #define fio_unused     __attribute((__unused__))
 
+#define for_each_td(td, i)     \
+       for ((i) = 0, (td) = &threads[0]; (i) < (int) thread_number; (i)++, (td)++)
 #define for_each_file(td, f, i)        \
-       for ((i) = 0, (f) = &(td)->files[0]; (i) < (int) (td)->nr_files; (i)++, (f) = &(td)->files[(i)])
+       for ((i) = 0, (f) = &(td)->files[0]; (i) < (int) (td)->nr_files; (i)++, (f)++)
 
 #endif