diff options
author | Max Kellermann <max.kellermann@ionos.com> | 2024-10-04 23:16:07 +0200 |
---|---|---|
committer | Max Kellermann <max.kellermann@ionos.com> | 2024-10-09 14:59:52 +0200 |
commit | f51ea0450ade2067ac6e9c9f602dd1df51af592a (patch) | |
tree | 61fcf1a09f9e757d49f6b79a79f7ecf918029780 /src | |
parent | mds/MDCache: remove unnecessary empty() check (diff) | |
download | ceph-f51ea0450ade2067ac6e9c9f602dd1df51af592a.tar.xz ceph-f51ea0450ade2067ac6e9c9f602dd1df51af592a.zip |
mds/CDir: use the erase() return value
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/mds/CDir.cc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/mds/CDir.cc b/src/mds/CDir.cc index f000da7928a..76e9fee68f8 100644 --- a/src/mds/CDir.cc +++ b/src/mds/CDir.cc @@ -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(); |