]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: use is_shadow_item() wrapper if possible
authorxie xingguo <xie.xingguo@zte.com.cn>
Wed, 26 Jul 2017 11:59:19 +0000 (19:59 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Wed, 26 Jul 2017 14:35:15 +0000 (22:35 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/crush/CrushWrapper.cc

index 9830fedb4097f7bac87334f5f39bffcf67177669..8b7b7581100443f18d60677a4d11e53fd51e5b5b 100644 (file)
@@ -1308,8 +1308,7 @@ pair<string,string> 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) {