#include <MmappedFile.h>
Public Types | |
typedef RefCount< DiskFile > | Pointer |
Public Member Functions | |
MmappedFile (char const *path) | |
~MmappedFile () 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 |
we only support blocking I/O More... | |
virtual void | configure (const Config &) |
notes supported configuration options; kids must call this first More... | |
Private Member Functions | |
CBDATA_CLASS (MmappedFile) | |
void | doClose () |
Private Attributes | |
char const * | path_ |
RefCount< IORequestor > | ioRequestor |
int | fd |
int64_t | minOffset |
enforced if not negative (to preserve file headers) More... | |
int64_t | maxOffset |
enforced if not negative (to avoid crashes) More... | |
bool | error_ |
Detailed Description
Definition at line 16 of file MmappedFile.h.
Member Typedef Documentation
◆ Pointer
|
inherited |
Definition at line 39 of file DiskFile.h.
Constructor & Destructor Documentation
◆ MmappedFile()
MmappedFile::MmappedFile | ( | char const * | path | ) |
◆ ~MmappedFile()
|
override |
Definition at line 64 of file MmappedFile.cc.
Member Function Documentation
◆ canRead()
|
overridevirtual |
◆ canWrite()
|
overridevirtual |
◆ CBDATA_CLASS()
|
private |
◆ close()
|
overridevirtual |
Implements DiskFile.
Definition at line 118 of file MmappedFile.cc.
References assert, IORequestor::closeCompleted(), debugs, doClose(), and ioRequestor.
◆ configure()
|
inlinevirtualinherited |
Reimplemented in IpcIoFile.
Definition at line 42 of file DiskFile.h.
Referenced by IpcIoFile::configure().
◆ create()
|
overridevirtual |
Alias for MmappedFile::open(...)
Implements DiskFile.
Definition at line 102 of file MmappedFile.cc.
References open().
◆ doClose()
|
private |
Definition at line 108 of file MmappedFile.cc.
References fd, file_close(), and store_open_disk_fd.
Referenced by ~MmappedFile(), close(), and write().
◆ error()
|
overridevirtual |
◆ getFD()
|
inlineoverridevirtual |
During migration only
Reimplemented from DiskFile.
Definition at line 29 of file MmappedFile.h.
References fd.
◆ ioInProgress()
|
overridevirtual |
Implements DiskFile.
Definition at line 215 of file MmappedFile.cc.
◆ open()
|
overridevirtual |
Implements DiskFile.
Definition at line 72 of file MmappedFile.cc.
References assert, debugs, error_, fd, file_open(), IORequestor::ioCompletedNotification(), ioRequestor, maxOffset, path_, sb, store_open_disk_fd, and xstrerr().
Referenced by create().
◆ read()
|
overridevirtual |
Implements DiskFile.
Definition at line 145 of file MmappedFile.cc.
References assert, ReadRequest::buf, debugs, DISK_ERROR, DISK_OK, error_, fd, ioRequestor, ReadRequest::len, Mmapping::map(), MAP_NORESERVE, maxOffset, minOffset, ReadRequest::offset, IORequestor::readCompleted(), and Mmapping::unmap().
◆ write()
|
overridevirtual |
Implements DiskFile.
Definition at line 175 of file MmappedFile.cc.
References assert, WriteRequest::buf, DBG_IMPORTANT, debugs, DISK_ERROR, DISK_OK, doClose(), error_, fd, WriteRequest::free_func, ioRequestor, WriteRequest::len, maxOffset, minOffset, WriteRequest::offset, IORequestor::writeCompleted(), and xstrerr().
Member Data Documentation
◆ error_
|
private |
◆ fd
|
private |
Definition at line 40 of file MmappedFile.h.
Referenced by canRead(), canWrite(), doClose(), getFD(), open(), read(), and write().
◆ ioRequestor
|
private |
◆ maxOffset
|
private |
Definition at line 44 of file MmappedFile.h.
◆ minOffset
|
private |
Definition at line 43 of file MmappedFile.h.
◆ path_
|
private |
Definition at line 36 of file MmappedFile.h.
Referenced by MmappedFile(), ~MmappedFile(), and open().
The documentation for this class was generated from the following files:
- src/DiskIO/Mmapped/MmappedFile.h
- src/DiskIO/Mmapped/MmappedFile.cc