#include <DiskdIOStrategy.h>

Inheritance diagram for DiskdIOStrategy:
Collaboration diagram for DiskdIOStrategy:

Public Member Functions

 DiskdIOStrategy ()
 
bool shedLoad () override
 
int load () override
 
RefCount< DiskFilenewFile (char const *path) override
 
bool unlinkdUseful () const override
 
void unlinkFile (char const *) override
 
ConfigOptiongetOptionTree () const override
 
void init () override
 
void sync () override
 
int callback () override
 
void statfs (StoreEntry &sentry) const override
 
int send (int mtype, int id, DiskdFile *theFile, size_t size, off_t offset, ssize_t shm_offset, Lock *requestor)
 

Public Attributes

SharedMemory shm
 

Private Member Functions

void openFailed ()
 
bool optionQ1Parse (char const *option, const char *value, int reconfiguring)
 
void optionQ1Dump (StoreEntry *e) const
 
bool optionQ2Parse (char const *option, const char *value, int reconfiguring)
 
void optionQ2Dump (StoreEntry *e) const
 
int send (int mtype, int id, RefCount< StoreIOState > sio, size_t size, off_t offset, ssize_t shm_offset)
 
int SEND (diomsg *M, int mtype, int id, size_t size, off_t offset, ssize_t shm_offset)
 
void handle (diomsg *M)
 
void unlinkDone (diomsg *M)
 

Static Private Member Functions

static size_t newInstance ()
 

Private Attributes

int magic1
 
int magic2
 
int away
 
int smsgid
 
int rmsgid
 
int wfd
 
size_t instanceID
 

Static Private Attributes

static size_t nextInstanceID
 

Detailed Description

Definition at line 42 of file DiskdIOStrategy.h.

Constructor & Destructor Documentation

◆ DiskdIOStrategy()

DiskdIOStrategy::DiskdIOStrategy ( )

Definition at line 89 of file DiskdIOStrategy.cc.

Member Function Documentation

◆ callback()

int DiskdIOStrategy::callback ( )
overridevirtual

◆ getOptionTree()

ConfigOption * DiskdIOStrategy::getOptionTree ( ) const
overridevirtual

module specific options

Reimplemented from DiskIOStrategy.

Definition at line 423 of file DiskdIOStrategy.cc.

References optionQ1Dump(), optionQ1Parse(), optionQ2Dump(), optionQ2Parse(), and ConfigOptionVector::options.

◆ handle()

◆ init()

◆ load()

int DiskdIOStrategy::load ( )
overridevirtual

What is the current load? 999 = 99.9%

Implements DiskIOStrategy.

Definition at line 65 of file DiskdIOStrategy.cc.

References away, and magic2.

◆ newFile()

DiskFile::Pointer DiskdIOStrategy::newFile ( char const *  path)
overridevirtual

Return a handle for performing IO operations

Implements DiskIOStrategy.

Definition at line 79 of file DiskdIOStrategy.cc.

References openFailed(), and shedLoad().

◆ newInstance()

size_t DiskdIOStrategy::newInstance ( )
staticprivate

Definition at line 43 of file DiskdIOStrategy.cc.

References nextInstanceID.

◆ openFailed()

void DiskdIOStrategy::openFailed ( )
private

Definition at line 73 of file DiskdIOStrategy.cc.

References diskd_stats, and diskd_stats_t::open_fail_queue_len.

Referenced by newFile().

◆ optionQ1Dump()

void DiskdIOStrategy::optionQ1Dump ( StoreEntry e) const
private

Definition at line 465 of file DiskdIOStrategy.cc.

References magic1, and storeAppendPrintf().

Referenced by getOptionTree().

◆ optionQ1Parse()

bool DiskdIOStrategy::optionQ1Parse ( char const *  option,
const char *  value,
int  reconfiguring 
)
private

Definition at line 432 of file DiskdIOStrategy.cc.

References DBG_IMPORTANT, debugs, and magic1.

Referenced by getOptionTree().

◆ optionQ2Dump()

void DiskdIOStrategy::optionQ2Dump ( StoreEntry e) const
private

Definition at line 497 of file DiskdIOStrategy.cc.

References magic2, and storeAppendPrintf().

Referenced by getOptionTree().

