IpcIoFile.cc File Reference
#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>
Include dependency graph for IpcIoFile.cc:

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 void DiskerClose ( const SBuf path)
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()

static bool DiskerOpen ( const SBuf path,
int  flags,
mode_t  mode 
)
static

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()

◆ diskerWrite()

static void diskerWrite ( IpcIoMsg ipcIo)
static

Definition at line 819 of file IpcIoFile.cc.

References diskerWriteAttempts(), IpcIoMsg::page, and Ipc::Mem::PutPage().

Referenced by IpcIoFile::DiskerHandleRequest().

◆ diskerWriteAttempts()

static void diskerWriteAttempts ( IpcIoMsg ipcIo)
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 std::ostream & operator<< ( std::ostream &  os,
const SipcIo sio 
)
static

Variable Documentation

◆ DbName

◆ QueueCapacity

const int QueueCapacity = 1024
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

const char* const ShmLabel = "io_file"
static

Definition at line 40 of file IpcIoFile.cc.

Referenced by IpcIoRr::create(), and IpcIoFile::open().

◆ TheFile

int TheFile = -1
static

Definition at line 730 of file IpcIoFile.cc.

Referenced by DiskerClose(), DiskerOpen(), diskerRead(), and diskerWriteAttempts().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors