xrootd
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
XrdOssDF Class Referenceabstract

#include <XrdOss.hh>

Inheritance diagram for XrdOssDF:
Inheritance graph
[legend]

Public Member Functions

virtual int Opendir (const char *path, XrdOucEnv &env)
 
virtual int Readdir (char *buff, int blen)
 
virtual int StatRet (struct stat *buff)
 
virtual int Fchmod (mode_t mode)
 
virtual void Flush ()
 Flush filesystem cached pages for this file (used for checksums).
 
virtual int Fstat (struct stat *buf)
 
virtual int Fsync ()
 
virtual int Fsync (XrdSfsAio *aiop)
 
virtual int Ftruncate (unsigned long long flen)
 
virtual off_t getMmap (void **addr)
 
virtual int isCompressed (char *cxidp=0)
 
virtual int Open (const char *path, int Oflag, mode_t Mode, XrdOucEnv &env)
 
virtual ssize_t pgRead (void *buffer, off_t offset, size_t rdlen, uint32_t *csvec, uint64_t opts)
 
virtual int pgRead (XrdSfsAio *aioparm, uint64_t opts)
 
virtual ssize_t pgWrite (void *buffer, off_t offset, size_t wrlen, uint32_t *csvec, uint64_t opts)
 
virtual int pgWrite (XrdSfsAio *aioparm, uint64_t opts)
 
virtual ssize_t Read (off_t offset, size_t size)
 
virtual ssize_t Read (void *buffer, off_t offset, size_t size)
 
virtual int Read (XrdSfsAio *aiop)
 
virtual ssize_t ReadRaw (void *buffer, off_t offset, size_t size)
 
virtual ssize_t ReadV (XrdOucIOVec *readV, int rdvcnt)
 
virtual ssize_t Write (const void *buffer, off_t offset, size_t size)
 
virtual int Write (XrdSfsAio *aiop)
 
virtual ssize_t WriteV (XrdOucIOVec *writeV, int wrvcnt)
 
virtual int Close (long long *retsz=0)=0
 
uint16_t DFType ()
 
virtual int Fctl (int cmd, int alen, const char *args, char **resp=0)
 
virtual int getFD ()
 
virtual const char * getTID ()
 
 XrdOssDF (const char *tid="", uint16_t dftype=0, int fdnum=-1)
 
virtual ~XrdOssDF ()
 

Static Public Attributes

static const uint64_t Verify = 0x8000000000000000ULL
 all: Verify checksums
 
static const uint64_t doCalc = 0x4000000000000000ULL
 pgw: Calculate checksums
 
static const uint16_t DF_isDir = 0x0001
 Object is for a directory.
 
static const uint16_t DF_isFile = 0x0002
 Object is for a file.
 
static const uint16_t DF_isProxy = 0x0010
 Object is a proxy object.
 
static const int Fctl_ckpObj = 0
 
static const int Fctl_utimes = 1
 

Protected Attributes

const char * tident
 
off_t pgwEOF
 
int fd
 
uint16_t dfType
 
short rsvd
 

Detailed Description

This class defines the object that handles directory as well as file oriented requests. It is instantiated for each file/dir to be opened. The object is obtained by calling newDir() or newFile() in class XrdOss. This allows flexibility on how to structure an oss plugin.

Constructor & Destructor Documentation

◆ XrdOssDF()

XrdOssDF::XrdOssDF ( const char *  tid = "",
uint16_t  dftype = 0,
int  fdnum = -1 
)
inline

Constructor and Destructor

Parameters
tid- Pointer to the trace identifier.
dftype- The type of the object.
fdnum- The value for the file descriptor.

◆ ~XrdOssDF()

virtual XrdOssDF::~XrdOssDF ( )
inlinevirtual

Member Function Documentation

◆ Close()

virtual int XrdOssDF::Close ( long long *  retsz = 0)
pure virtual

Close a directory or file.

Parameters
retszIf not nil, where the size of the file is to be returned.
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Implemented in XrdCephOssDir, XrdCephOssFile, XrdOssDir, XrdOssFile, XrdOssWrapDF, XrdOssCsiFile, XrdOssDFHandler, XrdPssDir, and XrdPssFile.

Referenced by XrdOssWrapDF::Close(), and XrdOssDFHandler::Close().

◆ DFType()

uint16_t XrdOssDF::DFType ( )
inline

