]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: clean up get_immediate_parent_id() 16623/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Thu, 27 Jul 2017 00:08:41 +0000 (08:08 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Sat, 29 Jul 2017 11:46:28 +0000 (19:46 +0800)
This is a follow-up cleanup of 9d908c14f606239d291cd3551e8f716943e0badf

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/crush/CrushWrapper.cc
src/crush/CrushWrapper.h

index 8eaf9f6fb8aa8ef3f4e1e301ff55d4e118ed3c64..2891056c90564c9e431b7d35ca44d14a68f5fc62 100644 (file)
@@ -1327,19 +1327,14 @@ pair<string,string> CrushWrapper::get_immediate_parent(int id, int *_ret)
   return pair<string, string>();
 }
 
-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;
index 0b58dacb3feeb7817d0bab1d838e258e8f05a5fa..94730d53d19637d7f3b81740ec92fc47131a585d 100644 (file)
@@ -662,15 +662,7 @@ public:
    */
   pair<string,string> 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