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

Method parse

src/erasure-code/jerasure/ErasureCodeJerasure.cc:67–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67int ErasureCodeJerasure::parse(ErasureCodeProfile &profile,
68 ostream *ss)
69{
70 int err = ErasureCode::parse(profile, ss);
71 err |= to_int("k", profile, &k, DEFAULT_K, ss);
72 err |= to_int("m", profile, &m, DEFAULT_M, ss);
73 err |= to_int("w", profile, &w, DEFAULT_W, ss);
74 if (chunk_mapping.size() > 0 && (int)chunk_mapping.size() != k + m) {
75 *ss << "mapping " << profile.find("mapping")->second
76 << " maps " << chunk_mapping.size() << " chunks instead of"
77 << " the expected " << k + m << " and will be ignored" << std::endl;
78 chunk_mapping.clear();
79 err = -EINVAL;
80 }
81 err |= sanity_check_k_m(k, m, ss);
82 return err;
83}
84
85unsigned int ErasureCodeJerasure::get_chunk_size(unsigned int stripe_width) const
86{

Callers

nothing calls this directly

Calls 5

to_intFunction · 0.85
parseFunction · 0.50
sizeMethod · 0.45
findMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected