XrdPosixPrepIO Class Reference

#include <XrdPosixPrepIO.hh>

Inheritance diagram for XrdPosixPrepIO:
Inheritance graph
[legend]
Collaboration diagram for XrdPosixPrepIO:
Collaboration graph
[legend]

List of all members.

Public Member Functions

bool Detach (XrdOucCacheIOCD &cdP)
void Disable ()
long long FSize ()
int Fstat (struct stat &buf)
int Open ()
const char * Path ()
int Read (char *Buffer, long long Offset, int Length)
void Read (XrdOucCacheIOCB &iocb, char *buff, long long offs, int rlen)
int ReadV (const XrdOucIOVec *readV, int n)
void ReadV (XrdOucCacheIOCB &iocb, const XrdOucIOVec *readV, int rnum)
int Sync ()
void Sync (XrdOucCacheIOCB &iocb)
int Trunc (long long Offset)
int Write (char *Buffer, long long Offset, int Length)
void Write (XrdOucCacheIOCB &iocb, char *buff, long long offs, int wlen)
 XrdPosixPrepIO (XrdPosixFile *fP, XrdCl::OpenFlags::Flags clflags, XrdCl::Access::Mode clmode)
virtual ~XrdPosixPrepIO ()

Private Member Functions

bool Init (XrdOucCacheIOCB *iocbP=0)

Private Attributes

XrdPosixFilefileP
int openRC
int iCalls
XrdCl::OpenFlags::Flags clFlags
XrdCl::Access::Mode clMode

Constructor & Destructor Documentation

XrdPosixPrepIO::XrdPosixPrepIO ( XrdPosixFile fP,
XrdCl::OpenFlags::Flags  clflags,
XrdCl::Access::Mode  clmode 
) [inline]
virtual XrdPosixPrepIO::~XrdPosixPrepIO (  )  [inline, virtual]

Member Function Documentation

bool XrdPosixPrepIO::Detach ( XrdOucCacheIOCD iocd  )  [inline, virtual]

Detach this CacheIO object from the cache.

Note:
This method must be called instead of using the delete operator since CacheIO objects may have multiple outstanding references and actual deletion may need to be defered.
Parameters:
iocd reference to the detach complete callback object.
Returns:
true Deletion can occur immediately. There is no outstanding I/O.
false Deletion must be deferred until it is safe to so from the cache perspective. At which point, the cache will call the DetachDone() method in the passed callback object. No locks may be held with respect to the CacheIO object when this is done to avoid deadlocks.

Implements XrdOucCacheIO.

void XrdPosixPrepIO::Disable (  ) 
long long XrdPosixPrepIO::FSize (  )  [inline, virtual]

Obtain size of the file.

Returns:
Size of the file in bytes.

Implements XrdOucCacheIO.

References fileP, XrdPosixFile::FSize(), Init(), and openRC.

int XrdPosixPrepIO::Fstat ( struct stat &  sbuff  )  [inline, virtual]

Perform an fstat() operation (defaults to passthrough).

Parameters:
sbuff reference to the stat buffer to be filled in. Only fields st_size, st_blocks, st_mtime (st_atime and st_ctime may be set to st_mtime), st_ino, and st_mode need to be set. All other fields are preset and should not be changed.
Returns:
<0 - fstat failed, value is -errno. =0 - fstat succeeded, sbuff holds stat information. >0 - fstat could not be done, forward operation to next level.

Reimplemented from XrdOucCacheIO.

References fileP, XrdPosixFile::Fstat(), Init(), and openRC.

bool XrdPosixPrepIO::Init ( XrdOucCacheIOCB iocbP = 0  )  [private]
int XrdPosixPrepIO::Open (  )  [inline]

References Init(), and openRC.

const char* XrdPosixPrepIO::Path (  )  [inline, virtual]

Get the path associated with this object.

Returns:
Pointer to the path.

Implements XrdOucCacheIO.

References fileP, and XrdPosixFile::Path().

void XrdPosixPrepIO::Read ( XrdOucCacheIOCB iocb,
char *  buff,
long long  offs,
int  rlen 
) [inline, virtual]

Perform an asynchronous read (defaults to synchronous).

Parameters:
iocb reference to the callback object that receives the result. All results are returned via this object's Done() method. If the caller holds any locks they must be recursive locks as the callback may occur on the calling thread.
buff pointer to the buffer to receive the results. The buffer must remain valid until the callback is invoked.
offs the offset into the file.
rlen the number of bytes to read.

