xrootd
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
XrdOssFile Class Reference

#include <XrdOssApi.hh>

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

Public Member Functions

virtual int Close (long long *retsz=0)
 
virtual int Open (const char *, int, mode_t, XrdOucEnv &)
 
int Fchmod (mode_t mode)
 
int Fctl (int cmd, int alen, const char *args, char **resp=0)
 
void Flush ()
 Flush filesystem cached pages for this file (used for checksums).
 
int Fstat (struct stat *)
 
int Fsync ()
 
int Fsync (XrdSfsAio *aiop)
 
int Ftruncate (unsigned long long)
 
int getFD ()
 
off_t getMmap (void **addr)
 
int isCompressed (char *cxidp=0)
 
ssize_t Read (off_t, size_t)
 
ssize_t Read (void *, off_t, size_t)
 
int Read (XrdSfsAio *aiop)
 
ssize_t ReadV (XrdOucIOVec *readV, int)
 
ssize_t ReadRaw (void *, off_t, size_t)
 
ssize_t Write (const void *, off_t, size_t)
 
int Write (XrdSfsAio *aiop)
 
 XrdOssFile (const char *tid, int fdnum=-1)
 
virtual ~XrdOssFile ()
 
- Public Member Functions inherited from XrdOssDF
virtual int Opendir (const char *path, XrdOucEnv &env)
 
virtual int Readdir (char *buff, int blen)
 
virtual int StatRet (struct stat *buff)
 
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 WriteV (XrdOucIOVec *writeV, int wrvcnt)
 
uint16_t DFType ()
 
virtual const char * getTID ()
 
 XrdOssDF (const char *tid="", uint16_t dftype=0, int fdnum=-1)
 
virtual ~XrdOssDF ()
 

Private Member Functions

int Open_ufs (const char *, int, int, unsigned long long)
 

Private Attributes

oocx_CXFile * cxobj
 
XrdOssCache_FScacheP
 
XrdOssMioFilemmFile
 
long long FSize
 
int rawio
 
int cxpgsz
 
char cxid [4]
 

Static Private Attributes

static int AioFailure
 

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
 
- Protected Attributes inherited from XrdOssDF
const char * tident
 
off_t pgwEOF
 
int fd
 
uint16_t dfType
 
short rsvd
 

Constructor & Destructor Documentation

◆ XrdOssFile()

XrdOssFile::XrdOssFile ( const char *  tid,
int  fdnum = -1 
)
inline

References cxid.

◆ ~XrdOssFile()

virtual XrdOssFile::~XrdOssFile ( )
inlinevirtual

References Close(), and XrdOssDF::fd.

Member Function Documentation

◆ Close()

virtual int XrdOssFile::Close ( long long *  retsz = 0)
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).

Implements XrdOssDF.

Referenced by ~XrdOssFile().

◆ Fchmod()

int XrdOssFile::Fchmod ( mode_t  mode)
virtual

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.

◆ Fctl()

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

Reimplemented from XrdOssDF.

◆ Flush()

void XrdOssFile::Flush ( )
virtual

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

Reimplemented from XrdOssDF.

◆ Fstat()

int XrdOssFile::Fstat ( struct stat buf)
virtual

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.

◆ Fsync() [1/2]

int XrdOssFile::Fsync ( void  )
virtual

Synchronize associated file with media (synchronous).

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

Reimplemented from XrdOssDF.

◆ Fsync() [2/2]

int XrdOssFile::Fsync ( XrdSfsAio aiop)
virtual

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.

◆ Ftruncate()

int XrdOssFile::Ftruncate ( unsigned long long  flen)
virtual

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.

◆ getFD()

int XrdOssFile::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::fd.

◆ getMmap()

off_t XrdOssFile::getMmap ( void **  addr)
virtual

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.

◆ isCompressed()

int XrdOssFile::isCompressed ( char *  cxidp = 0)
virtual

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.

◆ Open()

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

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.

◆ Open_ufs()

int XrdOssFile::Open_ufs ( const char *  ,
int  ,
int  ,
unsigned long long   
)
private

◆ Read() [1/3]

ssize_t XrdOssFile::Read ( off_t  offset,
size_t  size 
)
virtual

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.

◆ Read() [2/3]

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

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.

◆ Read() [3/3]

int XrdOssFile::Read ( XrdSfsAio aiop)
virtual

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.

◆ ReadRaw()

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

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.

◆ ReadV()

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

◆ Write() [1/2]

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

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.

◆ Write() [2/2]

int XrdOssFile::Write ( XrdSfsAio aiop)
virtual

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.

Member Data Documentation

◆ AioFailure

int XrdOssFile::AioFailure
staticprivate

◆ cacheP

XrdOssCache_FS* XrdOssFile::cacheP
private

◆ cxid

char XrdOssFile::cxid[4]
private

Referenced by XrdOssFile().

◆ cxobj

oocx_CXFile* XrdOssFile::cxobj
private

◆ cxpgsz

int XrdOssFile::cxpgsz
private

◆ FSize

long long XrdOssFile::FSize
private

◆ mmFile

XrdOssMioFile* XrdOssFile::mmFile
private

◆ rawio

int XrdOssFile::rawio
private

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