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

Method decode_chunks

src/erasure-code/isa/ErasureCodeIsa.cc:93–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93int ErasureCodeIsa::decode_chunks(const set<int> &want_to_read,
94 const map<int, bufferlist> &chunks,
95 map<int, bufferlist> *decoded)
96{
97 unsigned blocksize = (*chunks.begin()).second.length();
98 int erasures[k + m + 1];
99 int erasures_count = 0;
100 char *data[k];
101 char *coding[m];
102 for (int i = 0; i < k + m; i++) {
103 if (chunks.find(i) == chunks.end()) {
104 erasures[erasures_count] = i;
105 erasures_count++;
106 }
107 if (i < k) {
108 data[i] = (*decoded)[i].c_str();
109 } else {
110 coding[i - k] = (*decoded)[i].c_str();
111 }
112 }
113 erasures[erasures_count] = -1;
114 ceph_assert(erasures_count > 0);
115 return isa_decode(erasures, data, coding, blocksize);
116}
117
118int ErasureCodeIsa::encode_chunks(const shard_id_map<bufferptr> &in,
119 shard_id_map<bufferptr> &out)

Callers 1

_decodeMethod · 0.45

Calls 10

insert_rangeMethod · 0.80
shard_id_tClass · 0.50
lengthMethod · 0.45
beginMethod · 0.45
findMethod · 0.45
endMethod · 0.45
c_strMethod · 0.45
eraseMethod · 0.45
insertMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected