From: Xiubo Li Date: Wed, 1 Nov 2023 06:59:30 +0000 (+0800) Subject: client: switch to session's reference instead of constructing a new object X-Git-Tag: v16.2.15~72^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F53981%2Fhead;p=ceph.git client: switch to session's reference instead of constructing a new object This is for pacific only, because in higher version we have switched the mds_sessions map to a shared_ptr. Fixes: https://tracker.ceph.com/issues/63381 Signed-off-by: Xiubo Li --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 4bfe52f77c3..9bf5aa017b0 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -4817,7 +4817,7 @@ void Client::flush_caps_sync() { ldout(cct, 10) << __func__ << dendl; for (auto &q : mds_sessions) { - auto s = q.second; + auto &s = q.second; xlist::iterator p = s.dirty_list.begin(); while (!p.end()) { unsigned flags = CHECK_CAPS_NODELAY; @@ -6662,7 +6662,7 @@ void Client::_unmount(bool abort) if (abort || blocklisted) { for (auto &q : mds_sessions) { - auto s = q.second; + auto &s = q.second; for (auto p = s.dirty_list.begin(); !p.end(); ) { Inode *in = *p; ++p;