]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client/Client.cc: prefer prefix ++operator for iterators
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 13 Mar 2013 16:55:04 +0000 (17:55 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 13 Mar 2013 16:55:04 +0000 (17:55 +0100)
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/client/Client.cc

index 950dbb1d1cc20f27dd93db86ee8a776016197aaf..437d473429d59314ae884535aff9fc2991f6a0a3 100644 (file)
@@ -217,7 +217,7 @@ void Client::tear_down_cache()
   // fd's
   for (hash_map<int, Fh*>::iterator it = fd_map.begin();
        it != fd_map.end();
-       it++) {
+       ++it) {
     Fh *fh = it->second;
     ldout(cct, 1) << "tear_down_cache forcing close of fh " << it->first << " ino " << fh->inode->ino << dendl;
     put_inode(fh->inode);
@@ -277,7 +277,7 @@ void Client::dump_inode(Formatter *f, Inode *in, set<Inode*>& did, bool disconne
     ldout(cct, 1) << "  dir " << in->dir << " size " << in->dir->dentries.size() << dendl;
     for (hash_map<string, Dentry*>::iterator it = in->dir->dentries.begin();
          it != in->dir->dentries.end();
-         it++) {
+         ++it) {
       ldout(cct, 1) << "   " << in->ino << " dn " << it->first << " " << it->second << " ref " << it->second->ref << dendl;
       if (f) {
        f->open_object_section("dentry");
@@ -305,7 +305,7 @@ void Client::dump_cache(Formatter *f)
   // make a second pass to catch anything disconnected
   for (hash_map<vinodeno_t, Inode*>::iterator it = inode_map.begin();
        it != inode_map.end();
-       it++) {
+       ++it) {
     if (did.count(it->second))
       continue;
     dump_inode(f, it->second, did, true);
@@ -825,10 +825,10 @@ void Client::insert_readdir_results(MetaRequest *request, int mds, Inode *diri)
                                                  pd->first.length())] == fg) {  // do not remove items in earlier frags
          ldout(cct, 15) << "insert_trace  unlink '" << pd->first << "'" << dendl;
          Dentry *dn = pd->second;
-         pd++;
+         ++pd;
          unlink(dn, true);
        } else {
-         pd++;
+         ++pd;
        }
       }
 
@@ -844,14 +844,14 @@ void Client::insert_readdir_results(MetaRequest *request, int mds, Inode *diri)
        Dentry *olddn = pd->second;
        if (pd->second->inode != in) {
          // replace incorrect dentry
-         pd++;  // we are about to unlink this guy, move past it.
+         ++pd;  // we are about to unlink this guy, move past it.
          unlink(olddn, true);
          dn = link(dir, dname, in, NULL);
        } else {
          // keep existing dn
          dn = olddn;
          touch_dn(dn);
-         pd++;  // move past the dentry we just touched.
+         ++pd;  // move past the dentry we just touched.
        }
       } else {
        // new dn
@@ -875,10 +875,10 @@ void Client::insert_readdir_results(MetaRequest *request, int mds, Inode *diri)
                                                  pd->first.length())] == fg) {
          ldout(cct, 15) << "insert_trace  unlink '" << pd->first << "'" << dendl;
          Dentry *dn = pd->second;
-         pd++;
+         ++pd;
          unlink(dn, true);
        } else
-         pd++;
+         ++pd;
       }
     }
 
