|
Squid Web Cache v8/master
|
#include <UFSStoreState.h>
Classes | |
| class | _queued_read |
| class | _queued_write |
Public Types | |
| enum | CloseHow { wroteAll , writerGone , readerDone } |
| typedef RefCount< StoreIOState > | Pointer |
| typedef void | STRCB(void *their_data, const char *buf, ssize_t len, StoreIOState::Pointer self) |
| typedef void | STIOCB(void *their_data, int errflag, StoreIOState::Pointer self) |
| typedef RefCount< IORequestor > | Pointer |
Public Member Functions | |
| UFSStoreState (SwapDir *SD, StoreEntry *anEntry, STIOCB *callback_, void *callback_data_) | |
| ~UFSStoreState () override | |
| void | close (int how) override |
| finish or abort swapping per CloseHow | |
| void | closeCompleted () override |
| void | ioCompletedNotification () override |
| void | readCompleted (const char *buf, int len, int errflag, RefCount< ReadRequest >) override |
| void | writeCompleted (int errflag, size_t len, RefCount< WriteRequest >) override |
| void | read_ (char *buf, size_t size, off_t offset, STRCB *callback, void *callback_data) override |
| bool | write (char const *buf, size_t size, off_t offset, FREE *free_func) override |
| void * | operator new (size_t amount) |
| void | operator delete (void *address) |
| off_t | offset () const |
| bool | touchingStoreEntry () const |
Public Attributes | ||
| RefCount< DiskFile > | theFile | |
| bool | opening | |
| bool | creating | |
| bool | closing | |
| bool | reading | |
| bool | writing | |
| sdirno | swap_dirn | |
| sfileno | swap_filen | |
| StoreEntry * | e | |
| mode_t | mode | |
| off_t | offset_ | |
| number of bytes written or read for this entry so far | ||
| STIOCB * | callback | |
| void * | callback_data | |
| struct { | ||
| STRCB * callback | ||
| void * callback_data | ||
| } | read | |
Protected Member Functions | |
| virtual void | doCloseCallback (int errflag) |
| bool | kickReadQueue () |
| void | drainWriteQueue () |
| void | tryClosing () |
Protected Attributes | ||
| std::queue< Ufs::UFSStoreState::_queued_read > | pending_reads | |
| std::queue< Ufs::UFSStoreState::_queued_write > | pending_writes | |
| struct { | ||
| bool write_draining | ||
| bool try_closing | ||
| } | flags | |
| char * | read_buf | |
Private Member Functions | |
| CBDATA_CLASS (UFSStoreState) | |
| void | openDone () |
| void | freePending () |
| void | doWrite () |
Definition at line 23 of file UFSStoreState.h.
|
inherited |
Definition at line 22 of file IORequestor.h.
|
inherited |
Definition at line 21 of file StoreIOState.h.
|
inherited |
Definition at line 39 of file StoreIOState.h.
|
inherited |
Definition at line 29 of file StoreIOState.h.
|
inherited |
| Enumerator | |
|---|---|
| wroteAll | success: caller supplied all data it wanted to swap out |
| writerGone | failure: caller left before swapping out everything |
| readerDone | success or failure: either way, stop swapping in |
Definition at line 57 of file StoreIOState.h.
| Fs::Ufs::UFSStoreState::UFSStoreState | ( | SwapDir * | SD, |
| StoreEntry * | anEntry, | ||
| STIOCB * | callback_, | ||
| void * | callback_data_ | ||
| ) |
Definition at line 327 of file UFSStoreState.cc.
References StoreIOState::e, flags, Store::Disk::index, StoreIOState::swap_dirn, StoreEntry::swap_filen, and StoreIOState::swap_filen.
|
override |
Definition at line 346 of file UFSStoreState.cc.
References assert.
|
private |
|
overridevirtual |
Implements StoreIOState.
Definition at line 115 of file UFSStoreState.cc.
|
overridevirtual |
Implements IORequestor.
Definition at line 88 of file UFSStoreState.cc.
References asHex(), assert, debugs, DISK_ERROR, and DISK_OK.
|
protectedvirtual |
Definition at line 298 of file UFSStoreState.cc.
References cbdataReferenceValidDone, and debugs.
|
private |
Definition at line 192 of file UFSStoreState.cc.
References assert, DBG_IMPORTANT, debugs, and MYNAME.
|
protected |
Definition at line 393 of file UFSStoreState.cc.
|
private |
Definition at line 353 of file UFSStoreState.cc.
References debugs.
|
overridevirtual |
Implements IORequestor.
Definition at line 27 of file UFSStoreState.cc.
References asHex(), assert, closing, creating, debugs, DiskFile::error(), FILE_MODE, StoreIOState::mode, openDone(), opening, StoreIOState::swap_dirn, StoreIOState::swap_filen, theFile, and tryClosing().
|
protected |
Definition at line 365 of file UFSStoreState.cc.
References cbdataReferenceValidDone, and debugs.
|
inlineinherited |
Definition at line 48 of file StoreIOState.h.
References StoreIOState::offset_.
Referenced by store_client::fileRead(), MemObject::objectBytesOnDisk(), MemObject::stat(), and StoreEntry::swapOut().
|
private |
Definition at line 63 of file UFSStoreState.cc.
References DBG_CRITICAL, debugs, and FILE_MODE.
Referenced by ioCompletedNotification().
|
inherited |
Definition at line 25 of file StoreIOState.cc.
References assert.
|
inherited |
Definition at line 18 of file StoreIOState.cc.
References assert.
|
overridevirtual |
Implements StoreIOState.
Definition at line 124 of file UFSStoreState.cc.
References asHex(), assert, cbdataReference, debugs, and size.
|
overridevirtual |
Implements IORequestor.
Definition at line 229 of file UFSStoreState.cc.
References asHex(), assert, cbdataReferenceValidDone, debugs, and RefCount< C >::getRaw().
|
inherited |
Definition at line 52 of file StoreIOState.cc.
References StoreIOState::e, StoreEntry::swap_filen, and StoreIOState::swap_filen.
Referenced by Rock::SwapDir::writeCompleted(), and Rock::SwapDir::writeError().
|
protected |
Definition at line 429 of file UFSStoreState.cc.
References debugs.
Referenced by ioCompletedNotification().
|
overridevirtual |
write the given buffer and free it when it is no longer needed
| offset | zero for the very first write and -1 for all other writes |
| false | if write failed (callback has been or will be called) |
Implements StoreIOState.
Definition at line 158 of file UFSStoreState.cc.
References asHex(), DBG_IMPORTANT, debugs, INDEXSD, Store::Disk::maxObjectSize(), and size.
|
overridevirtual |
Implements IORequestor.
Definition at line 272 of file UFSStoreState.cc.
|
inherited |
Definition at line 76 of file StoreIOState.h.
Referenced by Fs::Ufs::UFSStrategy::callback().
|
inherited |
Definition at line 80 of file StoreIOState.h.
|
inherited |
Definition at line 77 of file StoreIOState.h.
Referenced by StoreIOState::~StoreIOState().
| bool Fs::Ufs::UFSStoreState::closing |
Definition at line 39 of file UFSStoreState.h.
Referenced by ioCompletedNotification().
| bool Fs::Ufs::UFSStoreState::creating |
Definition at line 38 of file UFSStoreState.h.
Referenced by Fs::Ufs::UFSStrategy::create(), and ioCompletedNotification().
|
inherited |
Definition at line 73 of file StoreIOState.h.
Referenced by Rock::IoState::IoState(), UFSStoreState(), StoreIOState::touchingStoreEntry(), Rock::SwapDir::writeCompleted(), and Rock::SwapDir::writeError().
| struct { ... } Fs::Ufs::UFSStoreState::flags |
Referenced by UFSStoreState().
|
inherited |
Definition at line 74 of file StoreIOState.h.
Referenced by Fs::Ufs::UFSStrategy::create(), ioCompletedNotification(), and Fs::Ufs::UFSStrategy::open().
|
inherited |
Definition at line 75 of file StoreIOState.h.
Referenced by StoreIOState::offset().
| bool Fs::Ufs::UFSStoreState::opening |
Definition at line 37 of file UFSStoreState.h.
Referenced by ioCompletedNotification(), and Fs::Ufs::UFSStrategy::open().
|
protected |
Definition at line 72 of file UFSStoreState.h.
|
protected |
Definition at line 102 of file UFSStoreState.h.
| struct { ... } StoreIOState::read |
Referenced by StoreIOState::StoreIOState(), and StoreIOState::~StoreIOState().
|
protected |
Definition at line 126 of file UFSStoreState.h.
| bool Fs::Ufs::UFSStoreState::reading |
Definition at line 40 of file UFSStoreState.h.
|
inherited |
Definition at line 71 of file StoreIOState.h.
Referenced by UFSStoreState(), Rock::SwapDir::createStoreIO(), Rock::SwapDir::createUpdateIO(), ioCompletedNotification(), Rock::SwapDir::openStoreIO(), and storeSwapOutStart().
|
inherited |
Definition at line 72 of file StoreIOState.h.
Referenced by UFSStoreState(), Fs::Ufs::UFSStrategy::create(), Rock::SwapDir::createStoreIO(), Rock::SwapDir::createUpdateIO(), ioCompletedNotification(), Rock::SwapDir::openStoreIO(), storeSwapOutStart(), StoreIOState::touchingStoreEntry(), Rock::SwapDir::writeCompleted(), and Rock::SwapDir::writeError().
Definition at line 36 of file UFSStoreState.h.
Referenced by Fs::Ufs::UFSStrategy::create(), ioCompletedNotification(), and Fs::Ufs::UFSStrategy::open().
| bool Fs::Ufs::UFSStoreState::try_closing |
DPW 2006-05-24 The try_closing flag is set by UFSStoreState::tryClosing() when UFSStoreState wants to close the file, but cannot because of pending I/Os. If set, UFSStoreState will try to close again in the I/O callbacks.
Definition at line 120 of file UFSStoreState.h.
| bool Fs::Ufs::UFSStoreState::write_draining |
DPW 2006-05-24 the write_draining flag is used to avoid recursion inside the UFSStoreState::drainWriteQueue() method.
Definition at line 112 of file UFSStoreState.h.
| bool Fs::Ufs::UFSStoreState::writing |
Definition at line 41 of file UFSStoreState.h.