/*
- * AUTHOR: Adrian Chadd <adrian@squid-cache.org>
- * DEBUG: section 79 Disk IO Routines
+ * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
*
- * SQUID Web Proxy Cache http://www.squid-cache.org/
- * ----------------------------------------------------------
- *
- * Squid is the result of efforts by numerous individuals from
- * the Internet community; see the CONTRIBUTORS file for full
- * details. Many organizations have provided support for Squid's
- * development; see the SPONSORS file for full details. Squid is
- * Copyrighted (C) 2001 by the Regents of the University of
- * California; see the COPYRIGHT file for full details. Squid
- * incorporates software developed and/or copyrighted by other
- * sources; see the CREDITS file for full details.
- *
- * This program is free software; you can redistribute it and/or modify
- * 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.
- *
- * Copyright (c) 2003, Robert Collins <robertc@squid-cache.org>
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
*/
+/* DEBUG: section 79 Disk IO Routines */
+
/**
- *
- \par
+ * \par
* These routines are simple plugin replacements for the file_* routines
* in disk.c . They back-end into the POSIX AIO routines to provide
* a nice and simple async IO framework for COSS.
*
- \par
+ * \par
* AIO is suitable for COSS - the only sync operations that the standard
* supports are read/write, and since COSS works on a single file
* per storedir it should work just fine.
*/
#include "squid.h"
-#include "AIODiskFile.h"
-#include "AIODiskIOStrategy.h"
+#include "Debug.h"
+#include "DiskIO/AIO/AIODiskFile.h"
+#include "DiskIO/AIO/AIODiskIOStrategy.h"
#include "DiskIO/IORequestor.h"
#include "DiskIO/ReadRequest.h"
#include "DiskIO/WriteRequest.h"
-#include "disk.h"
+#include "fs_io.h"
#include "globals.h"
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
CBDATA_CLASS_INIT(AIODiskFile);
}
void
-AIODiskFile::open(int flags, mode_t mode, RefCount<IORequestor> callback)
+AIODiskFile::open(int flags, mode_t, RefCount<IORequestor> callback)
{
/* Simulate async calls */
#if _SQUID_WINDOWS_
/* Initiate aio */
if (aio_read(&qe->aq_e_aiocb) < 0) {
- fatalf("Aiee! aio_read() returned error (%d) FIXME and wrap file_read !\n", errno);
- debugs(79, DBG_IMPORTANT, "WARNING: aio_read() returned error: " << xstrerror());
+ int xerrno = errno;
+ fatalf("Aiee! aio_read() returned error (%d) FIXME and wrap file_read !\n", xerrno);
+ debugs(79, DBG_IMPORTANT, "WARNING: aio_read() returned error: " << xstrerr(xerrno));
/* fall back to blocking method */
// file_read(fd, request->buf, request->len, request->offset, callback, data);
}
/* Initiate aio */
if (aio_write(&qe->aq_e_aiocb) < 0) {
- fatalf("Aiee! aio_write() returned error (%d) FIXME and wrap file_write !\n", errno);
- debugs(79, DBG_IMPORTANT, "WARNING: aio_write() returned error: " << xstrerror());
+ int xerrno = errno;
+ fatalf("Aiee! aio_write() returned error (%d) FIXME and wrap file_write !\n", xerrno);
+ debugs(79, DBG_IMPORTANT, "WARNING: aio_write() returned error: " << xstrerr(xerrno));
/* fall back to blocking method */
// file_write(fd, offset, buf, len, callback, data, freefunc);
}
{
return false;
}
+