XRootD
Loading...
Searching...
No Matches
XrdThrottle::File Class Referencefinal

#include <XrdThrottle.hh>

+ Inheritance diagram for XrdThrottle::File:
+ Collaboration diagram for XrdThrottle::File:

Public Member Functions

virtual int checkpoint (cpAct act, struct iov *range=0, int n=0) override
 
virtual int close () override
 
virtual int fctl (const int cmd, const char *args, XrdOucErrInfo &eInfo)=0
 
virtual int fctl (const int cmd, const char *args, XrdOucErrInfo &out_error) override
 
virtual int fctl (const int cmd, int alen, const char *args, const XrdSecEntity *client=0)
 
virtual const char * FName () override
 
virtual int getCXinfo (char cxtype[4], int &cxrsz) override
 
virtual int getMmap (void **Addr, off_t &Size) override
 
virtual int open (const char *fileName, XrdSfsFileOpenMode openMode, mode_t createMode, const XrdSecEntity *client, const char *opaque=0) override
 
virtual XrdSfsXferSize pgRead (XrdSfsAio *aioparm, uint64_t opts=0) override
 
virtual XrdSfsXferSize pgRead (XrdSfsFileOffset offset, char *buffer, XrdSfsXferSize rdlen, uint32_t *csvec, uint64_t opts=0) override
 
virtual XrdSfsXferSize pgWrite (XrdSfsAio *aioparm, uint64_t opts=0) override
 
virtual XrdSfsXferSize pgWrite (XrdSfsFileOffset offset, char *buffer, XrdSfsXferSize rdlen, uint32_t *csvec, uint64_t opts=0) override
 
virtual int read (XrdSfsAio *aioparm) override
 
virtual XrdSfsXferSize read (XrdSfsFileOffset fileOffset, char *buffer, XrdSfsXferSize buffer_size) override
 
virtual int read (XrdSfsFileOffset fileOffset, XrdSfsXferSize amount) override
 
virtual int SendData (XrdSfsDio *sfDio, XrdSfsFileOffset offset, XrdSfsXferSize size) override
 
virtual int stat (struct stat *buf) override
 
virtual int sync () override
 
virtual int sync (XrdSfsAio *aiop) override
 
virtual int truncate (XrdSfsFileOffset fileOffset) override
 
virtual int write (XrdSfsAio *aioparm) override
 
virtual XrdSfsXferSize write (XrdSfsFileOffset fileOffset, const char *buffer, XrdSfsXferSize buffer_size) override
 
- Public Member Functions inherited from XrdSfsFile
 XrdSfsFile (const char *user=0, int MonID=0)
 
 XrdSfsFile (XrdOucErrInfo &eInfo)
 
 XrdSfsFile (XrdSfsFile &wrapF)
 
virtual ~XrdSfsFile ()
 Destructor.
 
virtual XrdSfsXferSize readv (XrdOucIOVec *readV, int rdvCnt)
 
virtual void setXio (XrdSfsXio *xioP)
 
virtual XrdSfsXferSize writev (XrdOucIOVec *writeV, int wdvCnt)
 

Friends

class FileSystem
 

Additional Inherited Members

- Public Types inherited from XrdSfsFile
enum  cpAct {
  cpCreate =0 ,
  cpDelete ,
  cpRestore ,
  cpQuery ,
  cpTrunc ,
  cpWrite
}
 
- Public Attributes inherited from XrdSfsFile
XrdOucErrInfoerror
 
- Static Public Attributes inherited from XrdSfsFile
static const uint64_t Verify = 0x8000000000000000ULL
 Options for pgRead() and pgWrite() as noted below.
 

Detailed Description

Definition at line 28 of file XrdThrottle.hh.

Member Function Documentation

◆ checkpoint()

int File::checkpoint ( cpAct act,
struct iov * range = 0,
int n = 0 )
overridevirtual

Reimplemented from XrdSfsFile.

Definition at line 88 of file XrdThrottleFile.cc.

89{ return m_sfs->checkpoint(act, range, n);}
virtual int checkpoint(cpAct act, struct iov *range=0, int n=0)

References XrdSfsFile::checkpoint().

+ Here is the call graph for this function:

◆ close()

int File::close ( )
overridevirtual

Close the file.

Returns
One of SFS_OK or SFS_ERROR.

Implements XrdSfsFile.

Definition at line 81 of file XrdThrottleFile.cc.

82{
83 m_is_open = false;
84 m_throttle.CloseFile(m_user);
85 return m_sfs->close();
86}
virtual int close()=0
bool CloseFile(const std::string &entity)

