From c454184d5e51220e465f781cccc6e9af619bcbe2 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 23 Feb 2018 08:58:32 -0600 Subject: [PATCH] osd/osd_types: fix pg_t::pool() return type (uint64_t -> int64_t) Signed-off-by: Sage Weil --- src/mon/CreatingPGs.h | 2 +- src/mon/OSDMonitor.cc | 8 ++++---- src/mon/PGMap.cc | 6 +++--- src/osd/osd_types.h | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/mon/CreatingPGs.h b/src/mon/CreatingPGs.h index d0c695d9f60..a80585032be 100644 --- a/src/mon/CreatingPGs.h +++ b/src/mon/CreatingPGs.h @@ -52,7 +52,7 @@ struct creating_pgs_t { return true; } for (auto& i : pgs) { - if ((int64_t)i.first.pool() == poolid) { + if (i.first.pool() == poolid) { return true; } } diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 3e7eceebc88..5bfb445b387 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -11503,7 +11503,7 @@ int OSDMonitor::_prepare_remove_pool( for (auto p = osdmap.pg_temp->begin(); p != osdmap.pg_temp->end(); ++p) { - if (p->first.pool() == (uint64_t)pool) { + if (p->first.pool() == pool) { dout(10) << __func__ << " " << pool << " removing obsolete pg_temp " << p->first << dendl; pending_inc.new_pg_temp[p->first].clear(); @@ -11513,7 +11513,7 @@ int OSDMonitor::_prepare_remove_pool( for (auto p = osdmap.primary_temp->begin(); p != osdmap.primary_temp->end(); ++p) { - if (p->first.pool() == (uint64_t)pool) { + if (p->first.pool() == pool) { dout(10) << __func__ << " " << pool << " removing obsolete primary_temp" << p->first << dendl; pending_inc.new_primary_temp[p->first] = -1; @@ -11521,7 +11521,7 @@ int OSDMonitor::_prepare_remove_pool( } // remove any pg_upmap mappings for this pool for (auto& p : osdmap.pg_upmap) { - if (p.first.pool() == (uint64_t)pool) { + if (p.first.pool() == pool) { dout(10) << __func__ << " " << pool << " removing obsolete pg_upmap " << p.first << dendl; @@ -11544,7 +11544,7 @@ int OSDMonitor::_prepare_remove_pool( } // remove any pg_upmap_items mappings for this pool for (auto& p : osdmap.pg_upmap_items) { - if (p.first.pool() == (uint64_t)pool) { + if (p.first.pool() == pool) { dout(10) << __func__ << " " << pool << " removing obsolete pg_upmap_items " << p.first << dendl; diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index c2fd816f191..6d065427186 100644 --- a/src/mon/PGMap.cc +++ b/src/mon/PGMap.cc @@ -2040,7 +2040,7 @@ void PGMap::get_filtered_pg_stats(uint64_t state, int64_t poolid, int64_t osdid, for (auto i = pg_stat.begin(); i != pg_stat.end(); ++i) { - if ((poolid >= 0) && (uint64_t(poolid) != i->first.pool())) + if ((poolid >= 0) && (poolid != i->first.pool())) continue; if ((osdid >= 0) && !(i->second.is_acting_osd(osdid,primary))) continue; @@ -3331,13 +3331,13 @@ void PGMapUpdater::check_osd_map( ldout(cct, 10) << __func__ << " pool " << p.first << " gone, removing pgs" << dendl; for (auto& q : pgmap.pg_stat) { - if (q.first.pool() == (uint64_t)p.first) { + if (q.first.pool() == p.first) { pending_inc->pg_remove.insert(q.first); } } auto q = pending_inc->pg_stat_updates.begin(); while (q != pending_inc->pg_stat_updates.end()) { - if (q->first.pool() == (uint64_t)p.first) { + if (q->first.pool() == p.first) { q = pending_inc->pg_stat_updates.erase(q); } else { ++q; diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index 0a41f5eb1b7..d95ac4200ca 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -390,7 +390,7 @@ struct pg_t { ps_t ps() const { return m_seed; } - uint64_t pool() const { + int64_t pool() const { return m_pool; } -- 2.39.5