True if id is present in the map.
Signed-off-by: Caleb Miles <caleb.miles@inktank.com>
return -ENOENT;
}
+bool CrushWrapper::check_item_present(int id)
+{
+ bool found = false;
+
+ for (int bidx = 0; bidx < crush->max_buckets; bidx++) {
+ crush_bucket *b = crush->buckets[bidx];
+ if (b == 0)
+ continue;
+ for (unsigned i = 0; i < b->size; i++)
+ if (b->items[i] == id)
+ found = true;
+ }
+ return found;
+}
+
+
void CrushWrapper::reweight(CephContext *cct)
{
set<int> roots;
}
void reweight(CephContext *cct);
+ /// check if item id is present in the map hierarchy
+ bool check_item_present(int id);
+
+
/*** devices ***/
int get_max_devices() const {
if (!crush) return 0;