#include <DiskdFile.h>
Public Types | |
typedef RefCount< DiskFile > | Pointer |
Public Member Functions | |
DiskdFile (char const *path, DiskdIOStrategy *) | |
~DiskdFile () override | |
void | open (int flags, mode_t aMode, RefCount< IORequestor > callback) override |
void | create (int flags, mode_t aMode, RefCount< IORequestor > callback) override |
void | read (ReadRequest *) override |
void | write (WriteRequest *) override |
void | close () override |
bool | error () const override |
bool | canRead () const override |
bool | ioInProgress () const override |
int | getID () const |
void | completed (diomsg *) |
virtual void | configure (const Config &) |
notes supported configuration options; kids must call this first More... | |
virtual bool | canWrite () const |
virtual int | getFD () const |
Private Member Functions | |
CBDATA_CLASS (DiskdFile) | |
void | openDone (diomsg *) |
void | createDone (diomsg *) |
void | readDone (diomsg *) |
void | writeDone (diomsg *) |
void | closeDone (diomsg *) |
void | notifyClient () |
bool | canNotifyClient () const |
void | ioAway () |
void | ioCompleted () |
Private Attributes | |
int | id |
char const * | path_ |
bool | errorOccured |
DiskdIOStrategy * | IO |
RefCount< IORequestor > | ioRequestor |
int | mode |
size_t | inProgressIOs |
Detailed Description
Definition at line 24 of file DiskdFile.h.
Member Typedef Documentation
◆ Pointer
|
inherited |
Definition at line 39 of file DiskFile.h.
Constructor & Destructor Documentation
◆ DiskdFile()
DiskdFile::DiskdFile | ( | char const * | path, |
DiskdIOStrategy * | anIO | ||
) |
Definition at line 33 of file DiskdFile.cc.
References assert, debugs, diskd_stats, path_, diskd_stats_t::sio_id, and xstrdup.
◆ ~DiskdFile()
|
override |
Definition at line 46 of file DiskdFile.cc.
References assert, inProgressIOs, path_, and safe_free.
Member Function Documentation
◆ canNotifyClient()
|
private |
Definition at line 187 of file DiskdFile.cc.
References debugs, RefCount< C >::getRaw(), and ioRequestor.
Referenced by closeDone(), and notifyClient().
◆ canRead()
|
overridevirtual |
◆ canWrite()
|
inlinevirtualinherited |
Reimplemented in DiskThreadsDiskFile, IpcIoFile, and MmappedFile.
Definition at line 50 of file DiskFile.h.
◆ CBDATA_CLASS()
|
private |
◆ close()
|
overridevirtual |
Implements DiskFile.
Definition at line 148 of file DiskdFile.cc.
References _MQD_CLOSE, assert, diskd_stats_t::close, DBG_IMPORTANT, debugs, diskd_stats, errorOccured, RefCount< C >::getRaw(), IO, ioAway(), ioCompleted(), ioRequestor, notifyClient(), diskd_stats_t::ops, DiskdIOStrategy::send(), and xstrerr().
◆ closeDone()
|
private |
Definition at line 326 of file DiskdFile.cc.
References canNotifyClient(), diskd_stats_t::close, IORequestor::closeCompleted(), StatCounters::closes, debugs, StatCounters::disk, diskd_stats, errorOccured, diskd_stats_t::fail, ioCompleted(), ioRequestor, statCounter, diomsg::status, diskd_stats_t::success, and StatCounters::syscalls.
Referenced by completed().
◆ completed()
void DiskdFile::completed | ( | diomsg * | M | ) |
Definition at line 208 of file DiskdFile.cc.
References _MQD_CLOSE, _MQD_CREATE, _MQD_OPEN, _MQD_READ, _MQD_UNLINK, _MQD_WRITE, assert, closeDone(), createDone(), diomsg::mtype, diomsg::newstyle, openDone(), readDone(), and writeDone().
Referenced by DiskdIOStrategy::handle().
◆ configure()
|
inlinevirtualinherited |
Reimplemented in IpcIoFile.
Definition at line 42 of file DiskFile.h.
Referenced by IpcIoFile::configure().
◆ create()
|
overridevirtual |
Implements DiskFile.
Definition at line 84 of file DiskdFile.cc.
References _MQD_CREATE, assert, diskd_stats_t::create, DBG_IMPORTANT, debugs, diskd_stats, errorOccured, SharedMemory::get(), RefCount< C >::getRaw(), IO, ioAway(), ioCompleted(), ioRequestor, mode, notifyClient(), diskd_stats_t::ops, path_, DiskdIOStrategy::send(), DiskdIOStrategy::shm, SHMBUF_BLKSZ, xstrerr(), and xstrncpy().
◆ createDone()
|
private |
Definition at line 262 of file DiskdFile.cc.
References diskd_stats_t::create, debugs, StatCounters::disk, diskd_stats, errorOccured, diskd_stats_t::fail, ioCompleted(), notifyClient(), StatCounters::opens, statCounter, diomsg::status, diskd_stats_t::success, and StatCounters::syscalls.
Referenced by completed().
◆ error()
|
overridevirtual |
Implements DiskFile.
Definition at line 175 of file DiskdFile.cc.
References errorOccured.
Referenced by canRead().
◆ getFD()
|
inlinevirtualinherited |
During migration only
Reimplemented in BlockingFile, DiskThreadsDiskFile, IpcIoFile, and MmappedFile.
Definition at line 53 of file DiskFile.h.
◆ getID()
|
inline |
Definition at line 41 of file DiskdFile.h.
References id.
◆ ioAway()
|
private |
Definition at line 314 of file DiskdFile.cc.
References inProgressIOs.
Referenced by close(), create(), open(), read(), and write().
◆ ioCompleted()
|
private |
Definition at line 320 of file DiskdFile.cc.
References inProgressIOs.
Referenced by close(), closeDone(), create(), createDone(), open(), openDone(), read(), readDone(), write(), and writeDone().
◆ ioInProgress()
|
overridevirtual |
Inform callers if there is IO in progress
Implements DiskFile.
Definition at line 404 of file DiskdFile.cc.
References inProgressIOs.
◆ notifyClient()
|
private |
Definition at line 198 of file DiskdFile.cc.
References canNotifyClient(), IORequestor::ioCompletedNotification(), and ioRequestor.
Referenced by close(), create(), createDone(), openDone(), read(), and write().
◆ open()
|
overridevirtual |
Implements DiskFile.
Definition at line 53 of file DiskdFile.cc.
References _MQD_OPEN, assert, debugs, diskd_stats, errorOccured, SharedMemory::get(), RefCount< C >::getRaw(), IO, ioAway(), ioCompleted(), IORequestor::ioCompletedNotification(), ioRequestor, mode, diskd_stats_t::open, diskd_stats_t::ops, path_, DiskdIOStrategy::send(), DiskdIOStrategy::shm, SHMBUF_BLKSZ, and xstrncpy().
◆ openDone()
|
private |
Definition at line 245 of file DiskdFile.cc.
References debugs, StatCounters::disk, diskd_stats, errorOccured, diskd_stats_t::fail, ioCompleted(), notifyClient(), diskd_stats_t::open, StatCounters::opens, statCounter, diomsg::status, diskd_stats_t::success, and StatCounters::syscalls.
Referenced by completed().
◆ read()
|
overridevirtual |
Implements DiskFile.
Definition at line 118 of file DiskdFile.cc.
References _MQD_READ, assert, DBG_IMPORTANT, debugs, diskd_stats, errorOccured, SharedMemory::get(), RefCount< C >::getRaw(), IO, ioAway(), ioCompleted(), ioRequestor, ReadRequest::len, notifyClient(), ReadRequest::offset, diskd_stats_t::ops, diskd_stats_t::read, DiskdIOStrategy::send(), DiskdIOStrategy::shm, and xstrerr().
◆ readDone()
|
private |
Definition at line 347 of file DiskdFile.cc.
References assert, SharedMemory::buf, DBG_IMPORTANT, debugs, StatCounters::disk, DISK_ERROR, DISK_OK, diskd_stats, errorOccured, diskd_stats_t::fail, IO, ioCompleted(), ioRequestor, diskd_stats_t::read, IORequestor::readCompleted(), StatCounters::reads, diomsg::requestor, DiskdIOStrategy::shm, diomsg::shm_offset, statCounter, diomsg::status, diskd_stats_t::success, and StatCounters::syscalls.
Referenced by completed().
◆ write()
|
overridevirtual |
Implements DiskFile.
Definition at line 279 of file DiskdFile.cc.
References _MQD_WRITE, WriteRequest::buf, DBG_IMPORTANT, debugs, diskd_stats, errorOccured, WriteRequest::free_func, SharedMemory::get(), IO, ioAway(), ioCompleted(), ioRequestor, WriteRequest::len, notifyClient(), WriteRequest::offset, diskd_stats_t::ops, DiskdIOStrategy::send(), DiskdIOStrategy::shm, diskd_stats_t::write, and xstrerr().
◆ writeDone()
|
private |
Definition at line 376 of file DiskdFile.cc.
References assert, DBG_IMPORTANT, debugs, StatCounters::disk, DISK_ERROR, DISK_OK, diskd_stats, errorOccured, diskd_stats_t::fail, ioCompleted(), ioRequestor, diomsg::requestor, statCounter, diomsg::status, diskd_stats_t::success, StatCounters::syscalls, diskd_stats_t::write, IORequestor::writeCompleted(), and StatCounters::writes.
Referenced by completed().
Member Data Documentation
◆ errorOccured
|
private |
Definition at line 48 of file DiskdFile.h.
Referenced by close(), closeDone(), create(), createDone(), error(), open(), openDone(), read(), readDone(), write(), and writeDone().
◆ id
|
private |
Definition at line 46 of file DiskdFile.h.
Referenced by getID().
◆ inProgressIOs
|
private |
Definition at line 61 of file DiskdFile.h.
Referenced by ~DiskdFile(), ioAway(), ioCompleted(), and ioInProgress().
◆ IO
|
private |
Definition at line 49 of file DiskdFile.h.
Referenced by close(), create(), open(), read(), readDone(), and write().
◆ ioRequestor
|
private |
Definition at line 50 of file DiskdFile.h.
Referenced by canNotifyClient(), close(), closeDone(), create(), notifyClient(), open(), read(), readDone(), write(), and writeDone().
◆ mode
|
private |
Definition at line 56 of file DiskdFile.h.
◆ path_
|
private |
Definition at line 47 of file DiskdFile.h.
Referenced by DiskdFile(), ~DiskdFile(), create(), and open().
The documentation for this class was generated from the following files:
- src/DiskIO/DiskDaemon/DiskdFile.h
- src/DiskIO/DiskDaemon/DiskdFile.cc