![]() |
XRootD
|
#include <XrdSfsInterface.hh>
Public Types | |
enum | cpAct { cpCreate =0 , cpDelete , cpRestore , cpQuery , cpTrunc , cpWrite } |
Public Member Functions | |
XrdSfsFile (const char *user=0, int MonID=0) | |
XrdSfsFile (XrdOucErrInfo &eInfo) | |
XrdSfsFile (XrdSfsFile &wrapF) | |
virtual | ~XrdSfsFile () |
Destructor. More... | |
virtual int | checkpoint (cpAct act, struct iov *range=0, int n=0) |
virtual int | close ()=0 |
virtual int | fctl (const int cmd, const char *args, XrdOucErrInfo &eInfo)=0 |
virtual int | fctl (const int cmd, int alen, const char *args, const XrdSecEntity *client=0) |
virtual const char * | FName ()=0 |
virtual int | getCXinfo (char cxtype[4], int &cxrsz)=0 |
virtual int | getMmap (void **Addr, off_t &Size)=0 |
virtual int | open (const char *fileName, XrdSfsFileOpenMode openMode, mode_t createMode, const XrdSecEntity *client=0, const char *opaque=0)=0 |
virtual int | pgRead (XrdSfsAio *aioparm, uint64_t opts=0) |
virtual XrdSfsXferSize | pgRead (XrdSfsFileOffset offset, char *buffer, XrdSfsXferSize rdlen, uint32_t *csvec, uint64_t opts=0) |
virtual int | pgWrite (XrdSfsAio *aioparm, uint64_t opts=0) |
virtual XrdSfsXferSize | pgWrite (XrdSfsFileOffset offset, char *buffer, XrdSfsXferSize wrlen, uint32_t *csvec, uint64_t opts=0) |
virtual int | read (XrdSfsAio *aioparm)=0 |
virtual XrdSfsXferSize | read (XrdSfsFileOffset offset, char *buffer, XrdSfsXferSize size)=0 |
virtual XrdSfsXferSize | read (XrdSfsFileOffset offset, XrdSfsXferSize size)=0 |
virtual XrdSfsXferSize | readv (XrdOucIOVec *readV, int rdvCnt) |
virtual int | SendData (XrdSfsDio *sfDio, XrdSfsFileOffset offset, XrdSfsXferSize size) |
virtual void | setXio (XrdSfsXio *xioP) |
virtual int | stat (struct stat *buf)=0 |
virtual int | sync ()=0 |
virtual int | sync (XrdSfsAio *aiop)=0 |
virtual int | truncate (XrdSfsFileOffset fsize)=0 |
virtual int | write (XrdSfsAio *aioparm)=0 |
virtual XrdSfsXferSize | write (XrdSfsFileOffset offset, const char *buffer, XrdSfsXferSize size)=0 |
virtual XrdSfsXferSize | writev (XrdOucIOVec *writeV, int wdvCnt) |
Public Attributes | |
XrdOucErrInfo & | error |
Static Public Attributes | |
static const uint64_t | Verify = 0x8000000000000000ULL |
Options for pgRead() and pgWrite() as noted below. More... | |
Definition at line 369 of file XrdSfsInterface.hh.
enum XrdSfsFile::cpAct |
Create, delete, query, rollback a file checkpoint or perform an action.
act | - The operation to be performed (see cpAct enum below). |
range | - Use and requirement vary by function: cpCreate - Create a new checkpoint, one must not exist. Parameters ignored, not applicable. cpDelete - Delete an existing checkpoint, one must exist. Parameters ignored, not applicable. cpQuery - Where result is to be returned: range[0].offset - Amount currently in use. range[0].length - Maximum total length cpRestore - Restore data from checkpoint and delete it. Parameters ignored, not applicable. cpTrunc - Offset target for truncation. range[0].offset - Offset for truncations. cpWrite - Offset/lengths of the file to be checkpointed. The checkpoint must exist via previous cpCreate. |
n | - Number of elements in range. Applies only to cpWrite. |
Definition at line 433 of file XrdSfsInterface.hh.
|
inline |
Constructor (user and MonID are the ones passed to newFile()!). This constructor should only be used by base plugins. Plugins that wrap an SfsFile should use the second version of the constructor shown below.
user | - Text identifying the client responsible for this call. The pointer may be null if identification is missing. |
MonID | - The monitoring identifier assigned to this and all future requests using the returned object. |
Definition at line 779 of file XrdSfsInterface.hh.
References error.
|
inline |
Constructor for plugins that wrap another SFS plugin. This constructor inherits the error object from a wrapped XrdSfsFile object so that only one identical error object exists for all file objects in the chain.
wrapF | - Reference to the file object being wrapped. |
Definition at line 791 of file XrdSfsInterface.hh.
|
inline |
Constructor for base plugins that predefined an error object. This is a convenience constructor for base plugins only.
eInfo | - Reference to the error object to use. |
Definition at line 801 of file XrdSfsInterface.hh.
|
inlinevirtual |
Reimplemented in XrdOfsFile, and XrdThrottle::File.
Definition at line 60 of file XrdSfsInterface.cc.
References cpCreate, cpDelete, cpRestore, error, XrdOucErrInfo::setErrInfo(), and SFS_ERROR.
|
pure virtual |
Close the file.
Implemented in XrdThrottle::File, XrdSsiFile, XrdSfsNativeFile, XrdOfsFile, XrdDigFile, and XrdBwmFile.
|
pure 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. |
Implemented in XrdThrottle::File, XrdSsiFile, XrdSfsNativeFile, XrdOfsFile, XrdDigFile, and XrdBwmFile.
Referenced by XrdXrootdFile::XrdXrootdFile().
|
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 in XrdOfsFile, and XrdSsiFile.
Definition at line 80 of file XrdSfsInterface.cc.
References SFS_OK.
|
pure virtual |
Get the file path.
Implemented in XrdThrottle::File, XrdSsiFile, XrdSfsNativeFile, XrdOfsFile, XrdDigFile, and XrdBwmFile.
|
pure 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 |
Implemented in XrdThrottle::File, XrdSsiFile, XrdSfsNativeFile, XrdOfsFile, XrdDigFile, and XrdBwmFile.
|
pure 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. |
Implemented in XrdThrottle::File, XrdSsiFile, XrdSfsNativeFile, XrdOfsFile, XrdDigFile, and XrdBwmFile.
Referenced by XrdXrootdFile::XrdXrootdFile().
|
pure 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). |
Implemented in XrdSsiFile, XrdThrottle::File, XrdOfsFile, and XrdBwmFile.
|
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 in XrdThrottle::File, and XrdOfsFile.
Definition at line 116 of file XrdSfsInterface.cc.
References aiocb::aio_buf, aiocb::aio_nbytes, aiocb::aio_offset, XrdSfsAio::cksVec, XrdSfsAio::doneRead(), opts, pgRead(), XrdSfsAio::Result, SFS_OK, and XrdSfsAio::sfsAio.
|
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 in XrdThrottle::File, and XrdOfsFile.
Definition at line 93 of file XrdSfsInterface.cc.
References XrdOucPgrwUtils::csCalc(), and read().
Referenced by pgRead().
|
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 in XrdThrottle::File, and XrdOfsFile.
Definition at line 159 of file XrdSfsInterface.cc.
References aiocb::aio_buf, aiocb::aio_nbytes, aiocb::aio_offset, XrdSfsAio::cksVec, XrdSfsAio::doneWrite(), opts, pgWrite(), XrdSfsAio::Result, SFS_OK, and XrdSfsAio::sfsAio.
|
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 in XrdOfsFile, and XrdThrottle::File.
Definition at line 130 of file XrdSfsInterface.cc.
References XrdOucPgrwUtils::csVer(), eMsg, error, opts, XrdOucErrInfo::setErrInfo(), SFS_ERROR, Verify, and write().
Referenced by pgWrite().
|
pure virtual |
Read file bytes using asynchronous I/O.
aioparm | - Pointer to async I/O object controlling the I/O. |
Implemented in XrdThrottle::File, XrdSsiFile, XrdSfsNativeFile, XrdOfsFile, XrdDigFile, and XrdBwmFile.
|
pure 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. |
Implemented in XrdThrottle::File, XrdSsiFile, XrdSfsNativeFile, XrdOfsFile, XrdDigFile, and XrdBwmFile.
|
pure 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. |
Implemented in XrdSsiFile, XrdSfsNativeFile, XrdDigFile, XrdThrottle::File, XrdOfsFile, and XrdBwmFile.
Referenced by pgRead(), and readv().
|
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 in XrdSsiFile, XrdSfsNativeFile, XrdOfsFile, and XrdDigFile.
Definition at line 173 of file XrdSfsInterface.cc.
References error, read(), XrdOucErrInfo::setErrInfo(), and SFS_ERROR.
|
virtual |
Send file bytes via a XrdSfsDio sendfile object to a client (optional).
sfDio | - Pointer to the sendfile object for data transfer. |
offset | - The offset where the read is to start. |
size | - The number of bytes to read and send. |
Reimplemented in XrdThrottle::File, and XrdSsiFile.
Definition at line 195 of file XrdSfsInterface.cc.
References SFS_OK.
|
inlinevirtual |
Enable exchange buffer I/O for write calls.
xioP | - Pointer to the XrdSfsXio object to be used for buffer exchanges. |
Reimplemented in XrdSsiFile.
Definition at line 766 of file XrdSfsInterface.hh.
|
pure virtual |
Return state information on the file.
buf | - Pointer to the structure where info it to be returned. |
Implemented in XrdThrottle::File, XrdSsiFile, XrdSfsNativeFile, XrdOfsFile, XrdDigFile, and XrdBwmFile.
Referenced by XrdXrootdFile::XrdXrootdFile().
|
pure virtual |
Make sure all outstanding data is actually written to the file (sync).
Implemented in XrdThrottle::File, XrdSsiFile, XrdSfsNativeFile, XrdOfsFile, XrdDigFile, and XrdBwmFile.
|
pure virtual |
Make sure all outstanding data is actually written to the file (async).
Implemented in XrdThrottle::File, XrdSsiFile, XrdSfsNativeFile, XrdOfsFile, XrdDigFile, and XrdBwmFile.
|
pure virtual |
Truncate the file.
fsize | - The size that the file is to have. |
Implemented in XrdThrottle::File, XrdSsiFile, XrdSfsNativeFile, XrdOfsFile, XrdDigFile, and XrdBwmFile.
|
pure virtual |
Write file bytes using asynchronous I/O.
aioparm | - Pointer to async I/O object controlling the I/O. |
Implemented in XrdThrottle::File, XrdSsiFile, XrdSfsNativeFile, XrdOfsFile, XrdDigFile, and XrdBwmFile.
|
pure 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. |
Implemented in XrdThrottle::File, XrdSsiFile, XrdSfsNativeFile, XrdOfsFile, XrdDigFile, and XrdBwmFile.
Referenced by XrdXrootdProtocol::do_WriteSpan(), pgWrite(), and writev().
|
virtual |
Given an array of write requests (size wdvcnt), write them to the file from the provided associated buffer. A dumb default implementation is supplied but should be replaced to increase performance.
writeV | pointer to the array of write requests. |
wdvCnt | the number of elements in writeV. |
Definition at line 207 of file XrdSfsInterface.cc.
References error, XrdOucErrInfo::setErrInfo(), SFS_ERROR, and write().
XrdOucErrInfo& XrdSfsFile::error |
The error object is used to return details whenever something other than SFS_OK is returned from the methods in this class, when noted.
Definition at line 378 of file XrdSfsInterface.hh.
Referenced by XrdSfsFile(), XrdXrootdFile::XrdXrootdFile(), checkpoint(), XrdOfsFile::checkpoint(), XrdOfsFile::close(), XrdSfsNativeFile::close(), XrdThrottle::File::fctl(), XrdOfsFile::fctl(), XrdThrottle::File::getMmap(), XrdSfsNativeFile::open(), XrdBwmFile::open(), XrdOfsFile::open(), XrdThrottle::File::open(), XrdOfsFile::pgRead(), XrdOfsFile::pgWrite(), pgWrite(), XrdSfsNativeFile::read(), XrdOfsFile::read(), readv(), XrdOfsFile::readv(), XrdSfsNativeFile::readv(), XrdOfsFile::stat(), XrdSfsNativeFile::stat(), XrdOfsFile::sync(), XrdSfsNativeFile::sync(), XrdBwmFile::truncate(), XrdOfsFile::truncate(), XrdSfsNativeFile::truncate(), XrdOfsFile::write(), XrdSfsNativeFile::write(), and writev().
|
static |
Options for pgRead() and pgWrite() as noted below.
all: Verify checksums
Definition at line 518 of file XrdSfsInterface.hh.
Referenced by XrdOfsFile::pgRead(), XrdOfsFile::pgWrite(), and pgWrite().