]> git.apps.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>
Sat, 21 Oct 2017 17:59:16 +0000 (12:59 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/crush/CrushWrapper.cc
src/crush/CrushWrapper.h

index b5729aefd4dbc5425fbcdcc6b8d4c00451f062d7..6d580e91b9d75751557c6987cebec369010c3551 100644 (file)
@@ -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,
index 73085b68a0d637578e64bfa3eac7f483764c4f70..d2fc48586011c3367036929a7f950c6fe4d56344 100644 (file)
@@ -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);