X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=ioengines.c;h=8cdabe6f2551dd5217d1927f46a0836b8ac8a053;hp=feb986a844bba2342c5844094bacc89f6ed26821;hb=bb446c117849b39ece795602774c3716eef6064a;hpb=a61eddecca21d19f3f4c297400d6c5d93dc29259 diff --git a/ioengines.c b/ioengines.c index feb986a8..8cdabe6f 100644 --- a/ioengines.c +++ b/ioengines.c @@ -279,7 +279,7 @@ int td_io_open_file(struct thread_data *td, struct fio_file *f) f->last_free_lookup = 0; f->last_completed_pos = 0; - f->last_pos = 0; + f->last_pos = f->file_offset; f->flags |= FIO_FILE_OPEN; f->flags &= ~FIO_FILE_CLOSING; @@ -309,6 +309,7 @@ int td_io_open_file(struct thread_data *td, struct fio_file *f) memset(f->file_map, 0, f->num_maps * sizeof(long)); done: + log_file(td, f, FIO_LOG_OPEN_FILE); td->nr_open_files++; get_file(f); return 0; @@ -320,6 +321,9 @@ err: void td_io_close_file(struct thread_data *td, struct fio_file *f) { + if (!(f->flags & FIO_FILE_CLOSING)) + log_file(td, f, FIO_LOG_CLOSE_FILE); + /* * mark as closing, do real close when last io on it has completed */