From: Casey Bodley Date: Sat, 8 Apr 2017 16:40:12 +0000 (-0400) Subject: rgw: enable move on RGWRESTConn X-Git-Tag: v12.0.3~98^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d53c0591d4302748fc702cd8b8f1817c216bd0fd;p=ceph.git rgw: enable move on RGWRESTConn added custom move construct/assign because std::atomic is not movable Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_rest_conn.cc b/src/rgw/rgw_rest_conn.cc index 3cda4d305d6f9..22534d8656dea 100644 --- a/src/rgw/rgw_rest_conn.cc +++ b/src/rgw/rgw_rest_conn.cc @@ -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()) { diff --git a/src/rgw/rgw_rest_conn.h b/src/rgw/rgw_rest_conn.h index 2b2cf700ac480..bec829d6939b5 100644 --- a/src/rgw/rgw_rest_conn.h +++ b/src/rgw/rgw_rest_conn.h @@ -61,6 +61,10 @@ class RGWRESTConn public: RGWRESTConn(CephContext *_cct, RGWRados *store, const string& _remote_id, const list& 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() {