Signed-off-by: Sage Weil <sage@redhat.com>
return full_location;
}
+int CrushWrapper::get_full_location(const string& name,
+ map<string,string> *ploc)
+{
+ build_rmaps();
+ auto p = name_rmap.find(name);
+ if (p == name_rmap.end()) {
+ return -ENOENT;
+ }
+ *ploc = get_full_location(p->second);
+ return 0;
+}
+
int CrushWrapper::get_full_location_ordered(int id, vector<pair<string, string> >& path) const
{
if (!item_exists(id))
*/
map<string, string> get_full_location(int id) const;
+ /**
+ * return location map for a item, by name
+ */
+ int get_full_location(
+ const string& name,
+ std::map<string,string> *ploc);
+
/*
* identical to get_full_location(int id) although it returns the type/name
* pairs in the order they occur in the hierarchy.
static int parse_loc_multimap(const std::vector<string>& args,
std::multimap<string,string> *ploc);
+
/**
* get an item's weight
*