From: xie xingguo Date: Wed, 26 Jul 2017 11:59:19 +0000 (+0800) Subject: crush: use is_shadow_item() wrapper if possible X-Git-Tag: v12.1.2~68^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4b898951c132f5050ce8c8138b3ce4a25331742e;p=ceph.git crush: use is_shadow_item() wrapper if possible Signed-off-by: xie xingguo --- 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) {