]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
auth/RotatingKeyRing: use std::move() to set secrets 15866/head
authorKefu Chai <kchai@redhat.com>
Fri, 23 Jun 2017 04:27:15 +0000 (12:27 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 23 Jun 2017 07:36:14 +0000 (15:36 +0800)
the param will be thrown away anyway. see
CephxClientHandler::handle_response().

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/auth/RotatingKeyRing.cc
src/auth/RotatingKeyRing.h
src/auth/cephx/CephxClientHandler.cc

index ad0c0918de2b4bbc3cdd90eba9fb82fc02e5ecc0..e48127aa64b85b059e5210c7720e45764e95a1af 100644 (file)
@@ -21,10 +21,10 @@ bool RotatingKeyRing::need_new_secrets(utime_t now) const
   return secrets.need_new_secrets(now);
 }
 
-void RotatingKeyRing::set_secrets(RotatingSecrets& s)
+void RotatingKeyRing::set_secrets(RotatingSecrets&& s)
 {
   Mutex::Locker l(lock);
-  secrets = s;
+  secrets = std::move(s);
   dump_rotating();
 }
 
index 4a5e2375f0ca8b1c196818fb5b9d6e340c08dc4a..729f5c52021277cb34d3a676fa50d35e2a5c888a 100644 (file)
@@ -41,7 +41,7 @@ public:
 
   bool need_new_secrets() const;
   bool need_new_secrets(utime_t now) const;
-  void set_secrets(RotatingSecrets& s);
+  void set_secrets(RotatingSecrets&& s);
   void dump_rotating() const;
   bool get_secret(const EntityName& name, CryptoKey& secret) const override;
   bool get_service_secret(uint32_t service_id, uint64_t secret_id,
index 816b6526a009c7300210dfc9072c9726454a0d0a..89d4290373f582df4b8cad2e7d22343d2717a2e5 100644 (file)
@@ -186,7 +186,7 @@ int CephxClientHandler::handle_response(int ret, bufferlist::iterator& indata)
            << error << dendl;
          return -EINVAL;
        } else {
-         rotating_secrets->set_secrets(secrets);
+         rotating_secrets->set_secrets(std::move(secrets));
        }
       }
     }