From 4b898951c132f5050ce8c8138b3ce4a25331742e Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Wed, 26 Jul 2017 19:59:19 +0800 Subject: [PATCH] crush: use is_shadow_item() wrapper if possible Signed-off-by: xie xingguo --- src/crush/CrushWrapper.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index 9830fedb4097f..8b7b758110044 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -1308,8 +1308,7 @@ pair CrushWrapper::get_immediate_parent(int id, int *_ret) crush_bucket *b = crush->buckets[bidx]; if (b == 0) continue; - const char *n = get_item_name(b->id); - if (n && !is_valid_crush_name(n)) + if (is_shadow_item(b->id)) continue; for (unsigned i = 0; i < b->size; i++) if (b->items[i] == id) { @@ -1333,8 +1332,7 @@ int CrushWrapper::get_immediate_parent_id(int id, int *parent) const crush_bucket *b = crush->buckets[bidx]; if (b == 0) continue; - const char *n = get_item_name(b->id); - if (n && !is_valid_crush_name(n)) + if (is_shadow_item(b->id)) continue; for (unsigned i = 0; i < b->size; i++) { if (b->items[i] == id) { -- 2.39.5