| 66 | } |
| 67 | |
| 68 | int ErasureCodeClay::init(ErasureCodeProfile &profile, |
| 69 | ostream *ss) |
| 70 | { |
| 71 | int r; |
| 72 | r = parse(profile, ss); |
| 73 | if (r) |
| 74 | return r; |
| 75 | |
| 76 | r = ErasureCode::init(profile, ss); |
| 77 | if (r) |
| 78 | return r; |
| 79 | ErasureCodePluginRegistry ®istry = ErasureCodePluginRegistry::instance(); |
| 80 | r = registry.factory(mds.profile["plugin"], |
| 81 | directory, |
| 82 | mds.profile, |
| 83 | &mds.erasure_code, |
| 84 | ss); |
| 85 | if (r) |
| 86 | return r; |
| 87 | r = registry.factory(pft.profile["plugin"], |
| 88 | directory, |
| 89 | pft.profile, |
| 90 | &pft.erasure_code, |
| 91 | ss); |
| 92 | return r; |
| 93 | |
| 94 | } |
| 95 | |
| 96 | unsigned int ErasureCodeClay::get_chunk_size(unsigned int stripe_width) const |
| 97 | { |