References dfType.

Referenced by XrdOssWrapDF::DFType().

◆ Fchmod()

virtual int XrdOssDF::Fchmod ( mode_t  mode)
inlinevirtual

Change file mode settings.

Parameters
mode- The new file mode setting.
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Reimplemented in XrdOssFile, XrdOssWrapDF, XrdOssDFHandler, and XrdPssFile.

Referenced by XrdOssWrapDF::Fchmod(), and XrdOssDFHandler::Fchmod().

◆ Fctl()

virtual int XrdOssDF::Fctl ( int  cmd,
int  alen,
const char *  args,
char **  resp = 0 
)
virtual

◆ Flush()

virtual void XrdOssDF::Flush ( )
inlinevirtual

Flush filesystem cached pages for this file (used for checksums).

Reimplemented in XrdOssFile, XrdOssWrapDF, XrdOssCsiFile, and XrdOssDFHandler.

Referenced by XrdOssWrapDF::Flush(), and XrdOssDFHandler::Flush().

◆ Fstat()

virtual int XrdOssDF::Fstat ( struct stat buf)
inlinevirtual

Return state information for this file.

Parameters
buf- Pointer to the structure where info it to be returned.
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Reimplemented in XrdOssFile, XrdOssCsiFile, XrdPssFile, XrdOssWrapDF, XrdCephOssFile, and XrdOssDFHandler.

Referenced by XrdOssWrapDF::Fstat(), and XrdOssDFHandler::Fstat().

◆ Fsync() [1/2]

virtual int XrdOssDF::Fsync ( void  )
inlinevirtual

Synchronize associated file with media (synchronous).

Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Reimplemented in XrdOssFile, XrdOssWrapDF, XrdOssCsiFile, XrdOssDFHandler, XrdPssFile, and XrdCephOssFile.

Referenced by XrdOssWrapDF::Fsync(), XrdOssDFHandler::Fsync(), XrdOssWrapDF::Fsync(), and XrdOssDFHandler::Fsync().

◆ Fsync() [2/2]

virtual int XrdOssDF::Fsync ( XrdSfsAio aiop)
inlinevirtual

Synchronize associated file with media (asynchronous).

Parameters
aiop- Pointer to async I/O request object.
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Reimplemented in XrdOssCsiFile, XrdOssFile, XrdOssWrapDF, XrdOssDFHandler, and XrdPssFile.

◆ Ftruncate()

virtual int XrdOssDF::Ftruncate ( unsigned long long  flen)
inlinevirtual

Set the size of the associated file.

Parameters
flen- The new size of the file.
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Reimplemented in XrdOssWrapDF, XrdOssDFHandler, XrdCephOssFile, XrdOssFile, XrdOssCsiFile, and XrdPssFile.

Referenced by XrdOssWrapDF::Ftruncate(), and XrdOssDFHandler::Ftruncate().

◆ getFD()

virtual int XrdOssDF::getFD ( )
inlinevirtual

Return the underlying file descriptor.

Returns
-1 if there is no file descriptor or a non-negative FD number.

Reimplemented in XrdOssDir, XrdOssFile, XrdOssWrapDF, XrdOssCsiFile, and XrdOssDFHandler.

Referenced by XrdOssWrapDF::getFD(), and XrdOssDFHandler::getFD().

◆ getMmap()

virtual off_t XrdOssDF::getMmap ( void **  addr)
inlinevirtual

Return the memory mapped characteristics of the file.

Parameters
addr- Pointer to where the memory mapped address is to be returned.
Returns
If mapped, the size of the file is returned and it memory location is placed in addr. Otherwise, addr is set to zero and zero is returned. Note that zero length files cannot be memory mapped.

Reimplemented in XrdOssFile, XrdOssWrapDF, XrdOssCsiFile, and XrdOssDFHandler.

Referenced by XrdOssWrapDF::getMmap(), and XrdOssDFHandler::getMmap().

◆ getTID()

virtual const char * XrdOssDF::getTID ( )
inlinevirtual

Return trace identifier associated with this object.

Returns
Pointer to trace identifier

Reimplemented in XrdOssWrapDF, and XrdOssDFHandler.

References tident.

Referenced by XrdOssWrapDF::getTID(), and XrdOssDFHandler::getTID().

◆ isCompressed()

