[PATCH] Add for_each_td()

Similar to for_each_file(), just iterates over each td we know about.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/fio.h b/fio.h
index eed4950..67c2ec2 100644
--- a/fio.h
+++ b/fio.h
@@ -539,7 +539,9 @@
  */
 #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