X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=engines%2Fwindowsaio.c;h=314eaadf480c485a00f4753b2cd53206b5964211;hp=f5cb04838a31f70dc6cf801239e33df16800f54c;hb=9acb08a9957b1111a06fbca6af113fa0c98dbd7c;hpb=438bb1cf6c722ab2d83cce926bb94890af58c13a diff --git a/engines/windowsaio.c b/engines/windowsaio.c index f5cb0483..314eaadf 100644 --- a/engines/windowsaio.c +++ b/engines/windowsaio.c @@ -35,17 +35,7 @@ struct thread_ctx { struct windowsaio_data *wd; }; -static BOOL timeout_expired(DWORD start_count, DWORD end_count); -static int fio_windowsaio_getevents(struct thread_data *td, unsigned int min, - unsigned int max, const struct timespec *t); -static struct io_u *fio_windowsaio_event(struct thread_data *td, int event); -static int fio_windowsaio_queue(struct thread_data *td, - struct io_u *io_u); -static void fio_windowsaio_cleanup(struct thread_data *td); static DWORD WINAPI IoCompletionRoutine(LPVOID lpParameter); -static int fio_windowsaio_init(struct thread_data *td); -static int fio_windowsaio_open_file(struct thread_data *td, struct fio_file *f); -static int fio_windowsaio_close_file(struct thread_data fio_unused *td, struct fio_file *f); static int fio_windowsaio_init(struct thread_data *td) { @@ -152,7 +142,6 @@ static void fio_windowsaio_cleanup(struct thread_data *td) } } - static int fio_windowsaio_open_file(struct thread_data *td, struct fio_file *f) { int rc = 0; @@ -180,13 +169,26 @@ static int fio_windowsaio_open_file(struct thread_data *td, struct fio_file *f) /* * Inform Windows whether we're going to be doing sequential or - * random io so it can tune the Cache Manager + * random IO so it can tune the Cache Manager */ - if (td->o.td_ddir == TD_DDIR_READ || - td->o.td_ddir == TD_DDIR_WRITE) - flags |= FILE_FLAG_SEQUENTIAL_SCAN; - else + switch (td->o.fadvise_hint) { + case F_ADV_TYPE: + if (td_random(td)) + flags |= FILE_FLAG_RANDOM_ACCESS; + else + flags |= FILE_FLAG_SEQUENTIAL_SCAN; + break; + case F_ADV_RANDOM: flags |= FILE_FLAG_RANDOM_ACCESS; + break; + case F_ADV_SEQUENTIAL: + flags |= FILE_FLAG_SEQUENTIAL_SCAN; + break; + case F_ADV_NONE: + break; + default: + log_err("fio: unknown fadvise type %d\n", td->o.fadvise_hint); + } if (!td_write(td) || read_only) access = GENERIC_READ;