return changed;
}
-int CrushWrapper::adjust_subtree_weight(CephContext *cct, int id, int weight)
+int CrushWrapper::adjust_subtree_weight(CephContext *cct, int id, int weight,
+ bool update_weight_sets)
{
ldout(cct, 5) << __func__ << " " << id << " weight " << weight << dendl;
crush_bucket *b = get_bucket(id);
for (unsigned i=0; i<b->size; ++i) {
int n = b->items[i];
if (n >= 0) {
- bucket_adjust_item_weight(cct, b, n, weight);
+ adjust_item_weight_in_bucket(cct, n, weight, b->id, update_weight_sets);
++changed;
++local_changed;
} else {
q.push_back(sub);
}
}
- if (local_changed) {
- adjust_item_weight(cct, b->id, b->weight);
- }
}
return changed;
}
crush_choose_arg_map& arg_map,
vector<uint32_t> *weightv);
- int adjust_subtree_weight(CephContext *cct, int id, int weight);
- int adjust_subtree_weightf(CephContext *cct, int id, float weight) {
+ int adjust_subtree_weight(CephContext *cct, int id, int weight,
+ bool update_weight_sets=true);
+ int adjust_subtree_weightf(CephContext *cct, int id, float weight,
+ bool update_weight_sets=true) {
int r = validate_weightf(weight);
if (r < 0) {
return r;
}
- return adjust_subtree_weight(cct, id, (int)(weight * (float)0x10000));
+ return adjust_subtree_weight(cct, id, (int)(weight * (float)0x10000),
+ update_weight_sets);
}
/// check if item id is present in the map hierarchy