XRootD
XrdXrootdAioFob Class Reference

#include <XrdXrootdAioFob.hh>

+ Collaboration diagram for XrdXrootdAioFob:

Public Member Functions

 XrdXrootdAioFob ()
 
 ~XrdXrootdAioFob ()
 
void Reset ()
 
void Reset (XrdXrootdProtocol *protP)
 
void Schedule (XrdXrootdAioTask *aioP)
 
void Schedule (XrdXrootdProtocol *protP)
 

Detailed Description

Definition at line 37 of file XrdXrootdAioFob.hh.

Constructor & Destructor Documentation

◆ XrdXrootdAioFob()

XrdXrootdAioFob::XrdXrootdAioFob ( )
inline

Definition at line 49 of file XrdXrootdAioFob.hh.

49 : maxQ(0) {}

◆ ~XrdXrootdAioFob()

XrdXrootdAioFob::~XrdXrootdAioFob ( )
inline

Definition at line 51 of file XrdXrootdAioFob.hh.

51 {Reset();}

References Reset().

+ Here is the call graph for this function:

Member Function Documentation

◆ Reset() [1/2]

void XrdXrootdAioFob::Reset ( )

Definition at line 73 of file XrdXrootdAioFob.cc.

74 {
75  XrdXrootdAioTask *aioP;
76 
77 // Recycle all outstanding aio tasks
78 //
79  fobMutex.Lock();
80 
81  for (int i = 0; i < maxQ; i++)
82  {while((aioP = aioQ[i].first))
83  {aioQ[i].first = aioP->nextTask;
84  if (TRACING(TRACE_FSAIO)) Notify(aioP, "Discarding");
85  aioP->Recycle(true);
86  }
87  aioQ[i].last = 0;
88  Running[i] = false;
89  }
90 
91  fobMutex.UnLock();
92 }
#define TRACING(x)
Definition: XrdTrace.hh:70
#define TRACE_FSAIO
virtual void Recycle(bool release)=0

References XrdXrootdAioTask::Recycle(), TRACE_FSAIO, and TRACING.

Referenced by ~XrdXrootdAioFob(), and XrdXrootdFile::~XrdXrootdFile().

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

◆ Reset() [2/2]

void XrdXrootdAioFob::Reset ( XrdXrootdProtocol protP)

Definition at line 96 of file XrdXrootdAioFob.cc.

97 {
98  XrdXrootdAioTask *aioP;
99  int pathID = protP->getPathID();
100 
101 // Recycle all outstanding aio tasks
102 //
103  fobMutex.Lock();
104 
105  while((aioP = aioQ[pathID].first))
106  {aioQ[pathID].first = aioP->nextTask;
107  if (TRACING(TRACE_FSAIO)) Notify(aioP, "Discarding");
108  aioP->Recycle(true);
109  }
110  aioQ[pathID].last = 0;
111  Running[pathID] = false;
112 
113  fobMutex.UnLock();
114 }

References XrdXrootdProtocol::getPathID(), XrdXrootdAioTask::Recycle(), TRACE_FSAIO, and TRACING.

+ Here is the call graph for this function:

◆ Schedule() [1/2]

void XrdXrootdAioFob::Schedule ( XrdXrootdAioTask aioP)

Definition at line 120 of file XrdXrootdAioFob.cc.

121 {
122  int pathID = aioP->Protocol->getPathID();
123 
124 // Run or queue this task
125 //
126  fobMutex.Lock();
127 
128  if (Running[pathID])
129  {if (aioQ[pathID].last) aioQ[pathID].last->nextTask = aioP;
130  else aioQ[pathID].first = aioP;
131  aioQ[pathID].last = aioP;
132  aioP->nextTask = 0;
133  if (maxQ <= pathID) maxQ = pathID+1;
134  if (TRACING(TRACE_FSAIO)) Notify(aioP, "Queuing");
135  } else {
136  Sched->Schedule(aioP);
137  Running[pathID] = true;
138  if (TRACING(TRACE_FSAIO)) Notify(aioP, "Running");
139  }
140 
141  fobMutex.UnLock();
142 }
void Schedule(XrdJob *jp)
XrdXrootdProtocol * Protocol
XrdScheduler * Sched

References XrdXrootdProtocol::getPathID(), XrdXrootdAioTask::Protocol, XrdXrootd::Sched, XrdScheduler::Schedule(), TRACE_FSAIO, and TRACING.

+ Here is the call graph for this function:

◆ Schedule() [2/2]

void XrdXrootdAioFob::Schedule ( XrdXrootdProtocol protP)

Definition at line 146 of file XrdXrootdAioFob.cc.

147 {
148  int pathID = protP->getPathID();
149 
150 // Schedule the next task.
151 //
152  fobMutex.Lock();
153 
154  if (aioQ[pathID].first)
155  {XrdXrootdAioTask *aioP = aioQ[pathID].first;
156  if (!(aioQ[pathID].first = aioP->nextTask)) aioQ[pathID].last = 0;
157  aioP->nextTask = 0;
158  Sched->Schedule(aioP);
159  Running[pathID] = true;
160  if (TRACING(TRACE_FSAIO)) Notify(aioP, "Running");
161  } else Running[pathID] = false;
162 
163  fobMutex.UnLock();
164 }

References XrdXrootdProtocol::getPathID(), XrdXrootd::Sched, XrdScheduler::Schedule(), TRACE_FSAIO, and TRACING.

+ Here is the call graph for this function:

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