XrdPosixFile Class Reference

#include <XrdPosixFile.hh>

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

List of all members.

Public Member Functions

long long addOffset (long long offs, int updtSz=0)
bool Close (XrdCl::XRootDStatus &Status)
bool Detach (XrdOucCacheIOCD &cdP)
void DetachDone ()
 Indicate that the CacheIO object has been detached.
bool Finalize (XrdCl::XRootDStatus *Status)
long long FSize ()
int Fstat (struct stat &buf)
const char * Location ()
void HandleResponse (XrdCl::XRootDStatus *status, XrdCl::AnyObject *response)
void updLock ()
void updUnLock ()
long long Offset ()
const char * Origin ()
const char * Path ()
int Read (char *Buff, long long Offs, int Len)
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 n)
long long setOffset (long long offs)
bool Stat (XrdCl::XRootDStatus &Status, bool force=false)
int Sync ()
void Sync (XrdOucCacheIOCB &iocb)
int Trunc (long long Offset)
void UpdtSize (size_t newsz)
bool Who (XrdPosixFile **fileP)
int Write (char *Buff, long long Offs, int Len)
void Write (XrdOucCacheIOCB &iocb, char *buff, long long offs, int wlen)
 XrdPosixFile (bool &aOK, const char *path, XrdPosixCallBack *cbP=0, int Opts=0)
 ~XrdPosixFile ()

Static Public Member Functions

static void * DelayedDestroy (void *)
static void DelayedDestroy (XrdPosixFile *fp)

Public Attributes

XrdOucCacheIOXCio
XrdPosixPrepIOPrepIO
XrdCl::File clFile
size_t mySize
time_t myMtime
dev_t myRdev
ino_t myInode
mode_t myMode
long long currOffset
XrdPosixCallBacktheCB
XrdPosixFilenextFile
int cOpt
int numTries

Static Public Attributes

static XrdSysSemaphore ddSem
static XrdSysMutex ddMutex
static XrdPosixFileddList
static XrdPosixFileddLost
static char * sfSFX
static short sfSLN
static bool ddPosted
static int ddNum
static const int realFD = 1
static const int isStrm = 2
static const int isUpdt = 4

Private Attributes

union {
   long long   currOffset
   XrdPosixCallBack *   theCB
   XrdPosixFile *   nextFile
}; 
char * fPath
char * fOpen
char * fLoc
union {
   int   cOpt
   int   numTries
}; 
char isStream

Constructor & Destructor Documentation

XrdPosixFile::XrdPosixFile ( bool &  aOK,
const char *  path,
XrdPosixCallBack cbP = 0,
int  Opts = 0 
)
XrdPosixFile::~XrdPosixFile (  ) 

Member Function Documentation

long long XrdPosixFile::addOffset ( long long  offs,
int  updtSz = 0 
) [inline]
bool XrdPosixFile::Close ( XrdCl::XRootDStatus Status  ) 
static void XrdPosixFile::DelayedDestroy ( XrdPosixFile fp  )  [static]
static void* XrdPosixFile::DelayedDestroy ( void *   )  [static]
bool XrdPosixFile::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 XrdPosixFile::DetachDone (  )  [inline, virtual]

Indicate that the CacheIO object has been detached.

Implements XrdOucCacheIOCD.

References XrdPosixObject::unRef().

bool XrdPosixFile::Finalize ( XrdCl::XRootDStatus Status  ) 
long long XrdPosixFile::FSize (  )  [inline, virtual]

Obtain size of the file.

Returns:
Size of the file in bytes.

Implements XrdOucCacheIO.

References AtomicBeg, AtomicEnd, AtomicGet, mySize, and XrdPosixObject::updMutex.

Referenced by XrdPosixPrepIO::FSize().

int XrdPosixFile::Fstat ( struct stat &  sbuff  )  [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.

Referenced by XrdPosixPrepIO::Fstat().

void XrdPosixFile::HandleResponse ( XrdCl::XRootDStatus status,
XrdCl::AnyObject response 
) [virtual]

Called when a response to associated request arrives or an error occurs

Parameters:
status status of the request
response an object associated with the response (request dependent)

Reimplemented from XrdCl::ResponseHandler.

const char* XrdPosixFile::Location (  )  [virtual]

Get the file's location (i.e. endpoint hostname and port)

Returns:
A pointer to the file's location. It remains valid until the file is closed. A null string means the file is not open or is unknown.

Reimplemented from XrdOucCacheIO.

long long XrdPosixFile::Offset (  )  [inline]
const char* XrdPosixFile::Origin (  )  [inline]

References fOpen.

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

Get the path associated with this object.

Returns:
Pointer to the path.

Implements XrdOucCacheIO.

References fPath.

Referenced by XrdPosixPrepIO::Path().

void XrdPosixFile::Read ( XrdOucCacheIOCB iocb,
char *  buff,
long long  offs,
int  rlen 
) [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.

int XrdPosixFile::Read ( char *  buff,
long long  offs,
int  rlen 
) [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.

Referenced by XrdPosixPrepIO::Read().

void XrdPosixFile::ReadV ( XrdOucCacheIOCB iocb,
const XrdOucIOVec readV,
int  rnum 
) [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.

int XrdPosixFile::ReadV ( const XrdOucIOVec readV,
int  rnum 
) [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.

Referenced by XrdPosixPrepIO::ReadV().

long long XrdPosixFile::setOffset ( long long  offs  )  [inline]
bool XrdPosixFile::Stat ( XrdCl::XRootDStatus Status,
bool  force = false 
)
void XrdPosixFile::Sync ( XrdOucCacheIOCB iocb  )  [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.

int XrdPosixFile::Sync (  )  [virtual]

Perform an synchronous sync() operation.

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

Implements XrdOucCacheIO.

Referenced by XrdPosixPrepIO::Sync().

int XrdPosixFile::Trunc ( long long  offs  )  [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.

Referenced by XrdPosixPrepIO::Trunc().

void XrdPosixFile::updLock (  )  [inline]
void XrdPosixFile::UpdtSize ( size_t  newsz  )  [inline]
void XrdPosixFile::updUnLock (  )  [inline]
bool XrdPosixFile::Who ( XrdPosixFile **  fileP  )  [inline]
void XrdPosixFile::Write ( XrdOucCacheIOCB iocb,
char *  buff,
long long  offs,
int  wlen 
) [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.

int XrdPosixFile::Write ( char *  buff,
long long  offs,
int  wlen 
) [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.

Referenced by XrdPosixPrepIO::Write().


Member Data Documentation

union { ... } [private]
union { ... } [private]

Referenced by addOffset(), Offset(), and setOffset().

int XrdPosixFile::ddNum [static]
bool XrdPosixFile::ddPosted [static]
char* XrdPosixFile::fLoc [private]
char* XrdPosixFile::fOpen [private]

Referenced by Origin().

char* XrdPosixFile::fPath [private]

Referenced by Path().

char XrdPosixFile::isStream [private]
const int XrdPosixFile::isStrm = 2 [static]
const int XrdPosixFile::isUpdt = 4 [static]

Referenced by addOffset(), FSize(), and UpdtSize().

const int XrdPosixFile::realFD = 1 [static]
char* XrdPosixFile::sfSFX [static]
short XrdPosixFile::sfSLN [static]

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