/*
- * $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.
AIOCounts squidaio_counts;
-typedef struct squidaio_unlinkq_t
-{
+typedef struct squidaio_unlinkq_t {
char *path;
struct squidaio_unlinkq_t *next;
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;
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;
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;
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);
}
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)
{
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;
dlinkAdd(ctrlp, &ctrlp->node, &used_list);
} /* aioWrite */
-
void
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;
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;
{
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;