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

Method encode

src/erasure-code/shec/ErasureCodeShec.cc:211–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209}
210
211IGNORE_DEPRECATED
212[[deprecated]]
213int 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]]
237int ErasureCodeShec::encode_chunks(const set<int> &want_to_encode,

Callers 1

do_encodeMethod · 0.45

Calls 3

emptyMethod · 0.45
countMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected