string high_type_name = type_map[high_type];
path.push_back(parent_coord);
- parent_id = get_item_id( (parent_coord.second).c_str() );
+ parent_id = get_item_id(parent_coord.second);
while (parent_coord.first != high_type_name) {
parent_coord = get_immediate_parent(parent_id);
path.push_back(parent_coord);
if ( parent_coord.first != high_type_name ){
- parent_id = get_item_id( (parent_coord.second).c_str() );
+ parent_id = get_item_id(parent_coord.second);
}
}
high_type = (*it).first;
}
- parent_id = get_item_id((parent_coord.second).c_str());
+ parent_id = get_item_id(parent_coord.second);
while (type_counter < high_type) {
type_counter++;
if (type_counter < high_type){
// get the coordinate information for the next parent
parent_coord = get_immediate_parent(parent_id);
- parent_id = get_item_id(parent_coord.second.c_str());
+ parent_id = get_item_id(parent_coord.second);
}
}
if (!reweight_name.empty()) {
cout << me << " reweighting item " << reweight_name << " to " << reweight_weight << std::endl;
int r;
- if (!crush.name_exists(reweight_name.c_str())) {
+ if (!crush.name_exists(reweight_name)) {
cerr << " name " << reweight_name << " dne" << std::endl;
r = -ENOENT;
} else {
- int item = crush.get_item_id(reweight_name.c_str());
+ int item = crush.get_item_id(reweight_name);
r = crush.adjust_item_weightf(g_ceph_context, item, reweight_weight);
}
if (r >= 0)
if (!remove_name.empty()) {
cout << me << " removing item " << remove_name << std::endl;
int r;
- if (!crush.name_exists(remove_name.c_str())) {
+ if (!crush.name_exists(remove_name)) {
cerr << " name " << remove_name << " dne" << std::endl;
r = -ENOENT;
} else {
- int remove_item = crush.get_item_id(remove_name.c_str());
+ int remove_item = crush.get_item_id(remove_name);
r = crush.remove_item(g_ceph_context, remove_item, false);
}
if (r == 0)
// is this an entire large subtree down?
if (g_conf->mon_osd_down_out_subtree_limit.length()) {
- int type = osdmap.crush->get_type_id(g_conf->mon_osd_down_out_subtree_limit.c_str());
+ int type = osdmap.crush->get_type_id(g_conf->mon_osd_down_out_subtree_limit);
if (type > 0) {
if (osdmap.containing_subtree_is_down(g_ceph_context, o, type, &down_cache)) {
dout(10) << "tick entire containing " << g_conf->mon_osd_down_out_subtree_limit
CrushWrapper newcrush;
_get_pending_crush(newcrush);
- if (!newcrush.name_exists(name.c_str())) {
+ if (!newcrush.name_exists(name)) {
err = -ENOENT;
ss << "item " << name << " does not exist";
break;
}
- int id = newcrush.get_item_id(name.c_str());
+ int id = newcrush.get_item_id(name);
if (!newcrush.check_item_loc(g_ceph_context, id, loc, (int *)NULL)) {
err = newcrush.move_bucket(g_ceph_context, id, loc);
CrushWrapper newcrush;
_get_pending_crush(newcrush);
- if (!newcrush.name_exists(name.c_str())) {
+ if (!newcrush.name_exists(name)) {
err = -ENOENT;
ss << "item " << name << " does not exist";
break;
}
- int id = newcrush.get_item_id(name.c_str());
+ int id = newcrush.get_item_id(name);
if (!newcrush.check_item_loc(g_ceph_context, id, loc, (int *)NULL)) {
err = newcrush.link_bucket(g_ceph_context, id, loc);
string name;
cmd_getval(g_ceph_context, cmdmap, "name", name);
- if (!newcrush.name_exists(name.c_str())) {
+ if (!newcrush.name_exists(name)) {
err = 0;
ss << "device '" << name << "' does not appear in the crush map";
break;
}
- int id = newcrush.get_item_id(name.c_str());
+ int id = newcrush.get_item_id(name);
bool unlink_only = prefix == "osd crush unlink";
string ancestor_str;
if (cmd_getval(g_ceph_context, cmdmap, "ancestor", ancestor_str)) {
string name;
cmd_getval(g_ceph_context, cmdmap, "name", name);
- if (!newcrush.name_exists(name.c_str())) {
+ if (!newcrush.name_exists(name)) {
err = -ENOENT;
ss << "device '" << name << "' does not appear in the crush map";
break;
}
- int id = newcrush.get_item_id(name.c_str());
+ int id = newcrush.get_item_id(name);
if (id < 0) {
ss << "device '" << name << "' is not a leaf in the crush map";
break;