XRootD
XrdOssDF Class Referenceabstract

#include <XrdOss.hh>

+ Inheritance diagram for XrdOssDF:
+ Collaboration diagram for XrdOssDF:

Public Member Functions

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

Static Public Attributes

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

Protected Attributes

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

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.

Definition at line 62 of file XrdOss.hh.

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.

Definition at line 444 of file XrdOss.hh.

445  : tident(tid), pgwEOF(0), fd(fdnum), dfType(dftype),
446  rsvd(0) {}
uint16_t dfType
Definition: XrdOss.hh:456
const char * tident
Definition: XrdOss.hh:453
int fd
Definition: XrdOss.hh:455
off_t pgwEOF
Definition: XrdOss.hh:454
short rsvd
Definition: XrdOss.hh:457

◆ ~XrdOssDF()

virtual XrdOssDF::~XrdOssDF ( )
inlinevirtual

Definition at line 448 of file XrdOss.hh.

448 {}

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 XrdPssFile, XrdPssDir, XrdOssDFHandler, XrdOssCsiFile, XrdOssWrapDF, XrdOssFile, XrdOssDir, XrdOfsHanOssErr, XrdOfsHanOss, XrdCephOssFile, and XrdCephOssDir.

Referenced by XrdOfsDirectory::close(), XrdOfsHanOssErr::Close(), XrdOssWrapDF::Close(), XrdOssCsiFile::Close(), XrdOssDFHandler::Close(), XrdPfc::FsTraversal::close_delete(), XrdPfc::Cache::DetermineFullFileSize(), XrdPfc::Cache::ExecuteCommandUrl(), XrdPfc::Cache::LocalFilePath(), XrdOfsHandle::Retire(), and XrdPfc::DataFsSnapshot::write_json_file().

+ Here is the caller graph for this function:

◆ DFType()

uint16_t XrdOssDF::DFType ( )
inline

Definition at line 396 of file XrdOss.hh.

396 {return dfType;}

References dfType.

Referenced by XrdOfsHanOssErr::XrdOfsHanOssErr(), XrdOfsFile::checkpoint(), and XrdOssWrapDF::DFType().

+ Here is the caller graph for this function:

◆ 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 StatsFile, XrdPssFile, XrdOssDFHandler, XrdOssWrapDF, XrdOssFile, and XrdOfsHanOss.

Definition at line 120 of file XrdOss.hh.

120 {return -EISDIR;}

Referenced by XrdOfsFile::close(), XrdOssWrapDF::Fchmod(), XrdOssDFHandler::Fchmod(), and StatsFile::Fchmod().

+ Here is the caller graph for this function:

◆ Fctl()

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

Reimplemented in XrdOssDFHandler, XrdOssWrapDF, and XrdOssFile.

Definition at line 150 of file XrdOss.cc.

151 {
152  (void)cmd; (void)alen; (void)args; (void)resp;
153  return -ENOTSUP;
154 }

Referenced by XrdOssWrapDF::Fctl(), XrdOssDFHandler::Fctl(), and XrdOfsChkPnt::Restore().

+ Here is the caller graph for this function:

◆ Flush()

virtual void XrdOssDF::Flush ( )
inlinevirtual

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

Reimplemented in XrdOssDFHandler, XrdOssCsiFile, XrdOssWrapDF, and XrdOssFile.

Definition at line 126 of file XrdOss.hh.

126 {}

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

+ Here is the caller graph for this function:

◆ 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 XrdOfsHanOssErr, XrdOssDFHandler, XrdCephOssFile, StatsFile, XrdOssWrapDF, XrdPssFile, XrdOssCsiFile, XrdOssFile, and XrdOfsHanOss.

Definition at line 136 of file XrdOss.hh.

136 {return -EISDIR;}

Referenced by XrdOfsChkPnt::Create(), XrdPfc::File::Fstat(), XrdOssCsiFile::Fstat(), XrdOssWrapDF::Fstat(), StatsFile::Fstat(), XrdOssDFHandler::Fstat(), XrdOfsHanOssErr::Fstat(), and XrdOfsFile::stat().

+ Here is the caller graph for this function:

◆ 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 XrdCephOssFile, XrdPssFile, XrdOssDFHandler, XrdOssCsiFile, XrdOssWrapDF, XrdOssFile, and XrdOfsHanOss.

Definition at line 144 of file XrdOss.hh.

144 {return -EISDIR;}

Referenced by XrdOssWrapDF::Fsync(), XrdOssCsiFile::Fsync(), XrdOssDFHandler::Fsync(), XrdOfsChkPnt::Restore(), XrdOfsFile::sync(), and XrdPfc::File::Sync().

