| 210 | #endif |
| 211 | |
| 212 | int 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 | |
| 241 | int ErasureCodeClay::parse(ErasureCodeProfile &profile, |
| 242 | ostream *ss) |
no test coverage detected