From edc411ee4cb7b88a970ccfc9d29b3a3ba15d066c Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sat, 21 Oct 2017 12:59:16 -0500 Subject: [PATCH] crush/CrushWrapper: add bucket_set_alg() Signed-off-by: Sage Weil --- src/crush/CrushWrapper.cc | 10 ++++++++++ src/crush/CrushWrapper.h | 1 + 2 files changed, 11 insertions(+) diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index b5729aefd4d..6d580e91b9d 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -1842,6 +1842,16 @@ int CrushWrapper::bucket_remove_item(crush_bucket *bucket, int item) return 0; } +int CrushWrapper::bucket_set_alg(int bid, int alg) +{ + crush_bucket *b = get_bucket(bid); + if (!b) { + return -ENOENT; + } + b->alg = alg; + return 0; +} + int CrushWrapper::update_device_class(int id, const string& class_name, const string& name, diff --git a/src/crush/CrushWrapper.h b/src/crush/CrushWrapper.h index 73085b68a0d..d2fc4858601 100644 --- a/src/crush/CrushWrapper.h +++ b/src/crush/CrushWrapper.h @@ -1252,6 +1252,7 @@ public: crush_finalize(crush); have_uniform_rules = !has_legacy_rule_ids(); } + int bucket_set_alg(int id, int alg); int update_device_class(int id, const string& class_name, const string& name, ostream *ss); int remove_device_class(CephContext *cct, int id, ostream *ss); -- 2.47.3