From: Sage Weil Date: Sat, 21 Oct 2017 17:59:16 +0000 (-0500) Subject: crush/CrushWrapper: add bucket_set_alg() X-Git-Tag: v12.2.2~122^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=94a4ca6c8e4d26465cbefd1492ee05f21b08ff1e;p=ceph.git crush/CrushWrapper: add bucket_set_alg() Signed-off-by: Sage Weil (cherry picked from commit edc411ee4cb7b88a970ccfc9d29b3a3ba15d066c) --- diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index 96a928e19fa8..67b93a6540b6 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -1839,6 +1839,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 ea9ea0217bdb..ac779f26bee9 100644 --- a/src/crush/CrushWrapper.h +++ b/src/crush/CrushWrapper.h @@ -1208,6 +1208,7 @@ public: crush_finalize(crush); have_uniform_rules = !has_legacy_rulesets(); } + 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);