xrootd
Loading...
Searching...
No Matches
XrdXrootdAioPgrw.hh
Go to the documentation of this file.
1#ifndef __XRDXROOTDAIOPGRW__
2#define __XRDXROOTDAIOPGRW__
3/******************************************************************************/
4/* */
5/* X r d X r o o t d A i o P g r w . h h */
6/* */
7/* (c) 2021 by the Board of Trustees of the Leland Stanford, Jr., University */
8/* All Rights Reserved */
9/* Produced by Andrew Hanushevsky for Stanford University under contract */
10/* DE-AC02-76-SFO0515 with the Department of Energy */
11/* */
12/* This file is part of the XRootD software suite. */
13/* */
14/* XRootD is free software: you can redistribute it and/or modify it under */
15/* the terms of the GNU Lesser General Public License as published by the */
16/* Free Software Foundation, either version 3 of the License, or (at your */
17/* option) any later version. */
18/* */
19/* XRootD is distributed in the hope that it will be useful, but WITHOUT */
20/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
21/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
22/* License for more details. */
23/* */
24/* You should have received a copy of the GNU Lesser General Public License */
25/* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
26/* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
27/* */
28/* The copyright holder's institutional names and contributor's names may not */
29/* be used to endorse or promote products derived from this software without */
30/* specific prior written permission of the institution or contributor. */
31/******************************************************************************/
32
33#include <sys/uio.h>
34
38
39// The XrdXrootdAioPgr object represents a single aio read or write operation.
40// One or more of these are allocated by the XrdXrootdPgrwAio to effect
41// asynchronous I/O. This object is specific to pgRead requests.
42
43class XrdXrootdFile;
46
48{
49public:
50
51static
53
54struct iovec *iov4Data(int &iovNum) {iovNum = csNum<<1; return &ioVec[1];}
55
56struct iovec *iov4Recv(int &iovNum);
57
58struct iovec *iov4Send(int &iovNum, int &iovLen, bool cs2net=false);
59
60 bool noChkSums(bool reset=true)
61 {bool retval = cksVec == 0;
62 if (retval && reset) cksVec = csVec;
63 return retval;
64 }
65
66 void Recycle() override;
67
68 int Setup2Recv(off_t offs, int dlen, const char *&eMsg);
69
70 int Setup2Send(off_t offs, int dlen, const char *&eMsg);
71
74
75static const int aioSZ = XrdXrootdPgrwAio::aioSZ;
76static const int acsSZ = aioSZ/XrdProto::kXR_pgPageSZ; // 16 checksums
77
78private:
79
80static const char* TraceID;
81
84uint32_t csVec[acsSZ];
85struct iovec ioVec[acsSZ*2+1];
86};
87#endif
Definition XrdBuffer.hh:42
uint32_t * cksVec
Definition XrdSfsAio.hh:63
Definition XrdXrootdAioBuff.hh:41
Definition XrdXrootdAioPgrw.hh:48
int Setup2Send(off_t offs, int dlen, const char *&eMsg)
uint32_t csVec[acsSZ]
Definition XrdXrootdAioPgrw.hh:84
struct iovec * iov4Send(int &iovNum, int &iovLen, bool cs2net=false)
static const char * TraceID
Definition XrdXrootdAioPgrw.hh:80
static const int acsSZ
Definition XrdXrootdAioPgrw.hh:76
static const int aioSZ
Definition XrdXrootdAioPgrw.hh:75
static XrdXrootdAioPgrw * Alloc(XrdXrootdAioTask *arp)
struct iovec * iov4Data(int &iovNum)
Definition XrdXrootdAioPgrw.hh:54
XrdXrootdAioPgrw(XrdXrootdAioTask *tP, XrdBuffer *bP)
struct iovec * iov4Recv(int &iovNum)
void Recycle() override
int iovReset
Definition XrdXrootdAioPgrw.hh:83
bool noChkSums(bool reset=true)
Definition XrdXrootdAioPgrw.hh:60
int csNum
Definition XrdXrootdAioPgrw.hh:82
int Setup2Recv(off_t offs, int dlen, const char *&eMsg)
struct iovec ioVec[acsSZ *2+1]
Definition XrdXrootdAioPgrw.hh:85
Definition XrdXrootdAioTask.hh:47
Definition XrdXrootdFile.hh:101
static const int aioSZ
Definition XrdXrootdPgrwAio.hh:55
Definition XrdXrootdProtocol.hh:156
static const int kXR_pgPageSZ
Definition XProtocol.hh:494