#include <BlockingFile.h>

Inheritance diagram for BlockingFile:
Collaboration diagram for BlockingFile:

Public Types

typedef RefCount< DiskFilePointer
 

Public Member Functions

 BlockingFile (char const *path)
 
 ~BlockingFile () 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 ioInProgress () const override
 
virtual void configure (const Config &)
 notes supported configuration options; kids must call this first More...
 
virtual bool canWrite () const
 

Private Member Functions

 CBDATA_CLASS (BlockingFile)
 
void error (bool const &)
 
void doClose ()
 
void readDone (int fd, const char *buf, int len, int errflag)
 
void writeDone (int fd, int errflag, size_t len)
 

Private Attributes

int fd
 
bool closed
 
bool error_
 
char const * path_
 
RefCount< IORequestorioRequestor
 
RefCount< ReadRequestreadRequest
 
RefCount< WriteRequestwriteRequest
 

Static Private Attributes

static DRCB ReadDone
 
static DWCB WriteDone
 

Detailed Description

Definition at line 19 of file BlockingFile.h.

Member Typedef Documentation

◆ Pointer

typedef RefCount<DiskFile> DiskFile::Pointer
inherited

Definition at line 39 of file DiskFile.h.

Constructor & Destructor Documentation

◆ BlockingFile()

BlockingFile::BlockingFile ( char const *  path)

Definition at line 25 of file BlockingFile.cc.

References assert, debugs, path_, and xstrdup.

◆ ~BlockingFile()

BlockingFile::~BlockingFile ( )
override

Definition at line 32 of file BlockingFile.cc.

References doClose(), path_, and safe_free.

Member Function Documentation

◆ canRead()

bool BlockingFile::canRead ( ) const
overridevirtual

Implements DiskFile.

Definition at line 88 of file BlockingFile.cc.

References fd.

◆ canWrite()

virtual bool DiskFile::canWrite ( ) const
inlinevirtualinherited

Reimplemented in DiskThreadsDiskFile, IpcIoFile, and MmappedFile.

Definition at line 50 of file DiskFile.h.

◆ CBDATA_CLASS()

BlockingFile::CBDATA_CLASS ( BlockingFile  )
private

◆ close()

void BlockingFile::close ( )
overridevirtual

◆ configure()

virtual void DiskFile::configure ( const Config )
inlinevirtualinherited

Reimplemented in IpcIoFile.

Definition at line 42 of file DiskFile.h.

Referenced by IpcIoFile::configure().

◆ create()

void BlockingFile::create ( int  flags,
mode_t  mode,
RefCount< IORequestor callback 
)
overridevirtual

Alias for BlockingFile::open(...)

Implements DiskFile.

Definition at line 62 of file BlockingFile.cc.

References open().

◆ doClose()

void BlockingFile::doClose ( )
private

Definition at line 68 of file BlockingFile.cc.

References closed, fd, file_close(), and store_open_disk_fd.

Referenced by ~BlockingFile(), close(), and writeDone().

◆ error() [1/2]

bool BlockingFile::error ( ) const
overridevirtual

Implements DiskFile.

Definition at line 94 of file BlockingFile.cc.

References closed, error_, and fd.

Referenced by open().

◆ error() [2/2]

void BlockingFile::error ( bool const &  aBool)
private

Definition at line 102 of file BlockingFile.cc.

References error_.

◆ getFD()

int BlockingFile::getFD ( ) const
inlineoverridevirtual

During migration only

Reimplemented from DiskFile.

Definition at line 32 of file BlockingFile.h.

References fd.

◆ ioInProgress()

bool BlockingFile::ioInProgress ( ) const
overridevirtual

Inform callers if there is IO in progress

Return values
falseIO is never pending with UFS

Implements DiskFile.

Definition at line 140 of file BlockingFile.cc.

◆ open()

void BlockingFile::open ( int  flags,
mode_t  mode,
RefCount< IORequestor callback 
)
overridevirtual

Implements DiskFile.

Definition at line 39 of file BlockingFile.cc.

References closed, debugs, error(), fd, file_open(), IORequestor::ioCompletedNotification(), ioRequestor, path_, and store_open_disk_fd.

Referenced by create().

◆ read()

void BlockingFile::read ( ReadRequest aRequest)
overridevirtual

◆ readDone()

void BlockingFile::readDone ( int  fd,
const char *  buf,
int  len,
int  errflag 
)
private

◆ write()

void BlockingFile::write ( WriteRequest aRequest)
overridevirtual

◆ writeDone()

void BlockingFile::writeDone ( int  fd,
int  errflag,
size_t  len 
)
private

Member Data Documentation

◆ closed

bool BlockingFile::closed
private

Definition at line 41 of file BlockingFile.h.

Referenced by doClose(), error(), and open().

◆ error_

bool BlockingFile::error_
private

Definition at line 43 of file BlockingFile.h.

Referenced by error().

◆ fd

int BlockingFile::fd
private

Definition at line 40 of file BlockingFile.h.

Referenced by canRead(), doClose(), error(), getFD(), open(), read(), readDone(), write(), and writeDone().

◆ ioRequestor

RefCount<IORequestor> BlockingFile::ioRequestor
private

Definition at line 45 of file BlockingFile.h.

Referenced by close(), open(), read(), readDone(), and writeDone().

◆ path_

char const* BlockingFile::path_
private

Definition at line 44 of file BlockingFile.h.

Referenced by BlockingFile(), ~BlockingFile(), and open().

◆ ReadDone

void BlockingFile::ReadDone
staticprivate

Definition at line 38 of file BlockingFile.h.

Referenced by read().

◆ readRequest

RefCount<ReadRequest> BlockingFile::readRequest
private

Definition at line 46 of file BlockingFile.h.

Referenced by read(), and readDone().

◆ WriteDone

void BlockingFile::WriteDone
staticprivate

Definition at line 39 of file BlockingFile.h.

Referenced by write().

◆ writeRequest

RefCount<WriteRequest> BlockingFile::writeRequest
private

Definition at line 47 of file BlockingFile.h.

Referenced by write(), and writeDone().


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors