From ec4f4c8a64202827c968128fcb83591e959854cf Mon Sep 17 00:00:00 2001 From: Jesse Williamson Date: Wed, 26 Apr 2017 05:26:38 -0700 Subject: [PATCH] rgw: migrate atomic_t to std::atomic<> Signed-off-by: Jesse Williamson --- src/rgw/rgw_loadgen_process.cc | 4 ++-- src/rgw/rgw_object_expirer_core.h | 10 ++++------ src/rgw/rgw_process.h | 2 +- src/rgw/rgw_request.h | 4 ++-- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/rgw/rgw_loadgen_process.cc b/src/rgw/rgw_loadgen_process.cc index 23e6fefca73e7..fef37f805bac9 100644 --- a/src/rgw/rgw_loadgen_process.cc +++ b/src/rgw/rgw_loadgen_process.cc @@ -39,7 +39,7 @@ void RGWLoadGenProcess::run() vector buckets(num_buckets); - std::atomic failed = { 0 }; + std::atomic failed = { false }; for (i = 0; i < num_buckets; i++) { buckets[i] = "/loadgen"; @@ -104,7 +104,7 @@ void RGWLoadGenProcess::run() void RGWLoadGenProcess::gen_request(const string& method, const string& resource, - int content_length, std::atomic* fail_flag) + int content_length, std::atomic* fail_flag) { RGWLoadGenRequest* req = new RGWLoadGenRequest(store->get_new_req_id(), method, resource, diff --git a/src/rgw/rgw_object_expirer_core.h b/src/rgw/rgw_object_expirer_core.h index 6fe8d1410bff0..813eca3f939a1 100644 --- a/src/rgw/rgw_object_expirer_core.h +++ b/src/rgw/rgw_object_expirer_core.h @@ -4,11 +4,11 @@ #ifndef CEPH_OBJEXP_H #define CEPH_OBJEXP_H -#include -#include -#include -#include #include +#include +#include +#include +#include #include "auth/Crypto.h" @@ -38,8 +38,6 @@ #include "rgw_usage.h" #include "rgw_replica_log.h" -#include - class RGWObjectExpirer { protected: RGWRados *store; diff --git a/src/rgw/rgw_process.h b/src/rgw/rgw_process.h index 005f2db6fef74..3aaeaff61afb8 100644 --- a/src/rgw/rgw_process.h +++ b/src/rgw/rgw_process.h @@ -184,7 +184,7 @@ class RGWLoadGenProcess : public RGWProcess { void checkpoint(); void handle_request(RGWRequest* req) override; void gen_request(const string& method, const string& resource, - int content_length, std::atomic* fail_flag); + int content_length, std::atomic* fail_flag); void set_access_key(RGWAccessKey& key) { access_key = key; } }; diff --git a/src/rgw/rgw_request.h b/src/rgw/rgw_request.h index 3c835f7b1c94b..11345bb0d2308 100644 --- a/src/rgw/rgw_request.h +++ b/src/rgw/rgw_request.h @@ -59,10 +59,10 @@ struct RGWLoadGenRequest : public RGWRequest { string method; string resource; int content_length; - std::atomic* fail_flag = nullptr; + std::atomic* fail_flag = nullptr; RGWLoadGenRequest(uint64_t req_id, const string& _m, const string& _r, int _cl, - std::atomic *ff) + std::atomic *ff) : RGWRequest(req_id), method(_m), resource(_r), content_length(_cl), fail_flag(ff) {} };