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

#include <XrdOssWrapper.hh>

Inheritance diagram for XrdOssWrapDF:
Inheritance graph
[legend]
Collaboration diagram for XrdOssWrapDF:
Collaboration 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 *Stat)
 
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)
 
uint16_t DFType ()
 
virtual int Fctl (int cmd, int alen, const char *args, char **resp=0)
 
virtual int getFD ()
 
virtual const char * getTID ()
 
 XrdOssWrapDF (XrdOssDF &df2Wrap)
 
virtual ~XrdOssWrapDF ()
 
- Public Member Functions inherited from XrdOssDF
uint16_t DFType ()
 
 XrdOssDF (const char *tid="", uint16_t dftype=0, int fdnum=-1)
 
virtual ~XrdOssDF ()
 

Protected Attributes

XrdOssDFwrapDF
 
- Protected Attributes inherited from XrdOssDF
const char * tident
 
off_t pgwEOF
 
int fd
 
uint16_t dfType
 
short rsvd
 

Additional Inherited Members

- Static Public Attributes inherited from XrdOssDF
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
 

Detailed Description

This class defines a wrapper around the three basic XrdOss classes that defines the Oss interface. It is meant to be used by pushed XrdOss plugins that wish to intercept certain XrdOss method for an underlying Oss plugin. Inheriting this class and providing it the underlying wrapped object allows the derived class to easily intercept certain methods while allow non-intercepted methods to pass through. This class wraps the object that handles directory as well as file oriented requests. It is used by the derived class to wrap the object obtained by calling newDir() or newFile() in class XrdOss.

Constructor & Destructor Documentation

◆ XrdOssWrapDF()

XrdOssWrapDF::XrdOssWrapDF ( XrdOssDF df2Wrap)
inline

Constructor and Destructor

Parameters
df2Wrap-Reference to the newFile or newDir object being wrapped.
Note
: The object creator is responsible for deleting the df2Wrap object. The ref to this object is stored here and is accessible.

◆ ~XrdOssWrapDF()

virtual XrdOssWrapDF::~XrdOssWrapDF ( )
inlinevirtual

Member Function Documentation

◆ Close()

virtual int XrdOssWrapDF::Close ( long long *  retsz = 0)
inlinevirtual

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).

Implements XrdOssDF.

References XrdOssDF::Close(), and wrapDF.

◆ DFType()

uint16_t XrdOssWrapDF::DFType ( )
inline

Return the underlying object type.

Returns
Type of object.

References XrdOssDF::DFType(), and wrapDF.

◆ Fchmod()

virtual int XrdOssWrapDF::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 from XrdOssDF.

References XrdOssDF::Fchmod(), and wrapDF.

◆ Fctl()

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

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).

Reimplemented from XrdOssDF.

References XrdOssDF::Fctl(), and wrapDF.

◆ Flush()

virtual void XrdOssWrapDF::Flush ( )
inlinevirtual

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

Reimplemented from XrdOssDF.

References XrdOssDF::Flush(), and wrapDF.

◆ Fstat()

virtual int XrdOssWrapDF::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 from XrdOssDF.

References XrdOssDF::Fstat(), and wrapDF.

◆ Fsync() [1/2]

virtual int XrdOssWrapDF::Fsync ( void  )
inlinevirtual

Synchronize associated file with media (synchronous).

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

Reimplemented from XrdOssDF.

References XrdOssDF::Fsync(), and wrapDF.

◆ Fsync() [2/2]

virtual int XrdOssWrapDF::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 from XrdOssDF.

References XrdOssDF::Fsync(), and wrapDF.

◆ Ftruncate()

virtual int XrdOssWrapDF::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 from XrdOssDF.

References XrdOssDF::Ftruncate(), and wrapDF.

◆ getFD()

virtual int XrdOssWrapDF::getFD ( )
inlinevirtual

Return the underlying file descriptor.

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

Reimplemented from XrdOssDF.

References XrdOssDF::getFD(), and wrapDF.

◆ getMmap()

virtual off_t XrdOssWrapDF::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 from XrdOssDF.

References XrdOssDF::getMmap(), and wrapDF.

◆ getTID()

virtual const char * XrdOssWrapDF::getTID ( )
inlinevirtual

Return trace identifier associated with this object.

Returns
Pointer to trace identifier

Reimplemented from XrdOssDF.

References XrdOssDF::getTID(), and wrapDF.

◆ isCompressed()

virtual int XrdOssWrapDF::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 from XrdOssDF.

References XrdOssDF::isCompressed(), and wrapDF.

◆ Open()

virtual int XrdOssWrapDF::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 from XrdOssDF.

References XrdOssDF::Open(), and wrapDF.

◆ Opendir()

virtual int XrdOssWrapDF::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 from XrdOssDF.

References XrdOssDF::Opendir(), and wrapDF.

◆ pgRead() [1/2]

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

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).

Reimplemented from XrdOssDF.

References XrdOssDF::pgRead(), and wrapDF.

◆ pgRead() [2/2]

virtual int XrdOssWrapDF::pgRead ( XrdSfsAio aioparm,
uint64_t  opts 
)
inlinevirtual

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 from XrdOssDF.

References XrdOssDF::pgRead(), and wrapDF.

◆ pgWrite() [1/2]

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

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. It must be page aligned.
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. It must be size to wrlen/XrdSys::PageSize + (wrlenXrdSys::PageSize != 0)
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 from XrdOssDF.

References XrdOssDF::pgWrite(), and wrapDF.

◆ pgWrite() [2/2]

virtual int XrdOssWrapDF::pgWrite ( XrdSfsAio aioparm,
uint64_t  opts 
)
inlinevirtual

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 from XrdOssDF.

References XrdOssDF::pgWrite(), and wrapDF.

◆ Read() [1/3]

virtual ssize_t XrdOssWrapDF::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 from XrdOssDF.

References XrdOssDF::Read(), and wrapDF.

◆ Read() [2/3]

virtual ssize_t XrdOssWrapDF::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 from XrdOssDF.

References XrdOssDF::Read(), and wrapDF.

◆ Read() [3/3]

virtual int XrdOssWrapDF::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 from XrdOssDF.

References XrdOssDF::Read(), and wrapDF.

◆ Readdir()

virtual int XrdOssWrapDF::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 from XrdOssDF.

References XrdOssDF::Readdir(), and wrapDF.

◆ ReadRaw()

virtual ssize_t XrdOssWrapDF::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 from XrdOssDF.

References XrdOssDF::ReadRaw(), and wrapDF.

◆ ReadV()

virtual ssize_t XrdOssWrapDF::ReadV ( XrdOucIOVec readV,
int  rdvcnt 
)
inlinevirtual

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 from XrdOssDF.

References XrdOssDF::ReadV(), and wrapDF.

◆ StatRet()

virtual int XrdOssWrapDF::StatRet ( struct stat Stat)
inlinevirtual

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

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

Reimplemented from XrdOssDF.

References XrdOssDF::StatRet(), and wrapDF.

◆ Write() [1/2]

virtual ssize_t XrdOssWrapDF::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 from XrdOssDF.

References wrapDF, and XrdOssDF::Write().

◆ Write() [2/2]

virtual int XrdOssWrapDF::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 from XrdOssDF.

References wrapDF, and XrdOssDF::Write().

◆ WriteV()

virtual ssize_t XrdOssWrapDF::WriteV ( XrdOucIOVec writeV,
int  wrvcnt 
)
inlinevirtual

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 from XrdOssDF.

References wrapDF, and XrdOssDF::WriteV().

Member Data Documentation

◆ wrapDF

XrdOssDF& XrdOssWrapDF::wrapDF
protected

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