mirror of
https://github.com/ceph/ceph
synced 2025-01-19 09:32:00 +00:00
mds: simplify loops to range-for
No functional change. Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
This commit is contained in:
parent
36f3bc067f
commit
2d2b387372
@ -337,14 +337,10 @@ void MDBalancer::export_empties()
|
||||
{
|
||||
dout(5) << "export_empties checking for empty imports" << dendl;
|
||||
|
||||
for (map<CDir*,set<CDir*> >::iterator it = mds->mdcache->subtrees.begin();
|
||||
it != mds->mdcache->subtrees.end();
|
||||
++it) {
|
||||
CDir *dir = it->first;
|
||||
if (!dir->is_auth() ||
|
||||
dir->is_ambiguous_auth() ||
|
||||
dir->is_freezing() ||
|
||||
dir->is_frozen())
|
||||
std::set<CDir *> subtrees;
|
||||
mds->mdcache->get_fullauth_subtrees(subtrees);
|
||||
for (auto &dir : subtrees) {
|
||||
if (dir->is_freezing() || dir->is_frozen())
|
||||
continue;
|
||||
|
||||
if (!dir->inode->is_base() &&
|
||||
|
@ -1257,19 +1257,15 @@ void MDCache::verify_subtree_bounds(CDir *dir, const set<CDir*>& bounds)
|
||||
if (bounds != subtrees[dir]) {
|
||||
dout(0) << "verify_subtree_bounds failed" << dendl;
|
||||
set<CDir*> b = bounds;
|
||||
for (set<CDir*>::iterator p = subtrees[dir].begin();
|
||||
p != subtrees[dir].end();
|
||||
++p) {
|
||||
if (bounds.count(*p)) {
|
||||
b.erase(*p);
|
||||
for (auto &cd : subtrees[dir]) {
|
||||
if (bounds.count(cd)) {
|
||||
b.erase(cd);
|
||||
continue;
|
||||
}
|
||||
dout(0) << " missing bound " << **p << dendl;
|
||||
dout(0) << " missing bound " << *cd << dendl;
|
||||
}
|
||||
for (set<CDir*>::iterator p = b.begin();
|
||||
p != b.end();
|
||||
++p)
|
||||
dout(0) << " extra bound " << **p << dendl;
|
||||
for (const auto &cd : b)
|
||||
dout(0) << " extra bound " << *cd << dendl;
|
||||
}
|
||||
assert(bounds == subtrees[dir]);
|
||||
}
|
||||
@ -1281,10 +1277,8 @@ void MDCache::verify_subtree_bounds(CDir *dir, const list<dirfrag_t>& bounds)
|
||||
|
||||
// make sure that any bounds i do have are properly noted as such.
|
||||
int failed = 0;
|
||||
for (list<dirfrag_t>::const_iterator p = bounds.begin();
|
||||
p != bounds.end();
|
||||
++p) {
|
||||
CDir *bd = get_dirfrag(*p);
|
||||
for (const auto &fg : bounds) {
|
||||
CDir *bd = get_dirfrag(fg);
|
||||
if (!bd) continue;
|
||||
if (subtrees[dir].count(bd) == 0) {
|
||||
dout(0) << "verify_subtree_bounds failed: extra bound " << *bd << dendl;
|
||||
|
@ -1700,10 +1700,7 @@ void Migrator::export_reverse(CDir *dir)
|
||||
}
|
||||
|
||||
// unpin bounds
|
||||
for (set<CDir*>::iterator p = bounds.begin();
|
||||
p != bounds.end();
|
||||
++p) {
|
||||
CDir *bd = *p;
|
||||
for (const auto &bd : bounds) {
|
||||
bd->put(CDir::PIN_EXPORTBOUND);
|
||||
bd->state_clear(CDir::STATE_EXPORTBOUND);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user