]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/DiskIO/DiskThreads/async_io.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / DiskIO / DiskThreads / async_io.cc
index cf182b0afa298f22274a4d9c357ce4a291dd435a..9f62a45ad799712c164485684558ba32246fe2fc 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: async_io.cc,v 1.5 2007/08/16 23:32:28 hno Exp $
+ * $Id$
  *
  * DEBUG: section 32    Asynchronous Disk I/O
  * AUTHOR: Pete Bentley <pete@demon.net>
  *  it under the terms of the GNU General Public License as published by
  *  the Free Software Foundation; either version 2 of the License, or
  *  (at your option) any later version.
- *  
+ *
  *  This program is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *  GNU General Public License for more details.
- *  
+ *
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
@@ -43,8 +43,7 @@
 
 AIOCounts squidaio_counts;
 
-typedef struct squidaio_unlinkq_t
-{
+typedef struct squidaio_unlinkq_t {
     char *path;
 
     struct squidaio_unlinkq_t *next;
@@ -58,7 +57,7 @@ aioOpen(const char *path, int oflag, mode_t mode, AIOCB * callback, void *callba
     squidaio_ctrl_t *ctrlp;
 
     assert(DiskThreadsIOStrategy::Instance.initialised);
-    squidaio_counts.open_start++;
+    ++squidaio_counts.open_start;
     ctrlp = (squidaio_ctrl_t *)DiskThreadsIOStrategy::Instance.squidaio_ctrl_pool->alloc();
     ctrlp->fd = -2;
     ctrlp->done_handler = callback;
@@ -76,7 +75,7 @@ aioClose(int fd)
     squidaio_ctrl_t *ctrlp;
 
     assert(DiskThreadsIOStrategy::Instance.initialised);
-    squidaio_counts.close_start++;
+    ++squidaio_counts.close_start;
     aioCancel(fd);
     ctrlp = (squidaio_ctrl_t *)DiskThreadsIOStrategy::Instance.squidaio_ctrl_pool->alloc();
     ctrlp->fd = fd;
@@ -96,7 +95,7 @@ aioCancel(int fd)
     dlink_node *m, *next;
 
     assert(DiskThreadsIOStrategy::Instance.initialised);
-    squidaio_counts.cancel++;
+    ++squidaio_counts.cancel;
 
     for (m = used_list.head; m; m = next) {
         next = m->next;
@@ -111,7 +110,7 @@ aioCancel(int fd)
             AIOCB *callback = ctrlp->done_handler;
             void *cbdata;
             ctrlp->done_handler = NULL;
-            debugs(32, 1, "this be aioCancel. Danger ahead!");
+            debugs(32, DBG_IMPORTANT, "this be aioCancel. Danger ahead!");
 
             if (cbdataReferenceValidDone(ctrlp->done_handler_data, &cbdata))
                 callback(fd, cbdata, NULL, -2, -2);
@@ -126,11 +125,10 @@ aioCancel(int fd)
         }
 
         dlinkDelete(m, &used_list);
-        DiskThreadsIOStrategy::Instance.squidaio_ctrl_pool->free(ctrlp);
+        DiskThreadsIOStrategy::Instance.squidaio_ctrl_pool->freeOne(ctrlp);
     }
 }
 
-
 void
 aioWrite(int fd, off_t offset, char *bufp, size_t len, AIOCB * callback, void *callback_data, FREE * free_func)
 {
@@ -138,7 +136,7 @@ aioWrite(int fd, off_t offset, char *bufp, size_t len, AIOCB * callback, void *c
     int seekmode;
 
     assert(DiskThreadsIOStrategy::Instance.initialised);
-    squidaio_counts.write_start++;
+    ++squidaio_counts.write_start;
     ctrlp = (squidaio_ctrl_t *)DiskThreadsIOStrategy::Instance.squidaio_ctrl_pool->alloc();
     ctrlp->fd = fd;
     ctrlp->done_handler = callback;
@@ -159,7 +157,6 @@ aioWrite(int fd, off_t offset, char *bufp, size_t len, AIOCB * callback, void *c
     dlinkAdd(ctrlp, &ctrlp->node, &used_list);
 }                              /* aioWrite */
 
-
 void
 aioRead(int fd, off_t offset, size_t len, AIOCB * callback, void *callback_data)
 {
@@ -167,7 +164,7 @@ aioRead(int fd, off_t offset, size_t len, AIOCB * callback, void *callback_data)
     int seekmode;
 
     assert(DiskThreadsIOStrategy::Instance.initialised);
-    squidaio_counts.read_start++;
+    ++squidaio_counts.read_start;
     ctrlp = (squidaio_ctrl_t *)DiskThreadsIOStrategy::Instance.squidaio_ctrl_pool->alloc();
     ctrlp->fd = fd;
     ctrlp->done_handler = callback;
@@ -196,7 +193,7 @@ aioStat(char *path, struct stat *sb, AIOCB * callback, void *callback_data)
     squidaio_ctrl_t *ctrlp;
 
     assert(DiskThreadsIOStrategy::Instance.initialised);
-    squidaio_counts.stat_start++;
+    ++squidaio_counts.stat_start;
     ctrlp = (squidaio_ctrl_t *)DiskThreadsIOStrategy::Instance.squidaio_ctrl_pool->alloc();
     ctrlp->fd = -2;
     ctrlp->done_handler = callback;
@@ -213,7 +210,7 @@ aioUnlink(const char *path, AIOCB * callback, void *callback_data)
 {
     squidaio_ctrl_t *ctrlp;
     assert(DiskThreadsIOStrategy::Instance.initialised);
-    squidaio_counts.unlink_start++;
+    ++squidaio_counts.unlink_start;
     ctrlp = (squidaio_ctrl_t *)DiskThreadsIOStrategy::Instance.squidaio_ctrl_pool->alloc();
     ctrlp->fd = -2;
     ctrlp->done_handler = callback;