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

Method decode_chunks

src/erasure-code/clay/ErasureCodeClay.cc:212–239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210#endif
211
212int ErasureCodeClay::decode_chunks(const set<int> &want_to_read,
213 const map<int, bufferlist> &chunks,
214 map<int, bufferlist> *decoded)
215{
216 set<int> erasures;
217 map<int, bufferlist> coded_chunks;
218
219 for (int i = 0; i < k + m; i++) {
220 if (chunks.count(i) == 0) {
221 erasures.insert(i < k ? i : i+nu);
222 }
223 ceph_assert(decoded->count(i) > 0);
224 coded_chunks[i < k ? i : i+nu] = (*decoded)[i];
225 }
226 int chunk_size = coded_chunks[0].length();
227
228 for (int i = k; i < k+nu; i++) {
229 bufferptr buf(buffer::create_aligned(chunk_size, SIMD_ALIGN));
230 buf.zero();
231 coded_chunks[i].push_back(std::move(buf));
232 }
233
234 int res = decode_layered(erasures, &coded_chunks);
235 for (int i = k; i < k+nu; i++) {
236 coded_chunks[i].clear();
237 }
238 return res;
239}
240
241int ErasureCodeClay::parse(ErasureCodeProfile &profile,
242 ostream *ss)

Callers 5

repair_one_lost_chunkMethod · 0.45
decode_uncoupledMethod · 0.45
recover_type1_erasureMethod · 0.45

Calls 6

countMethod · 0.45
insertMethod · 0.45
lengthMethod · 0.45
zeroMethod · 0.45
push_backMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected