#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

◆ 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 ( )

Definition at line 32 of file BlockingFile.cc.

References doClose(), path_, and safe_free.

Member Function Documentation

◆ canRead()

bool BlockingFile::canRead ( ) const
virtual

Implements DiskFile.

Definition at line 88 of file BlockingFile.cc.

References fd.

Referenced by getFD().

◆ canWrite()

virtual bool DiskFile::canWrite ( ) const
inlinevirtualinherited

◆ CBDATA_CLASS()

BlockingFile::CBDATA_CLASS ( BlockingFile  )
private

◆ close()

void BlockingFile::close ( )
virtual

◆ configure()

virtual void DiskFile::configure ( const Config )
inlinevirtualinherited

◆ create()

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().

◆ 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 close(), writeDone(), and ~BlockingFile().

◆ error() [1/2]

bool BlockingFile::error ( ) const
virtual

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()

virtual int BlockingFile::getFD ( ) const
inlinevirtual

During migration only

Reimplemented from DiskFile.

Definition at line 32 of file BlockingFile.h.

References canRead(), fd, and ioInProgress().

◆ ioInProgress()

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.

Referenced by getFD().

◆ open()

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

◆ read()

void BlockingFile::read ( ReadRequest aRequest)
virtual

◆ readDone()

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

◆ write()

void BlockingFile::write ( WriteRequest aRequest)
virtual

◆ 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(), open(), and ~BlockingFile().

◆ 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 readDone(), and 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