[PATCH] Move timeout structure where it is used
authorJens Axboe <jens.axboe@oracle.com>
Tue, 9 Jan 2007 20:22:18 +0000 (21:22 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 9 Jan 2007 20:22:18 +0000 (21:22 +0100)
Also makes sure that it's always initialized to 0's.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fio.c

diff --git a/fio.c b/fio.c
index e8181a1c317f6a8a7a595100f9beed12126e9e5f..28f6376dfeac917305280324aafa822ff9e9e3f8 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -379,7 +379,6 @@ static void do_io(struct thread_data *td)
        td_set_runstate(td, TD_RUNNING);
 
        while (td->this_io_bytes[td->ddir] < td->io_size) {
-               struct timespec ts = { .tv_sec = 0, .tv_nsec = 0};
                struct timespec *timeout;
                int min_evts = 0;
                struct io_u *io_u;
@@ -407,6 +406,8 @@ static void do_io(struct thread_data *td)
                add_slat_sample(td, io_u->ddir, mtime_since(&io_u->start_time, &io_u->issue_time));
 
                if (td->cur_depth < td->iodepth) {
+                       struct timespec ts = { .tv_sec = 0, .tv_nsec = 0};
+
                        timeout = &ts;
                        min_evts = 0;
                } else {