virtual int XrdOssDF::isCompressed ( char *  cxidp = 0)
inlinevirtual

Return file compression charectistics.

Parameters
cxidp- Pointer to where the compression algorithm name returned.
Returns
If the file is compressed, the region size if returned. Otherwise, zero is returned (file not compressed).

Reimplemented in XrdOssFile, XrdOssWrapDF, and XrdOssDFHandler.

Referenced by XrdOssWrapDF::isCompressed(), and XrdOssDFHandler::isCompressed().

◆ Open()

virtual int XrdOssDF::Open ( const char *  path,
int  Oflag,
mode_t  Mode,
XrdOucEnv env 
)
inlinevirtual

Open a file.

Parameters
path- Pointer to the path of the file to be opened.
Oflag- Standard open flags.
Mode- File open mode (ignored unless creating a file).
env- Reference to environmental information.
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Reimplemented in XrdOssFile, XrdOssCsiFile, XrdPssFile, XrdCephOssFile, XrdOssWrapDF, and XrdOssDFHandler.

Referenced by XrdOssWrapDF::Open(), and XrdOssDFHandler::Open().

◆ Opendir()

virtual int XrdOssDF::Opendir ( const char *  path,
XrdOucEnv env 
)
inlinevirtual

Open a directory.

Parameters
path- Pointer to the path of the directory to be opened.
env- Reference to environmental information.
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Reimplemented in XrdCephOssDir, XrdOssDir, XrdPssDir, XrdOssDFHandler, XrdOssWrapDF, and XrdOssCsiDir.

Referenced by XrdOssDFHandler::Opendir(), and XrdOssWrapDF::Opendir().

◆ pgRead() [1/2]

virtual ssize_t XrdOssDF::pgRead ( void *  buffer,
off_t  offset,
size_t  rdlen,
uint32_t *  csvec,
uint64_t  opts 
)
virtual

◆ pgRead() [2/2]

virtual int XrdOssDF::pgRead ( XrdSfsAio aioparm,
uint64_t  opts 
)
virtual

Read file pages and checksums using asynchronous I/O.

Parameters
aioparm- Pointer to async I/O object controlling the I/O.
opts- Processing options (see above).
Returns
0 upon if request started success or -errno or -osserr (see XrdOssError.hh).

Reimplemented in XrdOssCsiFile, XrdOssWrapDF, XrdOssDFHandler, and XrdPssFile.

◆ pgWrite() [1/2]

virtual ssize_t XrdOssDF::pgWrite ( void *  buffer,
off_t  offset,
size_t  wrlen,
uint32_t *  csvec,
uint64_t  opts 
)
virtual

Write file pages into a file with corresponding checksums.

Parameters
buffer- pointer to buffer containing the bytes to write.
offset- The offset where the write is to start.
wrlen- The number of bytes to write.
csvec- A vector which contains the corresponding CRC32 checksum for each page. See XrdOucPgrwUtils::csNum() for sizing.
opts- Processing options (see above).
Returns
>= 0 The number of bytes written upon success. or -errno or -osserr upon failure. (see XrdOssError.hh).
< 0 -errno or -osserr upon failure. (see XrdOssError.hh).

Reimplemented in XrdOssCsiFile, XrdOssWrapDF, XrdOssDFHandler, and XrdPssFile.

Referenced by XrdOssWrapDF::pgWrite(), XrdOssDFHandler::pgWrite(), XrdOssWrapDF::pgWrite(), and XrdOssDFHandler::pgWrite().

◆ pgWrite() [2/2]

virtual int XrdOssDF::pgWrite ( XrdSfsAio aioparm,
uint64_t  opts 
)
virtual

Write file pages and checksums using asynchronous I/O.

Parameters
aioparm- Pointer to async I/O object controlling the I/O.
opts- Processing options (see above).
Returns
0 upon if request started success or -errno or -osserr (see XrdOssError.hh).

Reimplemented in XrdOssCsiFile, XrdOssWrapDF, XrdOssDFHandler, and XrdPssFile.

◆ Read() [1/3]

virtual ssize_t XrdOssDF::Read ( off_t  offset,
size_t  size 
)
inlinevirtual

Preread file blocks into the file system cache.

Parameters
offset- The offset where the read is to start.
size- The number of bytes to pre-read.
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Reimplemented in XrdCephOssFile, XrdOssDFHandler, XrdOssWrapDF, XrdOssFile, XrdOssCsiFile, and XrdPssFile.

