![]() |
XRootD
|
#include <XrdOfs.hh>
Public Member Functions | |
XrdOfsFile (XrdOucErrInfo &eInfo, const char *user) | |
~XrdOfsFile () | |
int | checkpoint (XrdSfsFile::cpAct act, struct iov *range=0, int n=0) |
int | close () |
virtual int | fctl (const int cmd, const char *args, XrdOucErrInfo &eInfo)=0 |
int | fctl (const int cmd, const char *args, XrdOucErrInfo &out_error) |
virtual int | fctl (const int cmd, int alen, const char *args, const XrdSecEntity *client=0) |
int | fctl (const int cmd, int alen, const char *args, const XrdSecEntity *client=0) |
const char * | FName () |
int | getCXinfo (char cxtype[4], int &cxrsz) |
int | getMmap (void **Addr, off_t &Size) |
int | open (const char *fileName, XrdSfsFileOpenMode openMode, mode_t createMode, const XrdSecEntity *client, const char *opaque=0) |
int | pgRead (XrdSfsAio *aioparm, uint64_t opts=0) |
XrdSfsXferSize | pgRead (XrdSfsFileOffset offset, char *buffer, XrdSfsXferSize rdlen, uint32_t *csvec, uint64_t opts=0) |
int | pgWrite (XrdSfsAio *aioparm, uint64_t opts=0) |
XrdSfsXferSize | pgWrite (XrdSfsFileOffset offset, char *buffer, XrdSfsXferSize wrlen, uint32_t *csvec, uint64_t opts=0) |
int | read (XrdSfsAio *aioparm) |
XrdSfsXferSize | read (XrdSfsFileOffset fileOffset, char *buffer, XrdSfsXferSize buffer_size) |
int | read (XrdSfsFileOffset fileOffset, XrdSfsXferSize amount) |
XrdSfsXferSize | readv (XrdOucIOVec *readV, int readCount) |
int | stat (struct stat *buf) |
int | sync () |
int | sync (XrdSfsAio *aiop) |
int | truncate (XrdSfsFileOffset fileOffset) |
int | write (XrdSfsAio *aioparm) |
XrdSfsXferSize | write (XrdSfsFileOffset fileOffset, const char *buffer, XrdSfsXferSize buffer_size) |
![]() | |
XrdSfsFile (const char *user=0, int MonID=0) | |
XrdSfsFile (XrdOucErrInfo &eInfo) | |
XrdSfsFile (XrdSfsFile &wrapF) | |
virtual | ~XrdSfsFile () |
Destructor. More... | |
virtual int | SendData (XrdSfsDio *sfDio, XrdSfsFileOffset offset, XrdSfsXferSize size) |
virtual void | setXio (XrdSfsXio *xioP) |
virtual XrdSfsXferSize | writev (XrdOucIOVec *writeV, int wdvCnt) |
Protected Attributes | |
bool | ckpBad |
int | dorawio |
XrdOucChkPnt * | myCKP |
XrdOfsTPC * | myTPC |
XrdOfsHandle * | oh |
const char * | tident |
char | viaDel |
Additional Inherited Members | |
![]() | |
enum | cpAct { cpCreate =0 , cpDelete , cpRestore , cpQuery , cpTrunc , cpWrite } |
![]() | |
XrdOucErrInfo & | error |
![]() | |
static const uint64_t | Verify = 0x8000000000000000ULL |
Options for pgRead() and pgWrite() as noted below. More... | |
XrdOfsFile::XrdOfsFile | ( | XrdOucErrInfo & | eInfo, |
const char * | user | ||
) |
|
inline |
|
virtual |
Reimplemented from XrdSfsFile.
Definition at line 911 of file XrdOfs.cc.
References ckpBad, XrdSfsFile::cpCreate, XrdSfsFile::cpDelete, XrdSfsFile::cpQuery, XrdSfsFile::cpRestore, XrdSfsFile::cpTrunc, XrdSfsFile::cpWrite, XrdOucChkPnt::Create(), XrdOucChkPnt::Delete(), XrdOssDF::DF_isProxy, XrdOssDF::DFType(), XrdOfs::Emsg(), XrdOfsConfigCP::Enabled, EPNAME, XrdSfsFile::error, XrdOucChkPnt::Finished(), FTRACE, XrdOfsHandle::Inactive(), myCKP, XrdOfsHandle::Name(), oh, XrdOucChkPnt::Query(), XrdOucChkPnt::Restore(), XrdOfsHandle::Select(), SFS_OK, XrdOfsHandle::Suppress(), XrdOucChkPnt::Truncate(), XrdOucChkPnt::Write(), and XrdOfsFS.
|
virtual |
Close the file.
Implements XrdSfsFile.
Definition at line 804 of file XrdOfs.cc.
References XrdCmsClient::Added(), XrdOfsEvs::Closer, XrdOfsEvs::Closew, XrdOfsStats::Data, XrdOfsTPC::Del(), XrdOfsPoscq::Del(), XrdOfs::Emsg(), XrdOfsEvs::Enabled(), EPNAME, XrdSfsFile::error, XrdOssDF::Fchmod(), XrdOucChkPnt::Finished(), FTRACE, XrdOfsHandle::Inactive(), XrdOfsHandle::isRW, XrdOfsHandle::Lock(), XrdSysMutex::Lock(), myCKP, myTPC, XrdOfsHandle::Name(), XrdOfsEvs::Notify(), XrdOfsStats::StatsData::numOpenP, XrdOfsStats::StatsData::numOpenR, XrdOfsStats::StatsData::numOpenW, OfsStats, oh, XrdOfsHandle::opPC, XrdOfsHandle::PoscGet(), XrdOucChkPnt::Restore(), XrdOfsHandle::Retire(), XrdOfsStats::sdMutex, XrdOfsHandle::Select(), SFS_OK, tident, XrdSysMutex::UnLock(), XrdOfs::Unpersist(), XrdOfsHandle::Usage(), viaDel, and XrdOfsFS.
Referenced by ~XrdOfsFile().
virtual int XrdSfsFile::fctl |
Execute a special operation on the file (version 1)
cmd | - The operation to be performed (see below). SFS_FCTL_GETFD Return file descriptor if possible SFS_FCTL_STATV Reserved for future use. |
args | - specific arguments to cmd SFS_FCTL_GETFD Set to zero. |
eInfo | - The object where error info or results are to be returned. This is legacy and the error onject may be used as well. |
|
virtual |
Execute a special operation on the file (version 1)
cmd | - The operation to be performed (see below). SFS_FCTL_GETFD Return file descriptor if possible SFS_FCTL_STATV Reserved for future use. |
args | - specific arguments to cmd SFS_FCTL_GETFD Set to zero. |
eInfo | - The object where error info or results are to be returned. This is legacy and the error onject may be used as well. |
Implements XrdSfsFile.
Definition at line 1041 of file XrdOfs.cc.
References XrdOssDF::getFD(), oh, XrdOfsHandle::Select(), XrdOucErrInfo::setErrCode(), XrdOucErrInfo::setErrInfo(), SFS_ERROR, SFS_FCTL_GETFD, and SFS_OK.
int XrdSfsFile::fctl |
Execute a special operation on the file (version 2)
cmd | - The operation to be performed: SFS_FCTL_SPEC1 Perform implementation defined action |
alen | - Length of data pointed to by args. |
args | - Data sent with request, zero if alen is zero. |
client | - Client's identify (see common description). |
Definition at line 489 of file XrdSfsInterface.cc.
|
virtual |
Execute a special operation on the file (version 2)
cmd | - The operation to be performed: SFS_FCTL_SPEC1 Perform implementation defined action |
alen | - Length of data pointed to by args. |
args | - Data sent with request, zero if alen is zero. |
client | - Client's identify (see common description). |
Reimplemented from XrdSfsFile.
Definition at line 1063 of file XrdOfs.cc.
References XrdOfsTPC::Del(), XrdSfsFile::error, XrdOfs::FSctl(), myTPC, XrdOucErrInfo::setErrInfo(), SFS_ERROR, SFS_FCTL_SPEC1, SFS_OK, and XrdOfsFS.
|
inlinevirtual |
Get the file path.
Implements XrdSfsFile.
Definition at line 140 of file XrdOfs.hh.
References XrdOfsHandle::Name(), and oh.
|
virtual |
Get compression information for the file.
cxtype | - Place where the compression algorithm name is to be placed |
cxrsz | - Place where the compression page size is to be returned |
Implements XrdSfsFile.
Definition at line 1732 of file XrdOfs.cc.
References XrdOssDF::isCompressed(), oh, XrdOfsHandle::Select(), and SFS_OK.
|
virtual |
Get file's memory mapping if one exists (memory mapped files only).
Addr | - Place where the starting memory address is returned. |
Size | - Place where the file's size is returned. |
Implements XrdSfsFile.
Definition at line 1575 of file XrdOfs.cc.
References XrdOssDF::getMmap(), oh, XrdOfsHandle::Select(), and SFS_OK.
|
virtual |
Open a file.
fileName | - Pointer to the path of the file to be opened. |
openMode | - Flags indicating how the open is to be handled. SFS_O_CREAT create the file SFS_O_MKPTH Make directory path if missing SFS_O_NOWAIT do not impose operational delays SFS_O_NOTPC do not allow TPC operation SFS_O_POSC persist only on successful close SFS_O_RAWIO allow client-side decompression SFS_O_RDONLY open read/only SFS_O_RDWR open read/write SFS_O_REPLICA Open for replication SFS_O_RESET Reset any cached information SFS_O_TRUNC truncate existing file to zero length SFS_O_WRONLY open write/only |
createMode | - The file's mode if it will be created. |
client | - Client's identify (see common description). |
opaque | - path's CGI information (see common description). |
Implements XrdSfsFile.
Definition at line 451 of file XrdOfs.cc.
References XrdAccAuthorize::Access(), XrdOfsPoscq::Add(), XrdCmsClient::Added(), XrdOfsHandle::Alloc(), AOP_Create, AOP_Excl_Create, AOP_Read, AOP_Update, AUTHORIZE, XrdOfsTPC::Authorize(), XrdOfsPoscq::Commit(), XrdOfsEvs::Create, XrdOss::Create(), XrdOfsStats::Data, XrdOfsPoscq::Del(), dorawio, XrdOfs::Emsg(), XrdSysError::Emsg(), XrdOfsEvs::Enabled(), EPNAME, XrdSfsFile::error, XrdOfs::evrObject, XrdOfs::Finder, XrdOfs::fMask, XrdOfs::fsError(), FTRACE, XrdOucEnv::Get(), XrdOucErrInfo::getUCap(), Xrd::hex1, XrdOfsHandle::isCompressed, XrdOss::Lfn2Pfn(), XrdCmsClient::Locate(), XrdSysMutex::Lock(), Mode, myTPC, XrdOss::newFile(), XrdOfsEvs::Notify(), XrdOfsStats::StatsData::numOpenP, XrdOfsStats::StatsData::numOpenR, XrdOfsStats::StatsData::numOpenW, O_DIRECT, Xrd::oct1, OfsEroute, OfsStats, oh, OOIDENTENV, XrdOfsEvs::Openr, XrdOfsEvs::Openw, XrdOfsHandle::opPC, XrdOfsHandle::opRW, XrdOfs::Options, Path, XrdOfs::RdrTPC, XrdCmsClient::Removed(), XrdOfsHandle::Retire(), XrdOfsStats::sdMutex, XrdOucErrInfo::setErrInfo(), SFS_O_CREAT, SFS_O_MKPTH, SFS_O_MULTIW, SFS_O_NOTPC, SFS_O_NOWAIT, SFS_O_POSC, SFS_O_RAWIO, SFS_O_RDONLY, SFS_O_RDWR, SFS_O_REPLICA, SFS_O_RESET, SFS_O_SEQIO, SFS_O_TRUNC, SFS_O_WRONLY, SFS_OK, SFS_REDIRECT, SFS_STARTED, XrdOfs::Stall(), tident, XrdOucTPC::tpcDlgOn, XrdOucTPC::tpcKey, XrdOfs::tpcRdrHost, XrdOfs::tpcRdrPort, XrdOucEI::uLclF, XrdSysMutex::UnLock(), XrdOfsHandle::Usage(), XrdOucEI::uUrlOK, XrdOfsTPC::Validate(), XrdOfsEvr::Wait4Event(), XrdOfsFS, XrdOfsOss, XRDOSS_mkpath, XRDOSS_new, XRDSFS_POSCPEND, and ZTRACE.
|
virtual |
Read file pages and checksums using asynchronous I/O.
aioparm | - Pointer to async I/O object controlling the I/O. |
opts | - Processing options (see above). |
Reimplemented from XrdSfsFile.
Definition at line 1142 of file XrdOfs.cc.
References aiocb::aio_nbytes, aiocb::aio_offset, XrdSfsAio::cksVec, dorawio, XrdOfs::Emsg(), EPNAME, XrdSfsFile::error, FTRACE, XrdOfsHandle::isCompressed, XrdOfsHandle::Name(), oh, opts, XrdOssDF::pgRead(), read(), XrdOfsHandle::Select(), SFS_OK, XrdSfsAio::sfsAio, XrdOssDF::Verify, XrdSfsFile::Verify, and XrdOfsFS.
|
virtual |
Read file pages into a buffer and return corresponding checksums.
offset | - The offset where the read is to start. It may be unaligned with certain caveats relative to csvec. |
buffer | - pointer to buffer where the bytes are to be placed. |
rdlen | - The number of bytes to read. The amount must be an integral number of XrdSfsPage::Size bytes. |
csvec | - A vector of entries to be filled with the cooresponding CRC32C checksum for each page. However, if the offset is unaligned, then csvec[0] contains the crc for the page fragment that brings it to alignment for csvec[1]. It must be sized to hold all aligned XrdSys::Pagesize crc's plus additional ones for leading and ending page fragments, if any. |
opts | - Processing options (see above). |
Reimplemented from XrdSfsFile.
Definition at line 1092 of file XrdOfs.cc.
References XrdOucPgrwUtils::csCalc(), dorawio, XrdOfs::Emsg(), EPNAME, XrdSfsFile::error, FTRACE, XrdOfsHandle::Name(), oh, opts, XrdOssDF::pgRead(), read(), XrdOfsHandle::Select(), XrdOssDF::Verify, XrdSfsFile::Verify, and XrdOfsFS.
|
virtual |
Write file pages and checksums using asynchronous I/O.
aioparm | - Pointer to async I/O object controlling the I/O. |
opts | - Processing options (see above). |
Reimplemented from XrdSfsFile.
Definition at line 1242 of file XrdOfs.cc.
References aiocb::aio_buf, aiocb::aio_nbytes, aiocb::aio_offset, XrdSfsAio::cksVec, XrdSfsAio::doneWrite(), XrdOfs::Emsg(), XrdOfsEvs::Enabled(), EPNAME, XrdSfsFile::error, FTRACE, XrdOfsEvs::Fwrite, XrdOfsHandle::isChanged, XrdOfsHandle::isPending, XrdOfsHandle::isRW, XrdOfsHandle::Name(), oh, XrdOfsHandle::opPC, opts, XrdOssDF::pgWrite(), pgWrite(), XrdSfsAio::Result, XrdOfsHandle::Select(), SFS_ERROR, SFS_OK, XrdSfsAio::sfsAio, XrdOssDF::Verify, XrdSfsFile::Verify, write(), and XrdOfsFS.
|
virtual |
Write file pages into a file with corresponding checksums.
offset | - The offset where the write is to start. It may be unaligned with certain caveats relative to csvec. |
buffer | - pointer to buffer containing the bytes to write. |
wrlen | - The number of bytes to write. If amount is not an integral number of XrdSys::PageSize bytes, then this must be the last write to the file at or above the offset. |
csvec | - A vector which contains the corresponding CRC32 checksum for each page or page fragment. If offset is unaligned then csvec[0] is the crc of the leading fragment to align the subsequent full page who's crc is in csvec[1]. It must be sized to hold all aligned XrdSys::Pagesize crc's plus additional ones for leading and ending page fragments, if any. |
opts | - Processing options (see above). |
Reimplemented from XrdSfsFile.
Definition at line 1188 of file XrdOfs.cc.
References XrdOfs::Emsg(), XrdOfsEvs::Enabled(), EPNAME, XrdSfsFile::error, FTRACE, XrdOfsEvs::Fwrite, XrdOfsHandle::isChanged, XrdOfsHandle::isPending, oh, opts, XrdOssDF::pgWrite(), XrdOfsHandle::Select(), SFS_ERROR, XrdOssDF::Verify, XrdSfsFile::Verify, write(), and XrdOfsFS.
Referenced by pgWrite().
|
virtual |
Read file bytes using asynchronous I/O.
aioparm | - Pointer to async I/O object controlling the I/O. |
Implements XrdSfsFile.
Definition at line 1432 of file XrdOfs.cc.
References aiocb::aio_buf, aiocb::aio_nbytes, aiocb::aio_offset, XrdSfsAio::doneRead(), XrdOfs::Emsg(), EPNAME, XrdSfsFile::error, FTRACE, XrdOfsHandle::isCompressed, XrdOfsHandle::Name(), oh, XrdOssDF::Read(), read(), XrdSfsAio::Result, XrdOfsHandle::Select(), SFS_OK, XrdSfsAio::sfsAio, and XrdOfsFS.
|
virtual |
Read file bytes into a buffer.
offset | - The offset where the read is to start. |
buffer | - pointer to buffer where the bytes are to be placed. |
size | - The number of bytes to read. |
Implements XrdSfsFile.
Definition at line 1346 of file XrdOfs.cc.
References dorawio, XrdOfs::Emsg(), EPNAME, XrdSfsFile::error, FTRACE, XrdOfsHandle::Name(), oh, XrdOssDF::Read(), read(), XrdOssDF::ReadRaw(), XrdOfsHandle::Select(), and XrdOfsFS.
|
virtual |
Preread file blocks into the file system cache.
offset | - The offset where the read is to start. |
size | - The number of bytes to pre-read. |
Implements XrdSfsFile.
Definition at line 1307 of file XrdOfs.cc.
References XrdOfs::Emsg(), EPNAME, XrdSfsFile::error, FTRACE, XrdOfsHandle::Name(), oh, XrdOssDF::Read(), XrdOfsHandle::Select(), and XrdOfsFS.
Referenced by pgRead(), and read().
|
virtual |
Given an array of read requests (size rdvCnt), read them from the file and place the contents consecutively in the provided buffer. A dumb default implementation is supplied but should be replaced to increase performance.
readV | pointer to the array of read requests. |
rdvCnt | the number of elements in readV. |
Reimplemented from XrdSfsFile.
Definition at line 1394 of file XrdOfs.cc.
References XrdOfs::Emsg(), EPNAME, XrdSfsFile::error, XrdOfsHandle::Name(), oh, XrdOssDF::ReadV(), XrdOfsHandle::Select(), and XrdOfsFS.
|
virtual |
Return state information on the file.
buf | - Pointer to the structure where info it to be returned. |
Implements XrdSfsFile.
Definition at line 1596 of file XrdOfs.cc.
References XrdOfs::Emsg(), EPNAME, XrdSfsFile::error, XrdOssDF::Fstat(), FTRACE, XrdOfsHandle::Name(), oh, XrdOfsHandle::Select(), SFS_OK, and XrdOfsFS.
|
virtual |
Make sure all outstanding data is actually written to the file (sync).
Implements XrdSfsFile.
Definition at line 1624 of file XrdOfs.cc.
References XrdOfs::Emsg(), EPNAME, XrdSfsFile::error, XrdOssDF::Fsync(), FTRACE, XrdOfsHandle::isPending, XrdOfsHandle::Lock(), myTPC, oh, XrdOfsHandle::Select(), SFS_OK, XrdOfsTPC::Sync(), XrdOfsHandle::UnLock(), and XrdOfsFS.
Referenced by sync().
|
virtual |
Make sure all outstanding data is actually written to the file (async).
Implements XrdSfsFile.
Definition at line 1674 of file XrdOfs.cc.
References XrdSfsAio::doneWrite(), XrdSfsAio::Result, and sync().
|
virtual |
Truncate the file.
fsize | - The size that the file is to have. |
Implements XrdSfsFile.
Definition at line 1685 of file XrdOfs.cc.
References XrdOfs::Emsg(), XrdOfsEvs::Enabled(), EPNAME, XrdSfsFile::error, FTRACE, XrdOssDF::Ftruncate(), XrdOfsEvs::Fwrite, XrdOfsHandle::isChanged, XrdOfsHandle::isPending, oh, XrdOfsHandle::Select(), SFS_OK, and XrdOfsFS.
|
virtual |
Write file bytes using asynchronous I/O.
aioparm | - Pointer to async I/O object controlling the I/O. |
Implements XrdSfsFile.
Definition at line 1528 of file XrdOfs.cc.
References aiocb::aio_buf, aiocb::aio_nbytes, aiocb::aio_offset, XrdSfsAio::doneWrite(), XrdOfs::Emsg(), XrdOfsEvs::Enabled(), EPNAME, XrdSfsFile::error, FTRACE, XrdOfsEvs::Fwrite, XrdOfsHandle::isChanged, XrdOfsHandle::isPending, XrdOfsHandle::isRW, XrdOfsHandle::Name(), oh, XrdOfsHandle::opPC, XrdSfsAio::Result, XrdOfsHandle::Select(), SFS_OK, XrdSfsAio::sfsAio, XrdOssDF::Write(), write(), and XrdOfsFS.
|
virtual |
Write file bytes from a buffer.
offset | - The offset where the write is to start. |
buffer | - pointer to buffer where the bytes reside. |
size | - The number of bytes to write. |
Implements XrdSfsFile.
Definition at line 1472 of file XrdOfs.cc.
References XrdOfs::Emsg(), XrdOfsEvs::Enabled(), EPNAME, XrdSfsFile::error, FTRACE, XrdOfsEvs::Fwrite, XrdOfsHandle::isChanged, XrdOfsHandle::isPending, oh, XrdOfsHandle::Select(), XrdOssDF::Write(), and XrdOfsFS.
Referenced by pgWrite(), and write().
|
protected |
Definition at line 202 of file XrdOfs.hh.
Referenced by checkpoint().
|
protected |
|
protected |
Definition at line 199 of file XrdOfs.hh.
Referenced by checkpoint(), and close().
|
protected |
|
protected |
Definition at line 197 of file XrdOfs.hh.
Referenced by ~XrdOfsFile(), checkpoint(), close(), fctl(), FName(), getCXinfo(), getMmap(), open(), pgRead(), pgWrite(), read(), readv(), stat(), sync(), truncate(), and write().
|
protected |
|
protected |
Definition at line 201 of file XrdOfs.hh.
Referenced by ~XrdOfsFile(), and close().