]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSDMap: cleanup: s/tmpmap/nextmap/ 23449/head
authorSage Weil <sage@redhat.com>
Fri, 31 Aug 2018 15:54:43 +0000 (10:54 -0500)
committerSage Weil <sage@redhat.com>
Fri, 7 Sep 2018 22:11:18 +0000 (17:11 -0500)
Be consistent with OSDMap.h

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSDMap.cc

index ed960ba9163595f5de9d85a1ad1f128d04733782..53faeafece9454528726953575ff11badb88cdff 100644 (file)
@@ -1642,16 +1642,16 @@ void OSDMap::dedup(const OSDMap *o, OSDMap *n)
 
 void OSDMap::clean_temps(CephContext *cct,
                         const OSDMap& oldmap,
-                        const OSDMap& tmpmap,
+                        const OSDMap& nextmap,
                         Incremental *pending_inc)
 {
   ldout(cct, 10) << __func__ << dendl;
 
-  for (auto pg : *tmpmap.pg_temp) {
+  for (auto pg : *nextmap.pg_temp) {
     // if pool does not exist, remove any existing pg_temps associated with
     // it.  we don't care about pg_temps on the pending_inc either; if there
     // are new_pg_temp entries on the pending, clear them out just as well.
-    if (!tmpmap.have_pg_pool(pg.first.pool())) {
+    if (!nextmap.have_pg_pool(pg.first.pool())) {
       ldout(cct, 10) << __func__ << " removing pg_temp " << pg.first
                     << " for nonexistent pool " << pg.first.pool() << dendl;
       pending_inc->new_pg_temp[pg.first].clear();
@@ -1660,7 +1660,7 @@ void OSDMap::clean_temps(CephContext *cct,
     // all osds down?
     unsigned num_up = 0;
     for (auto o : pg.second) {
-      if (!tmpmap.is_down(o)) {
+      if (!nextmap.is_down(o)) {
        ++num_up;
        break;
       }
@@ -1674,7 +1674,7 @@ void OSDMap::clean_temps(CephContext *cct,
     // redundant pg_temp?
     vector<int> raw_up;
     int primary;
-    tmpmap.pg_to_raw_up(pg.first, &raw_up, &primary);
+    nextmap.pg_to_raw_up(pg.first, &raw_up, &primary);
     bool remove = false;
     if (raw_up == pg.second) {
       ldout(cct, 10) << __func__ << "  removing pg_temp " << pg.first << " "
@@ -1682,7 +1682,7 @@ void OSDMap::clean_temps(CephContext *cct,
       remove = true;
     }
     // oversized pg_temp?
-    if (pg.second.size() > tmpmap.get_pg_pool(pg.first.pool())->get_size()) {
+    if (pg.second.size() > nextmap.get_pg_pool(pg.first.pool())->get_size()) {
       ldout(cct, 10) << __func__ << "  removing pg_temp " << pg.first << " "
                     << pg.second << " exceeds pool size" << dendl;
       remove = true;
@@ -1695,9 +1695,9 @@ void OSDMap::clean_temps(CephContext *cct,
     }
   }
   
-  for (auto &pg : *tmpmap.primary_temp) {
+  for (auto &pg : *nextmap.primary_temp) {
     // primary down?
-    if (tmpmap.is_down(pg.second)) {
+    if (nextmap.is_down(pg.second)) {
       ldout(cct, 10) << __func__ << "  removing primary_temp " << pg.first
                     << " to down " << pg.second << dendl;
       pending_inc->new_primary_temp[pg.first] = -1;
@@ -1707,8 +1707,8 @@ void OSDMap::clean_temps(CephContext *cct,
     vector<int> real_up, templess_up;
     int real_primary, templess_primary;
     pg_t pgid = pg.first;
-    tmpmap.pg_to_acting_osds(pgid, &real_up, &real_primary);
-    tmpmap.pg_to_raw_up(pgid, &templess_up, &templess_primary);
+    nextmap.pg_to_acting_osds(pgid, &real_up, &real_primary);
+    nextmap.pg_to_raw_up(pgid, &templess_up, &templess_primary);
     if (real_primary == templess_primary){
       ldout(cct, 10) << __func__ << "  removing primary_temp "
                     << pgid << " -> " << real_primary
@@ -1723,7 +1723,7 @@ void OSDMap::clean_temps(CephContext *cct,
 
 void OSDMap::maybe_remove_pg_upmaps(CephContext *cct,
                                     const OSDMap& oldmap,
-                                   const OSDMap& tmpmap,
+                                   const OSDMap& nextmap,
                                     Incremental *pending_inc)
 {
   ldout(cct, 10) << __func__ << dendl;
@@ -1731,10 +1731,10 @@ void OSDMap::maybe_remove_pg_upmaps(CephContext *cct,
   set<pg_t> to_cancel;
   map<int, map<int, float>> rule_weight_map;
 
-  for (auto& p : tmpmap.pg_upmap) {
+  for (auto& p : nextmap.pg_upmap) {
     to_check.insert(p.first);
   }
-  for (auto& p : tmpmap.pg_upmap_items) {
+  for (auto& p : nextmap.pg_upmap_items) {
     to_check.insert(p.first);
   }
   for (auto& p : pending_inc->new_pg_upmap) {
@@ -1744,7 +1744,7 @@ void OSDMap::maybe_remove_pg_upmaps(CephContext *cct,
     to_check.insert(p.first);
   }
   for (auto& pg : to_check) {
-    auto crush_rule = tmpmap.get_pg_pool_crush_rule(pg);
+    auto crush_rule = nextmap.get_pg_pool_crush_rule(pg);
     if (crush_rule < 0) {
       lderr(cct) << __func__ << " unable to load crush-rule of pg "
                  << pg << dendl;
@@ -1753,7 +1753,7 @@ void OSDMap::maybe_remove_pg_upmaps(CephContext *cct,
     map<int, float> weight_map;
     auto it = rule_weight_map.find(crush_rule);
     if (it == rule_weight_map.end()) {
-      auto r = tmpmap.crush->get_rule_weight_osd_map(crush_rule, &weight_map);
+      auto r = nextmap.crush->get_rule_weight_osd_map(crush_rule, &weight_map);
       if (r < 0) {
         lderr(cct) << __func__ << " unable to get crush weight_map for "
                    << "crush_rule " << crush_rule << dendl;
@@ -1763,7 +1763,7 @@ void OSDMap::maybe_remove_pg_upmaps(CephContext *cct,
     } else {
       weight_map = it->second;
     }
-    auto type = tmpmap.crush->get_rule_failure_domain(crush_rule);
+    auto type = nextmap.crush->get_rule_failure_domain(crush_rule);
     if (type < 0) {
       lderr(cct) << __func__ << " unable to load failure-domain-type of pg "
                  << pg << dendl;
@@ -1776,11 +1776,11 @@ void OSDMap::maybe_remove_pg_upmaps(CephContext *cct,
                    << dendl;
     vector<int> raw;
     int primary;
-    tmpmap.pg_to_raw_up(pg, &raw, &primary);
+    nextmap.pg_to_raw_up(pg, &raw, &primary);
     set<int> parents;
     for (auto osd : raw) {
       if (type > 0) {
-        auto parent = tmpmap.crush->get_parent_of_type(osd, type, crush_rule);
+        auto parent = nextmap.crush->get_parent_of_type(osd, type, crush_rule);
         if (parent < 0) {
           auto r = parents.insert(parent);
           if (!r.second) {
@@ -1803,7 +1803,7 @@ void OSDMap::maybe_remove_pg_upmaps(CephContext *cct,
         to_cancel.insert(pg);
         break;
       }
-      auto adjusted_weight = tmpmap.get_weightf(it->first) * it->second;
+      auto adjusted_weight = nextmap.get_weightf(it->first) * it->second;
       if (adjusted_weight == 0) {
         // osd is out/crush-out
         to_cancel.insert(pg);