| 209 | } |
| 210 | |
| 211 | IGNORE_DEPRECATED |
| 212 | [[deprecated]] |
| 213 | int ErasureCodeShec::encode(const set<int> &want_to_encode, |
| 214 | const bufferlist &in, |
| 215 | map<int, bufferlist> *encoded) |
| 216 | { |
| 217 | unsigned int k = get_data_chunk_count(); |
| 218 | unsigned int m = get_chunk_count() - k; |
| 219 | bufferlist out; |
| 220 | |
| 221 | if (!encoded || !encoded->empty()){ |
| 222 | return -EINVAL; |
| 223 | } |
| 224 | |
| 225 | int err = encode_prepare(in, *encoded); |
| 226 | if (err) |
| 227 | return err; |
| 228 | encode_chunks(want_to_encode, encoded); |
| 229 | for (unsigned int i = 0; i < k + m; i++) { |
| 230 | if (want_to_encode.count(i) == 0) |
| 231 | encoded->erase(i); |
| 232 | } |
| 233 | return 0; |
| 234 | } |
| 235 | |
| 236 | [[deprecated]] |
| 237 | int ErasureCodeShec::encode_chunks(const set<int> &want_to_encode, |