]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crush/CrushWrapper: add bucket_set_alg()
authorSage Weil <sage@redhat.com>
Sat, 21 Oct 2017 17:59:16 +0000 (12:59 -0500)
committerSage Weil <sage@redhat.com>
Mon, 23 Oct 2017 22:19:25 +0000 (17:19 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit edc411ee4cb7b88a970ccfc9d29b3a3ba15d066c)

src/crush/CrushWrapper.cc
src/crush/CrushWrapper.h

index 96a928e19fa833a0758b4c6848ebdd45d47c025f..67b93a6540b6c8af77240c86822a26396801d1a1 100644 (file)
@@ -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,
index ea9ea0217bdbd462322a4955d49a877c4317bfad..ac779f26bee9fbad8ba16fc9aa12b5c7d4e2f6df 100644 (file)
@@ -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);