+ Here is the caller graph for this function:

◆ 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 XrdPssFile, XrdOssDFHandler, XrdOssWrapDF, XrdOssFile, XrdOfsHanOss, and XrdOssCsiFile.

Definition at line 154 of file XrdOss.hh.

154 {return -EISDIR;}

◆ 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 XrdPssFile, XrdOssCsiFile, XrdOssFile, XrdOfsHanOss, XrdCephOssFile, StatsFile, XrdOssDFHandler, and XrdOssWrapDF.

Definition at line 164 of file XrdOss.hh.

164 {return -EISDIR;}

Referenced by XrdOssWrapDF::Ftruncate(), XrdOssDFHandler::Ftruncate(), StatsFile::Ftruncate(), XrdOssCsiFile::Ftruncate(), XrdOfsChkPnt::Restore(), XrdOfsFile::truncate(), and XrdPfc::DataFsSnapshot::write_json_file().

+ Here is the caller graph for this function:

◆ 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 XrdOssDFHandler, XrdOssCsiFile, XrdOssWrapDF, XrdOssFile, and XrdOssDir.

Definition at line 426 of file XrdOss.hh.

426 {return -1;} // Must override to support sendfile()

Referenced by XrdOfsHanOssErr::XrdOfsHanOssErr(), XrdPfc::Cache::ExecuteCommandUrl(), XrdOfsFile::fctl(), XrdOssWrapDF::getFD(), and XrdOssDFHandler::getFD().

+ Here is the caller graph for this function:

◆ 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 XrdOssDFHandler, XrdOssCsiFile, XrdOssWrapDF, XrdOssFile, and XrdOfsHanOss.

Definition at line 176 of file XrdOss.hh.

176 {*addr = 0; return 0;}

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

+ Here is the caller graph for this function:

◆ getTID()

virtual const char* XrdOssDF::getTID ( )
inlinevirtual

Return trace identifier associated with this object.

Returns
Pointer to trace identifier

Reimplemented in XrdOssDFHandler, and XrdOssWrapDF.

Definition at line 434 of file XrdOss.hh.

434 {return tident;}

References tident.

Referenced by XrdOfsHanOssErr::XrdOfsHanOssErr(), XrdOssWrapDF::getTID(), XrdOssDFHandler::getTID(), XrdOssAt::Opendir(), and XrdOssAt::OpenRO().

+ Here is the caller graph for this function:

◆ 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 XrdOssDFHandler, XrdOssWrapDF, XrdOssFile, and XrdOfsHanOss.

Definition at line 187 of file XrdOss.hh.

187 {(void)cxidp; return 0;}

Referenced by XrdOfsFile::getCXinfo(), XrdOssWrapDF::isCompressed(), XrdOssDFHandler::isCompressed(), and XrdOssCsiFile::Open().

+ Here is the caller graph for this function:

◆ 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 StatsFile, XrdOssDFHandler, XrdOssWrapDF, XrdCephOssFile, XrdPssFile, XrdOssCsiFile, XrdOssFile, and XrdOfsHanOss.

Definition at line 200 of file XrdOss.hh.

201  {return -EISDIR;}

Referenced by XrdPfc::Cache::DetermineFullFileSize(), XrdPfc::Cache::ExecuteCommandUrl(), XrdPfc::Cache::LocalFilePath(), XrdOssWrapDF::Open(), XrdOssDFHandler::Open(), StatsFile::Open(), XrdOfsChkPnt::Restore(), and XrdPfc::DataFsSnapshot::write_json_file().

+ Here is the caller graph for this function:

◆ 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 StatsDirectory, XrdOssCsiDir, XrdOssWrapDF, XrdOssDFHandler, XrdPssDir, XrdOssDir, XrdOfsHanOss, and XrdCephOssDir.

Definition at line 79 of file XrdOss.hh.

79 {return -ENOTDIR;}

Referenced by XrdPfc::Print::Print(), XrdPfc::FsTraversal::begin_traversal(), XrdOfsDirectory::open(), XrdOssDFHandler::Opendir(), XrdOssWrapDF::Opendir(), and StatsDirectory::Opendir().

+ Here is the caller graph for this function:

◆ pgRead() [1/2]

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

Reimplemented in StatsFile, XrdPssFile, XrdOssDFHandler, XrdOssWrapDF, XrdOfsHanOssErr, XrdOfsHanOss, and XrdOssCsiFile.

Definition at line 160 of file XrdOss.cc.