References XrdSfsFile::close(), and XrdThrottleManager::CloseFile().

+ Here is the call graph for this function:

◆ fctl() [1/3]

virtual int XrdSfsFile::fctl ( const int cmd,
const char * args,
XrdOucErrInfo & eInfo )
virtual

Execute a special operation on the file (version 1)

Parameters
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.
Returns
If an error occurs or the operation is not support, SFS_ERROR should be returned with error.code set to errno. Otherwise, SFS_FCTL_GETFD error.code holds the real file descriptor number If the value is negative, sendfile() is not used. If the value is SFS_SFIO_FDVAL then the SendData() method is used for future read requests.

Implements XrdSfsFile.

◆ fctl() [2/3]

int File::fctl ( const int cmd,
const char * args,
XrdOucErrInfo & eInfo )
overridevirtual

Execute a special operation on the file (version 1)

Parameters
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.
Returns
If an error occurs or the operation is not support, SFS_ERROR should be returned with error.code set to errno. Otherwise, SFS_FCTL_GETFD error.code holds the real file descriptor number If the value is negative, sendfile() is not used. If the value is SFS_SFIO_FDVAL then the SendData() method is used for future read requests.

Implements XrdSfsFile.

Definition at line 92 of file XrdThrottleFile.cc.

95{
96 // Disable sendfile
97 if (cmd == SFS_FCTL_GETFD)
98 {
99 error.setErrInfo(ENOTSUP, "Sendfile not supported by throttle plugin.");
100 return SFS_ERROR;
101 }
102 else return m_sfs->fctl(cmd, args, out_error);
103}
#define SFS_ERROR
#define SFS_FCTL_GETFD
int setErrInfo(int code, const char *emsg)
XrdOucErrInfo & error
virtual int fctl(const int cmd, const char *args, XrdOucErrInfo &eInfo)=0

References XrdSfsFile::error, XrdSfsFile::fctl(), XrdOucErrInfo::setErrInfo(), SFS_ERROR, and SFS_FCTL_GETFD.

+ Here is the call graph for this function:

◆ fctl() [3/3]

int XrdSfsFile::fctl ( const int cmd,
int alen,
const char * args,
const XrdSecEntity * client = 0 )
virtual

Execute a special operation on the file (version 2)

Parameters
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).
Returns
SFS_OK a null response is sent.
SFS_DATA error.code length of the data to be sent. error.message contains the data to be sent. o/w one of SFS_ERROR, SFS_REDIRECT, or SFS_STALL.

Reimplemented from XrdSfsFile.

Definition at line 489 of file XrdSfsInterface.cc.

84{
85 (void)cmd; (void)alen; (void)args; (void)client;
86 return SFS_OK;
87}
#define SFS_OK

◆ FName()

const char * File::FName ( )
overridevirtual

Get the file path.

Returns
Null terminated string of the path used in open().

Implements XrdSfsFile.

Definition at line 106 of file XrdThrottleFile.cc.

107{
108 return m_sfs->FName();
109}
virtual const char * FName()=0

References XrdSfsFile::FName().

+ Here is the call graph for this function:

◆ getCXinfo()

int File::getCXinfo ( char cxtype[4],
int & cxrsz )
overridevirtual

Get compression information for the file.

Parameters
cxtype- Place where the compression algorithm name is to be placed
cxrsz- Place where the compression page size is to be returned
Returns
One of the valid SFS return codes described above. If the file is not compressed or an error is returned, cxrsz must be set to 0.

Implements XrdSfsFile.

Definition at line 233 of file XrdThrottleFile.cc.

234{
235 return m_sfs->getCXinfo(cxtype, cxrsz);
236}
virtual int getCXinfo(char cxtype[4], int &cxrsz)=0

References XrdSfsFile::getCXinfo().

+ Here is the call graph for this function:

◆ getMmap()

int File::getMmap ( void ** Addr,
off_t & Size )
overridevirtual

Get file's memory mapping if one exists (memory mapped files only).

Parameters
Addr- Place where the starting memory address is returned.
Size- Place where the file's size is returned.
Returns
SFS_OK when the file is memory mapped or any other code otherwise.

Implements XrdSfsFile.

Definition at line 112 of file XrdThrottleFile.cc.

113{ // We cannot monitor mmap-based reads, so we disable them.
114 error.setErrInfo(ENOTSUP, "Mmap not supported by throttle plugin.");
115 return SFS_ERROR;
116}

References XrdSfsFile::error, XrdOucErrInfo::setErrInfo(), and SFS_ERROR.

+ Here is the call graph for this function:

◆ open()

