]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/OSDMap.h: toss osd out if it has no more pending states
authorxie xingguo <xie.xingguo@zte.com.cn>
Fri, 22 Dec 2017 02:45:15 +0000 (10:45 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Fri, 22 Dec 2017 02:45:15 +0000 (10:45 +0800)
So we don't push an empty entry into new_state map,
which is inefficient.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/osd/OSDMap.h

index fd1f381d90cf8570c2a49c121833fad2ae9b3046..bfebdaedbdf8720e036f781b4ed3616ad94fcc32 100644 (file)
@@ -480,6 +480,10 @@ public:
       }
 
       new_state[osd] &= ~state;
+      if (!new_state[osd]) {
+        // all flags cleared
+        new_state.erase(osd);
+      }
       return true;
     }