]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mds/CDir: use the erase() return value
authorMax Kellermann <max.kellermann@ionos.com>
Fri, 4 Oct 2024 21:16:07 +0000 (23:16 +0200)
committerMax Kellermann <max.kellermann@ionos.com>
Wed, 9 Oct 2024 12:59:52 +0000 (14:59 +0200)
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
src/mds/CDir.cc

index f000da7928a726071c4b0f2ea4517001b8695991..76e9fee68f883621b8282554b8dcbfe136070352 100644 (file)
@@ -1319,7 +1319,7 @@ void CDir::take_dentry_waiting(std::string_view dname, snapid_t first, snapid_t
             << it->first.snapid
             << " on " << *this << dendl;
     std::copy(it->second.begin(), it->second.end(), std::back_inserter(ls));
-    waiting_on_dentry.erase(it++);
+    it = waiting_on_dentry.erase(it);
   }
 
   if (waiting_on_dentry.empty())
@@ -2823,8 +2823,6 @@ void CDir::_committed(int r, version_t v)
 
   auto it = waiting_for_commit.begin();
   while (it != waiting_for_commit.end()) {
-    auto _it = it;
-    ++_it;
     if (it->first > committed_version) {
       dout(10) << " there are waiters for " << it->first << ", committing again" << dendl;
       _commit(it->first, -1);
@@ -2834,8 +2832,7 @@ void CDir::_committed(int r, version_t v)
     for (const auto &waiter : it->second)
       t.push_back(waiter);
     mdcache->mds->queue_waiters(t);
-    waiting_for_commit.erase(it);
-    it = _it;
+    it = waiting_for_commit.erase(it);
 
     if (!(++count % mdcache->mds->heartbeat_reset_grace()))
       mdcache->mds->heartbeat_reset();