diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index 8eaf9f6fb8a..2891056c905 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -1327,19 +1327,14 @@ pair CrushWrapper::get_immediate_parent(int id, int *_ret) return pair(); } -int CrushWrapper::get_immediate_parent_id(int id, - int *parent, - parent_type_t choice) const +int CrushWrapper::get_immediate_parent_id(int id, int *parent) const { for (int bidx = 0; bidx < crush->max_buckets; bidx++) { crush_bucket *b = crush->buckets[bidx]; if (b == 0) continue; - if (choice == PARENT_NONSHADOW && is_shadow_item(b->id)) { + if (is_shadow_item(b->id)) continue; - } else if (choice == PARENT_SHADOW && !is_shadow_item(b->id)) { - continue; - } for (unsigned i = 0; i < b->size; i++) { if (b->items[i] == id) { *parent = b->id; diff --git a/src/crush/CrushWrapper.h b/src/crush/CrushWrapper.h index 0b58dacb3fe..94730d53d19 100644 --- a/src/crush/CrushWrapper.h +++ b/src/crush/CrushWrapper.h @@ -662,15 +662,7 @@ public: */ pair get_immediate_parent(int id, int *ret = NULL); - typedef enum { - PARENT_NONSHADOW, - PARENT_SHADOW, - PARENT_ALL, - } parent_type_t; - - int get_immediate_parent_id(int id, - int *parent, - parent_type_t choice = PARENT_NONSHADOW) const; + int get_immediate_parent_id(int id, int *parent) const; /** * return ancestor of the given type, or 0 if none