Some weird 4-space tabs in there, clean it up.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
OVERLAPPED o;
struct io_u *io_u;
BOOL io_complete;
OVERLAPPED o;
struct io_u *io_u;
BOOL io_complete;
};
struct windowsaio_data {
};
struct windowsaio_data {
wd = td->io_ops->data;
if (wd != NULL) {
wd = td->io_ops->data;
if (wd != NULL) {
- wd->iothread_running = FALSE;
- WaitForSingleObject(wd->iothread, INFINITE);
+ wd->iothread_running = FALSE;
+ WaitForSingleObject(wd->iothread, INFINITE);
CloseHandle(wd->iothread);
CloseHandle(wd->iocomplete_event);
CloseHandle(wd->iothread);
CloseHandle(wd->iocomplete_event);
- for (i = 0; i < td->o.iodepth; i++) {
+ for (i = 0; i < td->o.iodepth; i++)
CloseHandle(wd->ovls[i].o.hEvent);
CloseHandle(wd->ovls[i].o.hEvent);
free(wd->aio_events);
free(wd->ovls);
free(wd->aio_events);
free(wd->ovls);
/* Only set up the competion port and thread if we're not just
* querying the device size */
/* Only set up the competion port and thread if we're not just
* querying the device size */
- if (!rc && td->io_ops->data != NULL) {
+ if (!rc && td->io_ops->data != NULL) {
- struct windowsaio_data *wd;
- hFile = CreateIoCompletionPort(f->hFile, NULL, 0, 0);
+ struct windowsaio_data *wd;
+ hFile = CreateIoCompletionPort(f->hFile, NULL, 0, 0);
wd->iothread_running = TRUE;
if (!rc) {
wd->iothread_running = TRUE;
if (!rc) {
fov = (struct fio_overlapped*)io_u->engine_data;
if (fov->io_complete) {
fov = (struct fio_overlapped*)io_u->engine_data;
if (fov->io_complete) {
- fov->io_complete = FALSE;
+ fov->io_complete = FALSE;
fov->io_free = TRUE;
wd->aio_events[dequeued] = io_u;
dequeued++;
fov->io_free = TRUE;
wd->aio_events[dequeued] = io_u;
dequeued++;
status = WaitForSingleObject(wd->iocomplete_event, mswait);
if (status != WAIT_OBJECT_0 && dequeued > 0)
break;
status = WaitForSingleObject(wd->iocomplete_event, mswait);
if (status != WAIT_OBJECT_0 && dequeued > 0)
break;
-static int fio_windowsaio_queue(struct thread_data *td,
- struct io_u *io_u)
+static int fio_windowsaio_queue(struct thread_data *td, struct io_u *io_u)
{
LPOVERLAPPED lpOvl = NULL;
struct windowsaio_data *wd;
{
LPOVERLAPPED lpOvl = NULL;
struct windowsaio_data *wd;
io_u->engine_data = &wd->ovls[index];
switch (io_u->ddir) {
io_u->engine_data = &wd->ovls[index];
switch (io_u->ddir) {
success = WriteFile(io_u->file->hFile, io_u->xfer_buf, io_u->xfer_buflen, &iobytes, lpOvl);
break;
case DDIR_READ:
success = WriteFile(io_u->file->hFile, io_u->xfer_buf, io_u->xfer_buflen, &iobytes, lpOvl);
break;
case DDIR_READ:
- if (success || GetLastError() == ERROR_IO_PENDING) {
+ if (success || GetLastError() == ERROR_IO_PENDING)
io_u->error = GetLastError();
io_u->resid = io_u->xfer_buflen;
}
io_u->error = GetLastError();
io_u->resid = io_u->xfer_buflen;
}
io_u->error = ovl->Internal;
}
io_u->error = ovl->Internal;
}
- fov->io_complete = TRUE;
+ fov->io_complete = TRUE;
SetEvent(wd->iocomplete_event);
} while (ctx->wd->iothread_running);
SetEvent(wd->iocomplete_event);
} while (ctx->wd->iothread_running);
/* If we're running on Vista or newer, we can cancel individual IO requests */
if (wd->pCancelIoEx != NULL) {
struct fio_overlapped *ovl = io_u->engine_data;
/* If we're running on Vista or newer, we can cancel individual IO requests */
if (wd->pCancelIoEx != NULL) {
struct fio_overlapped *ovl = io_u->engine_data;
if (!wd->pCancelIoEx(io_u->file->hFile, &ovl->o))
rc = 1;
} else
if (!wd->pCancelIoEx(io_u->file->hFile, &ovl->o))
rc = 1;
} else