Loading...
Searching...
No Matches
XrdXrootdNormAio Class Reference

`#include <XrdXrootdNormAio.hh>`

Inheritance diagram for XrdXrootdNormAio:
Collaboration diagram for XrdXrootdNormAio:

## Public Member Functions

void | DoIt () override
void | Read (long long offs, int dlen) override
void | Recycle (bool release) override
int | Write (long long offs, int dlen) override
Public Member Functions inherited from XrdXrootdAioTask
void | Completed (XrdXrootdAioBuff *aioP)
const char * | ID ()
void | Init (XrdXrootdProtocol *protP, XrdXrootdResponse &resp, XrdXrootdFile *fP)
XrdXrootdProtocol * | urProtocol ()
Public Member Functions inherited from XrdJob
| XrdJob (const char *desc="")
virtual | ~XrdJob ()

## Static Public Member Functions

static XrdXrootdNormAio * | Alloc (XrdXrootdProtocol *protP, XrdXrootdResponse &resp, XrdXrootdFile *fP)

## Additional Inherited Members

Public Attributes inherited from XrdJob
const char * | Comment
XrdJob * | NextJob
Protected Member Functions inherited from XrdXrootdAioTask
| XrdXrootdAioTask (const char *what="aio request")
virtual | ~XrdXrootdAioTask ()
bool | Drain ()
int | gdDone () override
void | gdFail () override
XrdXrootdAioBuff * | getBuff (bool wait)
void | SendError (int rc, const char *eText)
void | SendFSError (int rc)
bool | Validate (XrdXrootdAioBuff *aioP)
Protected Attributes inherited from XrdXrootdAioTask
union { |
XrdXrootdNormAio * | nextNorm
XrdXrootdPgrwAio * | nextPgrw
XrdXrootdAioTask * | nextTask
}; |
union { |
XrdXrootdAioBuff * | finalRead
XrdXrootdAioBuff * | pendWrite
}; |
XrdSysMutex | aioMutex
XrdSysCondVar2 | aioReady
char | aioState
XrdXrootdFile * | dataFile
int | dataLen
XrdLink * | dataLink
off_t | dataOffset
off_t | highOffset
RAtomic_uchar | inFlight
RAtomic_bool | isDone
XrdXrootdAioBuff * | pendQ
XrdXrootdAioBuff * | pendQEnd
XrdXrootdProtocol * | Protocol
XrdXrootdResponse | Response
char | Status
Static Protected Attributes inherited from XrdXrootdAioTask
static const int | aioDead = 0x01
static const int | aioHeld = 0x02
static const int | aioPage = 0x04
static const int | aioRead = 0x08
static const int | aioSchd = 0x10
static const int | Offline = 0
static const int | Running = 1
static const char * | TraceID = "AioTask"
static const int | Waiting = 2

## Detailed Description

Definition at line 38 of file XrdXrootdNormAio.hh.

## Member Function Documentation

## Alloc()

XrdXrootdNormAio * XrdXrootdNormAio::Alloc | ( | XrdXrootdProtocol * | protP,
|  | XrdXrootdResponse & | resp,
|  | XrdXrootdFile * | fP )

static

Definition at line 84 of file XrdXrootdNormAio.cc.

{
XrdXrootdNormAio *reqP;
// Obtain a preallocated aio request object
//
fqMutex.Lock();
if ((reqP = fqFirst))
{fqFirst = reqP->nextNorm;
numFree--;
}
fqMutex.UnLock();
// If we have no object, create a new one
//
if (!reqP) reqP = new XrdXrootdNormAio;
// Initialize the object and return it
//
reqP->Init(protP, resp, fP);
reqP->nextNorm = 0;
return reqP;
}
XrdXrootdAioTask::Init
void Init(XrdXrootdProtocol *protP, XrdXrootdResponse &resp, XrdXrootdFile *fP)
Definition XrdXrootdAioTask.cc:275

References XrdXrootdAioTask::Init().

Here is the call graph for this function:

## DoIt()

void XrdXrootdNormAio::DoIt | ( |  | ) |

override virtual

Implements XrdJob.

Definition at line 375 of file XrdXrootdNormAio.cc.

{
// Reads run disconnected as they will never read from the link.
//
if (aioState & aioRead) CopyF2L();
}
XrdXrootdAioTask::aioState
char aioState
Definition XrdXrootdAioTask.hh:106
XrdXrootdAioTask::CopyF2L
virtual void CopyF2L()=0
XrdXrootdAioTask::aioRead
static const int aioRead
Definition XrdXrootdAioTask.hh:118

References XrdXrootdAioTask::aioRead, XrdXrootdAioTask::aioState, and XrdXrootdAioTask::CopyF2L().

Here is the call graph for this function:

## Read()

void XrdXrootdNormAio::Read | ( | long long | offs,
|  | int | dlen )

