]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
include: switch mempool.h to ceph::atomic. 33034/head
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 29 Jan 2020 20:15:55 +0000 (21:15 +0100)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Sun, 2 Feb 2020 15:21:34 +0000 (16:21 +0100)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/include/mempool.h
src/osd/PeeringState.h

index 155ec18d438242e0a7ce0edd99b5277846649fa4..8027305688d201bb39c6b3056736791b99c8b96d 100644 (file)
 #include <vector>
 #include <list>
 #include <mutex>
-#include <atomic>
 #include <typeinfo>
 #include <boost/container/flat_set.hpp>
 #include <boost/container/flat_map.hpp>
 
-#include <common/Formatter.h>
+#include "common/Formatter.h"
+#include "common/ceph_atomic.h"
 #include "include/ceph_assert.h"
 #include "include/compact_map.h"
 #include "include/compact_set.h"
@@ -194,9 +194,9 @@ enum {
 
 // align shard to a cacheline
 struct shard_t {
-  std::atomic<size_t> bytes = {0};
-  std::atomic<size_t> items = {0};
-  char __padding[128 - sizeof(std::atomic<size_t>)*2];
+  ceph::atomic<size_t> bytes = {0};
+  ceph::atomic<size_t> items = {0};
+  char __padding[128 - sizeof(ceph::atomic<size_t>)*2];
 } __attribute__ ((aligned (128)));
 
 static_assert(sizeof(shard_t) == 128, "shard_t should be cacheline-sized");
@@ -222,7 +222,7 @@ const char *get_pool_name(pool_index_t ix);
 struct type_t {
   const char *type_name;
   size_t item_size;
-  std::atomic<ssize_t> items = {0};  // signed
+  ceph::atomic<ssize_t> items = {0};  // signed
 };
 
 struct type_info_hash {
index a9bccea5d4489f2ee45909a963e3d4b2e695ab07..327e35eeb975a03f3bd2c768197873a6af831bb2 100644 (file)
@@ -1455,7 +1455,7 @@ public:
   set<pg_shard_t> might_have_unfound;
 
   bool deleting = false;  /// true while in removing or OSD is shutting down
-  atomic<bool> deleted = {false}; /// true once deletion complete
+  std::atomic<bool> deleted = {false}; /// true once deletion complete
 
   MissingLoc missing_loc; ///< information about missing objects