xrootd
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
XrdPosixPrepIO Class Reference

#include <XrdPosixPrepIO.hh>

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

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 ()
 
- Public Member Functions inherited from XrdOucCacheIO
virtual const char * Location (bool refresh=false)
 
virtual int pgRead (char *buff, long long offs, int rdlen, std::vector< uint32_t > &csvec, uint64_t opts=0, int *csfix=0)
 
virtual void pgRead (XrdOucCacheIOCB &iocb, char *buff, long long offs, int rdlen, std::vector< uint32_t > &csvec, uint64_t opts=0, int *csfix=0)
 
virtual int pgWrite (char *buff, long long offs, int wrlen, std::vector< uint32_t > &csvec, uint64_t opts=0, int *csfix=0)
 
virtual void pgWrite (XrdOucCacheIOCB &iocb, char *buff, long long offs, int wrlen, std::vector< uint32_t > &csvec, uint64_t opts=0, int *csfix=0)
 
virtual void Preread (long long offs, int rlen, int opts=0)
 
virtual void Preread (aprParms &Parms)
 
virtual void Trunc (XrdOucCacheIOCB &iocb, long long offs)
 
virtual void Update (XrdOucCacheIO &iocp)
 
virtual int WriteV (const XrdOucIOVec *writV, int wnum)
 
virtual void WriteV (XrdOucCacheIOCB &iocb, const XrdOucIOVec *writV, int wnum)
 
 XrdOucCacheIO ()
 Construct and Destructor.
 

Private Member Functions

bool Init (XrdOucCacheIOCB *iocbP=0)
 

Private Attributes

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

Additional Inherited Members

- Static Public Attributes inherited from XrdOucCacheIO
static const uint64_t forceCS = 0x0000000000000001ULL
 
static const int SingleUse = 0x0001
 Mark pages for single use.
 
- Protected Member Functions inherited from XrdOucCacheIO
virtual ~XrdOucCacheIO ()
 

Constructor & Destructor Documentation

◆ XrdPosixPrepIO()

XrdPosixPrepIO::XrdPosixPrepIO ( XrdPosixFile fP,
XrdCl::OpenFlags::Flags  clflags,
XrdCl::Access::Mode  clmode 
)
inline

◆ ~XrdPosixPrepIO()

virtual XrdPosixPrepIO::~XrdPosixPrepIO ( )
inlinevirtual

Member Function Documentation

◆ Detach()

bool XrdPosixPrepIO::Detach ( XrdOucCacheIOCD iocd)
inlinevirtual

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 deferred.
Parameters
iocdreference 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.

◆ Disable()

void XrdPosixPrepIO::Disable ( )

◆ FSize()

long long XrdPosixPrepIO::FSize ( )
inlinevirtual

Obtain size of the file.

Returns
Size of the file in bytes.

Implements XrdOucCacheIO.

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

◆ Fstat()

int XrdPosixPrepIO::Fstat ( struct stat sbuff)
inlinevirtual

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

Parameters
sbuffreference 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.

◆ Init()

bool XrdPosixPrepIO::Init ( XrdOucCacheIOCB iocbP = 0)
private

◆ Open()

int XrdPosixPrepIO::Open ( )
inline

References Init(), and openRC.

◆ Path()

const char * XrdPosixPrepIO::Path ( )
inlinevirtual

Get the path associated with this object.

Returns
Pointer to the path.

Implements XrdOucCacheIO.

References fileP, and XrdPosixFile::Path().

◆ Read() [1/2]

int XrdPosixPrepIO::Read ( char *  buff,
long long  offs,
int  rlen 
)
inlinevirtual

Perform an synchronous read.

Parameters
buffpointer to the buffer to receive the results. The buffer must remain valid until the callback is invoked.
offsthe offset into the file.
rlenthe 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().

◆ Read() [2/2]

void XrdPosixPrepIO::Read ( XrdOucCacheIOCB iocb,
char *  buff,
long long  offs,
int  rlen 
)
inlinevirtual

Perform an asynchronous read (defaults to synchronous).

Parameters
iocbreference 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.
buffpointer to the buffer to receive the results. The buffer must remain valid until the callback is invoked.
offsthe offset into the file.
rlenthe number of bytes to read.

Reimplemented from XrdOucCacheIO.

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

◆ ReadV() [1/2]

int XrdPosixPrepIO::ReadV ( const XrdOucIOVec readV,
int  rnum 
)
inlinevirtual

Perform an synchronous vector read.

Parameters
readVpointer to a vector of read requests.
rnumthe 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().

◆ ReadV() [2/2]

void XrdPosixPrepIO::ReadV ( XrdOucCacheIOCB iocb,
const XrdOucIOVec readV,
int  rnum 
)
inlinevirtual

Perform an asynchronous vector read (defaults to synchronous).

Parameters
iocbreference 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.
readVpointer to a vector of read requests.
rnumthe number of elements in the vector.

Reimplemented from XrdOucCacheIO.

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

◆ Sync() [1/2]

int XrdPosixPrepIO::Sync ( )
inlinevirtual

Perform an synchronous sync() operation.

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

Implements XrdOucCacheIO.

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

◆ Sync() [2/2]

void XrdPosixPrepIO::Sync ( XrdOucCacheIOCB iocb)
inlinevirtual

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

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

◆ Trunc()

int XrdPosixPrepIO::Trunc ( long long  offs)
inlinevirtual

Perform an synchronous trunc() operation.

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

Implements XrdOucCacheIO.

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

◆ Write() [1/2]

int XrdPosixPrepIO::Write ( char *  buff,
long long  offs,
int  wlen 
)
inlinevirtual

Perform an synchronous write.

Parameters
buffpointer to the buffer holding the contents. The buffer must remain valid until the callback is invoked.
offsthe offset into the file.
wlenthe 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().

◆ Write() [2/2]

void XrdPosixPrepIO::Write ( XrdOucCacheIOCB iocb,
char *  buff,
long long  offs,
int  wlen 
)
inlinevirtual

Perform an asynchronous write (defaults to synchronous).

Parameters
iocbreference 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.
buffpointer to the buffer holding the contents. The buffer must remain valid until the callback is invoked.
offsthe offset into the file.
wlenthe number of bytes to write

Reimplemented from XrdOucCacheIO.

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

Member Data Documentation

◆ clFlags

XrdCl::OpenFlags::Flags XrdPosixPrepIO::clFlags
private

◆ clMode

XrdCl::Access::Mode XrdPosixPrepIO::clMode
private

◆ fileP

XrdPosixFile* XrdPosixPrepIO::fileP
private

◆ iCalls

int XrdPosixPrepIO::iCalls
private

◆ openRC

int XrdPosixPrepIO::openRC
private

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