override virtual

Implements XrdXrootdAioTask.

Definition at line 386 of file XrdXrootdNormAio.cc.

{
// Setup the copy from the file to the network
//
dataOffset = highOffset = sendOffset = offs;
dataLen = dlen;
aioState = aioRead;
// Reads run disconnected and are self-terminating, so we need to increase the
// refcount for the link we will be using to prevent it from disapearing.
// Recycle will decrement it but does so only for reads. We always update
// the file refcount and increase the request count.
//
dataLink->setRef(1);
dataFile->Ref(1);
Protocol->aioUpdReq(1);
// Schedule ourselves to run this asynchronously and return
//
dataFile->aioFob->Schedule(this);
}
XrdXrootdAioTask::dataLen
int dataLen
Definition XrdXrootdAioTask.hh:104
XrdXrootdAioTask::dataLink
XrdLink * dataLink
Definition XrdXrootdAioTask.hh:97
XrdXrootdAioTask::dataFile
XrdXrootdFile * dataFile
Definition XrdXrootdAioTask.hh:98
XrdXrootdAioTask::highOffset
off_t highOffset
Definition XrdXrootdAioTask.hh:102
XrdXrootdAioTask::dataOffset
off_t dataOffset
Definition XrdXrootdAioTask.hh:103
XrdXrootdAioTask::Protocol
XrdXrootdProtocol * Protocol
Definition XrdXrootdAioTask.hh:96

References XrdXrootdAioTask::aioRead, XrdXrootdAioTask::aioState, XrdXrootdAioTask::dataFile, XrdXrootdAioTask::dataLen, XrdXrootdAioTask::dataLink, XrdXrootdAioTask::dataOffset, XrdXrootdAioTask::highOffset, and XrdXrootdAioTask::Protocol.

## Recycle()

void XrdXrootdNormAio::Recycle | ( | bool | release | ) |

override virtual

Implements XrdXrootdAioTask.

Definition at line 413 of file XrdXrootdNormAio.cc.

{
// Update request count, file and link reference count
//
if (!(aioState & aioHeld))
{Protocol->aioUpdReq(-1);
if (aioState & aioRead)
{dataFile->Ref(-1);
dataLink->setRef(-1);
}
aioState |= aioHeld;
}
// Do some tracing and reset reorder counter
//
TRACEP(FSAIO,"aio"<<(aioState & aioRead ? 'R' : 'W')<<" recycle"
<<(release ? "" : " hold")<<"; reorders="<<reorders
<<" D-S="<<isDone<<'-'<<int(Status));
reorders = 0;
// Place the object on the free queue if possible
//
if (release)
{fqMutex.Lock();
if (numFree >= maxKeep)
{fqMutex.UnLock();
delete this;
} else {
nextNorm = fqFirst;
fqFirst = this;
numFree++;
fqMutex.UnLock();
}
}
}
TRACEP
#define TRACEP(act, x)
Definition XrdXrootdTrace.hh:63
XrdXrootdAioTask::isDone
RAtomic_bool isDone
Definition XrdXrootdAioTask.hh:108
XrdXrootdAioTask::Status
char Status
Definition XrdXrootdAioTask.hh:109
XrdXrootdAioTask::aioHeld
static const int aioHeld
Definition XrdXrootdAioTask.hh:116

References XrdXrootdAioTask::aioHeld, XrdXrootdAioTask::aioRead, XrdXrootdAioTask::aioState, XrdXrootdAioTask::dataFile, XrdXrootdAioTask::dataLink, XrdXrootdAioTask::isDone, XrdXrootdAioTask::Protocol, XrdXrootdAioTask::Status, and TRACEP.

## Write()

int XrdXrootdNormAio::Write | ( | long long | offs,
|  | int | dlen )

override virtual

Implements XrdXrootdAioTask.

Definition at line 479 of file XrdXrootdNormAio.cc.

{
// Update request count. Note that dataLink and dataFile references are
// handled outboard as writes are inextricably tied to the data link.
//
Protocol->aioUpdReq(1);
// Setup the copy from the network to the file
//
aioState &= ~aioRead;
dataOffset = highOffset = offs;
dataLen = dlen;
// Since this thread can't do anything else since it's blocked by the socket
// we simply initiate the write operation via a simulated getData() callback.
//
return gdDone();
}
XrdXrootdAioTask::gdDone
int gdDone() override
Definition XrdXrootdAioTask.cc:157

References XrdXrootdAioTask::aioRead, XrdXrootdAioTask::aioState, XrdXrootdAioTask::dataLen, XrdXrootdAioTask::dataOffset, XrdXrootdAioTask::gdDone(), XrdXrootdAioTask::highOffset, and XrdXrootdAioTask::Protocol.

Here is the call graph for this function:

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

- XrdXrootdNormAio.hh
- XrdXrootdNormAio.cc