@@ -1109,7 +1109,7 @@ void Client::connect_mds_targets(int mds)
   const MDSMap::mds_info_t& info = mdsmap->get_mds_info(mds);
   for (set<int>::const_iterator q = info.export_targets.begin();
        q != info.export_targets.end();
-       q++) {
+       ++q) {
     if (mds_sessions.count(*q) == 0 && waiting_for_session.count(*q) == 0) {
       ldout(cct, 10) << "check_mds_sessions opening mds." << mds
               << " export target mds." << *q << dendl;
@@ -1823,7 +1823,7 @@ void Client::handle_mds_map(MMDSMap* m)
   // reset session
   for (map<int,MetaSession*>::iterator p = mds_sessions.begin();
        p != mds_sessions.end();
-       p++) {
+       ++p) {
     int oldstate = oldmap->get_state(p->first);
     int newstate = mdsmap->get_state(p->first);
     if (!mdsmap->is_up(p->first) ||
@@ -1862,7 +1862,7 @@ void Client::handle_mds_map(MMDSMap* m)
       signal_cond_list(p->second);
       waiting_for_session.erase(p++);
     } else {
-      p++;
+      ++p;
     }
   }
 
@@ -1884,7 +1884,7 @@ void Client::send_reconnect(int mds)
   hash_set<inodeno_t> did_snaprealm;
   for (hash_map<vinodeno_t, Inode*>::iterator p = inode_map.begin();
        p != inode_map.end();
-       p++) {
+       ++p) {
     Inode *in = p->second;
     if (in->caps.count(mds)) {
       ldout(cct, 10) << " caps on " << p->first
@@ -2183,7 +2183,7 @@ void Client::put_cap_ref(Inode *in, int cap)
       if (cap & CEPH_CAP_FILE_BUFFER) {
        for (map<snapid_t,CapSnap*>::iterator p = in->cap_snaps.begin();
            p != in->cap_snaps.end();
-           p++)
+           ++p)
          p->second->dirty_data = 0;
        check_caps(in, false);
        signal_cond_list(in->waitfor_commit);
@@ -2364,7 +2364,7 @@ void Client::check_caps(Inode *in, bool is_delayed)
   while (it != in->caps.end()) {
     int mds = it->first;
     Cap *cap = it->second;
-    it++;
+    ++it;
 
     int revoking = cap->implemented & ~cap->issued;
     
@@ -2506,7 +2506,7 @@ void Client::flush_snaps(Inode *in, bool all_again, CapSnap *again)
   int mseq = in->auth_cap->mseq;
   assert(mds >= 0);
 
-  for (map<snapid_t,CapSnap*>::iterator p = in->cap_snaps.begin(); p != in->cap_snaps.end(); p++) {
+  for (map<snapid_t,CapSnap*>::iterator p = in->cap_snaps.begin(); p != in->cap_snaps.end(); ++p) {
     CapSnap *capsnap = p->second;
     if (again) {
       // only one capsnap
@@ -2567,7 +2567,7 @@ void Client::wait_on_list(list<Cond*>& ls)
 
 void Client::signal_cond_list(list<Cond*>& ls)
 {
-  for (list<Cond*>::iterator it = ls.begin(); it != ls.end(); it++)
+  for (list<Cond*>::iterator it = ls.begin(); it != ls.end(); ++it)
     (*it)->Signal();
   ls.clear();
 }
@@ -2982,7 +2982,7 @@ void Client::wait_sync_caps(uint64_t want)
           << num_flushing_caps << " total flushing)" << dendl;
   for (map<int,MetaSession*>::iterator p = mds_sessions.begin();
        p != mds_sessions.end();
-       p++) {
+       ++p) {
     if (p->second->flushing_caps.empty())
        continue;
     Inode *in = p->second->flushing_caps.front();
@@ -3042,7 +3042,7 @@ void SnapRealm::build_snap_context()
   cached_snap_context.seq = max_seq;
   cached_snap_context.snaps.resize(0);
   cached_snap_context.snaps.reserve(snaps.size());
-  for (set<snapid_t>::reverse_iterator p = snaps.rbegin(); p != snaps.rend(); p++)
+  for (set<snapid_t>::reverse_iterator p = snaps.rbegin(); p != snaps.rend(); ++p)
     cached_snap_context.snaps.push_back(*p);
 }
 
@@ -3060,7 +3060,7 @@ void Client::invalidate_snaprealm_and_children(SnapRealm *realm)
 
     for (set<SnapRealm*>::iterator p = realm->pchildren.begin();
         p != realm->pchildren.end(); 
-        p++)
+        ++p)
       q.push_back(*p);
   }
 }
@@ -3151,7 +3151,7 @@ inodeno_t Client::update_snap_trace(bufferlist& bl, bool flush)
          
          for (set<SnapRealm*>::iterator p = realm->pchildren.begin(); 
               p != realm->pchildren.end(); 
-              p++)
+              ++p)
            q.push_back(*p);
        }
       }
@@ -3206,7 +3206,7 @@ void Client::handle_snap(MClientSnap *m)
     ldout(cct, 10) << " splitting off " << *realm << dendl;
     for (vector<inodeno_t>::iterator p = m->split_inos.begin();
         p != m->split_inos.end();
-        p++) {
+        ++p) {
       vinodeno_t vino(*p, CEPH_NOSNAP);
       if (inode_map.count(vino)) {
        Inode *in = inode_map[vino];
@@ -3231,7 +3231,7 @@ void Client::handle_snap(MClientSnap *m)
     // move child snaprealms, too
     for (vector<inodeno_t>::iterator p = m->split_realms.begin();
         p != m->split_realms.end();
-        p++) {
+        ++p) {
       ldout(cct, 10) << "adjusting snaprealm " << *p << " parent" << dendl;
       SnapRealm *child = get_snap_realm_maybe(*p);
       if (!child)
@@ -3244,7 +3244,7 @@ void Client::handle_snap(MClientSnap *m)
   update_snap_trace(m->bl, m->head.op != CEPH_SNAP_OP_DESTROY);
 
   if (realm) {
-    for (list<Inode*>::iterator p = to_move.begin(); p != to_move.end(); p++) {
+    for (list<Inode*>::iterator p = to_move.begin(); p != to_move.end(); ++p) {
       Inode *in = *p;
       in->snaprealm = realm;
       realm->inodes_with_caps.push_back(&in->snaprealm_item);
@@ -3358,7 +3358,7 @@ void Client::handle_cap_export(Inode *in, MClientCaps *m)
   bool found_higher_mseq = false;
   for (map<int,Cap*>::iterator p = in->caps.begin();
        p != in->caps.end();
-       p++) {
+       ++p) {
     if (p->first == mds)
       cap = p->second;
     if (p->second->mseq > m->get_mseq()) {
@@ -3777,7 +3777,7 @@ void Client::flush_cap_releases()
   // send any cap releases
   for (map<int,MetaSession*>::iterator p = mds_sessions.begin();
        p != mds_sessions.end();
-       p++) {
+       ++p) {
     if (p->second->release && mdsmap->is_up(p->first)) {
       messenger->send_message(p->second->release, mdsmap->get_inst(p->first));
       p->second->release = 0;
@@ -3829,7 +3829,7 @@ void Client::renew_caps()
   
   for (map<int,MetaSession*>::iterator p = mds_sessions.begin();
        p != mds_sessions.end();
-       p++) {
+       ++p) {
     ldout(cct, 15) << "renew_caps requesting from mds." << p->first << dendl;
     if (mdsmap->get_state(p->first) >= MDSMap::STATE_REJOIN)
       renew_caps(p->first);
@@ -4923,7 +4923,7 @@ int Client::_readdir_cache_cb(dir_result_t *dirp, add_dirent_cb_t cb, void *p)
     pd = dir->dentry_map.find(dirp->at_cache_name);
     if (pd == dir->dentry_map.end())
       return -EAGAIN;  // weird, i give up
-    pd++;
+    ++pd;
   } else {
     pd = dir->dentry_map.begin();
   }
@@ -4933,7 +4933,7 @@ int Client::_readdir_cache_cb(dir_result_t *dirp, add_dirent_cb_t cb, void *p)
     Dentry *dn = pd->second;
     if (dn->inode == NULL) {
       ldout(cct, 15) << " skipping null '" << pd->first << "'" << dendl;
-      pd++;
+      ++pd;
       continue;
     }
 
@@ -4943,7 +4943,7 @@ int Client::_readdir_cache_cb(dir_result_t *dirp, add_dirent_cb_t cb, void *p)
     fill_dirent(&de, pd->first.c_str(), st.st_mode, st.st_ino, dirp->offset + 1);
       
     uint64_t next_off = dn->offset + 1;
-    pd++;
+    ++pd;
     if (pd == dir->dentry_map.end())
       next_off = dir_result_t::END;
 
@@ -6727,7 +6727,7 @@ int Client::_listxattr(Inode *in, char *name, size_t size, int uid, int gid)
     const char dir_vxattrs[] = "ceph.dir.layout";
     for (map<string,bufferptr>::iterator p = in->xattrs.begin();
         p != in->xattrs.end();
-        p++)
+        ++p)
       r += p->first.length() + 1;
     if (in->is_file())
       r += sizeof(file_vxattrs);
@@ -6738,7 +6738,7 @@ int Client::_listxattr(Inode *in, char *name, size_t size, int uid, int gid)
       if (size >= (unsigned)r) {
        for (map<string,bufferptr>::iterator p = in->xattrs.begin();
             p != in->xattrs.end();
-            p++) {
+            ++p) {
          memcpy(name, p->first.c_str(), p->first.length());
          name += p->first.length();
          *name = '\0';