int File::open ( const char * fileName,
XrdSfsFileOpenMode openMode,
mode_t createMode,
const XrdSecEntity * client,
const char * opaque = 0 )
overridevirtual

Open a file.

Parameters
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).
Returns
One of SFS_OK, SFS_ERROR, SFS_REDIRECT, SFS_STALL, or SFS_STARTED

Implements XrdSfsFile.

Definition at line 49 of file XrdThrottleFile.cc.

54{
55 // Try various potential "names" associated with the request, from the most
56 // specific to most generic.
57 if (client->eaAPI && client->eaAPI->Get("token.subject", m_user)) {
58 if (client->vorg) m_user = std::string(client->vorg) + ":" + m_user;
59 } else if (client->eaAPI) {
60 std::string user;
61 if (client->eaAPI->Get("request.name", user) && !user.empty()) m_user = user;
62 }
63 if (m_user.empty()) {m_user = client->name ? client->name : "nobody";}
64 m_uid = XrdThrottleManager::GetUid(m_user.c_str());
65 m_throttle.PrepLoadShed(opaque, m_loadshed);
66 std::string open_error_message;
67 if (!m_throttle.OpenFile(m_user, open_error_message)) {
68 error.setErrInfo(EMFILE, open_error_message.c_str());
69 return SFS_ERROR;
70 }
71 auto retval = m_sfs->open(fileName, openMode, createMode, client, opaque);
72 if (retval != SFS_ERROR) {
73 m_is_open = true;
74 } else {
75 m_throttle.CloseFile(m_user);
76 }
77 return retval;
78}
XrdSecAttr * Get(const void *sigkey)
char * vorg
Entity's virtual organization(s)
XrdSecEntityAttr * eaAPI
non-const API to attributes
char * name
Entity's name.
virtual int open(const char *fileName, XrdSfsFileOpenMode openMode, mode_t createMode, const XrdSecEntity *client=0, const char *opaque=0)=0
void PrepLoadShed(const char *opaque, std::string &lsOpaque)
bool OpenFile(const std::string &entity, std::string &open_error_message)
static int GetUid(const char *username)

References XrdThrottleManager::CloseFile(), XrdSecEntity::eaAPI, XrdSfsFile::error, XrdSecEntityAttr::Get(), XrdThrottleManager::GetUid(), XrdSecEntity::name, XrdSfsFile::open(), XrdThrottleManager::OpenFile(), XrdThrottleManager::PrepLoadShed(), XrdOucErrInfo::setErrInfo(), SFS_ERROR, and XrdSecEntity::vorg.

+ Here is the call graph for this function:

◆ pgRead() [1/2]

XrdSfsXferSize File::pgRead ( XrdSfsAio * aioparm,
uint64_t opts = 0 )
overridevirtual

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
SFS_OK Request accepted and will be scheduled.
SFS_ERROR File could not be read, error holds the reason.

Reimplemented from XrdSfsFile.

Definition at line 130 of file XrdThrottleFile.cc.

131{ // We disable all AIO-based reads.
132 aioparm->Result = this->pgRead((XrdSfsFileOffset)aioparm->sfsAio.aio_offset,
133 (char *)aioparm->sfsAio.aio_buf,
135 aioparm->cksVec, opts);
136 aioparm->doneRead();
137 return SFS_OK;
138}
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
long long XrdSfsFileOffset
int XrdSfsXferSize
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
virtual XrdSfsXferSize pgRead(XrdSfsFileOffset offset, char *buffer, XrdSfsXferSize rdlen, uint32_t *csvec, uint64_t opts=0) override

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

+ Here is the call graph for this function:

◆ pgRead() [2/2]

XrdSfsXferSize File::pgRead ( XrdSfsFileOffset offset,
char * buffer,
XrdSfsXferSize rdlen,
uint32_t * csvec,
uint64_t opts = 0 )
overridevirtual

Read file pages into a buffer and return corresponding checksums.

Parameters
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).
Returns
>= 0 The number of bytes that placed in buffer.
SFS_ERROR File could not be read, error holds the reason.

Reimplemented from XrdSfsFile.

Definition at line 119 of file XrdThrottleFile.cc.

124{
125 DO_THROTTLE(rdlen)
126 return m_sfs->pgRead(offset, buffer, rdlen, csvec, opts);
127}
#define DO_THROTTLE(amount)
virtual XrdSfsXferSize pgRead(XrdSfsFileOffset offset, char *buffer, XrdSfsXferSize rdlen, uint32_t *csvec, uint64_t opts=0)

References DO_THROTTLE, opts, and XrdSfsFile::pgRead().

Referenced by pgRead().

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

◆ pgWrite() [1/2]

