X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=log.c;h=7a3327e5d29c2909700ba3413ae1bd903ce1f197;hp=b5c6f690d4572770557462cad1b80201317fb814;hb=67a1000f49db76ddb18ce9420ba03059af0214b9;hpb=429f6675446eec26652b010b0c715d8bb6bc32e1 diff --git a/log.c b/log.c index b5c6f690..7a3327e5 100644 --- a/log.c +++ b/log.c @@ -57,8 +57,7 @@ int read_iolog_get(struct thread_data *td, struct io_u *io_u) { struct io_piece *ipo; -restart: - if (!list_empty(&td->io_log_list)) { + while (!list_empty(&td->io_log_list)) { ipo = list_entry(td->io_log_list.next, struct io_piece, list); list_del(&ipo->list); @@ -71,11 +70,11 @@ restart: if (ipo->file_action == FIO_LOG_OPEN_FILE) { assert(!td_io_open_file(td, f)); free(ipo); - goto restart; + continue; } else if (ipo->file_action == FIO_LOG_CLOSE_FILE) { td_io_close_file(td, f); free(ipo); - goto restart; + continue; } } @@ -92,6 +91,7 @@ restart: return 0; } + td->done = 1; return 1; } @@ -174,9 +174,10 @@ static int read_iolog2(struct thread_data *td, FILE *f) { unsigned long long offset; unsigned int bytes; - int rw, reads, writes, fileno = 0, file_action = 0; /* stupid gcc */ + int reads, writes, fileno = 0, file_action = 0; /* stupid gcc */ char *fname, *act; char *str, *p; + enum fio_ddir rw; free_release_files(td); @@ -247,7 +248,7 @@ static int read_iolog2(struct thread_data *td, FILE *f) INIT_LIST_HEAD(&ipo->list); ipo->offset = offset; ipo->len = bytes; - ipo->ddir = (enum fio_ddir) rw; + ipo->ddir = rw; if (bytes > td->o.max_bs[rw]) td->o.max_bs[rw] = bytes; if (rw == DDIR_INVAL) { @@ -281,7 +282,8 @@ static int read_iolog(struct thread_data *td, FILE *f) unsigned long long offset; unsigned int bytes; char *str, *p; - int rw, reads, writes; + int reads, writes; + enum fio_ddir rw; /* * Read in the read iolog and store it, reuse the infrastructure @@ -310,7 +312,7 @@ static int read_iolog(struct thread_data *td, FILE *f) INIT_LIST_HEAD(&ipo->list); ipo->offset = offset; ipo->len = bytes; - ipo->ddir = (enum fio_ddir) rw; + ipo->ddir = rw; if (bytes > td->o.max_bs[rw]) td->o.max_bs[rw] = bytes; list_add_tail(&ipo->list, &td->io_log_list);