32 #include <arpa/inet.h>
43 #define TRACELINK reqP
63 const char *XrdXrootdAioPgrw::TraceID =
"PgrwBuff";
71 static const int csLen =
sizeof(uint32_t);
73 static const int maxKeep = 64;
83 char *buff = bP->
buff;
84 uint32_t *csV = csVec;
88 for (
int i = 1; i <=
acsSZ<<1; i+= 2)
89 {ioVec[i ].iov_base = csV;
90 ioVec[i ].iov_len = csLen;
91 ioVec[i+1].iov_base = buff;
127 if ((aiobuff = fqFirst))
128 {fqFirst = aiobuff->
next;
151 return aiobuff->
pgrwP;
166 ioVec[2].iov_len = fLen;
168 {iovReset = csNum<<1;
169 ioVec[iovReset].iov_len = lLen;
171 }
else csNum =
acsSZ;
191 iovNum = (csNum<<1) + 1;
192 iovLen =
Result + (csNum *
sizeof(uint32_t));
193 ioVec[2].iov_len = fLen;
195 {iovReset = csNum<<1;
196 ioVec[iovReset].iov_len = lLen;
202 if (cs2net)
for (
int i = 0; i < csNum; i++) csVec[i] = htonl(csVec[i]);
227 if (numFree >= maxKeep)
264 ioVec[2].iov_len = layout.
fLen;
266 {iovReset = csNum<<1;
267 ioVec[iovReset].iov_len = layout.
lLen;
307 ioVec[2].iov_len = layout.
fLen;
309 {iovReset = csNum<<1;
310 ioVec[iovReset].iov_len = layout.
lLen;
XrdSysTrace XrdXrootdTrace
void Release(XrdBuffer *bp)
XrdBuffer * Obtain(int bsz)
off_t bOffset
Buffer offset to apply iov[1].iov_base.
int dataLen
Total number of filesys bytes the iovec will handle.
static int sendLayout(Layout &layout, off_t offs, int dlen, int bsz=0)
int fLen
Length to use for iov[1].iov_len.
int sockLen
Total number of network bytes the iovec will handle.
const char * eWhy
Reason for failure when zero is returned.
static int csNum(off_t offs, int count)
Compute the required size of a checksum vector based on offset & length.
int lLen
Length to use for iov[csnum*2-1].iov_len)
static int recvLayout(Layout &layout, off_t offs, int dlen, int bsz=0)
Compute the layout for an iovec that receives network bytes applying.
XrdXrootdAioPgrw *const pgrwP
int Setup2Send(off_t offs, int dlen, const char *&eMsg)
struct iovec * iov4Send(int &iovNum, int &iovLen, bool cs2net=false)
XrdXrootdAioPgrw(XrdXrootdAioTask *tP, XrdBuffer *bP)
struct iovec * iov4Recv(int &iovNum)
static XrdXrootdAioPgrw * Alloc(XrdXrootdAioTask *arp)
int Setup2Recv(off_t offs, int dlen, const char *&eMsg)
XrdXrootdProtocol * urProtocol()
static const int kXR_pgPageSZ