Referenced by XrdOssCsiFileAioJob::DoItRead1(), XrdOssCsiFileAioJob::DoItRead2(), XrdOssCsiTagstoreFile::fullread(), XrdOssCsiPages::maxread(), XrdOssDFHandler::Read(), XrdOssWrapDF::Read(), XrdOssDFHandler::Read(), XrdOssWrapDF::Read(), XrdOssWrapDF::Read(), and XrdOssDFHandler::Read().

◆ Read() [2/3]

virtual ssize_t XrdOssDF::Read ( void *  buffer,
off_t  offset,
size_t  size 
)
inlinevirtual

Read file bytes into a buffer.

Parameters
buffer- pointer to buffer where the bytes are to be placed.
offset- The offset where the read is to start.
size- The number of bytes to read.
Returns
>= 0 The number of bytes that placed in buffer.
< 0 -errno or -osserr upon failure (see XrdOssError.hh).

Reimplemented in XrdOssFile, XrdOssCsiFile, XrdPssFile, XrdCephOssFile, XrdOssDFHandler, and XrdOssWrapDF.

◆ Read() [3/3]

virtual int XrdOssDF::Read ( XrdSfsAio aiop)
inlinevirtual

Read file bytes using asynchronous I/O.

Parameters
aiop- Pointer to async I/O object controlling the I/O.
Returns
0 upon if request started success or -errno or -osserr (see XrdOssError.hh).

Reimplemented in XrdOssCsiFile, XrdCephOssFile, XrdOssFile, XrdOssWrapDF, XrdOssDFHandler, and XrdPssFile.

◆ Readdir()

virtual int XrdOssDF::Readdir ( char *  buff,
int  blen 
)
inlinevirtual

Get the next directory entry.

Parameters
buff- Pointer to buffer where a null terminated string of the entry name is to be returned. If no more entries exist, a null string is returned.
blen- Length of the buffer.
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

Reimplemented in XrdCephOssDir, XrdOssDir, XrdOssWrapDF, XrdOssCsiDir, XrdOssDFHandler, and XrdPssDir.

Referenced by XrdOssWrapDF::Readdir(), and XrdOssDFHandler::Readdir().

◆ ReadRaw()

virtual ssize_t XrdOssDF::ReadRaw ( void *  buffer,
off_t  offset,
size_t  size 
)
inlinevirtual

Read uncompressed file bytes into a buffer.

Parameters
buffer- pointer to buffer where the bytes are to be placed.
offset- The offset where the read is to start.
size- The number of bytes to read.
Returns
>= 0 The number of bytes that placed in buffer.
< 0 -errno or -osserr upon failure (see XrdOssError.hh).

Reimplemented in XrdCephOssFile, XrdOssFile, XrdOssCsiFile, XrdPssFile, XrdOssDFHandler, and XrdOssWrapDF.

Referenced by XrdOssDFHandler::ReadRaw(), and XrdOssWrapDF::ReadRaw().

◆ ReadV()

virtual ssize_t XrdOssDF::ReadV ( XrdOucIOVec readV,
int  rdvcnt 
)
virtual

Read file bytes as directed by the read vector.

Parameters
readVpointer to the array of read requests.
rdvcntthe number of elements in readV.
Returns
>=0 The numbe of bytes read.
< 0 -errno or -osserr upon failure (see XrdOssError.hh).

Reimplemented in XrdOssCsiFile, XrdOssDFHandler, XrdPssFile, XrdOssWrapDF, and XrdOssFile.

Referenced by XrdOssDFHandler::ReadV(), and XrdOssWrapDF::ReadV().

◆ StatRet()

virtual int XrdOssDF::StatRet ( struct stat buff)
inlinevirtual

Set the stat() buffer where stat information is to be placed corresponding to the directory entry returned by Readdir().

Parameters
buff- Pointer to stat structure to be used.
Returns
0 upon success or -ENOTSUP if not supported.
Note
This is a one-time call as stat structure is reused for each Readdir.
When StatRet() is in effect, directory entries that have been deleted from the target directory are quietly skipped.

Reimplemented in XrdOssDir, XrdOssDFHandler, and XrdOssWrapDF.

Referenced by XrdOssDFHandler::StatRet(), and XrdOssWrapDF::StatRet().

◆ Write() [1/2]

virtual ssize_t XrdOssDF::Write ( const void *  buffer,
off_t  offset,
size_t  size 
)
inlinevirtual

Write file bytes from a buffer.

Parameters
buffer- pointer to buffer where the bytes reside.
offset- The offset where the write is to start.
size- The number of bytes to write.
Returns
>= 0 The number of bytes that were written.
< 0 -errno or -osserr upon failure (see XrdOssError.hh).

Reimplemented in XrdOssFile, XrdOssCsiFile, XrdPssFile, XrdCephOssFile, XrdOssDFHandler, and XrdOssWrapDF.

Referenced by XrdOssCsiFileAioJob::DoItWrite1(), XrdOssCsiFileAioJob::DoItWrite2(), XrdOssCsiTagstoreFile::fullwrite(), XrdOssDFHandler::Write(), XrdOssWrapDF::Write(), XrdOssWrapDF::Write(), and XrdOssDFHandler::Write().

◆ Write() [2/2]

virtual int XrdOssDF::Write ( XrdSfsAio aiop)
inlinevirtual

Write file bytes using asynchronous I/O.

Parameters
aiop- Pointer to async I/O object controlling the I/O.
Returns
0 upon if request started success or -errno or -osserr (see XrdOssError.hh).

Reimplemented in XrdOssCsiFile, XrdCephOssFile, XrdOssFile, XrdOssWrapDF, XrdOssDFHandler, and XrdPssFile.

◆ WriteV()

virtual ssize_t XrdOssDF::WriteV ( XrdOucIOVec writeV,
int  wrvcnt 
)
virtual

Write file bytes as directed by the write vector.

Parameters
writeVpointer to the array of write requests.
wrvcntthe number of elements in writeV.
Returns
>=0 The numbe of bytes read.
< 0 -errno or -osserr upon failure (see XrdOssError.hh).

Reimplemented in XrdOssCsiFile, XrdOssDFHandler, and XrdOssWrapDF.

Referenced by XrdOssDFHandler::WriteV(), and XrdOssWrapDF::WriteV().

Member Data Documentation

◆ DF_isDir

const uint16_t XrdOssDF::DF_isDir = 0x0001
static

Object is for a directory.

Return the underlying object type.

Returns
Type of object.

◆ DF_isFile

const uint16_t XrdOssDF::DF_isFile = 0x0002
static

Object is for a file.

◆ DF_isProxy

const uint16_t XrdOssDF::DF_isProxy = 0x0010
static

Object is a proxy object.

◆ dfType

uint16_t XrdOssDF::dfType
protected

Referenced by DFType().

◆ doCalc

const uint64_t XrdOssDF::doCalc = 0x4000000000000000ULL
static

pgw: Calculate checksums

◆ Fctl_ckpObj

const int XrdOssDF::Fctl_ckpObj = 0
static

Execute a special operation on the directory or file.

Parameters
cmd- The operation to be performed: Fctl_ckpObj - Obtain checkpoint object for proxy file. Argument: None. Response: Pointer to XrdOucChkPnt object. Fctl_utimes - Set atime and mtime (no response). Argument: struct timeval tv[2]
alen- Length of data pointed to by args.
args- Data sent with request, zero if alen is zero.
resp- Where the response is to be set. The caller must call delete on the returned object.
Returns
0 upon success or -errno or -osserr (see XrdOssError.hh).

◆ Fctl_utimes

const int XrdOssDF::Fctl_utimes = 1
static

◆ fd

int XrdOssDF::fd
protected

◆ pgwEOF

off_t XrdOssDF::pgwEOF
protected

◆ rsvd

short XrdOssDF::rsvd
protected

◆ tident

const char* XrdOssDF::tident
protected

Referenced by getTID().

◆ Verify

const uint64_t XrdOssDF::Verify = 0x8000000000000000ULL
static

all: Verify checksums

Read file pages into a buffer and return corresponding checksums.

Parameters
buffer- pointer to buffer where the bytes are to be placed.
offset- The offset where the read is to start. It must be page aligned.
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. It must be size to rdlen/XrdSys::PageSize + (rdlenXrdSys::PageSize != 0)
opts- Processing options (see below).
Returns
>= 0 The number of bytes that placed in buffer upon success.
< 0 -errno or -osserr upon failure. (see XrdOssError.hh).

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