| 312 | } |
| 313 | |
| 314 | IGNORE_DEPRECATED |
| 315 | [[deprecated]] |
| 316 | int ErasureCode::encode(const set<int> &want_to_encode, |
| 317 | const bufferlist &in, |
| 318 | map<int, bufferlist> *encoded) |
| 319 | { |
| 320 | unsigned int k = get_data_chunk_count(); |
| 321 | unsigned int m = get_chunk_count() - k; |
| 322 | bufferlist out; |
| 323 | int err = encode_prepare(in, *encoded); |
| 324 | if (err) |
| 325 | return err; |
| 326 | encode_chunks(want_to_encode, encoded); |
| 327 | for (unsigned int i = 0; i < k + m; i++) { |
| 328 | if (want_to_encode.count(i) == 0) |
| 329 | encoded->erase(i); |
| 330 | } |
| 331 | return 0; |
| 332 | } |
| 333 | END_IGNORE_DEPRECATED |
| 334 | |
| 335 | int ErasureCode::encode(const shard_id_set &want_to_encode, |