#include <BlockingFile.h>

Inheritance diagram for BlockingFile:
Collaboration diagram for BlockingFile:

Public Types

typedef RefCount< DiskFilePointer
 

Public Member Functions

 BlockingFile (char const *path)
 
 ~BlockingFile ()
 
virtual void open (int flags, mode_t mode, RefCount< IORequestor > callback)
 
virtual void create (int flags, mode_t mode, RefCount< IORequestor > callback)
 
virtual void read (ReadRequest *)
 
virtual void write (WriteRequest *)
 
virtual void close ()
 
virtual bool error () const
 
virtual int getFD () const
 
virtual bool canRead () const
 
virtual bool ioInProgress () const
 
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

typedef RefCount<DiskFile> DiskFile::Pointer
inherited

Definition at line 39 of file DiskFile.h.

Constructor & Destructor Documentation

BlockingFile::BlockingFile ( char const *  path)

Definition at line 25 of file BlockingFile.cc.

References assert, debugs, path_, and xstrdup.

BlockingFile::~BlockingFile ( )

Definition at line 32 of file BlockingFile.cc.

References doClose(), path_, and safe_free.

Member Function Documentation

bool BlockingFile::canRead ( ) const
virtual

Implements DiskFile.

Definition at line 88 of file BlockingFile.cc.

References fd.

virtual bool DiskFile::canWrite ( ) const
inlinevirtualinherited

Reimplemented in IpcIoFile, DiskThreadsDiskFile, and MmappedFile.

Definition at line 50 of file DiskFile.h.

BlockingFile::CBDATA_CLASS ( BlockingFile  )
private
void BlockingFile::close ( )
virtual
virtual void DiskFile::configure ( const Config )
inlinevirtualinherited

Reimplemented in IpcIoFile.

Definition at line 42 of file DiskFile.h.

Referenced by IpcIoFile::configure().

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

Alias for BlockingFile::open(...)

Implements DiskFile.

Definition at line 62 of file BlockingFile.cc.

References open().

void BlockingFile::doClose ( )
private

Definition at line 68 of file BlockingFile.cc.

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

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

bool BlockingFile::error ( ) const
virtual

Implements DiskFile.

Definition at line 94 of file BlockingFile.cc.

References closed, error_, and fd.

Referenced by open().

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

Definition at line 102 of file BlockingFile.cc.

References error_.

virtual int BlockingFile::getFD ( ) const
inlinevirtual

During migration only

Reimplemented from DiskFile.

Definition at line 32 of file BlockingFile.h.

References fd.

bool BlockingFile::ioInProgress ( ) const
virtual

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.

void BlockingFile::open ( int  flags,
mode_t  mode,
RefCount< IORequestor callback 
)
virtual
void BlockingFile::read ( ReadRequest aRequest)
virtual
void BlockingFile::readDone ( int  fd,
const char *  buf,
int  len,
int  errflag 
)
private
void BlockingFile::write ( WriteRequest aRequest)
virtual
void BlockingFile::writeDone ( int  fd,
int  errflag,
size_t  len 
)
private

Member Data Documentation

bool BlockingFile::closed
private

Definition at line 41 of file BlockingFile.h.

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

bool BlockingFile::error_
private

Definition at line 43 of file BlockingFile.h.

Referenced by error().

int BlockingFile::fd
private

Definition at line 40 of file BlockingFile.h.

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

RefCount<IORequestor> BlockingFile::ioRequestor
private

Definition at line 45 of file BlockingFile.h.

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

char const* BlockingFile::path_
private

Definition at line 44 of file BlockingFile.h.

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

void BlockingFile::ReadDone
staticprivate

Definition at line 38 of file BlockingFile.h.

Referenced by read().

RefCount<ReadRequest> BlockingFile::readRequest
private

Definition at line 46 of file BlockingFile.h.

Referenced by read(), and readDone().

void BlockingFile::WriteDone
staticprivate

Definition at line 39 of file BlockingFile.h.

Referenced by write().

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