XrdSfsXferSize File::pgWrite ( XrdSfsAio * aioparm,
uint64_t opts = 0 )
overridevirtual

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
SFS_OK Request accepted and will be scheduled.
SFS_ERROR File could not be read, error holds the reason.

Reimplemented from XrdSfsFile.

Definition at line 152 of file XrdThrottleFile.cc.

153{ // We disable all AIO-based writes.
154 aioparm->Result = this->pgWrite((XrdSfsFileOffset)aioparm->sfsAio.aio_offset,
155 (char *)aioparm->sfsAio.aio_buf,
157 aioparm->cksVec, opts);
158 aioparm->doneWrite();
159 return SFS_OK;
160}
virtual void doneWrite()=0
virtual XrdSfsXferSize pgWrite(XrdSfsFileOffset offset, char *buffer, XrdSfsXferSize rdlen, uint32_t *csvec, uint64_t opts=0) override

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

+ Here is the call graph for this function:

◆ pgWrite() [2/2]

XrdSfsXferSize File::pgWrite ( XrdSfsFileOffset offset,
char * buffer,
XrdSfsXferSize wrlen,
uint32_t * csvec,
uint64_t opts = 0 )
overridevirtual

Write file pages into a file with corresponding checksums.

Parameters
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).
Returns
>= 0 The number of bytes written.
SFS_ERROR File could not be read, error holds the reason.

Reimplemented from XrdSfsFile.

Definition at line 141 of file XrdThrottleFile.cc.

146{
147 DO_THROTTLE(rdlen)
148 return m_sfs->pgWrite(offset, buffer, rdlen, csvec, opts);
149}
virtual XrdSfsXferSize pgWrite(XrdSfsFileOffset offset, char *buffer, XrdSfsXferSize wrlen, uint32_t *csvec, uint64_t opts=0)

References DO_THROTTLE, opts, and XrdSfsFile::pgWrite().

Referenced by pgWrite().

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

◆ read() [1/3]

int File::read ( XrdSfsAio * aioparm)
overridevirtual

Read file bytes using asynchronous I/O.

Parameters
aioparm- Pointer to async I/O object controlling the I/O.
Returns
SFS_OK Request accepted and will be scheduled.
SFS_ERROR File could not be read, error holds the reason.

Implements XrdSfsFile.

Definition at line 180 of file XrdThrottleFile.cc.

