]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/DiskIO/AIO/aio_win32.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / DiskIO / AIO / aio_win32.cc
index 6f31515bef5af8c18b977b330017cb183232c575..606d2473da3fe8a27b9dc1c32ee12df2fa122eaf 100644 (file)
@@ -1,7 +1,5 @@
 
 /*
- * $Id$
- *
  * DEBUG: section 81    aio_xxx() POSIX emulation on Windows
  * AUTHOR: Guido Serassio <serassio@squid-cache.org>
  *
 
 #include "squid.h"
 #include "comm.h"
-#include "aio_win32.h"
+#include "DiskIO/AIO/aio_win32.h"
+#include "fd.h"
+#include "StatCounters.h"
+#include "win32.h"
+
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
 
 #if _SQUID_WINDOWS_
 VOID CALLBACK IoCompletionRoutine(DWORD dwErrorCode,
@@ -50,7 +55,6 @@ VOID CALLBACK IoCompletionRoutine(DWORD dwErrorCode,
     xfree(lpOverlapped);
 }
 
-
 int aio_read(struct aiocb *aiocbp)
 {
     LPOVERLAPPED Overlapped;
@@ -100,7 +104,7 @@ int aio_read(struct aiocb *aiocbp)
     /* Test to see if the I/O was queued successfully. */
     if (!IoOperationStatus) {
         errno = GetLastError();
-        debugs(81,1, "aio_read: GetLastError=" << errno  );
+        debugs(81, DBG_IMPORTANT, "aio_read: GetLastError=" << errno  );
         return -1;
     }
 
@@ -110,7 +114,6 @@ int aio_read(struct aiocb *aiocbp)
     return 0;
 }
 
-
 int aio_read64(struct aiocb64 *aiocbp)
 {
     LPOVERLAPPED Overlapped;
@@ -152,7 +155,7 @@ int aio_read64(struct aiocb64 *aiocbp)
     /* Test to see if the I/O was queued successfully. */
     if (!IoOperationStatus) {
         errno = GetLastError();
-        debugs(81, 1, "aio_read: GetLastError=" << errno  );
+        debugs(81, DBG_IMPORTANT, "aio_read: GetLastError=" << errno  );
         return -1;
     }
 
@@ -162,7 +165,6 @@ int aio_read64(struct aiocb64 *aiocbp)
     return 0;
 }
 
-
 int aio_write(struct aiocb *aiocbp)
 {
     LPOVERLAPPED Overlapped;
@@ -212,7 +214,7 @@ int aio_write(struct aiocb *aiocbp)
     /* Test to see if the I/O was queued successfully. */
     if (!IoOperationStatus) {
         errno = GetLastError();
-        debugs(81, 1, "aio_write: GetLastError=" << errno  );
+        debugs(81, DBG_IMPORTANT, "aio_write: GetLastError=" << errno  );
         return -1;
     }
 
@@ -222,7 +224,6 @@ int aio_write(struct aiocb *aiocbp)
     return 0;
 }
 
-
 int aio_write64(struct aiocb64 *aiocbp)
 {
     LPOVERLAPPED Overlapped;
@@ -264,7 +265,7 @@ int aio_write64(struct aiocb64 *aiocbp)
     /* Test to see if the I/O was queued successfully. */
     if (!IoOperationStatus) {
         errno = GetLastError();
-        debugs(81, 1, "aio_write: GetLastError=" << errno  );
+        debugs(81, DBG_IMPORTANT, "aio_write: GetLastError=" << errno  );
         return -1;
     }
 
@@ -274,19 +275,16 @@ int aio_write64(struct aiocb64 *aiocbp)
     return 0;
 }
 
-
 int aio_error(const struct aiocb * aiocbp)
 {
     return aiocbp->aio_sigevent.sigev_notify;
 }
 
-
 int aio_error64(const struct aiocb64 * aiocbp)
 {
     return aiocbp->aio_sigevent.sigev_notify;
 }
 
-
 int aio_open(const char *path, int mode)
 {
     HANDLE hndl;
@@ -319,7 +317,7 @@ int aio_open(const char *path, int mode)
                            FILE_FLAG_OVERLAPPED,       /* file attributes         */
                            NULL                                    /* handle to template file */
                           )) != INVALID_HANDLE_VALUE) {
-        statCounter.syscalls.disk.opens++;
+        ++ statCounter.syscalls.disk.opens;
         fd = _open_osfhandle((long) hndl, 0);
         commSetCloseOnExec(fd);
         fd_open(fd, FD_FILE, path);
@@ -331,21 +329,18 @@ int aio_open(const char *path, int mode)
     return fd;
 }
 
-
 void aio_close(int fd)
 {
     CloseHandle((HANDLE)_get_osfhandle(fd));
     fd_close(fd);
-    statCounter.syscalls.disk.closes++;
+    ++ statCounter.syscalls.disk.closes;
 }
 
-
 ssize_t aio_return(struct aiocb * aiocbp)
 {
     return aiocbp->aio_sigevent.sigev_signo;
 }
 
-
 ssize_t aio_return64(struct aiocb64 * aiocbp)
 
 {