From 812ca2136b8cdee0a3bb99ac9dcd240fa9ee3852 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Fri, 15 Mar 2013 10:31:15 +0100 Subject: [PATCH] osd/OSD.cc: prefer prefix ++operator for iterators Signed-off-by: Danny Al-Gaaf --- src/osd/OSD.cc | 58 +++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 0f2707c22f126..576aeed08e290 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -1223,7 +1223,7 @@ int OSD::shutdown() // then kick all pgs, for (hash_map::iterator p = pg_map.begin(); p != pg_map.end(); - p++) { + ++p) { dout(20) << " kicking pg " << p->first << dendl; p->second->lock(); p->second->kick(); @@ -1238,7 +1238,7 @@ int OSD::shutdown() // tell pgs we're shutting down for (hash_map::iterator p = pg_map.begin(); p != pg_map.end(); - p++) { + ++p) { p->second->lock(); p->second->on_shutdown(); p->second->unlock(); @@ -1281,7 +1281,7 @@ int OSD::shutdown() // close pgs for (hash_map::iterator p = pg_map.begin(); p != pg_map.end(); - p++) { + ++p) { PG *pg = p->second; pg->put(); } @@ -1359,7 +1359,7 @@ void OSD::clear_temp(ObjectStore *store, coll_t tmp) unsigned removed = 0; for (vector::iterator p = objects.begin(); p != objects.end(); - p++, removed++) { + ++p, removed++) { t.collection_remove(tmp, *p); if (removed > 300) { int r = store->apply_transaction(t); @@ -1552,7 +1552,7 @@ void OSD::load_pgs() map > pgs; for (vector::iterator it = ls.begin(); it != ls.end(); - it++) { + ++it) { pg_t pgid; snapid_t snap; @@ -1683,7 +1683,7 @@ void OSD::build_past_intervals_parallel() epoch_t cur_epoch = superblock.newest_map; for (hash_map::iterator i = pg_map.begin(); i != pg_map.end(); - i++) { + ++i) { PG *pg = i->second; epoch_t start, end; @@ -2040,7 +2040,7 @@ void OSD::update_osd_stat() osd_stat.kb_avail = stbuf.f_bavail * stbuf.f_bsize / 1024; osd_stat.hb_in.clear(); - for (map::iterator p = heartbeat_peers.begin(); p != heartbeat_peers.end(); p++) + for (map::iterator p = heartbeat_peers.begin(); p != heartbeat_peers.end(); ++p) osd_stat.hb_in.push_back(p->first); osd_stat.hb_out.clear(); @@ -2095,7 +2095,7 @@ void OSD::maybe_update_heartbeat_peers() // build heartbeat from set for (hash_map::iterator i = pg_map.begin(); i != pg_map.end(); - i++) { + ++i) { PG *pg = i->second; pg->heartbeat_peer_lock.Lock(); dout(20) << i->first << " heartbeat_peers " << pg->heartbeat_peers << dendl; @@ -2275,7 +2275,7 @@ void OSD::heartbeat_check() cutoff -= g_conf->osd_heartbeat_grace; for (map::iterator p = heartbeat_peers.begin(); p != heartbeat_peers.end(); - p++) { + ++p) { dout(25) << "heartbeat_check osd." << p->first << " first_tx " << p->second.first_tx << " last_tx " << p->second.last_tx @@ -2328,7 +2328,7 @@ void OSD::heartbeat() // send heartbeats for (map::iterator i = heartbeat_peers.begin(); i != heartbeat_peers.end(); - i++) { + ++i) { int peer = i->first; dout(30) << "heartbeat allocating ping for osd." << peer << dendl; Message *m = new MOSDPing(monc->get_fsid(), @@ -2575,7 +2575,7 @@ void TestOpsSocketHook::test_ops(OSDService *service, ObjectStore *store, if (r >= 0) { ss << "header=" << string(hdrbl.c_str(), hdrbl.length()); for (map::iterator it = keyvals.begin(); - it != keyvals.end(); it++) + it != keyvals.end(); ++it) ss << " key=" << (*it).first << " val=" << string((*it).second.c_str(), (*it).second.length()); } else { @@ -3670,7 +3670,7 @@ void OSD::handle_scrub(MOSDScrub *m) if (m->scrub_pgs.empty()) { for (hash_map::iterator p = pg_map.begin(); p != pg_map.end(); - p++) { + ++p) { PG *pg = p->second; pg->lock(); if (pg->is_primary()) { @@ -3686,7 +3686,7 @@ void OSD::handle_scrub(MOSDScrub *m) } else { for (vector::iterator p = m->scrub_pgs.begin(); p != m->scrub_pgs.end(); - p++) + ++p) if (pg_map.count(*p)) { PG *pg = pg_map[*p]; pg->lock(); @@ -4054,7 +4054,7 @@ void OSD::handle_osd_map(MOSDMap *m) // kill connections to newly down osds set old; osdmap->get_all_osds(old); - for (set::iterator p = old.begin(); p != old.end(); p++) { + for (set::iterator p = old.begin(); p != old.end(); ++p) { if (*p != whoami && osdmap->have_inst(*p) && // in old map (!newmap->exists(*p) || !newmap->is_up(*p))) { // but not the new one @@ -4342,7 +4342,7 @@ void OSD::consume_map() // scan pg's for (hash_map::iterator it = pg_map.begin(); it != pg_map.end(); - it++) { + ++it) { PG *pg = it->second; pg->lock(); if (pg->is_primary()) @@ -4385,7 +4385,7 @@ void OSD::consume_map() // scan pg's for (hash_map::iterator it = pg_map.begin(); it != pg_map.end(); - it++) { + ++it) { PG *pg = it->second; pg->lock(); pg->queue_null(osdmap->get_epoch(), osdmap->get_epoch()); @@ -4749,7 +4749,7 @@ void OSD::do_split(PG *parent, set& childpgids, ObjectStore::Transaction& map children; for (set::iterator q = childpgids.begin(); q != childpgids.end(); - q++) { + ++q) { pg_history_t history; history.epoch_created = history.same_up_since = history.same_interval_since = history.same_primary_since = @@ -4776,7 +4776,7 @@ void OSD::do_split(PG *parent, set& childpgids, ObjectStore::Transaction& // unlock parent, children parent->unlock(); - for (map::iterator q = children.begin(); q != children.end(); q++) { + for (map::iterator q = children.begin(); q != children.end(); ++q) { PG *pg = q->second; pg->handle_create(&rctx); pg->write_if_dirty(t); @@ -4799,7 +4799,7 @@ void OSD::split_pg(PG *parent, map& children, ObjectStore::Transaction vector olist; store->collection_list(coll_t(parent->info.pgid), olist); - for (vector::iterator p = olist.begin(); p != olist.end(); p++) { + for (vector::iterator p = olist.begin(); p != olist.end(); ++p) { hobject_t poid = *p; object_locator_t oloc(parentid.pool()); if (poid.get_key().size()) @@ -4847,7 +4847,7 @@ void OSD::split_pg(PG *parent, map& children, ObjectStore::Transaction list::iterator p = parent->log.log.begin(); while (p != parent->log.log.end()) { list::iterator cur = p; - p++; + ++p; hobject_t& poid = cur->soid; object_locator_t oloc(parentid.pool()); if (poid.get_key().size()) @@ -4869,7 +4869,7 @@ void OSD::split_pg(PG *parent, map& children, ObjectStore::Transaction for (map::iterator p = children.begin(); p != children.end(); - p++) { + ++p) { PG *child = p->second; // fix log bounds @@ -4934,7 +4934,7 @@ void OSD::handle_pg_create(OpRequestRef op) for (map::iterator p = m->mkpg.begin(); p != m->mkpg.end(); - p++) { + ++p) { pg_t pgid = p->first; epoch_t created = p->second.created; pg_t parent = p->second.parent; @@ -4990,7 +4990,7 @@ void OSD::handle_pg_create(OpRequestRef op) dout(10) << "mkpg " << pgid << " e" << created << " h " << history << " : querying priors " << pset << dendl; - for (set::iterator p = pset.begin(); p != pset.end(); p++) + for (set::iterator p = pset.begin(); p != pset.end(); ++p) if (osdmap->is_up(*p)) (*rctx.query_map)[*p][pgid] = pg_query_t(pg_query_t::INFO, history, osdmap->get_epoch()); @@ -5105,7 +5105,7 @@ void OSD::do_notifies( { for (map< int, vector > >::iterator it = notify_list.begin(); it != notify_list.end(); - it++) { + ++it) { if (it->first == whoami) { dout(7) << "do_notify osd." << it->first << " is self, skipping" << dendl; continue; @@ -5148,7 +5148,7 @@ void OSD::do_queries(map< int, map >& query_map, { for (map< int, map >::iterator pit = query_map.begin(); pit != query_map.end(); - pit++) { + ++pit) { if (!curmap->is_up(pit->first)) continue; int who = pit->first; @@ -5238,7 +5238,7 @@ void OSD::handle_pg_notify(OpRequestRef op) for (vector >::iterator it = m->get_pg_list().begin(); it != m->get_pg_list().end(); - it++) { + ++it) { PG *pg = 0; if (it->first.info.pgid.preferred() >= 0) { @@ -5567,7 +5567,7 @@ void OSD::handle_pg_query(OpRequestRef op) for (map::iterator it = m->pg_list.begin(); it != m->pg_list.end(); - it++) { + ++it) { pg_t pgid = it->first; if (pgid.preferred() >= 0) { @@ -5653,7 +5653,7 @@ void OSD::handle_pg_remove(OpRequestRef op) for (vector::iterator it = m->pg_list.begin(); it != m->pg_list.end(); - it++) { + ++it) { pg_t pgid = *it; if (pgid.preferred() >= 0) { dout(10) << "ignoring localized pg " << pgid << dendl; @@ -5771,7 +5771,7 @@ void OSD::check_replay_queue() } replay_queue_lock.Unlock(); - for (list< pair >::iterator p = pgids.begin(); p != pgids.end(); p++) { + for (list< pair >::iterator p = pgids.begin(); p != pgids.end(); ++p) { pg_t pgid = p->first; if (pg_map.count(pgid)) { PG *pg = _lookup_lock_pg_with_map_lock_held(pgid); -- 2.39.5