Skip to content

Commit 35c0078

Browse files
committed
Merge PR ceph#60214 into main
* refs/pull/60214/head: mds/MDCache: use `auto` mds/CDir: use the erase() return value mds/MDCache: remove unnecessary empty() check mds/MDCache: use the erase() return value mds/MDCache: pass iterator by value Reviewed-by: Patrick Donnelly <[email protected]>
2 parents 514ff50 + 4fbb678 commit 35c0078

File tree

3 files changed

+122
-136
lines changed

3 files changed

+122
-136
lines changed

src/mds/CDir.cc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,7 +1319,7 @@ void CDir::take_dentry_waiting(std::string_view dname, snapid_t first, snapid_t
13191319
<< it->first.snapid
13201320
<< " on " << *this << dendl;
13211321
std::copy(it->second.begin(), it->second.end(), std::back_inserter(ls));
1322-
waiting_on_dentry.erase(it++);
1322+
it = waiting_on_dentry.erase(it);
13231323
}
13241324

13251325
if (waiting_on_dentry.empty())
@@ -2823,8 +2823,6 @@ void CDir::_committed(int r, version_t v)
28232823

28242824
auto it = waiting_for_commit.begin();
28252825
while (it != waiting_for_commit.end()) {
2826-
auto _it = it;
2827-
++_it;
28282826
if (it->first > committed_version) {
28292827
dout(10) << " there are waiters for " << it->first << ", committing again" << dendl;
28302828
_commit(it->first, -1);
@@ -2834,8 +2832,7 @@ void CDir::_committed(int r, version_t v)
28342832
for (const auto &waiter : it->second)
28352833
t.push_back(waiter);
28362834
mdcache->mds->queue_waiters(t);
2837-
waiting_for_commit.erase(it);
2838-
it = _it;
2835+
it = waiting_for_commit.erase(it);
28392836

28402837
if (!(++count % mdcache->mds->heartbeat_reset_grace()))
28412838
mdcache->mds->heartbeat_reset();

0 commit comments

Comments
 (0)