Merge branch 'jf_readme_typo' of https://github.com/jfpanisset/fio
[fio.git] / engines / windowsaio.c
index 94393931eeb38eb490ad76ab32305fd4b771a433..9868e816adb68b8e196dc42d1832b8869e36fec3 100644 (file)
@@ -106,11 +106,10 @@ static int fio_windowsaio_init(struct thread_data *td)
                        ctx->iocp = hFile;
                        ctx->wd = wd;
                        wd->iothread = CreateThread(NULL, 0, IoCompletionRoutine, ctx, 0, &threadid);
-
-                       if (wd->iothread != NULL)
-                               fio_setaffinity(threadid, td->o.cpumask);
-                       else
+                       if (!wd->iothread)
                                log_err("windowsaio: failed to create io completion thread\n");
+                       else if (fio_option_is_set(&td->o, cpumask))
+                               fio_setaffinity(threadid, td->o.cpumask);
                }
 
                if (rc || wd->iothread == NULL)
@@ -162,15 +161,15 @@ static int windowsaio_invalidate_cache(struct fio_file *f)
        if (ihFile != INVALID_HANDLE_VALUE) {
                if (!CloseHandle(ihFile)) {
                        error = GetLastError();
-                       log_info("windowsaio: invalidation fd close %s "
-                                "failed: error %d\n", f->file_name, error);
+                       log_info("windowsaio: invalidation fd close %s failed: error %lu\n",
+                                f->file_name, error);
                        rc = 1;
                }
        } else {
                error = GetLastError();
                if (error != ERROR_FILE_NOT_FOUND) {
-                       log_info("windowsaio: cache invalidation of %s failed: "
-                                       "error %d\n", f->file_name, error);
+                       log_info("windowsaio: cache invalidation of %s failed: error %lu\n",
+                                f->file_name, error);
                        rc = 1;
                }
        }
@@ -354,7 +353,8 @@ static int fio_windowsaio_getevents(struct thread_data *td, unsigned int min,
        return dequeued;
 }
 
-static int fio_windowsaio_queue(struct thread_data *td, struct io_u *io_u)
+static enum fio_q_status fio_windowsaio_queue(struct thread_data *td,
+                                             struct io_u *io_u)
 {
        struct fio_overlapped *o = io_u->engine_data;
        LPOVERLAPPED lpOvl = &o->o;