IpcIoFile.cc File Reference
#include "squid.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/StrandSearch.h"
#include "ipc/UdsOp.h"
#include "sbuf/SBuf.h"
#include "SquidConfig.h"
#include "SquidTime.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)
 
std::ostream & operator<< (std::ostream &os, const SipcIo &sio)
 
static void diskerRead (IpcIoMsg &ipcIo)
 
static void diskerWriteAttempts (IpcIoMsg &ipcIo)
 
static void diskerWrite (IpcIoMsg &ipcIo)
 
 RunnerRegistrationEntry (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 ( IpcIoFile  )
static void DiskerClose ( const SBuf path)
static

Definition at line 912 of file IpcIoFile.cc.

References SBuf::clear(), debugs, file_close(), HERE(), store_open_disk_fd, and TheFile.

Referenced by IpcIoFile::close().

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

Definition at line 892 of file IpcIoFile.cc.

References assert, SBuf::c_str(), DBG_CRITICAL, debugs, file_open(), store_open_disk_fd, TheFile, and xstrerr().

Referenced by IpcIoFile::open().

static void diskerWrite ( IpcIoMsg ipcIo)
static

Definition at line 734 of file IpcIoFile.cc.

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

Referenced by IpcIoFile::DiskerHandleRequest().

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 678 of file IpcIoFile.cc.

References assert, buf, DBG_IMPORTANT, 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, IpcIoMsg::xerrno, and xstrerr().

Referenced by diskerWrite().

std::ostream& operator<< ( std::ostream &  os,
const SipcIo sio 
)
RunnerRegistrationEntry ( IpcIoRr  )

Variable Documentation

SBuf DbName
static

Definition at line 644 of file IpcIoFile.cc.

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 43 of file IpcIoFile.cc.

Referenced by IpcIoRr::claimMemoryNeeds(), and IpcIoRr::create().

const char* const ShmLabel = "io_file"
static

Definition at line 38 of file IpcIoFile.cc.

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

int TheFile = -1
static

Definition at line 645 of file IpcIoFile.cc.

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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors