MCPcopy Create free account
hub / github.com/ceph/ceph / _decode

Method _decode

src/erasure-code/ErasureCode.cc:371–409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369}
370
371IGNORE_DEPRECATED
372[[deprecated]]
373int ErasureCode::_decode(const set<int> &want_to_read,
374 const map<int, bufferlist> &chunks,
375 map<int, bufferlist> *decoded)
376{
377 vector<int> have;
378 have.reserve(chunks.size());
379 for (map<int, bufferlist>::const_iterator i = chunks.begin();
380 i != chunks.end();
381 ++i) {
382 have.push_back(i->first);
383 }
384 if (includes(
385 have.begin(), have.end(), want_to_read.begin(), want_to_read.end())) {
386 for (set<int>::iterator i = want_to_read.begin();
387 i != want_to_read.end();
388 ++i) {
389 (*decoded)[*i] = chunks.find(*i)->second;
390 }
391 return 0;
392 }
393 unsigned int k = get_data_chunk_count();
394 unsigned int m = get_chunk_count() - k;
395 unsigned blocksize = (*chunks.begin()).second.length();
396 for (unsigned int i = 0; i < k + m; i++) {
397 if (chunks.find(i) == chunks.end()) {
398 bufferlist tmp;
399 bufferptr ptr(buffer::create_aligned(blocksize, SIMD_ALIGN));
400 tmp.push_back(ptr);
401 tmp.claim_append((*decoded)[i]);
402 (*decoded)[i].swap(tmp);
403 } else {
404 (*decoded)[i] = chunks.find(i)->second;
405 (*decoded)[i].rebuild_aligned(SIMD_ALIGN);
406 }
407 }
408 return decode_chunks(want_to_read, chunks, decoded);
409}
410END_IGNORE_DEPRECATED
411
412int ErasureCode::_decode(const shard_id_set &want_to_read,

Callers

nothing calls this directly

Calls 15

rebuild_alignedMethod · 0.80
includesMethod · 0.80
is_contiguousMethod · 0.80
get_current_ptrMethod · 0.80
reserveMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45
findMethod · 0.45
lengthMethod · 0.45
claim_appendMethod · 0.45

Tested by

no test coverage detected