#include <XrdXrootdAioTask.hh>
Definition at line 46 of file XrdXrootdAioTask.hh.
◆ XrdXrootdAioTask()
XrdXrootdAioTask::XrdXrootdAioTask |
( |
const char * | what = "aio request" | ) |
|
|
inlineprotected |
◆ ~XrdXrootdAioTask()
virtual XrdXrootdAioTask::~XrdXrootdAioTask |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ Completed()
Definition at line 73 of file XrdXrootdAioTask.cc.
74{
75
76
78
79
80
86 return;
87 }
88
89
90
95 }
96
97
98
99
104 }
105
107}
void Schedule(XrdJob *jp)
virtual void Recycle() override
virtual void Recycle(bool release)=0
XrdXrootdAioBuff * pendQEnd
References aioMutex, aioReady, inFlight, isDone, XrdXrootdAioBuff::next, Offline, pendQ, pendQEnd, XrdXrootdAioBuff::Recycle(), Recycle(), Running, XrdXrootd::Sched, Status, and Waiting.
◆ CopyF2L()
virtual void XrdXrootdAioTask::CopyF2L |
( |
| ) |
|
|
protectedpure virtual |
◆ CopyL2F() [1/2]
virtual int XrdXrootdAioTask::CopyL2F |
( |
| ) |
|
|
protectedpure virtual |
◆ CopyL2F() [2/2]
◆ Drain()
bool XrdXrootdAioTask::Drain |
( |
| ) |
|
|
protected |
Definition at line 113 of file XrdXrootdAioTask.cc.
114{
115 XrdXrootdAioBuff *aioP;
116 int maxWait = 6;
117
118
119
122 {
while((aioP =
pendQ))
128 }
129 if (
inFlight <= 0 || !Wait4Buff(maxWait))
break;
130 }
131
132
133
134
136 {char buff[128];
137 snprintf(buff, sizeof(buff),
138 "aio%c overdue %d inflight request%s for",
142 }
143
144
145
146
151}
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
References aioMutex, aioRead, aioState, dataFile, dataLink, XrdXrootd::eLog, inFlight, isDone, XrdXrootdAioBuff::next, Offline, pendQ, pendQEnd, XrdXrootdAioBuff::Recycle(), and Status.
Referenced by gdDone(), and gdFail().
◆ gdDone()
int XrdXrootdAioTask::gdDone |
( |
| ) |
|
|
overrideprotected |
Definition at line 157 of file XrdXrootdAioTask.cc.
158{
159 XrdXrootdAioBuff *bP = pendWrite;
160 int rc;
161
162
163
164 TRACEP(
DEBUG,
"gdDone: "<<(
void *)
this<<
" pendWrite "
165 <<(pendWrite != 0 ? "set":"not set"));
166
167
168
169
170 pendWrite = 0;
173 else rc = 0;
174 }
175
176
177
178 TRACEP(
DEBUG,
"gdDone: "<<(
void *)
this<<
" ending rc="<<rc);
179
180
181
182
183
184 if (rc <= 0)
185 {XrdXrootdProtocol* prot =
Protocol;
190 }
191 return rc;
192}
XrdXrootdProtocol * Protocol
int getDump(const char *dtype, int dlen)
References XrdJob::Comment, CopyL2F(), dataLen, DEBUG, Drain(), XrdXrootdProtocol::getDump(), inFlight, isDone, Protocol, Recycle(), and TRACEP.
Referenced by XrdXrootdNormAio::Write(), and XrdXrootdPgrwAio::Write().
◆ gdFail()
void XrdXrootdAioTask::gdFail |
( |
| ) |
|
|
overrideprotected |
Definition at line 198 of file XrdXrootdAioTask.cc.
199{
200 char eBuff[512];
201
202
203
205
206
207
208 snprintf(eBuff,
sizeof(eBuff),
"link error aborted %s for",
Comment);
210
211
212
216 if (pendWrite) {pendWrite->Recycle(); pendWrite = 0;}
217
218
219
221
222
223
226}
References aioDead, aioRead, aioState, XrdJob::Comment, dataFile, dataLen, dataLink, DEBUG, Drain(), XrdXrootd::eLog, inFlight, isDone, Protocol, Recycle(), and TRACEP.
◆ getBuff()
◆ ID()
const char * XrdXrootdAioTask::ID |
( |
| ) |
|
◆ Init()
Definition at line 275 of file XrdXrootdAioTask.cc.
278{
279
280
281
283 finalRead = 0;
292}
XrdXrootdResponse Response
References aioState, dataFile, dataLink, inFlight, isDone, pendQ, pendQEnd, Protocol, Response, Running, Status, and XrdXrootdResponse::theLink().
Referenced by XrdXrootdNormAio::Alloc(), and XrdXrootdPgrwAio::Alloc().
◆ Read()
virtual void XrdXrootdAioTask::Read |
( |
long long | offs, |
|
|
int | dlen ) |
|
pure virtual |
◆ Recycle()
virtual void XrdXrootdAioTask::Recycle |
( |
bool | release | ) |
|
|
pure virtual |
◆ SendError()
void XrdXrootdAioTask::SendError |
( |
int | rc, |
|
|
const char * | eText ) |
|
protected |
Definition at line 298 of file XrdXrootdAioTask.cc.
299{
300 char eBuff[1024];
301
302
303
304 if (!eText) eText = (rc ?
XrdSysE2T(rc) :
"invalid error code");
305
306
307
308 snprintf(eBuff, sizeof(eBuff), "async %s failed for %s;",
311
312
313
321 }
322}
const char * XrdSysE2T(int errcode)
static int mapError(int rc)
References aioDead, aioRead, aioState, dataFile, dataLen, dataLink, XrdXrootd::eLog, isDone, XProtocol::mapError(), Response, and XrdSysE2T().
Referenced by getBuff(), SendFSError(), and Validate().
◆ SendFSError()
void XrdXrootdAioTask::SendFSError |
( |
int | rc | ) |
|
|
protected |
Definition at line 328 of file XrdXrootdAioTask.cc.
329{
330 XrdOucErrInfo &myError =
dataFile->XrdSfsp->error;
331 int eCode;
332
333
334
335
337 {char eBuff[256];
338 snprintf(eBuff, sizeof(eBuff), "fs returned unexpected rc %d", rc);
341 return;
342 }
343
344
345
355 }
356
357
358
360}
const char * getErrText()
void Reset()
Reset object to no message state. Call this method to release appendages.
References aioDead, aioRead, aioState, dataFile, dataLen, dataLink, XrdXrootd::eLog, eMsg, XrdOucErrInfo::extData(), XrdOucErrInfo::getErrText(), isDone, XProtocol::mapError(), XrdOucErrInfo::Reset(), Response, SendError(), and SFS_ERROR.
◆ urProtocol()
◆ Validate()
Definition at line 366 of file XrdXrootdAioTask.cc.
367{
368 ssize_t aioResult = aioP->
Result;
371
372
373
374
376
377
378
379
382 return false;
383 }
384
385
386
387
388
389
390
391 if (aioResult < aioLength)
393 if (!aioResult)
394 {if ((finalRead && aioOffset < finalRead->sfsAio.aio_offset)
396 return false;
397 } else {
399 {
SendError(ENODEV,
"embedded short block");
400 return false;
401 } else {
402 if (finalRead)
SendError(ENODEV,
"multiple short blocks");
403 else {finalRead = aioP;
405 }
406 }
407 }
408 return false;
409 }
410
411
412
413
414 if (finalRead && aioOffset >= finalRead->sfsAio.aio_offset)
415 {
SendError(ENODEV,
"read offset past EOD");
416 return false;
417 }
419 return true;
420}
References aiocb::aio_nbytes, aiocb::aio_offset, dataLen, highOffset, isDone, XrdSfsAio::Result, SendError(), and XrdSfsAio::sfsAio.
◆ Write()
virtual int XrdXrootdAioTask::Write |
( |
long long | offs, |
|
|
int | dlen ) |
|
pure virtual |
◆ XrdXrootdAioFob
◆ [union]
◆ [union]
◆ aioDead
const int XrdXrootdAioTask::aioDead = 0x01 |
|
staticprotected |
◆ aioHeld
const int XrdXrootdAioTask::aioHeld = 0x02 |
|
staticprotected |
◆ aioMutex
◆ aioPage
const int XrdXrootdAioTask::aioPage = 0x04 |
|
staticprotected |
◆ aioRead
const int XrdXrootdAioTask::aioRead = 0x08 |
|
staticprotected |
Definition at line 118 of file XrdXrootdAioTask.hh.
Referenced by XrdXrootdNormAio::DoIt(), XrdXrootdPgrwAio::DoIt(), Drain(), gdFail(), getBuff(), XrdXrootdNormAio::Read(), XrdXrootdPgrwAio::Read(), XrdXrootdNormAio::Recycle(), XrdXrootdPgrwAio::Recycle(), SendError(), SendFSError(), XrdXrootdNormAio::Write(), and XrdXrootdPgrwAio::Write().
◆ aioReady
◆ aioSchd
const int XrdXrootdAioTask::aioSchd = 0x10 |
|
staticprotected |
◆ aioState
char XrdXrootdAioTask::aioState |
|
protected |
Definition at line 106 of file XrdXrootdAioTask.hh.
Referenced by XrdXrootdNormAio::DoIt(), XrdXrootdPgrwAio::DoIt(), Drain(), gdFail(), getBuff(), Init(), XrdXrootdNormAio::Read(), XrdXrootdPgrwAio::Read(), XrdXrootdNormAio::Recycle(), XrdXrootdPgrwAio::Recycle(), SendError(), SendFSError(), XrdXrootdNormAio::Write(), and XrdXrootdPgrwAio::Write().
◆ dataFile
◆ dataLen
int XrdXrootdAioTask::dataLen |
|
protected |
◆ dataLink
XrdLink* XrdXrootdAioTask::dataLink |
|
protected |
◆ dataOffset
off_t XrdXrootdAioTask::dataOffset |
|
protected |
◆ highOffset
off_t XrdXrootdAioTask::highOffset |
|
protected |
◆ inFlight
◆ isDone
◆ Offline
const int XrdXrootdAioTask::Offline = 0 |
|
staticprotected |
◆ pendQ
◆ pendQEnd
◆ Protocol
Definition at line 96 of file XrdXrootdAioTask.hh.
Referenced by gdDone(), gdFail(), Init(), XrdXrootdNormAio::Read(), XrdXrootdPgrwAio::Read(), XrdXrootdNormAio::Recycle(), XrdXrootdPgrwAio::Recycle(), XrdXrootdAioFob::Schedule(), urProtocol(), XrdXrootdNormAio::Write(), and XrdXrootdPgrwAio::Write().
◆ Response
◆ Running
const int XrdXrootdAioTask::Running = 1 |
|
staticprotected |
◆ Status
char XrdXrootdAioTask::Status |
|
protected |
◆ TraceID
const char * XrdXrootdAioTask::TraceID = "AioTask" |
|
staticprotected |
◆ Waiting
const int XrdXrootdAioTask::Waiting = 2 |
|
staticprotected |
The documentation for this class was generated from the following files: