#include "squid.h"
#include "base/AsyncFunCalls.h"
#include "base/CodeContext.h"
#include "base/RunnersRegistry.h"
#include "base/TextException.h"
#include "DiskIO/IORequestor.h"
#include "DiskIO/IpcIo/IpcIoFile.h"
#include "DiskIO/ReadRequest.h"
#include "DiskIO/WriteRequest.h"
#include "fd.h"
#include "fs_io.h"
#include "globals.h"
#include "ipc/mem/Pages.h"
#include "ipc/Messages.h"
#include "ipc/Port.h"
#include "ipc/Queue.h"
#include "ipc/StrandCoord.h"
#include "ipc/StrandSearch.h"
#include "ipc/UdsOp.h"
#include "sbuf/SBuf.h"
#include "SquidConfig.h"
#include "StatCounters.h"
#include "tools.h"
#include <cerrno>
Go to the source code of this file.
Classes | |
struct | SipcIo |
IpcIo wrapper for debugs() streams; XXX: find a better class name. More... | |
class | IpcIoRr |
Functions | |
CBDATA_CLASS_INIT (IpcIoFile) | |
static bool | DiskerOpen (const SBuf &path, int flags, mode_t mode) |
static void | DiskerClose (const SBuf &path) |
static std::ostream & | operator<< (std::ostream &os, const SipcIo &sio) |
static void | diskerRead (IpcIoMsg &ipcIo) |
static void | diskerWriteAttempts (IpcIoMsg &ipcIo) |
static void | diskerWrite (IpcIoMsg &ipcIo) |
DefineRunnerRegistrator (IpcIoRr) | |
Variables | |
static const char *const | ShmLabel = "io_file" |
shared memory segment path to use for IpcIoFile maps More... | |
static const int | QueueCapacity = 1024 |
static SBuf | DbName |
full db file name More... | |
static int | TheFile = -1 |
db file descriptor More... | |
Function Documentation
◆ CBDATA_CLASS_INIT()
CBDATA_CLASS_INIT | ( | IpcIoFile | ) |
◆ DefineRunnerRegistrator()
DefineRunnerRegistrator | ( | IpcIoRr | ) |
◆ DiskerClose()
|
static |
Definition at line 1000 of file IpcIoFile.cc.
References SBuf::clear(), DbName, debugs, file_close(), store_open_disk_fd, and TheFile.
Referenced by IpcIoFile::close().
◆ DiskerOpen()
Definition at line 980 of file IpcIoFile.cc.
References assert, SBuf::c_str(), DBG_CRITICAL, DbName, debugs, file_open(), store_open_disk_fd, TheFile, and xstrerr().
Referenced by IpcIoFile::open().
◆ diskerRead()
|
static |
Definition at line 733 of file IpcIoFile.cc.
References debugs, StatCounters::disk, fd_bytes(), FD_READ, Ipc::Mem::GetPage(), Ipc::Mem::PageId::ioPage, KidIdentifier, IpcIoMsg::len, min(), IpcIoMsg::offset, IpcIoMsg::page, Ipc::Mem::PagePointer(), Ipc::Mem::PageSize(), StatCounters::reads, statCounter, StatCounters::syscalls, TheFile, and IpcIoMsg::xerrno.
Referenced by IpcIoFile::DiskerHandleRequest().
◆ diskerWrite()
|
static |
Definition at line 819 of file IpcIoFile.cc.
References diskerWriteAttempts(), IpcIoMsg::page, and Ipc::Mem::PutPage().
Referenced by IpcIoFile::DiskerHandleRequest().
◆ diskerWriteAttempts()
|
static |
Tries to write buffer to disk (a few times if needed); sets ipcIo results, but does no cleanup. The caller must cleanup.
Definition at line 763 of file IpcIoFile.cc.
References assert, DBG_IMPORTANT, DbName, debugs, StatCounters::disk, fd_bytes(), FD_WRITE, KidIdentifier, IpcIoMsg::len, min(), IpcIoMsg::offset, IpcIoMsg::page, Ipc::Mem::PagePointer(), Ipc::Mem::PageSize(), statCounter, StatCounters::syscalls, TheFile, StatCounters::writes, IpcIoMsg::xerrno, and xstrerr().
Referenced by diskerWrite().
◆ operator<<()
|
static |
Definition at line 67 of file IpcIoFile.cc.
References IpcIoMsg::command, SipcIo::disker, SipcIo::msg, IpcIoMsg::requestId, and SipcIo::worker.
Variable Documentation
◆ DbName
|
static |
Definition at line 729 of file IpcIoFile.cc.
Referenced by DiskerClose(), IpcIoFile::DiskerHandleRequest(), DiskerOpen(), diskerWriteAttempts(), and IpcIoFile::WaitBeforePop().
◆ QueueCapacity
|
static |
a single worker-to-disker or disker-to-worker queue capacity; up to 2*QueueCapacity I/O requests queued between a single worker and a single disker
Definition at line 45 of file IpcIoFile.cc.
Referenced by IpcIoRr::claimMemoryNeeds(), IpcIoRr::create(), and IpcIoFile::push().
◆ ShmLabel
|
static |
Definition at line 40 of file IpcIoFile.cc.
Referenced by IpcIoRr::create(), and IpcIoFile::open().
◆ TheFile
|
static |
Definition at line 730 of file IpcIoFile.cc.
Referenced by DiskerClose(), DiskerOpen(), diskerRead(), and diskerWriteAttempts().