Reimplemented from XrdOucCacheIO.

References XrdOucCacheIOCB::Done(), fileP, Init(), openRC, and XrdPosixFile::Read().

int XrdPosixPrepIO::Read ( char *  buff,
long long  offs,
int  rlen 
) [inline, virtual]

Perform an synchronous read.

Parameters:
buff pointer to the buffer to receive the results. The buffer must remain valid until the callback is invoked.
offs the offset into the file.
rlen the number of bytes to read.
Returns:
< 0 - Read failed, value is -errno. >=0 - Read succeeded, value is number of bytes read.

Implements XrdOucCacheIO.

References fileP, Init(), openRC, and XrdPosixFile::Read().

void XrdPosixPrepIO::ReadV ( XrdOucCacheIOCB iocb,
const XrdOucIOVec readV,
int  rnum 
) [inline, virtual]

Perform an asynchronous vector read (defaults to synchronous).

Parameters:
iocb reference to the callback object that receives the result. All results are returned via this object's Done() method. If the caller holds any locks they must be recursive locks as the callback may occur on the calling thread.
readV pointer to a vector of read requests.
rnum the number of elements in the vector.

Reimplemented from XrdOucCacheIO.

References XrdOucCacheIOCB::Done(), fileP, Init(), openRC, and XrdPosixFile::ReadV().

int XrdPosixPrepIO::ReadV ( const XrdOucIOVec readV,
int  rnum 
) [inline, virtual]

Perform an synchronous vector read.

Parameters:
readV pointer to a vector of read requests.
rnum the number of elements in the vector.
Returns:
< 0 - ReadV failed, value is -errno. >=0 - ReadV succeeded, value is number of bytes read.

Reimplemented from XrdOucCacheIO.

References fileP, Init(), openRC, and XrdPosixFile::ReadV().

void XrdPosixPrepIO::Sync ( XrdOucCacheIOCB iocb  )  [inline, virtual]

Perform an asynchronous sync() operation (defaults to synchronous).

Parameters:
iocb reference to the callback object that receives the result. All results are returned via this object's Done() method. If the caller holds any locks they must be recursive locks as the callback may occur on the calling thread.

Reimplemented from XrdOucCacheIO.

References XrdOucCacheIOCB::Done(), fileP, Init(), openRC, and XrdPosixFile::Sync().

int XrdPosixPrepIO::Sync (  )  [inline, virtual]

Perform an synchronous sync() operation.

Returns:
<0 - Sync failed, value is -errno. =0 - Sync succeeded.

Implements XrdOucCacheIO.

References fileP, Init(), openRC, and XrdPosixFile::Sync().

int XrdPosixPrepIO::Trunc ( long long  offs  )  [inline, virtual]

Perform an synchronous trunc() operation.

Parameters:
offs the size the file is have.
Returns:
<0 - Trunc failed, value is -errno. =0 - Trunc succeeded.

Implements XrdOucCacheIO.

References fileP, Init(), openRC, and XrdPosixFile::Trunc().

void XrdPosixPrepIO::Write ( XrdOucCacheIOCB iocb,
char *  buff,
long long  offs,
int  wlen 
) [inline, virtual]

Perform an asynchronous write (defaults to synchronous).

Parameters:
iocb reference to the callback object that receives the result. All results are returned via this object's Done() method. If the caller holds any locks they must be recursive locks as the callback may occur on the calling thread.
buff pointer to the buffer holding the contents. The buffer must remain valid until the callback is invoked.
offs the offset into the file.
wlen the number of bytes to write

Reimplemented from XrdOucCacheIO.

References XrdOucCacheIOCB::Done(), fileP, Init(), openRC, and XrdPosixFile::Write().

int XrdPosixPrepIO::Write ( char *  buff,
long long  offs,
int  wlen 
) [inline, virtual]

Perform an synchronous write.

Parameters:
buff pointer to the buffer holding the contents. The buffer must remain valid until the callback is invoked.
offs the offset into the file.
wlen the number of bytes to write
Returns:
< 0 - Write failed, value is -errno. >=0 - Write succeeded, value is number of bytes written.

Implements XrdOucCacheIO.

References fileP, Init(), openRC, and XrdPosixFile::Write().


Member Data Documentation

int XrdPosixPrepIO::iCalls [private]
int XrdPosixPrepIO::openRC [private]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 7 Jul 2020 for xrootd by  doxygen 1.6.1