summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2007-01-09 21:22:18 +0100
committerJens Axboe <jens.axboe@oracle.com>2007-01-09 21:22:18 +0100
commit8d7ad8d9d737982f7967f91f00ba9a56402fc60b (patch)
tree81a23c242131ecaeeb874fa8f80e7edcb54742f9
parent29fc6afe1bfcb97dd7f33d8e58b99b2d93237d47 (diff)
downloadfio-8d7ad8d9d737982f7967f91f00ba9a56402fc60b.tar.gz
[PATCH] Move timeout structure where it is used
Also makes sure that it's always initialized to 0's. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r--fio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fio.c b/fio.c
index e8181a1c..28f6376d 100644
--- 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 {