summaryrefslogtreecommitdiffstats
path: root/src/erasure-code
diff options
context:
space:
mode:
Diffstat (limited to 'src/erasure-code')
-rw-r--r--src/erasure-code/ErasureCode.cc46
-rw-r--r--src/erasure-code/ErasureCode.h2
2 files changed, 13 insertions, 35 deletions
diff --git a/src/erasure-code/ErasureCode.cc b/src/erasure-code/ErasureCode.cc
index 928d05f2adb..5212baee251 100644
--- a/src/erasure-code/ErasureCode.cc
+++ b/src/erasure-code/ErasureCode.cc
@@ -52,12 +52,6 @@ int ErasureCode::init(
err |= to_string("crush-failure-domain", profile,
&rule_failure_domain,
DEFAULT_RULE_FAILURE_DOMAIN, ss);
- err |= to_int("crush-osds-per-failure-domain", profile,
- &rule_osds_per_failure_domain,
- "0", ss);
- err |= to_int("crush-num-failure-domains", profile,
- &rule_num_failure_domains,
- "0", ss);
err |= to_string("crush-device-class", profile,
&rule_device_class,
"", ss);
@@ -72,33 +66,19 @@ int ErasureCode::create_rule(
CrushWrapper &crush,
std::ostream *ss) const
{
- if (rule_osds_per_failure_domain <= 1) {
- return crush.add_simple_rule(
- name,
- rule_root,
- rule_failure_domain,
- rule_num_failure_domains,
- rule_device_class,
- "indep",
- pg_pool_t::TYPE_ERASURE,
- ss);
- } else {
- if (rule_num_failure_domains < 1) {
- if (ss) {
- *ss << "crush-num-failure-domains " << rule_num_failure_domains
- << " must be >= 1 if crush-osds-per-failure-domain specified";
- return -EINVAL;
- }
- }
- return crush.add_indep_multi_osd_per_failure_domain_rule(
- name,
- rule_root,
- rule_failure_domain,
- rule_num_failure_domains,
- rule_osds_per_failure_domain,
- rule_device_class,
- ss);
- }
+ int ruleid = crush.add_simple_rule(
+ name,
+ rule_root,
+ rule_failure_domain,
+ rule_device_class,
+ "indep",
+ pg_pool_t::TYPE_ERASURE,
+ ss);
+
+ if (ruleid < 0)
+ return ruleid;
+
+ return ruleid;
}
int ErasureCode::sanity_check_k_m(int k, int m, ostream *ss)
diff --git a/src/erasure-code/ErasureCode.h b/src/erasure-code/ErasureCode.h
index fd6d1a41f71..c246d5dc6b6 100644
--- a/src/erasure-code/ErasureCode.h
+++ b/src/erasure-code/ErasureCode.h
@@ -37,8 +37,6 @@ namespace ceph {
std::string rule_root;
std::string rule_failure_domain;
std::string rule_device_class;
- int rule_osds_per_failure_domain = -1;
- int rule_num_failure_domains = -1;
~ErasureCode() override {}