#include <DiskThreadsDiskFile.h>
Public Types | |
typedef RefCount< DiskFile > | Pointer |
Public Member Functions | |
DiskThreadsDiskFile (char const *path) | |
~DiskThreadsDiskFile () override | |
void | open (int flags, mode_t mode, RefCount< IORequestor > callback) override |
void | create (int flags, mode_t mode, RefCount< IORequestor > callback) override |
void | read (ReadRequest *) override |
void | write (WriteRequest *) override |
void | close () override |
bool | error () const override |
int | getFD () const override |
bool | canRead () const override |
bool | canWrite () const override |
bool | ioInProgress () const override |
virtual void | configure (const Config &) |
notes supported configuration options; kids must call this first More... | |
Private Member Functions | |
CBDATA_CLASS (DiskThreadsDiskFile) | |
void | openDone (int fd, const char *buf, int aio_return, int aio_errno) |
void | doClose () |
void | readDone (int fd, const char *buf, int len, int errflag, RefCount< ReadRequest > request) |
void | writeDone (int fd, int errflag, size_t len, RefCount< WriteRequest > request) |
Private Attributes | |
int | fd = -1 |
bool | errorOccured = false |
char const * | path_ = nullptr |
size_t | inProgressIOs = 0 |
RefCount< IORequestor > | ioRequestor |
Static Private Attributes | |
static AIOCB | ReadDone |
static DWCB | WriteDone |
static AIOCB | OpenDone |
Detailed Description
Definition at line 19 of file DiskThreadsDiskFile.h.
Member Typedef Documentation
◆ Pointer
|
inherited |
Definition at line 39 of file DiskFile.h.
Constructor & Destructor Documentation
◆ DiskThreadsDiskFile()
DiskThreadsDiskFile::DiskThreadsDiskFile | ( | char const * | path | ) |
◆ ~DiskThreadsDiskFile()
|
override |
Definition at line 37 of file DiskThreadsDiskFile.cc.
Member Function Documentation
◆ canRead()
|
overridevirtual |
Implements DiskFile.
Definition at line 198 of file DiskThreadsDiskFile.cc.
◆ canWrite()
|
overridevirtual |
◆ CBDATA_CLASS()
|
private |
◆ close()
|
overridevirtual |
Implements DiskFile.
Definition at line 182 of file DiskThreadsDiskFile.cc.
References assert, IORequestor::closeCompleted(), DBG_CRITICAL, debugs, doClose(), RefCount< C >::getRaw(), ioInProgress(), and ioRequestor.
◆ configure()
|
inlinevirtualinherited |
Reimplemented in IpcIoFile.
Definition at line 42 of file DiskFile.h.
Referenced by IpcIoFile::configure().
◆ create()
|
overridevirtual |
Implements DiskFile.
Definition at line 93 of file DiskThreadsDiskFile.cc.
References aioOpen(), debugs, StatCounters::disk, errorOccured, fd, file_open(), inProgressIOs, ioRequestor, OpenDone, openDone(), Opening_FD, StatCounters::opens, path_, statCounter, and StatCounters::syscalls.
◆ doClose()
|
private |
Definition at line 162 of file DiskThreadsDiskFile.cc.
References aioCancel(), aioClose(), StatCounters::closes, StatCounters::disk, fd, fd_close(), file_close(), statCounter, store_open_disk_fd, and StatCounters::syscalls.
Referenced by ~DiskThreadsDiskFile(), and close().
◆ error()
|
overridevirtual |
Implements DiskFile.
Definition at line 125 of file DiskThreadsDiskFile.cc.
References errorOccured.
◆ getFD()
|
inlineoverridevirtual |
During migration only
Reimplemented from DiskFile.
Definition at line 32 of file DiskThreadsDiskFile.h.
References fd.
◆ ioInProgress()
|
overridevirtual |
Inform callers if there is IO in progress
Implements DiskFile.
Definition at line 228 of file DiskThreadsDiskFile.cc.
References inProgressIOs.
Referenced by close().
◆ open()
|
overridevirtual |
Implements DiskFile.
Definition at line 44 of file DiskThreadsDiskFile.cc.
References aioOpen(), debugs, StatCounters::disk, errorOccured, fd, file_open(), inProgressIOs, ioRequestor, OpenDone, openDone(), Opening_FD, StatCounters::opens, path_, statCounter, and StatCounters::syscalls.
◆ openDone()
|
private |
Definition at line 138 of file DiskThreadsDiskFile.cc.
References commSetCloseOnExec(), DBG_CRITICAL, DBG_IMPORTANT, debugs, errorOccured, fd, FD_FILE, fd_open(), inProgressIOs, IORequestor::ioCompletedNotification(), ioRequestor, MYNAME, Opening_FD, path_, store_open_disk_fd, and xstrerr().
◆ read()
|
overridevirtual |
Implements DiskFile.
Definition at line 76 of file DiskThreadsDiskFile.cc.
References aioRead(), assert, ReadRequest::buf, debugs, StatCounters::disk, fd, file_read(), RefCount< C >::getRaw(), inProgressIOs, ioRequestor, ReadRequest::len, ReadRequest::offset, ReadDone, StatCounters::reads, statCounter, and StatCounters::syscalls.
◆ readDone()
|
private |
Definition at line 250 of file DiskThreadsDiskFile.cc.
References assert, debugs, DISK_EOF, DISK_ERROR, DISK_OK, fd, inProgressIOs, ioRequestor, and IORequestor::readCompleted().
◆ write()
|
overridevirtual |
Implements DiskFile.
Definition at line 205 of file DiskThreadsDiskFile.cc.
References aioWrite(), WriteRequest::buf, debugs, StatCounters::disk, fd, file_write(), WriteRequest::free_func, inProgressIOs, WriteRequest::len, WriteRequest::offset, statCounter, StatCounters::syscalls, WriteDone, and StatCounters::writes.
◆ writeDone()
|
private |
Definition at line 300 of file DiskThreadsDiskFile.cc.
References assert, debugs, DISK_ERROR, DISK_NO_SPACE_LEFT, DISK_OK, fd, inProgressIOs, ioRequestor, and IORequestor::writeCompleted().
Member Data Documentation
◆ errorOccured
|
private |
Definition at line 55 of file DiskThreadsDiskFile.h.
Referenced by create(), error(), open(), and openDone().
◆ fd
|
private |
Definition at line 54 of file DiskThreadsDiskFile.h.
Referenced by canRead(), canWrite(), create(), doClose(), getFD(), open(), openDone(), read(), readDone(), write(), and writeDone().
◆ inProgressIOs
|
private |
Definition at line 57 of file DiskThreadsDiskFile.h.
Referenced by create(), ioInProgress(), open(), openDone(), read(), readDone(), write(), and writeDone().
◆ ioRequestor
|
private |
Definition at line 60 of file DiskThreadsDiskFile.h.
Referenced by close(), create(), open(), openDone(), read(), readDone(), and writeDone().
◆ OpenDone
|
staticprivate |
Definition at line 58 of file DiskThreadsDiskFile.h.
◆ path_
|
private |
Definition at line 56 of file DiskThreadsDiskFile.h.
Referenced by DiskThreadsDiskFile(), ~DiskThreadsDiskFile(), create(), open(), and openDone().
◆ ReadDone
|
staticprivate |
Definition at line 41 of file DiskThreadsDiskFile.h.
Referenced by read().
◆ WriteDone
|
staticprivate |
Definition at line 51 of file DiskThreadsDiskFile.h.
Referenced by write().
The documentation for this class was generated from the following files:
- src/DiskIO/DiskThreads/DiskThreadsDiskFile.h
- src/DiskIO/DiskThreads/DiskThreadsDiskFile.cc