165 {
166  ssize_t bytes;
167 
168 // Read the data into the buffer
169 //
170  bytes = Read(buffer, offset, rdlen);
171 
172 // Calculate checksums if so wanted
173 //
174  if (bytes > 0 && csvec)
175  XrdOucPgrwUtils::csCalc((const char *)buffer, offset, bytes, csvec);
176 
177 // All done
178 //
179  return bytes;
180 }
virtual ssize_t Read(off_t offset, size_t size)
Definition: XrdOss.hh:281
static void csCalc(const char *data, off_t offs, size_t count, uint32_t *csval)

References XrdOucPgrwUtils::csCalc(), and Read().

Referenced by XrdOfsHanOssErr::pgRead(), XrdOssWrapDF::pgRead(), XrdOssDFHandler::pgRead(), StatsFile::pgRead(), pgRead(), and XrdOfsFile::pgRead().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pgRead() [2/2]

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 StatsFile, XrdPssFile, XrdOssDFHandler, XrdOssWrapDF, XrdOfsHanOssErr, XrdOfsHanOss, and XrdOssCsiFile.

Definition at line 184 of file XrdOss.cc.

185 {
186  aioparm->Result = this->pgRead((void *)aioparm->sfsAio.aio_buf,
187  (off_t) aioparm->sfsAio.aio_offset,
188  (size_t)aioparm->sfsAio.aio_nbytes,
189  aioparm->cksVec, opts);
190  aioparm->doneRead();
191  return 0;
192 }
struct myOpts opts
off_t aio_offset
Definition: XrdSfsAio.hh:49
size_t aio_nbytes
Definition: XrdSfsAio.hh:48
void * aio_buf
Definition: XrdSfsAio.hh:47
virtual ssize_t pgRead(void *buffer, off_t offset, size_t rdlen, uint32_t *csvec, uint64_t opts)
Definition: XrdOss.cc:160
uint32_t * cksVec
Definition: XrdSfsAio.hh:63
ssize_t Result
Definition: XrdSfsAio.hh:65
virtual void doneRead()=0
struct aiocb sfsAio
Definition: XrdSfsAio.hh:62

References aiocb::aio_buf, aiocb::aio_nbytes, aiocb::aio_offset, XrdSfsAio::cksVec, XrdSfsAio::doneRead(), opts, pgRead(), XrdSfsAio::Result, and XrdSfsAio::sfsAio.

+ Here is the call graph for this function:

◆ pgWrite() [1/2]

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 StatsFile, XrdPssFile, XrdOssDFHandler, XrdOssWrapDF, XrdOfsHanOss, and XrdOssCsiFile.

Definition at line 198 of file XrdOss.cc.

203 {
204 
205 // If we have a checksum vector and verify is on, make sure the data
206 // in the buffer corresponds to he checksums.
207 //
208  if (csvec && (opts & Verify))
209  {XrdOucPgrwUtils::dataInfo dInfo((const char *)buffer,csvec,offset,wrlen);
210  off_t bado;
211  int badc;
212  if (!XrdOucPgrwUtils::csVer(dInfo, bado, badc)) return -EDOM;
213  }
214 
215 // Now just return the result of a plain write
216 //
217  return Write(buffer, offset, wrlen);
218 }
static const uint64_t Verify
all: Verify checksums
Definition: XrdOss.hh:223
virtual ssize_t Write(const void *buffer, off_t offset, size_t size)
Definition: XrdOss.hh:345
static bool csVer(dataInfo &dInfo, off_t &bado, int &badc)

References XrdOucPgrwUtils::csVer(), opts, Verify, and Write().

Referenced by XrdOssWrapDF::pgWrite(), XrdOssDFHandler::pgWrite(), StatsFile::pgWrite(), pgWrite(), XrdOfsFile::pgWrite(), and XrdPfc::File::WriteBlockToDisk().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pgWrite() [2/2]

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 StatsFile, XrdPssFile, XrdOssDFHandler, XrdOssWrapDF, XrdOfsHanOss, and XrdOssCsiFile.

Definition at line 222 of file XrdOss.cc.

223 {
224  aioparm->Result = this->pgWrite((void *)aioparm->sfsAio.aio_buf,
225  (off_t) aioparm->sfsAio.aio_offset,
226  (size_t)aioparm->sfsAio.aio_nbytes,
227  aioparm->cksVec, opts);
228  aioparm->doneWrite();
229  return 0;
230 }
virtual ssize_t pgWrite(void *buffer, off_t offset, size_t wrlen, uint32_t *csvec, uint64_t opts)
Definition: XrdOss.cc:198
virtual void doneWrite()=0

References aiocb::aio_buf, aiocb::aio_nbytes, aiocb::aio_offset, XrdSfsAio::cksVec, XrdSfsAio::doneWrite(), opts, pgWrite(), XrdSfsAio::Result, and XrdSfsAio::sfsAio.

+ Here is the call graph for this function:

◆ 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 XrdPssFile, XrdOssCsiFile, XrdOssFile, XrdOfsHanOss, StatsFile, XrdOssWrapDF, XrdOfsHanOssErr, XrdOssDFHandler, and XrdCephOssFile.

Definition at line 281 of file XrdOss.hh.

281 {return (ssize_t)-EISDIR;}

Referenced by XrdOssCsiFileAioJob::DoItRead1(), XrdOssCsiFileAioJob::DoItRead2(), XrdOssCsiTagstoreFile::fullread(), XrdOssCsiPages::maxread(), XrdOssCsiFile::pgRead(), pgRead(), XrdPfc::File::Read(), XrdOssDFHandler::Read(), XrdOfsHanOssErr::Read(), XrdOssWrapDF::Read(), StatsFile::Read(), XrdOssCsiFile::Read(), XrdOfsFile::read(), ReadV(), XrdOfsChkPnt::Truncate(), and XrdOfsChkPnt::Write().

+ Here is the caller graph for this function:

◆ 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 StatsFile, XrdOssWrapDF, XrdOfsHanOssErr, XrdOssDFHandler, XrdCephOssFile, XrdPssFile, XrdOssCsiFile, XrdOssFile, and XrdOfsHanOss.

Definition at line 294 of file XrdOss.hh.

295  {return (ssize_t)-EISDIR;}

◆ 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 StatsFile, XrdPssFile, XrdOssDFHandler, XrdOssWrapDF, XrdOssFile, XrdOfsHanOssErr, XrdOfsHanOss, XrdCephOssFile, and XrdOssCsiFile.

Definition at line 306 of file XrdOss.hh.

306 {(void)aiop; return (ssize_t)-EISDIR;}

◆ 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 StatsDirectory, XrdPssDir, XrdOssDFHandler, XrdOssCsiDir, XrdOssWrapDF, XrdOssDir, XrdOfsHanOssErr, XrdOfsHanOss, and XrdCephOssDir.

Definition at line 92 of file XrdOss.hh.

92 {return -ENOTDIR;}

Referenced by XrdOfsDirectory::nextEntry(), XrdOfsHanOssErr::Readdir(), XrdOssWrapDF::Readdir(), XrdOssCsiDir::Readdir(), XrdOssDFHandler::Readdir(), StatsDirectory::Readdir(), and XrdPfc::FsTraversal::slurp_dir_ll().

+ Here is the caller graph for this function:

◆ 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 StatsFile, XrdOssWrapDF, XrdOfsHanOssErr, XrdOssDFHandler, XrdPssFile, XrdOssCsiFile, XrdOssFile, XrdOfsHanOss, and XrdCephOssFile.

Definition at line 319 of file XrdOss.hh.

320  {return (ssize_t)-EISDIR;}

Referenced by XrdOfsFile::read(), XrdOssCsiFile::ReadRaw(), XrdOssDFHandler::ReadRaw(), XrdOfsHanOssErr::ReadRaw(), XrdOssWrapDF::ReadRaw(), and StatsFile::ReadRaw().

+ Here is the caller graph for this function:

◆ ReadV()

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 XrdOssFile, StatsFile, XrdOssWrapDF, XrdOfsHanOssErr, XrdOfsHanOss, XrdPssFile, XrdOssDFHandler, and XrdOssCsiFile.

Definition at line 236 of file XrdOss.cc.

238 {
239  ssize_t nbytes = 0, curCount = 0;
240  for (int i=0; i<n; i++)
241  {curCount = Read((void *)readV[i].data,
242  (off_t)readV[i].offset,
243  (size_t)readV[i].size);
244  if (curCount != readV[i].size)
245  {if (curCount < 0) return curCount;
246  return -ESPIPE;
247  }
248  nbytes += curCount;
249  }
250  return nbytes;
251 }

References Read().

Referenced by XrdPfc::File::ReadV(), XrdOssCsiFile::ReadV(), XrdOssDFHandler::ReadV(), XrdOfsHanOssErr::ReadV(), XrdOssWrapDF::ReadV(), StatsFile::ReadV(), and XrdOfsFile::readv().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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 XrdOssWrapDF, XrdOssDFHandler, and XrdOssDir.

Definition at line 107 of file XrdOss.hh.

107 {return -ENOTSUP;}

Referenced by XrdOfsDirectory::autoStat(), XrdPfc::FsTraversal::slurp_dir_ll(), XrdOssDFHandler::StatRet(), and XrdOssWrapDF::StatRet().

+ Here is the caller graph for this function:

◆ 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 StatsFile, XrdOssWrapDF, XrdOssDFHandler, XrdCephOssFile, XrdPssFile, XrdOssCsiFile, XrdOssFile, and XrdOfsHanOss.

Definition at line 345 of file XrdOss.hh.

346  {return (ssize_t)-EISDIR;}

Referenced by XrdOssCsiFileAioJob::DoItWrite1(), XrdOssCsiFileAioJob::DoItWrite2(), XrdOssCsiTagstoreFile::fullwrite(), XrdOssCsiFile::pgWrite(), pgWrite(), XrdOssCsiFile::Write(), XrdOssDFHandler::Write(), XrdOssWrapDF::Write(), StatsFile::Write(), XrdOfsFile::write(), XrdPfc::DataFsSnapshot::write_json_file(), XrdPfc::File::WriteBlockToDisk(), and WriteV().

+ Here is the caller graph for this function:

◆ 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 StatsFile, XrdPssFile, XrdOssDFHandler, XrdOssWrapDF, XrdOssFile, XrdOfsHanOss, XrdCephOssFile, and XrdOssCsiFile.

Definition at line 357 of file XrdOss.hh.

357 {(void)aiop; return (ssize_t)-EISDIR;}

◆ WriteV()

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 StatsFile, XrdOssWrapDF, XrdOfsHanOss, XrdOssDFHandler, and XrdOssCsiFile.

Definition at line 257 of file XrdOss.cc.

259 {
260  ssize_t nbytes = 0, curCount = 0;
261 
262  for (int i=0; i<n; i++)
263  {curCount =Write((void *)writeV[i].data,
264  (off_t)writeV[i].offset,
265  (size_t)writeV[i].size);
266  if (curCount != writeV[i].size)
267  {if (curCount < 0) return curCount;
268  return -ESPIPE;
269  }
270  nbytes += curCount;
271  }
272  return nbytes;
273 }

References Write().

Referenced by XrdOfsChkPnt::Restore(), XrdOssCsiFile::WriteV(), XrdOssDFHandler::WriteV(), XrdOssWrapDF::WriteV(), and StatsFile::WriteV().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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.

Definition at line 392 of file XrdOss.hh.

◆ DF_isFile

const uint16_t XrdOssDF::DF_isFile = 0x0002
static

Object is for a file.

Definition at line 393 of file XrdOss.hh.

◆ DF_isProxy

const uint16_t XrdOssDF::DF_isProxy = 0x0010
static

Object is a proxy object.

Definition at line 394 of file XrdOss.hh.

Referenced by XrdOfsFile::checkpoint().

◆ dfType

uint16_t XrdOssDF::dfType
protected

Definition at line 456 of file XrdOss.hh.

Referenced by XrdOfsHanOssErr::XrdOfsHanOssErr(), and DFType().

◆ doCalc

const uint64_t XrdOssDF::doCalc = 0x4000000000000000ULL
static

pgw: Calculate checksums

Definition at line 225 of file XrdOss.hh.

Referenced by XrdPssFile::pgWrite(), and XrdOssCsiPages::StoreRange().

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

Definition at line 415 of file XrdOss.hh.

◆ Fctl_utimes

const int XrdOssDF::Fctl_utimes = 1
static

Definition at line 416 of file XrdOss.hh.

Referenced by XrdOssFile::Fctl(), and XrdOfsChkPnt::Restore().

◆ fd

◆ pgwEOF

off_t XrdOssDF::pgwEOF
protected

Definition at line 454 of file XrdOss.hh.

◆ rsvd

short XrdOssDF::rsvd
protected

Definition at line 457 of file XrdOss.hh.

◆ tident

const char* XrdOssDF::tident
protected

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

Definition at line 223 of file XrdOss.hh.

Referenced by XrdOssCsiPages::FetchRange(), XrdOssCsiPages::FetchRangeAligned(), XrdOssCsiPages::FetchRangeUnaligned(), XrdOssCsiPages::FetchRangeUnaligned_postblock(), XrdOssCsiPages::FetchRangeUnaligned_preblock(), XrdOfsFile::pgRead(), pgWrite(), XrdPssFile::pgWrite(), XrdOfsFile::pgWrite(), XrdOssCsiPages::pgWritePrelockCheck(), XrdOssCsiPages::VerifyRangeAligned(), and XrdOssCsiPages::VerifyRangeUnaligned().


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