From: xie xingguo Date: Fri, 22 Dec 2017 02:45:15 +0000 (+0800) Subject: osd/OSDMap.h: toss osd out if it has no more pending states X-Git-Tag: v13.0.2~553^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F19642%2Fhead;p=ceph.git osd/OSDMap.h: toss osd out if it has no more pending states So we don't push an empty entry into new_state map, which is inefficient. Signed-off-by: xie xingguo --- diff --git a/src/osd/OSDMap.h b/src/osd/OSDMap.h index fd1f381d90c..bfebdaedbdf 100644 --- a/src/osd/OSDMap.h +++ b/src/osd/OSDMap.h @@ -480,6 +480,10 @@ public: } new_state[osd] &= ~state; + if (!new_state[osd]) { + // all flags cleared + new_state.erase(osd); + } return true; }