]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: enable move on RGWRESTConn
authorCasey Bodley <cbodley@redhat.com>
Sat, 8 Apr 2017 16:40:12 +0000 (12:40 -0400)
committerCasey Bodley <cbodley@redhat.com>
Wed, 3 May 2017 14:52:23 +0000 (10:52 -0400)
added custom move construct/assign because std::atomic is not movable

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_rest_conn.cc
src/rgw/rgw_rest_conn.h

index 3cda4d305d6f9f0ad7449a7e1685af7ffe318046..22534d8656dea9aaa76f174f5c51ff2f8f1cebdd 100644 (file)
@@ -19,6 +19,27 @@ RGWRESTConn::RGWRESTConn(CephContext *_cct, RGWRados *store,
   }
 }
 
+RGWRESTConn::RGWRESTConn(RGWRESTConn&& other)
+  : cct(other.cct),
+    endpoints(std::move(other.endpoints)),
+    key(std::move(other.key)),
+    self_zone_group(std::move(other.self_zone_group)),
+    remote_id(std::move(other.remote_id)),
+    counter(other.counter.load())
+{
+}
+
+RGWRESTConn& RGWRESTConn::operator=(RGWRESTConn&& other)
+{
+  cct = other.cct;
+  endpoints = std::move(other.endpoints);
+  key = std::move(other.key);
+  self_zone_group = std::move(other.self_zone_group);
+  remote_id = std::move(other.remote_id);
+  counter = other.counter.load();
+  return *this;
+}
+
 int RGWRESTConn::get_url(string& endpoint)
 {
   if (endpoints.empty()) {
index 2b2cf700ac480e531bec2e57d9c9cd43982b0da9..bec829d6939b5e00c8e906a1f5f5f0208181d076 100644 (file)
@@ -61,6 +61,10 @@ class RGWRESTConn
 public:
 
   RGWRESTConn(CephContext *_cct, RGWRados *store, const string& _remote_id, const list<string>& endpoints);
+  // custom move needed for atomic
+  RGWRESTConn(RGWRESTConn&& other);
+  RGWRESTConn& operator=(RGWRESTConn&& other);
+
   int get_url(string& endpoint);
   string get_url();
   const string& get_self_zonegroup() {