blktrace: use for_each_file() instead of open coding the loop
authorJens Axboe <axboe@kernel.dk>
Mon, 11 Jun 2012 06:58:42 +0000 (08:58 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 11 Jun 2012 06:58:42 +0000 (08:58 +0200)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
blktrace.c

index e195f7f..dea1be4 100644 (file)
@@ -418,10 +418,8 @@ int load_blktrace(struct thread_data *td, const char *filename)
                }
        } while (1);
 
-       for (i = 0; i < td->files_index; i++) {
-               f= td->files[i];
+       for_each_file(td, f, i)
                trace_add_open_close_event(td, f->fileno, FIO_LOG_CLOSE_FILE);
-       }
 
        fifo_free(fifo);
        close(fd);