◆ optionQ2Parse()

bool DiskdIOStrategy::optionQ2Parse ( char const *  option,
const char *  value,
int  reconfiguring 
)
private

Definition at line 471 of file DiskdIOStrategy.cc.

References DBG_IMPORTANT, debugs, and magic2.

Referenced by getOptionTree().

◆ SEND()

◆ send() [1/2]

int DiskdIOStrategy::send ( int  mtype,
int  id,
DiskdFile theFile,
size_t  size,
off_t  offset,
ssize_t  shm_offset,
Lock requestor 
)

◆ send() [2/2]

int DiskdIOStrategy::send ( int  mtype,
int  id,
RefCount< StoreIOState sio,
size_t  size,
off_t  offset,
ssize_t  shm_offset 
)
private

◆ shedLoad()

bool DiskdIOStrategy::shedLoad ( )
overridevirtual

Can the IO Strategy handle more requests ?

Implements DiskIOStrategy.

Definition at line 49 of file DiskdIOStrategy.cc.

References away, debugs, and magic1.

Referenced by newFile(), and unlinkFile().

◆ statfs()

void DiskdIOStrategy::statfs ( StoreEntry ) const
overridevirtual

cachemgr output on the IO instance stats

Reimplemented from DiskIOStrategy.

Definition at line 569 of file DiskdIOStrategy.cc.

References away, and storeAppendPrintf().

◆ sync()

void DiskdIOStrategy::sync ( )
overridevirtual

flush all IO operations

Reimplemented from DiskIOStrategy.

Definition at line 507 of file DiskdIOStrategy.cc.

References away, callback(), DBG_IMPORTANT, debugs, and squid_curtime.

◆ unlinkDone()

◆ unlinkdUseful()

bool DiskdIOStrategy::unlinkdUseful ( ) const
overridevirtual

whether the IO Strategy can use unlinkd

Implements DiskIOStrategy.

Definition at line 93 of file DiskdIOStrategy.cc.

◆ unlinkFile()

void DiskdIOStrategy::unlinkFile ( char const *  )
overridevirtual

Member Data Documentation

◆ away

int DiskdIOStrategy::away
private

Definition at line 89 of file DiskdIOStrategy.h.

Referenced by callback(), load(), SEND(), shedLoad(), statfs(), and sync().

◆ instanceID

size_t DiskdIOStrategy::instanceID
private

Definition at line 93 of file DiskdIOStrategy.h.

Referenced by init().

◆ magic1

int DiskdIOStrategy::magic1
private

magic1 is the number of messages away which we stop allowing open/create for.

Definition at line 79 of file DiskdIOStrategy.h.

Referenced by optionQ1Dump(), optionQ1Parse(), and shedLoad().

◆ magic2

int DiskdIOStrategy::magic2
private

magic2 is the point at which we start blocking on msgsnd/msgrcv. If a queue has magic2 (or more) messages away, then we read the queue until the level falls below magic2. Recommended value is 75% of SHMBUFS.

Definition at line 87 of file DiskdIOStrategy.h.

Referenced by callback(), init(), load(), optionQ2Dump(), optionQ2Parse(), and SEND().

◆ nextInstanceID

size_t DiskdIOStrategy::nextInstanceID
staticprivate

Definition at line 64 of file DiskdIOStrategy.h.

Referenced by newInstance().

◆ rmsgid

int DiskdIOStrategy::rmsgid
private

Definition at line 91 of file DiskdIOStrategy.h.

Referenced by callback(), and init().

◆ shm

SharedMemory DiskdIOStrategy::shm

public for accessing return address's

Definition at line 60 of file DiskdIOStrategy.h.

Referenced by callback(), DiskdFile::create(), init(), DiskdFile::open(), DiskdFile::read(), DiskdFile::readDone(), SEND(), unlinkDone(), unlinkFile(), and DiskdFile::write().

◆ smsgid

int DiskdIOStrategy::smsgid
private

Definition at line 90 of file DiskdIOStrategy.h.

Referenced by init(), and SEND().

◆ wfd

int DiskdIOStrategy::wfd
private

Definition at line 92 of file DiskdIOStrategy.h.

Referenced by init().


The documentation for this class was generated from the following files:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors