Skip to content

Commit

Permalink
ec/jerasure: save the default m=2 of reed_sol_r6_op in profile
Browse files Browse the repository at this point in the history
save the default value of m to profile so that it could be dumped
in command 'ceph osd erasure-code-profile get xxx', which is more
useful and friendly to user.

Signed-off-by: Yan Jun <[email protected]>
  • Loading branch information
Yan-waller committed Sep 9, 2019
1 parent a8c710e commit 87c20c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/erasure-code/jerasure/ErasureCodeJerasure.cc
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,11 @@ int ErasureCodeJerasureReedSolomonRAID6::parse(ErasureCodeProfile &profile,
ostream *ss)
{
int err = ErasureCodeJerasure::parse(profile, ss);
profile.erase("m");
m = 2;
if (m != stoi(DEFAULT_M)) {
*ss << "ReedSolomonRAID6: m=" << m
<< " must be 2 for RAID6: revert to 2" << std::endl;
err = -EINVAL;
}
if (w != 8 && w != 16 && w != 32) {
*ss << "ReedSolomonRAID6: w=" << w
<< " must be one of {8, 16, 32} : revert to 8 " << std::endl;
Expand Down
1 change: 1 addition & 0 deletions src/erasure-code/jerasure/ErasureCodeJerasure.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ class ErasureCodeJerasureReedSolomonRAID6 : public ErasureCodeJerasure {
matrix(0)
{
DEFAULT_K = "7";
DEFAULT_M = "2";
DEFAULT_W = "8";
}
~ErasureCodeJerasureReedSolomonRAID6() override {
Expand Down

0 comments on commit 87c20c3

Please sign in to comment.