181{ // We disable all AIO-based reads.
182 aioparm->Result = this->read((XrdSfsFileOffset)aioparm->sfsAio.aio_offset,
183 (char *)aioparm->sfsAio.aio_buf,
185 aioparm->doneRead();
186 return SFS_OK;
187}
#define read(a, b, c)
Definition XrdPosix.hh:82

References aiocb::aio_buf, aiocb::aio_nbytes, aiocb::aio_offset, XrdSfsAio::doneRead(), read, XrdSfsAio::Result, SFS_OK, and XrdSfsAio::sfsAio.

+ Here is the call graph for this function:

◆ read() [2/3]

XrdSfsXferSize File::read ( XrdSfsFileOffset offset,
char * buffer,
XrdSfsXferSize size )
overridevirtual

Read file bytes into a buffer.

Parameters
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.
Returns
>= 0 The number of bytes that placed in buffer.
SFS_ERROR File could not be read, error holds the reason.

Implements XrdSfsFile.

Definition at line 171 of file XrdThrottleFile.cc.

174{
175 DO_THROTTLE(buffer_size);
176 return m_sfs->read(fileOffset, buffer, buffer_size);
177}
virtual XrdSfsXferSize read(XrdSfsFileOffset offset, XrdSfsXferSize size)=0

References DO_THROTTLE, and XrdSfsFile::read().

+ Here is the call graph for this function:

◆ read() [3/3]

int File::read ( XrdSfsFileOffset offset,
XrdSfsXferSize size )
overridevirtual

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 The number of bytes that will be pre-read.
SFS_ERROR File could not be preread, error holds the reason.

Implements XrdSfsFile.

Definition at line 163 of file XrdThrottleFile.cc.

165{
166 DO_THROTTLE(amount)
167 return m_sfs->read(fileOffset, amount);
168}

References DO_THROTTLE, and XrdSfsFile::read().

+ Here is the call graph for this function:

◆ SendData()

int File::SendData ( XrdSfsDio * sfDio,
XrdSfsFileOffset offset,
XrdSfsXferSize size )
overridevirtual

Send file bytes via a XrdSfsDio sendfile object to a client (optional).

Parameters
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.
Returns
SFS_ERROR File not read, error object has reason.
SFS_OK Either data has been successfully sent via sfDio or no data has been sent and a normal read() should be issued.

Reimplemented from XrdSfsFile.

Definition at line 239 of file XrdThrottleFile.cc.

242{
243 DO_THROTTLE(size);
244 return m_sfs->SendData(sfDio, offset, size);
245}
virtual int SendData(XrdSfsDio *sfDio, XrdSfsFileOffset offset, XrdSfsXferSize size)

References DO_THROTTLE, and XrdSfsFile::SendData().

+ Here is the call graph for this function:

◆ stat()

int File::stat ( struct stat * buf)
overridevirtual

Return state information on the file.

Parameters
buf- Pointer to the structure where info it to be returned.
Returns
One of SFS_OK, SFS_ERROR, SFS_REDIRECT, or SFS_STALL. When SFS_OK is returned, buf must hold stat information.

Implements XrdSfsFile.

Definition at line 221 of file XrdThrottleFile.cc.

222{
223 return m_sfs->stat(buf);
224}
virtual int stat(struct stat *buf)=0

References XrdSfsFile::stat().

+ Here is the call graph for this function:

◆ sync() [1/2]

int File::sync ( )
overridevirtual

Make sure all outstanding data is actually written to the file (sync).

Returns
One of SFS_OK, SFS_ERROR, SFS_REDIRECT, SFS_STALL, or SFS_STARTED

Implements XrdSfsFile.

Definition at line 209 of file XrdThrottleFile.cc.

210{
211 return m_sfs->sync();
212}
virtual int sync()=0

References XrdSfsFile::sync().

+ Here is the call graph for this function:

◆ sync() [2/2]

int File::sync ( XrdSfsAio * aiop)
overridevirtual

Make sure all outstanding data is actually written to the file (async).

Returns
SFS_OK Request accepted and will be scheduled.
SFS_ERROR Request could not be accepted, return error has reason.

Implements XrdSfsFile.

Definition at line 215 of file XrdThrottleFile.cc.

216{
217 return m_sfs->sync(aiop);
218}

References XrdSfsFile::sync().

+ Here is the call graph for this function:

◆ truncate()

int File::truncate ( XrdSfsFileOffset fsize)
overridevirtual

Truncate the file.

Parameters
fsize- The size that the file is to have.
Returns
One of SFS_OK, SFS_ERROR, SFS_REDIRECT, or SFS_STALL

Implements XrdSfsFile.

Definition at line 227 of file XrdThrottleFile.cc.

228{
229 return m_sfs->truncate(fileOffset);
230}
virtual int truncate(XrdSfsFileOffset fsize)=0

References XrdSfsFile::truncate().

+ Here is the call graph for this function:

◆ write() [1/2]

int File::write ( XrdSfsAio * aioparm)
overridevirtual

Write file bytes using asynchronous I/O.

Parameters
aioparm- Pointer to async I/O object controlling the I/O.
Returns
0 Request accepted and will be scheduled.
!0 Request not accepted, returned value is errno.

Implements XrdSfsFile.

Definition at line 199 of file XrdThrottleFile.cc.

200{
201 aioparm->Result = this->write((XrdSfsFileOffset)aioparm->sfsAio.aio_offset,
202 (char *)aioparm->sfsAio.aio_buf,
204 aioparm->doneWrite();
205 return SFS_OK;
206}
#define write(a, b, c)
Definition XrdPosix.hh:115

References aiocb::aio_buf, aiocb::aio_nbytes, aiocb::aio_offset, XrdSfsAio::doneWrite(), XrdSfsAio::Result, SFS_OK, XrdSfsAio::sfsAio, and write.

+ Here is the call graph for this function:

◆ write() [2/2]

XrdSfsXferSize File::write ( XrdSfsFileOffset offset,
const char * buffer,
XrdSfsXferSize size )
overridevirtual

Write file bytes from a buffer.

Parameters
offset- The offset where the write is to start.
buffer- pointer to buffer where the bytes reside.
size- The number of bytes to write.
Returns
>= 0 The number of bytes that were written.
SFS_ERROR File could not be written, error holds the reason.

Implements XrdSfsFile.

Definition at line 190 of file XrdThrottleFile.cc.

193{
194 DO_THROTTLE(buffer_size);
195 return m_sfs->write(fileOffset, buffer, buffer_size);
196}
virtual XrdSfsXferSize write(XrdSfsFileOffset offset, const char *buffer, XrdSfsXferSize size)=0

References DO_THROTTLE, and XrdSfsFile::write().

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ FileSystem

friend class FileSystem
friend

Definition at line 30 of file XrdThrottle.hh.


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