From 165faf16657c17b924a84e5601e17a516c76c135 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 7 Feb 2007 11:30:37 +0100 Subject: [PATCH] [PATCH] Misc fixes - Change the hour/day eta display to be more clever. - Style Signed-off-by: Jens Axboe --- eta.c | 11 +++++------ io_u.c | 6 ++++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/eta.c b/eta.c index 0b022502..fc485985 100644 --- a/eta.c +++ b/eta.c @@ -70,7 +70,7 @@ static void check_str_update(struct thread_data *td) static void eta_to_str(char *str, int eta_sec) { unsigned int d, h, m, s; - static int always_d, always_h; + int disp_hour = 0; d = h = m = s = 0; @@ -82,14 +82,13 @@ static void eta_to_str(char *str, int eta_sec) eta_sec /= 24; d = eta_sec; - if (d || always_d) { - always_d = 1; + if (d) { + disp_hour = 1; str += sprintf(str, "%02ud:", d); } - if (h || always_h) { - always_h = 1; + + if (h || disp_hour) str += sprintf(str, "%02uh:", h); - } str += sprintf(str, "%02um:", m); str += sprintf(str, "%02us", s); diff --git a/io_u.c b/io_u.c index da6fe8f3..ebfa0d45 100644 --- a/io_u.c +++ b/io_u.c @@ -322,8 +322,12 @@ struct io_u *get_io_u(struct thread_data *td, struct fio_file *f) return NULL; } + /* + * Set io data pointers. + */ io_u->xfer_buf = io_u->buf; io_u->xfer_buflen = io_u->buflen; + fio_gettime(&io_u->start_time, NULL); return io_u; } @@ -381,5 +385,3 @@ void ios_completed(struct thread_data *td, struct io_completion_data *icd) put_io_u(td, io_u); } } - - -- 2.25.1