From 2ae9c1c04944cdf76b4f030e56ce7b6292a018e6 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Thu, 26 Dec 2013 09:49:02 +0100 Subject: [PATCH] partially rename rule to ruleset Where code is changed, get the opportunity to rename rule to ruleset to improve naming consistency. Signed-off-by: Loic Dachary --- src/crush/CrushWrapper.cc | 8 ++++---- src/crush/CrushWrapper.h | 4 ++-- src/mon/OSDMonitor.cc | 8 ++++---- src/mon/OSDMonitor.h | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index 84eaf768ba2cb..3245793c62b07 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -705,10 +705,10 @@ void CrushWrapper::reweight(CephContext *cct) } } -int CrushWrapper::add_simple_rule(string name, string root_name, - string failure_domain_name, - string mode, - ostream *err) +int CrushWrapper::add_simple_ruleset(string name, string root_name, + string failure_domain_name, + string mode, + ostream *err) { if (rule_exists(name)) { if (err) diff --git a/src/crush/CrushWrapper.h b/src/crush/CrushWrapper.h index c9664cb880f3a..3b56bb4fc3e77 100644 --- a/src/crush/CrushWrapper.h +++ b/src/crush/CrushWrapper.h @@ -646,8 +646,8 @@ public: return set_rule_step(ruleno, step, CRUSH_RULE_EMIT, 0, 0); } - int add_simple_rule(string name, string root_name, string failure_domain_type, - string mode, ostream *err = 0); + int add_simple_ruleset(string name, string root_name, string failure_domain_type, + string mode, ostream *err = 0); int remove_rule(int ruleno); diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index a51c9c3eb27b2..aa9001831d2b4 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -2748,7 +2748,7 @@ int OSDMonitor::prepare_new_pool(MPoolOp *m) * * @return 0 on success, negative errno on failure. */ -int OSDMonitor::prepare_new_pool(string& name, uint64_t auid, int crush_rule, +int OSDMonitor::prepare_new_pool(string& name, uint64_t auid, int crush_ruleset, unsigned pg_num, unsigned pgp_num, const vector &properties, const unsigned pool_type, @@ -2784,8 +2784,8 @@ int OSDMonitor::prepare_new_pool(string& name, uint64_t auid, int crush_rule, pi->size = g_conf->osd_pool_default_size; pi->min_size = g_conf->get_osd_pool_default_min_size(); - if (crush_rule >= 0) - pi->crush_ruleset = crush_rule; + if (crush_ruleset >= 0) + pi->crush_ruleset = crush_ruleset; else pi->crush_ruleset = g_conf->osd_pool_default_crush_rule; pi->object_hash = CEPH_STR_HASH_RJENKINS; @@ -3509,7 +3509,7 @@ bool OSDMonitor::prepare_command(MMonCommand *m) ss << "rule " << name << " already exists"; err = 0; } else { - int rule = newcrush.add_simple_rule(name, root, type, mode, &ss); + int rule = newcrush.add_simple_ruleset(name, root, type, mode, &ss); if (rule < 0) { err = rule; goto reply; diff --git a/src/mon/OSDMonitor.h b/src/mon/OSDMonitor.h index d2f15c84ea208..90ce6eb56335c 100644 --- a/src/mon/OSDMonitor.h +++ b/src/mon/OSDMonitor.h @@ -238,7 +238,7 @@ private: bool prepare_pool_op (MPoolOp *m); bool prepare_pool_op_create (MPoolOp *m); bool prepare_pool_op_delete(MPoolOp *m); - int prepare_new_pool(string& name, uint64_t auid, int crush_rule, + int prepare_new_pool(string& name, uint64_t auid, int crush_ruleset, unsigned pg_num, unsigned pgp_num, const vector &properties, const unsigned pool_type, -- 2.39.5