From: Samuel Just Date: Fri, 19 Apr 2013 00:40:12 +0000 (-0700) Subject: OSD: use PGRef in consume_map X-Git-Tag: v0.61~136^2~15 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0b7795acda5bd5dc0328705cb50694ae9f8c223b;p=ceph.git OSD: use PGRef in consume_map Signed-off-by: Samuel Just --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index ba502e6112d9..1039d57ab2be 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -4455,7 +4455,7 @@ void OSD::consume_map() dout(7) << "consume_map version " << osdmap->get_epoch() << dendl; int num_pg_primary = 0, num_pg_replica = 0, num_pg_stray = 0; - list to_remove; + list to_remove; // scan pg's for (hash_map::iterator it = pg_map.begin(); @@ -4473,8 +4473,7 @@ void OSD::consume_map() set split_pgs; if (!osdmap->have_pg_pool(pg->info.pgid.pool())) { //pool is deleted! - pg->get(); - to_remove.push_back(pg); + to_remove.push_back(PGRef(pg)); } else if (it->first.is_split( service.get_osdmap()->get_pg_num(it->first.pool()), osdmap->get_pg_num(it->first.pool()), @@ -4485,13 +4484,12 @@ void OSD::consume_map() pg->unlock(); } - for (list::iterator i = to_remove.begin(); + for (list::iterator i = to_remove.begin(); i != to_remove.end(); - ++i) { + to_remove.erase(i++)) { (*i)->lock(); - _remove_pg((*i)); + _remove_pg(&**i); (*i)->unlock(); - (*i)->put(); } to_remove.clear();