]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: switch to session's reference instead of constructing a new object 53981/head
authorXiubo Li <xiubli@redhat.com>
Wed, 1 Nov 2023 06:59:30 +0000 (14:59 +0800)
committerXiubo Li <xiubli@redhat.com>
Wed, 1 Nov 2023 08:07:34 +0000 (16:07 +0800)
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 <xiubli@redhat.com>
src/client/Client.cc

index 4bfe52f77c35acd9fe11063eb8f26c04af5d4930..9bf5aa017b0666582a6a76a70c33a4d645a36eda 100644 (file)
@@ -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<Inode*>::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;