From 20d6dfa4ebb32b2f57e51158fdecbe45a88f6ad6 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 7 Aug 2008 11:46:01 -0700 Subject: [PATCH] mds: list -> vector --- src/mds/MDCache.cc | 38 ++++++++++++++++----------------- src/mds/MDCache.h | 10 ++++----- src/mds/Server.cc | 4 ++-- src/mds/events/EImportStart.h | 6 +++--- src/mds/events/ESubtreeMap.h | 2 +- src/mds/journal.cc | 2 +- src/messages/MExportDir.h | 2 +- src/messages/MMDSResolve.h | 8 +++---- src/messages/MMDSResolveAck.h | 4 ++-- src/messages/MMDSSlaveRequest.h | 4 ++-- 10 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index da0da5f836de2..855516785f496 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -671,7 +671,7 @@ void MDCache::adjust_bounded_subtree_auth(CDir *dir, set& bounds, pair& bound_dfs, pair auth) +void MDCache::adjust_bounded_subtree_auth(CDir *dir, vector& bound_dfs, pair auth) { dout(7) << "adjust_bounded_subtree_auth " << dir->get_dir_auth() << " -> " << auth << " on " << *dir @@ -680,7 +680,7 @@ void MDCache::adjust_bounded_subtree_auth(CDir *dir, list& bound_dfs, // make bounds list set bounds; - for (list::iterator p = bound_dfs.begin(); + for (vector::iterator p = bound_dfs.begin(); p != bound_dfs.end(); ++p) { CDir *bd = get_dirfrag(*p); @@ -1762,7 +1762,7 @@ void MDCache::send_resolve_now(int who) assert(migrator->get_import_state(dir->dirfrag()) >= Migrator::IMPORT_LOGGINGSTART); set bounds; get_subtree_bounds(dir, bounds); - list dfls; + vector dfls; for (set::iterator p = bounds.begin(); p != bounds.end(); ++p) dfls.push_back((*p)->dirfrag()); m->add_ambiguous_import(dir->dirfrag(), dfls); @@ -1781,7 +1781,7 @@ void MDCache::send_resolve_now(int who) } // ambiguous - for (map >::iterator p = my_ambiguous_imports.begin(); + for (map >::iterator p = my_ambiguous_imports.begin(); p != my_ambiguous_imports.end(); ++p) m->add_ambiguous_import(p->first, p->second); @@ -1969,7 +1969,7 @@ void MDCache::handle_resolve(MMDSResolve *m) // ambiguous slave requests? if (!m->slave_requests.empty()) { MMDSResolveAck *ack = new MMDSResolveAck; - for (list::iterator p = m->slave_requests.begin(); + for (vector::iterator p = m->slave_requests.begin(); p != m->slave_requests.end(); ++p) { if (uncommitted_masters.count(*p)) { //mds->sessionmap.have_completed_request(*p)) { @@ -1989,9 +1989,9 @@ void MDCache::handle_resolve(MMDSResolve *m) // am i a surviving ambiguous importer? if (mds->is_active() || mds->is_stopping()) { // check for any import success/failure (from this node) - map >::iterator p = my_ambiguous_imports.begin(); + map >::iterator p = my_ambiguous_imports.begin(); while (p != my_ambiguous_imports.end()) { - map >::iterator next = p; + map >::iterator next = p; next++; CDir *dir = get_dirfrag(p->first); assert(dir); @@ -2002,7 +2002,7 @@ void MDCache::handle_resolve(MMDSResolve *m) // check if sender claims the subtree bool claimed_by_sender = false; - for (map >::iterator q = m->subtrees.begin(); + for (map >::iterator q = m->subtrees.begin(); q != m->subtrees.end(); ++q) { CDir *base = get_dirfrag(q->first); @@ -2010,7 +2010,7 @@ void MDCache::handle_resolve(MMDSResolve *m) continue; // base not dir or an ancestor of dir, clearly doesn't claim dir. bool inside = true; - for (list::iterator r = q->second.begin(); + for (vector::iterator r = q->second.begin(); r != q->second.end(); ++r) { CDir *bound = get_dirfrag(*r); @@ -2037,7 +2037,7 @@ void MDCache::handle_resolve(MMDSResolve *m) } // update my dir_auth values - for (map >::iterator pi = m->subtrees.begin(); + for (map >::iterator pi = m->subtrees.begin(); pi != m->subtrees.end(); ++pi) { CInode *diri = get_inode(pi->first.ino); @@ -2060,7 +2060,7 @@ void MDCache::handle_resolve(MMDSResolve *m) // note ambiguous imports too - for (map >::iterator pi = m->ambiguous_imports.begin(); + for (map >::iterator pi = m->ambiguous_imports.begin(); pi != m->ambiguous_imports.end(); ++pi) { dout(10) << "noting ambiguous import on " << pi->first << " bounds " << pi->second << dendl; @@ -2106,7 +2106,7 @@ void MDCache::handle_resolve_ack(MMDSResolveAck *ack) dout(10) << "handle_resolve_ack " << *ack << " from " << ack->get_source() << dendl; int from = ack->get_source().num(); - for (list::iterator p = ack->commit.begin(); + for (vector::iterator p = ack->commit.begin(); p != ack->commit.end(); ++p) { dout(10) << " commit on slave " << *p << dendl; @@ -2131,7 +2131,7 @@ void MDCache::handle_resolve_ack(MMDSResolveAck *ack) } } - for (list::iterator p = ack->abort.begin(); + for (vector::iterator p = ack->abort.begin(); p != ack->abort.end(); ++p) { dout(10) << " abort on slave " << *p << dendl; @@ -2183,13 +2183,13 @@ void MDCache::disambiguate_imports() dout(10) << "disambiguate_imports" << dendl; // other nodes' ambiguous imports - for (map > >::iterator p = other_ambiguous_imports.begin(); + for (map > >::iterator p = other_ambiguous_imports.begin(); p != other_ambiguous_imports.end(); ++p) { int who = p->first; dout(10) << "ambiguous imports for mds" << who << dendl; - for (map >::iterator q = p->second.begin(); + for (map >::iterator q = p->second.begin(); q != p->second.end(); ++q) { dout(10) << " ambiguous import " << q->first << " bounds " << q->second << dendl; @@ -2210,7 +2210,7 @@ void MDCache::disambiguate_imports() // my ambiguous imports while (!my_ambiguous_imports.empty()) { - map >::iterator q = my_ambiguous_imports.begin(); + map >::iterator q = my_ambiguous_imports.begin(); CDir *dir = get_dirfrag(q->first); if (!dir) continue; @@ -2245,7 +2245,7 @@ void MDCache::disambiguate_imports() } -void MDCache::add_ambiguous_import(dirfrag_t base, list& bounds) +void MDCache::add_ambiguous_import(dirfrag_t base, vector& bounds) { assert(my_ambiguous_imports.count(base) == 0); my_ambiguous_imports[base].swap( bounds ); @@ -2255,7 +2255,7 @@ void MDCache::add_ambiguous_import(dirfrag_t base, list& bounds) void MDCache::add_ambiguous_import(CDir *base, const set& bounds) { // make a list - list binos; + vector binos; for (set::iterator p = bounds.begin(); p != bounds.end(); ++p) @@ -2280,7 +2280,7 @@ void MDCache::cancel_ambiguous_import(dirfrag_t df) void MDCache::finish_ambiguous_import(dirfrag_t df) { assert(my_ambiguous_imports.count(df)); - list bounds; + vector bounds; bounds.swap(my_ambiguous_imports[df]); my_ambiguous_imports.erase(df); diff --git a/src/mds/MDCache.h b/src/mds/MDCache.h index d37da220b91e8..18eb0c167436d 100644 --- a/src/mds/MDCache.h +++ b/src/mds/MDCache.h @@ -453,8 +453,8 @@ public: void adjust_bounded_subtree_auth(CDir *dir, set& bounds, int a) { adjust_bounded_subtree_auth(dir, bounds, pair(a, CDIR_AUTH_UNKNOWN)); } - void adjust_bounded_subtree_auth(CDir *dir, list& bounds, pair auth); - void adjust_bounded_subtree_auth(CDir *dir, list& bounds, int a) { + void adjust_bounded_subtree_auth(CDir *dir, vector& bounds, pair auth); + void adjust_bounded_subtree_auth(CDir *dir, vector& bounds, int a) { adjust_bounded_subtree_auth(dir, bounds, pair(a, CDIR_AUTH_UNKNOWN)); } void map_dirfrag_set(list& dfs, set& result); @@ -557,9 +557,9 @@ public: protected: // [resolve] // from EImportStart w/o EImportFinish during journal replay - map > my_ambiguous_imports; + map > my_ambiguous_imports; // from MMDSResolves - map > > other_ambiguous_imports; + map > > other_ambiguous_imports; map > uncommitted_slave_updates; // slave: for replay. @@ -597,7 +597,7 @@ public: } // ambiguous imports - void add_ambiguous_import(dirfrag_t base, list& bounds); + void add_ambiguous_import(dirfrag_t base, vector& bounds); void add_ambiguous_import(CDir *base, const set& bounds); bool have_ambiguous_import(dirfrag_t base) { return my_ambiguous_imports.count(base); diff --git a/src/mds/Server.cc b/src/mds/Server.cc index b0209c0455455..9f201c5157ae9 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -1068,7 +1068,7 @@ void Server::handle_slave_auth_pin(MDRequest *mdr) list objects; bool fail = false; - for (list::iterator p = mdr->slave_request->get_authpins().begin(); + for (vector::iterator p = mdr->slave_request->get_authpins().begin(); p != mdr->slave_request->get_authpins().end(); ++p) { MDSCacheObject *object = mdcache->get_object(*p); @@ -1141,7 +1141,7 @@ void Server::handle_slave_auth_pin_ack(MDRequest *mdr, MMDSSlaveRequest *ack) // added auth pins? set pinned; - for (list::iterator p = ack->get_authpins().begin(); + for (vector::iterator p = ack->get_authpins().begin(); p != ack->get_authpins().end(); ++p) { MDSCacheObject *object = mdcache->get_object(*p); diff --git a/src/mds/events/EImportStart.h b/src/mds/events/EImportStart.h index 6b076a3083846..6b92d9f3f02ee 100644 --- a/src/mds/events/EImportStart.h +++ b/src/mds/events/EImportStart.h @@ -26,7 +26,7 @@ class EImportStart : public LogEvent { protected: dirfrag_t base; - list bounds; + vector bounds; public: EMetaBlob metablob; @@ -34,8 +34,8 @@ protected: version_t cmapv; EImportStart(dirfrag_t di, - list& b) : LogEvent(EVENT_IMPORTSTART), - base(di), bounds(b) { } + vector& b) : LogEvent(EVENT_IMPORTSTART), + base(di), bounds(b) { } EImportStart() : LogEvent(EVENT_IMPORTSTART) { } void print(ostream& out) { diff --git a/src/mds/events/ESubtreeMap.h b/src/mds/events/ESubtreeMap.h index 28a5c5cbddb9d..aaedc859f304b 100644 --- a/src/mds/events/ESubtreeMap.h +++ b/src/mds/events/ESubtreeMap.h @@ -21,7 +21,7 @@ class ESubtreeMap : public LogEvent { public: EMetaBlob metablob; - map > subtrees; + map > subtrees; ESubtreeMap() : LogEvent(EVENT_SUBTREEMAP) { } diff --git a/src/mds/journal.cc b/src/mds/journal.cc index e2640c28880ba..abe044f61cfec 100644 --- a/src/mds/journal.cc +++ b/src/mds/journal.cc @@ -800,7 +800,7 @@ void ESubtreeMap::replay(MDS *mds) metablob.replay(mds, _segment); // restore import/export maps - for (map >::iterator p = subtrees.begin(); + for (map >::iterator p = subtrees.begin(); p != subtrees.end(); ++p) { CDir *dir = mds->mdcache->get_dirfrag(p->first); diff --git a/src/messages/MExportDir.h b/src/messages/MExportDir.h index 595267a024bb5..aeb92a6657d48 100644 --- a/src/messages/MExportDir.h +++ b/src/messages/MExportDir.h @@ -23,7 +23,7 @@ class MExportDir : public Message { public: dirfrag_t dirfrag; bufferlist export_data; - list bounds; + vector bounds; bufferlist client_map; MExportDir() {} diff --git a/src/messages/MMDSResolve.h b/src/messages/MMDSResolve.h index 59d2d3e5e172b..1f59e72fea752 100644 --- a/src/messages/MMDSResolve.h +++ b/src/messages/MMDSResolve.h @@ -21,9 +21,9 @@ class MMDSResolve : public Message { public: - map > subtrees; - map > ambiguous_imports; - list slave_requests; + map > subtrees; + map > ambiguous_imports; + vector slave_requests; MMDSResolve() : Message(MSG_MDS_RESOLVE) {} @@ -42,7 +42,7 @@ class MMDSResolve : public Message { subtrees[im].push_back(ex); } - void add_ambiguous_import(dirfrag_t im, const list& m) { + void add_ambiguous_import(dirfrag_t im, const vector& m) { ambiguous_imports[im] = m; } diff --git a/src/messages/MMDSResolveAck.h b/src/messages/MMDSResolveAck.h index 6c5a23156283f..8a908116cdb62 100644 --- a/src/messages/MMDSResolveAck.h +++ b/src/messages/MMDSResolveAck.h @@ -22,8 +22,8 @@ class MMDSResolveAck : public Message { public: - list commit; - list abort; + vector commit; + vector abort; MMDSResolveAck() : Message(MSG_MDS_RESOLVEACK) {} diff --git a/src/messages/MMDSSlaveRequest.h b/src/messages/MMDSSlaveRequest.h index c0ceeda863ea8..531f92dd67c26 100644 --- a/src/messages/MMDSSlaveRequest.h +++ b/src/messages/MMDSSlaveRequest.h @@ -75,7 +75,7 @@ class MMDSSlaveRequest : public Message { MDSCacheObjectInfo object_info; // for authpins - list authpins; + vector authpins; public: // for rename prep @@ -97,7 +97,7 @@ public: int get_lock_type() { return lock_type; } MDSCacheObjectInfo &get_object_info() { return object_info; } - list& get_authpins() { return authpins; } + vector& get_authpins() { return authpins; } void set_lock_type(int t) { lock_type = t; } -- 2.39.5