95 LOGCEPH(
"XrdCephOssReadVFile::ReadV: fd: " <<
fd <<
" " << rnum );
97 std::stringstream msg_extents;
98 msg_extents <<
"XrdCephOssReadVFile::Extentslist={\"fd\": " <<
fd <<
", \"EXTENTS\":[";
101 for (
int i = 0; i < rnum; i++) {
103 msg_extents <<
"[" << readV[i].
offset <<
"," << readV[i].
size <<
"]," ;
113 LOGCEPH(
"XrdCephOssReadVFile::Extents: fd: "<<
fd <<
" " << extents.
size() <<
" " << extents.
len() <<
" "
118 std::vector<ExtentHolder> mappedExtents =
m_readVAdapter->convert(extents);
122 int nbytes = 0, curCount = 0, counter(0);
123 size_t totalBytesRead(0), totalBytesUseful(0);
126 size_t buffersize{0};
127 for (std::vector<ExtentHolder>::const_iterator ehit = mappedExtents.cbegin(); ehit!= mappedExtents.cend(); ++ehit ) {
128 buffersize = std::max(buffersize, ehit->len());
130 std::vector<char> buffer;
131 buffer.reserve(buffersize);
135 for (std::vector<ExtentHolder>::const_iterator ehit = mappedExtents.cbegin(); ehit!= mappedExtents.cend(); ++ehit ) {
136 off_t off = ehit->begin();
137 size_t len = ehit->len();
142 long timed_read_ns{0};
144 curCount =
m_xrdOssDF->Read(buffer.data(), off, len);
154 if (curCount != (ssize_t)len) {
155 return (curCount < 0 ? curCount : -ESPIPE);
157 totalBytesRead += curCount;
158 totalBytesUseful += ehit->bytesContained();
162 const char* data = buffer.data();
164 for (ExtentContainer::const_iterator it = innerExtents.cbegin(); it != innerExtents.cend(); ++it) {
165 off_t innerBegin = it->begin() - off;
166 off_t innerEnd = it->end() - off;
170 std::copy(data+innerBegin, data+innerEnd, readV[counter].data );
176 LOGCEPH(
"readV returning " << nbytes <<
" bytes: " <<
"Read: " <<totalBytesRead <<
" Useful: " << totalBytesUseful );