]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
include/unordered_{map,set}: remove, use `std` directly instead 61841/head
authorMax Kellermann <max.kellermann@ionos.com>
Mon, 17 Feb 2025 07:30:18 +0000 (08:30 +0100)
committerMax Kellermann <max.kellermann@ionos.com>
Thu, 20 Feb 2025 05:12:10 +0000 (06:12 +0100)
This is only an alias for the `std` classes anyway.  This effectively
reverts commit 8e8672047ccc which added these aliases, probably
because C++11 was new and not all compilers supported it properly, but
that was 12 years ago and we're onl C++20 meanwhile.

Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
50 files changed:
doc/dev/network-encoding.rst
fusetrace/fusetrace_ll.cc
src/client/Client.cc
src/client/Client.h
src/client/Dir.h
src/client/SyntheticClient.cc
src/client/fuse_ll.cc
src/cls/2pc_queue/cls_2pc_queue_types.h
src/common/LogEntry.h
src/common/WorkQueue.h
src/common/lockdep.cc
src/common/shared_cache.hpp
src/common/win32/errno.cc
src/include/encoding.h
src/include/object.h
src/include/types.h
src/include/unordered_map.h [deleted file]
src/include/unordered_set.h [deleted file]
src/librbd/cache/ObjectCacherWriteback.h
src/mds/LogSegment.h
src/mds/MDCache.h
src/mds/Mutation.h
src/mds/ScrubStack.cc
src/mds/SessionMap.cc
src/mds/SessionMap.h
src/mds/journal.cc
src/mgr/DaemonServer.h
src/mon/LogMonitor.h
src/mon/OSDMonitor.cc
src/msg/async/AsyncMessenger.h
src/msg/async/rdma/RDMAStack.h
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h
src/os/kstore/KStore.cc
src/os/kstore/KStore.h
src/os/memstore/MemStore.cc
src/os/memstore/MemStore.h
src/osd/HitSet.cc
src/osd/HitSet.h
src/osd/OSD.h
src/osd/PGLog.cc
src/osd/PGLog.h
src/osdc/ObjectCacher.cc
src/osdc/ObjectCacher.h
src/rgw/driver/rados/rgw_notify.cc
src/test/immutable_object_cache/test_DomainSocket.cc
src/test/objectstore/ObjectStoreImitator.cc
src/test/objectstore/store_test.cc
src/test/xattr_bench.cc
src/tools/osdmaptool.cc

index d5d1a6d15371422933f0997c6b0ca48fcdd510fc..71328422e22dc8cd349a99f5db79afb3cac65751 100644 (file)
@@ -136,7 +136,7 @@ Lists are represented as an element count followed by that many elements.
        The size of the elements in the list are not necessarily uniform.
 
 Lists are used to encode ``std::list``, ``std::vector``, ``std::deque``,
-``std::set`` and ``ceph::unordered_set``.
+``std::set`` and ``std::unordered_set``.
 
 Blob
 ----
@@ -179,8 +179,8 @@ Maps are a list of pairs.
                ceph_pair<K,V> entries[length];
        }
 
-Maps are used to encode ``std::map``, ``std::multimap`` and
-``ceph::unordered_map``.
+Maps are used to encode ``std::map``, ``std::multimap``,
+``std::unordered_map`` and ``std::unordered_multimap``.
 
 Complex Types
 =============
index f10c29fd22e9ef1806e47541deae9319b6753f92..46851fd177b640bb658b37b723bc41d92ec7dbc9 100644 (file)
@@ -30,8 +30,6 @@
 #endif
 #include <time.h>
 
-
-#include "include/unordered_map.h"
 #include "include/hash_namespace.h"
 
 #ifndef __LP64__
@@ -50,6 +48,7 @@ CEPH_HASH_NAMESPACE_END
 #include <fstream>
 #include <map>
 #include <set>
+#include <unordered_map>
 using namespace std;
 
 #include "common/ceph_mutex.h"
@@ -87,7 +86,7 @@ struct Inode {
 };
 
 Inode *root = 0;
-ceph::unordered_map<ino_t, Inode*> inode_map;
+std::unordered_map<ino_t, Inode*> inode_map;
 
 bool make_inode_path(string &buf, Inode *in)
 {
index e7a45e1baba8895ba9a9826a25b3e9e2461bd417..57a4fbcb4513796b97e1475ff65dcb373897072a 100644 (file)
@@ -524,7 +524,7 @@ void Client::dump_inode(Formatter *f, Inode *in, set<Inode*>& did, bool disconne
   did.insert(in);
   if (in->dir) {
     ldout(cct, 1) << "  dir " << in->dir << " size " << in->dir->dentries.size() << dendl;
-    for (ceph::unordered_map<string, Dentry*>::iterator it = in->dir->dentries.begin();
+    for (auto it = in->dir->dentries.begin();
          it != in->dir->dentries.end();
          ++it) {
       ldout(cct, 1) << "   " << in->ino << " dn " << it->first << " " << it->second << " ref " << it->second->ref << dendl;
@@ -552,9 +552,7 @@ void Client::dump_cache(Formatter *f)
     dump_inode(f, root.get(), did, true);
 
   // make a second pass to catch anything disconnected
-  for (ceph::unordered_map<vinodeno_t, Inode*>::iterator it = inode_map.begin();
-       it != inode_map.end();
-       ++it) {
+  for (auto it = inode_map.begin(); it != inode_map.end(); ++it) {
     if (did.count(it->second))
       continue;
     dump_inode(f, it->second, did, true);
@@ -1876,7 +1874,7 @@ int Client::verify_reply_trace(int r, MetaSession *session,
   bufferlist extra_bl;
   inodeno_t created_ino;
   bool got_created_ino = false;
-  ceph::unordered_map<vinodeno_t, Inode*>::iterator p;
+  std::unordered_map<vinodeno_t, Inode*>::iterator p;
 
   extra_bl = reply->get_extra_bl();
   if (extra_bl.length() >= 8) {
@@ -2858,9 +2856,7 @@ void Client::_handle_full_flag(int64_t pool)
   // field with -ENOSPC as long as we're sure all the ops we cancelled were
   // affecting this pool, and all the objectsets we're purging were also
   // in this pool.
-  for (unordered_map<vinodeno_t,Inode*>::iterator i = inode_map.begin();
-       i != inode_map.end(); ++i)
-  {
+  for (auto i = inode_map.begin(); i != inode_map.end(); ++i) {
     Inode *inode = i->second;
     if (inode->oset.dirty_or_tx
         && (pool == -1 || inode->layout.pool_id == pool)) {
@@ -3178,10 +3174,8 @@ void Client::send_reconnect(MetaSession *session)
   bool allow_multi = session->mds_features.test(CEPHFS_FEATURE_MULTI_RECONNECT);
 
   // i have an open session.
-  ceph::unordered_set<inodeno_t> did_snaprealm;
-  for (ceph::unordered_map<vinodeno_t, Inode*>::iterator p = inode_map.begin();
-       p != inode_map.end();
-       ++p) {
+  std::unordered_set<inodeno_t> did_snaprealm;
+  for (auto p = inode_map.begin(); p != inode_map.end(); ++p) {
     Inode *in = p->second;
     auto it = in->caps.find(mds);
     if (it != in->caps.end()) {
@@ -4726,7 +4720,7 @@ void Client::_invalidate_kernel_dcache()
 
   if (can_invalidate_dentries) {
     if (dentry_invalidate_cb && root->dir) {
-      for (ceph::unordered_map<string, Dentry*>::iterator p = root->dir->dentries.begin();
+      for (auto p = root->dir->dentries.begin();
          p != root->dir->dentries.end();
          ++p) {
        if (p->second->inode)
@@ -10208,7 +10202,7 @@ int Client::_lookup_vino(vinodeno_t vino, const UserPerm& perms, Inode **inode)
 
   int r = make_request(req, perms, NULL, NULL, rand() % mdsmap->get_num_in_mds());
   if (r == 0 && inode != NULL) {
-    unordered_map<vinodeno_t,Inode*>::iterator p = inode_map.find(vino);
+    auto p = inode_map.find(vino);
     ceph_assert(p != inode_map.end());
     *inode = p->second;
     _ll_get(*inode);
@@ -13244,7 +13238,7 @@ int Client::ll_lookup_vino(
   ldout(cct, 3) << __func__ << " " << vino << dendl;
 
   // Check the cache first
-  unordered_map<vinodeno_t,Inode*>::iterator p = inode_map.find(vino);
+  auto p = inode_map.find(vino);
   if (p != inode_map.end()) {
     *inode = p->second;
     _ll_get(*inode);
@@ -13400,10 +13394,8 @@ void Client::_ll_drop_pins()
 {
   ldout(cct, 10) << __func__ << dendl;
   std::set<InodeRef> to_be_put; //this set will be deconstructed item by item when exit
-  ceph::unordered_map<vinodeno_t, Inode*>::iterator next;
-  for (ceph::unordered_map<vinodeno_t, Inode*>::iterator it = inode_map.begin();
-       it != inode_map.end();
-       it = next) {
+  std::unordered_map<vinodeno_t, Inode*>::iterator next;
+  for (auto it = inode_map.begin(); it != inode_map.end(); it = next) {
     Inode *in = it->second;
     next = it;
     ++next;
@@ -13480,7 +13472,7 @@ Inode *Client::ll_get_inode(ino_t ino)
   std::scoped_lock lock(client_lock);
 
   vinodeno_t vino = _map_faked_ino(ino);
-  unordered_map<vinodeno_t,Inode*>::iterator p = inode_map.find(vino);
+  auto p = inode_map.find(vino);
   if (p == inode_map.end())
     return NULL;
   Inode *in = p->second;
@@ -13499,7 +13491,7 @@ Inode *Client::ll_get_inode(vinodeno_t vino)
 
   std::scoped_lock lock(client_lock);
 
-  unordered_map<vinodeno_t,Inode*>::iterator p = inode_map.find(vino);
+  auto p = inode_map.find(vino);
   if (p == inode_map.end())
     return NULL;
   Inode *in = p->second;
index 0b96be0c6aaff27a6fcecfa0a5b0c47e9e402f7c..a3364b5327e96dbaf8f584c73d355ac1ab450ad2 100644 (file)
@@ -28,8 +28,6 @@
 #include "include/interval_set.h"
 #include "include/lru.h"
 #include "include/types.h"
-#include "include/unordered_map.h"
-#include "include/unordered_set.h"
 #include "include/cephfs/metrics/Types.h"
 #include "mds/mdstypes.h"
 #include "mds/MDSAuthCaps.h"
@@ -50,6 +48,8 @@
 #include <set>
 #include <string>
 #include <thread>
+#include <unordered_map>
+#include <unordered_set>
 
 using std::set;
 using std::map;
@@ -1876,16 +1876,16 @@ private:
 
   // file handles, etc.
   interval_set<int> free_fd_set;  // unused fds
-  ceph::unordered_map<int, Fh*> fd_map;
+  std::unordered_map<int, Fh*> fd_map;
   set<Fh*> ll_unclosed_fh_set;
-  ceph::unordered_set<dir_result_t*> opened_dirs;
+  std::unordered_set<dir_result_t*> opened_dirs;
   uint64_t fd_gen = 1;
 
   bool   mount_aborted = false;
   bool   blocklisted = false;
 
-  ceph::unordered_map<vinodeno_t, Inode*> inode_map;
-  ceph::unordered_map<ino_t, vinodeno_t> faked_ino_map;
+  std::unordered_map<vinodeno_t, Inode*> inode_map;
+  std::unordered_map<ino_t, vinodeno_t> faked_ino_map;
   interval_set<ino_t> free_faked_inos;
   ino_t last_used_faked_ino;
   ino_t last_used_faked_root;
@@ -1903,7 +1903,7 @@ private:
 
   xlist<Inode*> delayed_list;
   int num_flushing_caps = 0;
-  ceph::unordered_map<inodeno_t,SnapRealm*> snap_realms;
+  std::unordered_map<inodeno_t, SnapRealm*> snap_realms;
   std::map<std::string, std::string> metadata;
 
   ceph::coarse_mono_time last_auto_reconnect;
index f98782e4392d2f3e33168ec5b868836b98a97392..80eeafbbf4cb460ef813d2fdb621d932e67f47ab 100644 (file)
@@ -2,6 +2,7 @@
 #define CEPH_CLIENT_DIR_H
 
 #include <string>
+#include <unordered_map>
 #include <vector>
 
 class Dentry;
@@ -10,7 +11,7 @@ struct Inode;
 class Dir {
  public:
   Inode    *parent_inode;  // my inode
-  ceph::unordered_map<std::string, Dentry*> dentries;
+  std::unordered_map<std::string, Dentry*> dentries;
   unsigned num_null_dentries = 0;
 
   std::vector<Dentry*> readdir_cache;
index 6b315d2dee34a3d7ea3f22e2551778280e841b86..1160b2dd7dea575b1a0033474292e5aef966a30e 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <iostream>
 #include <sstream>
+#include <unordered_map>
 
 
 #include "common/config.h"
@@ -1014,12 +1015,12 @@ int SyntheticClient::play_trace(Trace& t, string& prefix, bool metadata_only)
 
   utime_t start = ceph_clock_now();
 
-  ceph::unordered_map<int64_t, int64_t> open_files;
-  ceph::unordered_map<int64_t, dir_result_t*> open_dirs;
+  std::unordered_map<int64_t, int64_t> open_files;
+  std::unordered_map<int64_t, dir_result_t*> open_dirs;
 
-  ceph::unordered_map<int64_t, Fh*> ll_files;
-  ceph::unordered_map<int64_t, dir_result_t*> ll_dirs;
-  ceph::unordered_map<uint64_t, int64_t> ll_inos;
+  std::unordered_map<int64_t, Fh*> ll_files;
+  std::unordered_map<int64_t, dir_result_t*> ll_dirs;
+  std::unordered_map<uint64_t, int64_t> ll_inos;
 
   Inode *i1, *i2;
 
@@ -1514,27 +1515,19 @@ int SyntheticClient::play_trace(Trace& t, string& prefix, bool metadata_only)
   dout(10) << "trace finished on line " << t.get_line() << dendl;
 
   // close open files
-  for (ceph::unordered_map<int64_t, int64_t>::iterator fi = open_files.begin();
-       fi != open_files.end();
-       ++fi) {
+  for (auto fi = open_files.begin(); fi != open_files.end(); ++fi) {
     dout(1) << "leftover close " << fi->second << dendl;
     if (fi->second > 0) client->close(fi->second);
   }
-  for (ceph::unordered_map<int64_t, dir_result_t*>::iterator fi = open_dirs.begin();
-       fi != open_dirs.end();
-       ++fi) {
+  for (auto fi = open_dirs.begin(); fi != open_dirs.end(); ++fi) {
     dout(1) << "leftover closedir " << fi->second << dendl;
     if (fi->second != 0) client->closedir(fi->second);
   }
-  for (ceph::unordered_map<int64_t,Fh*>::iterator fi = ll_files.begin();
-       fi != ll_files.end();
-       ++fi) {
+  for (auto fi = ll_files.begin(); fi != ll_files.end(); ++fi) {
     dout(1) << "leftover ll_release " << fi->second << dendl;
     if (fi->second) client->ll_release(fi->second);
   }
-  for (ceph::unordered_map<int64_t,dir_result_t*>::iterator fi = ll_dirs.begin();
-       fi != ll_dirs.end();
-       ++fi) {
+  for (auto fi = ll_dirs.begin(); fi != ll_dirs.end(); ++fi) {
     dout(1) << "leftover ll_releasedir " << fi->second << dendl;
     if (fi->second) client->ll_releasedir(fi->second);
   }
@@ -1594,8 +1587,8 @@ int SyntheticClient::full_walk(string& basedir)
   frag_info_t empty;
   statq.push_back(empty);
 
-  ceph::unordered_map<inodeno_t, int> nlink;
-  ceph::unordered_map<inodeno_t, int> nlink_seen;
+  std::unordered_map<inodeno_t, int> nlink;
+  std::unordered_map<inodeno_t, int> nlink_seen;
 
   UserPerm perms = client->pick_my_perms();
   while (!dirq.empty()) {
@@ -1674,7 +1667,7 @@ int SyntheticClient::full_walk(string& basedir)
     }
   }
 
-  for (ceph::unordered_map<inodeno_t,int>::iterator p = nlink.begin(); p != nlink.end(); ++p) {
+  for (auto p = nlink.begin(); p != nlink.end(); ++p) {
     if (nlink_seen[p->first] != p->second)
       dout(0) << p->first << " nlink " << p->second << " != " << nlink_seen[p->first] << "seen" << dendl;
   }
index 1b86af94965ea780284264aa29adfe8e669d8583..de6422c7c50b65856757ba8bdfce39b67f50c008 100644 (file)
@@ -46,6 +46,8 @@
 #include "fuse_ll.h"
 #include <fuse_lowlevel.h>
 
+#include <unordered_map>
+
 #define dout_context g_ceph_context
 
 #define FINO_INO(x) ((x) & ((1ull<<48)-1ull))
  * reserved for CEPH_SNAPDIR.
  */
 struct ceph_fuse_fake_inode_stag {
-  ceph::unordered_map<uint64_t,int> snap_stag_map;  // <snapid, stagid>
-  ceph::unordered_map<int, uint64_t> stag_snap_map; // <stagid, snapid>
+  std::unordered_map<uint64_t, int> snap_stag_map;  // <snapid, stagid>
+  std::unordered_map<int, uint64_t> stag_snap_map; // <stagid, snapid>
   int last_stag = 1;
 };
 
 using namespace std;
 
-static const ceph::unordered_map<int,int> cephfs_errno_to_system_errno = {
+static const std::unordered_map<int, int> cephfs_errno_to_system_errno = {
   {EBLOCKLISTED,    ESHUTDOWN},
   {EPERM,           EPERM},
   {ESTALE,          ESTALE},
@@ -182,7 +184,7 @@ public:
   ceph::mutex stag_lock = ceph::make_mutex("fuse_ll.cc stag_lock");
 
   // a map of <ceph ino, fino stag/snapid map>
-  ceph::unordered_map<uint64_t, struct ceph_fuse_fake_inode_stag> g_fino_maps;
+  std::unordered_map<uint64_t, struct ceph_fuse_fake_inode_stag> g_fino_maps;
 
   pthread_key_t fuse_req_key = 0;
   void set_fuse_req(fuse_req_t);
index 093b69cb193d31685633c7fada12069a05114ccc..17c19b6ab0d1943c5b22fae009c2b7f7ac52c09c 100644 (file)
@@ -4,6 +4,8 @@
 
 #include "include/types.h"
 
+#include <unordered_map>
+
 struct cls_2pc_reservation
 {
   using id_t = uint32_t;
@@ -50,7 +52,7 @@ struct cls_2pc_reservation
 };
 WRITE_CLASS_ENCODER(cls_2pc_reservation)
 
-using cls_2pc_reservations = ceph::unordered_map<cls_2pc_reservation::id_t, cls_2pc_reservation>;
+using cls_2pc_reservations = std::unordered_map<cls_2pc_reservation::id_t, cls_2pc_reservation>;
 
 struct cls_2pc_urgent_data
 {
index 08e2eca1c6afef5b95e89ceed3286a47c941a6e2..2b77f77e01fe55f79cd6614e24879027e5b16ae9 100644 (file)
@@ -18,7 +18,6 @@
 #include <fmt/format.h>
 
 #include "include/types.h" // for version_t
-#include "include/unordered_set.h"
 #include "include/utime.h"
 #include "include/utime_fmt.h"
 #include "msg/msg_fmt.h"
@@ -32,6 +31,7 @@
 #include <list>
 #include <map>
 #include <string>
+#include <unordered_set>
 
 namespace ceph {
   class Formatter;
@@ -161,7 +161,7 @@ struct LogSummary {
   // channel -> [(seq#, entry), ...]
   std::map<std::string,std::list<std::pair<uint64_t,LogEntry>>> tail_by_channel;
   uint64_t seq = 0;
-  ceph::unordered_set<LogEntryKey> keys;
+  std::unordered_set<LogEntryKey> keys;
 
   // ---- quincy+ ----
   LRUSet<LogEntryKey> recent_keys;
index cc3695e46c270b47a3625613b5263b0356059e61..f30dc08e6d17c692712d3c83b3c429c8ab522a39 100644 (file)
@@ -31,7 +31,6 @@ struct ThreadPool {
 #include <vector>
 
 #include "common/ceph_mutex.h"
-#include "include/unordered_map.h"
 #include "common/config_obs.h"
 #include "common/HeartbeatMap.h"
 #include "common/Thread.h"
@@ -556,8 +555,7 @@ protected:
     int result = 0;
     {
       std::lock_guard locker(m_lock);
-      ceph::unordered_map<Context *, int>::iterator it =
-        m_context_results.find(ctx);
+      auto it = m_context_results.find(ctx);
       if (it != m_context_results.end()) {
         result = it->second;
         m_context_results.erase(it);
@@ -567,7 +565,7 @@ protected:
   }
 private:
   ceph::mutex m_lock = ceph::make_mutex("ContextWQ::m_lock");
-  ceph::unordered_map<Context*, int> m_context_results;
+  std::unordered_map<Context*, int> m_context_results;
 };
 
 class ShardedThreadPool {
index 55e2f5e3f0d6816c86454dc33307f8e14f23732d..81c1f77609668c6eae314ed156df9cce9d61d0d2 100644 (file)
 #include "common/ceph_context.h"
 #include "common/dout.h"
 #include "common/valgrind.h"
-#include "include/unordered_map.h"
 
 #include <algorithm> // for std::for_each()
 #include <bitset>
 #include <map>
 #include <string>
 #include <vector>
+#include <unordered_map>
 
 /******* Constants **********/
 #define lockdep_dout(v) lsubdout(g_lockdep_ceph_ctx, lockdep, v)
@@ -41,12 +41,12 @@ struct lockdep_stopper_t {
 static pthread_mutex_t lockdep_mutex = PTHREAD_MUTEX_INITIALIZER;
 static CephContext *g_lockdep_ceph_ctx = NULL;
 static lockdep_stopper_t lockdep_stopper;
-static ceph::unordered_map<std::string, int> lock_ids;
+static std::unordered_map<std::string, int> lock_ids;
 static std::map<int, std::string> lock_names;
 static std::map<int, int> lock_refs;
 static constexpr size_t MAX_LOCKS = 128 * 1024;   // increase me as needed
 static std::bitset<MAX_LOCKS> free_ids; // bit set = free
-static ceph::unordered_map<pthread_t, std::map<int,ceph::BackTrace*> > held;
+static std::unordered_map<pthread_t, std::map<int, ceph::BackTrace*>> held;
 static constexpr size_t NR_LOCKS = 4096; // the initial number of locks
 static std::vector<std::bitset<MAX_LOCKS>> follows(NR_LOCKS); // follows[a][b] means b taken after a
 static std::vector<std::map<int,ceph::BackTrace *>> follows_bt(NR_LOCKS);
@@ -165,7 +165,7 @@ static int _lockdep_register(const char *name)
 
   if (!g_lockdep)
     return id;
-  ceph::unordered_map<std::string, int>::iterator p = lock_ids.find(name);
+  auto p = lock_ids.find(name);
   if (p == lock_ids.end()) {
     id = lockdep_get_free_id();
     if (id < 0) {
index 2735692dcc8061040423420762384a8c0473458b..f20a930f6abb0b34c51b8e644377086a1da77cd2 100644 (file)
@@ -25,7 +25,8 @@
 #include "common/ceph_mutex.h"
 #include "common/ceph_context.h"
 #include "common/dout.h"
-#include "include/unordered_map.h"
+
+#include <unordered_map>
 
 template <class K, class V>
 class SharedLRU {
@@ -46,7 +47,7 @@ public:
 private:
   using C = std::less<K>;
   using H = std::hash<K>;
-  ceph::unordered_map<K, typename std::list<std::pair<K, VPtr> >::iterator, H> contents;
+  std::unordered_map<K, typename std::list<std::pair<K, VPtr>>::iterator, H> contents;
   std::list<std::pair<K, VPtr> > lru;
 
   std::map<K, std::pair<WeakVPtr, V*>, C> weak_refs;
index 022f4c4f61c8ed6f7995b35c3a8019dc667ba6d6..b7fdf8067995d881ca60dc84894ca57c7a007816 100644 (file)
@@ -24,7 +24,8 @@
 #include "include/int_types.h"
 #include "include/types.h"
 #include "include/fs_types.h"
-#include "include/unordered_map.h"
+
+#include <unordered_map>
 
 // We're only converting errors defined in errno.h, not standard Windows
 // system error codes that are usually retrievied using GetLastErrorCode().
@@ -602,4 +603,4 @@ std::string win32_lasterror_str()
 {
   DWORD err = ::GetLastError();
   return win32_strerror(err);
-}
\ No newline at end of file
+}
index d970d28b9944156cbe3fbb54d8596e36250f49e7..d5fcf77d66030d9c6548a85a349843517e050f4e 100644 (file)
 #include <string_view>
 #include <tuple>
 #include <optional>
+#include <unordered_map>
+#include <unordered_set>
+
 #include <boost/container/small_vector.hpp>
 #include <boost/optional/optional_io.hpp>
 #include <boost/tuple/tuple.hpp>
 
-#include "include/unordered_map.h"
-#include "include/unordered_set.h"
 #include "common/ceph_time.h"
 
 #include "include/int_types.h"
@@ -586,16 +587,16 @@ inline void encode(const std::multimap<T,U,Comp,Alloc>& m, bufferlist& bl);
 template<class T, class U, class Comp, class Alloc>
 inline void decode(std::multimap<T,U,Comp,Alloc>& m, bufferlist::const_iterator& p);
 template<class T, class U, class Hash, class Pred, class Alloc>
-inline void encode(const unordered_map<T,U,Hash,Pred,Alloc>& m, bufferlist& bl,
+inline void encode(const std::unordered_map<T,U,Hash,Pred,Alloc>& m, bufferlist& bl,
                   uint64_t features);
 template<class T, class U, class Hash, class Pred, class Alloc>
-inline void encode(const unordered_map<T,U,Hash,Pred,Alloc>& m, bufferlist& bl);
+inline void encode(const std::unordered_map<T,U,Hash,Pred,Alloc>& m, bufferlist& bl);
 template<class T, class U, class Hash, class Pred, class Alloc>
-inline void decode(unordered_map<T,U,Hash,Pred,Alloc>& m, bufferlist::const_iterator& p);
+inline void decode(std::unordered_map<T,U,Hash,Pred,Alloc>& m, bufferlist::const_iterator& p);
 template<class T, class Hash, class Pred, class Alloc>
-inline void encode(const ceph::unordered_set<T,Hash,Pred,Alloc>& m, bufferlist& bl);
+inline void encode(const std::unordered_set<T,Hash,Pred,Alloc>& m, bufferlist& bl);
 template<class T, class Hash, class Pred, class Alloc>
-inline void decode(ceph::unordered_set<T,Hash,Pred,Alloc>& m, bufferlist::const_iterator& p);
+inline void decode(std::unordered_set<T,Hash,Pred,Alloc>& m, bufferlist::const_iterator& p);
 template<class T, class Alloc>
 inline void encode(const std::deque<T,Alloc>& ls, bufferlist& bl, uint64_t features);
 template<class T, class Alloc>
@@ -1299,9 +1300,9 @@ inline void decode(std::multimap<T,U,Comp,Alloc>& m, bufferlist::const_iterator&
   }
 }
 
-// ceph::unordered_map
+// std::unordered_map
 template<class T, class U, class Hash, class Pred, class Alloc>
-inline void encode(const unordered_map<T,U,Hash,Pred,Alloc>& m, bufferlist& bl,
+inline void encode(const std::unordered_map<T,U,Hash,Pred,Alloc>& m, bufferlist& bl,
                   uint64_t features)
 {
   __u32 n = (__u32)(m.size());
@@ -1312,7 +1313,7 @@ inline void encode(const unordered_map<T,U,Hash,Pred,Alloc>& m, bufferlist& bl,
   }
 }
 template<class T, class U, class Hash, class Pred, class Alloc>
-inline void encode(const unordered_map<T,U,Hash,Pred,Alloc>& m, bufferlist& bl)
+inline void encode(const std::unordered_map<T,U,Hash,Pred,Alloc>& m, bufferlist& bl)
 {
   __u32 n = (__u32)(m.size());
   encode(n, bl);
@@ -1322,7 +1323,7 @@ inline void encode(const unordered_map<T,U,Hash,Pred,Alloc>& m, bufferlist& bl)
   }
 }
 template<class T, class U, class Hash, class Pred, class Alloc>
-inline void decode(unordered_map<T,U,Hash,Pred,Alloc>& m, bufferlist::const_iterator& p)
+inline void decode(std::unordered_map<T,U,Hash,Pred,Alloc>& m, bufferlist::const_iterator& p)
 {
   __u32 n;
   decode(n, p);
@@ -1335,7 +1336,7 @@ inline void decode(unordered_map<T,U,Hash,Pred,Alloc>& m, bufferlist::const_iter
 }
 
 template <std::move_constructible T, std::move_constructible U, class Hash, class Pred, class Alloc>
-inline void decode(unordered_map<T, U, Hash, Pred, Alloc>& m, bufferlist::const_iterator& p)
+inline void decode(std::unordered_map<T, U, Hash, Pred, Alloc>& m, bufferlist::const_iterator& p)
 {
   __u32 n;
   decode(n, p);
@@ -1349,9 +1350,9 @@ inline void decode(unordered_map<T, U, Hash, Pred, Alloc>& m, bufferlist::const_
   }
 }
 
-// ceph::unordered_set
+// std::unordered_set
 template<class T, class Hash, class Pred, class Alloc>
-inline void encode(const ceph::unordered_set<T,Hash,Pred,Alloc>& m, bufferlist& bl)
+inline void encode(const std::unordered_set<T,Hash,Pred,Alloc>& m, bufferlist& bl)
 {
   __u32 n = (__u32)(m.size());
   encode(n, bl);
@@ -1359,7 +1360,7 @@ inline void encode(const ceph::unordered_set<T,Hash,Pred,Alloc>& m, bufferlist&
     encode(*p, bl);
 }
 template<class T, class Hash, class Pred, class Alloc>
-inline void decode(ceph::unordered_set<T,Hash,Pred,Alloc>& m, bufferlist::const_iterator& p)
+inline void decode(std::unordered_set<T,Hash,Pred,Alloc>& m, bufferlist::const_iterator& p)
 {
   __u32 n;
   decode(n, p);
index 4e6001d09e609780f01317ac3e563e887703972a..211bd1d2237978ccd7fff04f9b20870fedb0d8fd 100644 (file)
@@ -27,7 +27,6 @@
 #include <fmt/format.h>
 
 #include "include/rados.h"
-#include "include/unordered_map.h"
 #include "common/Formatter.h"
 
 #include "hash.h"
index 25ce11190cc2fd8b9ab27966b7e897bb584dba45..d818e7426a0faaf7b5848aceb37e8fa6439a4353 100644 (file)
@@ -46,9 +46,6 @@ extern "C" {
 #include <ostream>
 #include <iomanip>
 
-
-#include "include/unordered_map.h"
-
 #include "object.h"
 #include "intarith.h"
 
@@ -296,8 +293,8 @@ inline std::ostream& operator<<(std::ostream& out, const boost::container::flat_
 /*
  * comparators for stl containers
  */
-// for ceph::unordered_map:
-//   ceph::unordered_map<const char*, long, hash<const char*>, eqstr> vals;
+// for std::unordered_map:
+//   std::unordered_map<const char*, long, hash<const char*>, eqstr> vals;
 struct eqstr
 {
   bool operator()(const char* s1, const char* s2) const
diff --git a/src/include/unordered_map.h b/src/include/unordered_map.h
deleted file mode 100644 (file)
index aee5f5a..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef CEPH_UNORDERED_MAP_H
-#define CEPH_UNORDERED_MAP_H
-
-#include <unordered_map>
-
-namespace ceph {
-  using std::unordered_map;
-  using std::unordered_multimap;
-}
-
-#endif
diff --git a/src/include/unordered_set.h b/src/include/unordered_set.h
deleted file mode 100644 (file)
index e30e179..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef CEPH_UNORDERED_SET_H
-#define CEPH_UNORDERED_SET_H
-
-#include <unordered_set>
-
-namespace ceph {
-  using std::unordered_set;
-}
-
-#endif
index 169204c1385bcfd312e7b5c16132c5634b92743b..ad9246605446f16df55bb4357437e205977d06ac 100644 (file)
@@ -5,10 +5,11 @@
 #define CEPH_LIBRBD_CACHE_OBJECT_CACHER_WRITEBACK_H
 
 #include "common/snap_types.h"
-#include "include/unordered_map.h"
 #include "osd/osd_types.h"
 #include "osdc/WritebackHandler.h"
+
 #include <queue>
+#include <unordered_map>
 
 class Context;
 
@@ -69,7 +70,7 @@ private:
   ceph_tid_t m_tid;
   ceph::mutex& m_lock;
   librbd::ImageCtx *m_ictx;
-  ceph::unordered_map<std::string, std::queue<write_result_d*> > m_writes;
+  std::unordered_map<std::string, std::queue<write_result_d*>> m_writes;
   friend class C_OrderedWrite;
 };
 
index 04427ad8be8ead820cf23ff480d547e56cb6c99e..6e1797de4646085a39414e7e241bf5ae81d4594a 100644 (file)
@@ -24,9 +24,7 @@
 #include "CDentry.h"
 #include "CDir.h"
 
-#include "include/unordered_set.h"
-
-using ceph::unordered_set;
+#include <unordered_set>
 
 class CDir;
 class CInode;
@@ -87,7 +85,7 @@ class LogSegment {
   interval_set<inodeno_t> purging_inodes;
   MDSContext* purged_cb = nullptr;
 
-  std::map<int, ceph::unordered_set<version_t> > pending_commit_tids;  // mdstable
+  std::map<int, std::unordered_set<version_t>> pending_commit_tids;  // mdstable
   std::set<metareqid_t> uncommitted_leaders;
   std::set<metareqid_t> uncommitted_peers;
   std::set<dirfrag_t> uncommitted_fragments;
index 1b4c7ad3992d4114774ca5ab28a6002f5d5177e5..5e2af9c2659eddc7a16f81b1985df932261bcb3b 100644 (file)
@@ -18,6 +18,7 @@
 #include <chrono>
 #include <string_view>
 #include <thread>
+#include <unordered_map>
 
 #include "common/DecayCounter.h"
 #include "common/MemoryModel.h"
@@ -1293,7 +1294,7 @@ private:
   void repair_dirfrag_stats_work(const MDRequestRef& mdr);
   void rdlock_dirfrags_stats_work(const MDRequestRef& mdr);
 
-  ceph::unordered_map<inodeno_t,CInode*> inode_map;  // map of head inodes by ino
+  std::unordered_map<inodeno_t, CInode*> inode_map;  // map of head inodes by ino
   std::map<vinodeno_t, CInode*> snap_inode_map;  // map of snap inodes by ino
   CInode *root = nullptr; // root inode
   CInode *myin = nullptr; // .ceph/mds%d dir
@@ -1315,7 +1316,7 @@ private:
   std::map<CInode*,std::list<std::pair<CDir*,CDir*> > > projected_subtree_renames;  // renamed ino -> target dir
 
   // -- requests --
-  ceph::unordered_map<metareqid_t, MDRequestRef> active_requests;
+  std::unordered_map<metareqid_t, MDRequestRef> active_requests;
 
   // -- recovery --
   std::set<mds_rank_t> recovery_set;
index adf5c53d06b4b9cff7c5d6d9520c92eb8bffe5fc..7872733339dd107e7ab675c443e62a92ba1554a3 100644 (file)
@@ -16,6 +16,7 @@
 #define CEPH_MDS_MUTATION_H
 
 #include <optional>
+#include <unordered_map>
 
 #include "include/interval_set.h"
 #include "include/elist.h"
@@ -249,7 +250,7 @@ public:
   // flag mutation as peer
   mds_rank_t peer_to_mds = MDS_RANK_NONE;  // this is a peer request if >= 0.
 
-  ceph::unordered_map<MDSCacheObject*, ObjectState> object_states;
+  std::unordered_map<MDSCacheObject*, ObjectState> object_states;
   int num_pins = 0;
   int num_auth_pins = 0;
   int num_remote_auth_pins = 0;
index 0443038813f477efc5f8f02ef699a9d4b687dab3..cc84a1866ef26f62080734431878cb5dab6993ec 100644 (file)
@@ -1156,7 +1156,7 @@ void ScrubStack::handle_scrub_stats(const cref_t<MMDSScrubStats> &m)
     bool any_finished = false;
     bool any_repaired = false;
     std::set<std::string> scrubbing_tags;
-    std::unordered_map<std::string, unordered_map<int, std::vector<_inodeno_t>>> uninline_failed_meta_info;
+    std::unordered_map<std::string, std::unordered_map<int, std::vector<_inodeno_t>>> uninline_failed_meta_info;
     std::unordered_map<_inodeno_t, std::string> paths;
     std::unordered_map<std::string, std::vector<uint64_t>> counters;
 
index f1d7b9d1f0e2e9728f62ab7dcbfd92a351ba4307..b9d4ef8e08fb67b935cea6f4b8cc26a3140856cf 100644 (file)
@@ -81,9 +81,7 @@ void SessionMap::register_perfcounters()
 void SessionMap::dump()
 {
   dout(10) << "dump" << dendl;
-  for (ceph::unordered_map<entity_name_t,Session*>::iterator p = session_map.begin();
-       p != session_map.end();
-       ++p) 
+  for (auto p = session_map.begin(); p != session_map.end(); ++p) 
     dout(10) << p->first << " " << p->second
             << " state " << p->second->get_state_name()
             << " completed " << p->second->info.completed_requests
@@ -256,8 +254,7 @@ void SessionMap::_load_finish(
   } else {
     // I/O is complete.  Update `by_state`
     dout(10) << __func__ << ": omap load complete" << dendl;
-    for (ceph::unordered_map<entity_name_t, Session*>::iterator i = session_map.begin();
-         i != session_map.end(); ++i) {
+    for (auto i = session_map.begin(); i != session_map.end(); ++i) {
       Session *s = i->second;
       auto by_state_entry = by_state.find(s->get_state());
       if (by_state_entry == by_state.end())
@@ -349,8 +346,7 @@ void SessionMap::_load_legacy_finish(int r, bufferlist &bl)
 
   // Mark all sessions dirty, so that on next save() we will write
   // a complete OMAP version of the data loaded from the legacy format
-  for (ceph::unordered_map<entity_name_t, Session*>::iterator i = session_map.begin();
-       i != session_map.end(); ++i) {
+  for (auto i = session_map.begin(); i != session_map.end(); ++i) {
     // Don't use mark_dirty because on this occasion we want to ignore the
     // keys_per_op limit and do one big write (upgrade must be atomic)
     dirty_sessions.insert(i->first);
@@ -503,8 +499,7 @@ void SessionMap::decode_legacy(bufferlist::const_iterator &p)
   SessionMapStore::decode_legacy(p);
 
   // Update `by_state`
-  for (ceph::unordered_map<entity_name_t, Session*>::iterator i = session_map.begin();
-       i != session_map.end(); ++i) {
+  for (auto i = session_map.begin(); i != session_map.end(); ++i) {
     Session *s = i->second;
     auto by_state_entry = by_state.find(s->get_state());
     if (by_state_entry == by_state.end())
@@ -669,9 +664,7 @@ void SessionMap::wipe()
 
 void SessionMap::wipe_ino_prealloc()
 {
-  for (ceph::unordered_map<entity_name_t,Session*>::iterator p = session_map.begin(); 
-       p != session_map.end(); 
-       ++p) {
+  for (auto p = session_map.begin();  p != session_map.end();  ++p) {
     p->second->pending_prealloc_inos.clear();
     p->second->free_prealloc_inos.clear();
     p->second->delegated_inos.clear();
index bfe7dcd48950c66744d5fd1bf21076b6cfc59213..d5d7bbe2b51ea43b6b896bd042fbacfd842cb633 100644 (file)
@@ -16,8 +16,7 @@
 #define CEPH_MDS_SESSIONMAP_H
 
 #include <set>
-
-#include "include/unordered_map.h"
+#include <unordered_map>
 
 #include "include/Context.h"
 #include "include/xlist.h"
@@ -587,7 +586,7 @@ public:
 
 protected:
   version_t version = 0;
-  ceph::unordered_map<entity_name_t, Session*> session_map;
+  std::unordered_map<entity_name_t, Session*> session_map;
   PerfCounters *logger =nullptr;
 
   // total request load avg
@@ -673,7 +672,7 @@ public:
            session_map_entry-> second : nullptr);
   }
   const Session* get_session(entity_name_t w) const {
-    ceph::unordered_map<entity_name_t, Session*>::const_iterator p = session_map.find(w);
+    auto p = session_map.find(w);
     if (p == session_map.end()) {
       return NULL;
     } else {
index e5f679b3343364ad8c8e05d38185a3b89dfa8ebb..e4a738ee37845f7a4536d6639b837e9e1ceb7133 100644 (file)
@@ -319,14 +319,12 @@ void LogSegment::try_to_expire(MDSRank *mds, MDSGatherBuilder &gather_bld, int o
   touched_sessions.clear();
 
   // pending commit atids
-  for (map<int, ceph::unordered_set<version_t> >::iterator p = pending_commit_tids.begin();
+  for (auto p = pending_commit_tids.begin();
        p != pending_commit_tids.end();
        ++p) {
     MDSTableClient *client = mds->get_table_client(p->first);
     ceph_assert(client);
-    for (ceph::unordered_set<version_t>::iterator q = p->second.begin();
-        q != p->second.end();
-        ++q) {
+    for (auto q = p->second.begin(); q != p->second.end(); ++q) {
       dout(10) << "try_to_expire " << get_mdstable_name(p->first) << " transaction " << *q 
               << " pending commit (not yet acked), waiting" << dendl;
       ceph_assert(!client->has_committed(*q));
index beb396115f3c381140588bb878c6c5a97b527b68..1da225ffb7e9f8a1c9684c8de9e81a6ea5daddaa 100644 (file)
@@ -19,6 +19,7 @@
 #include <map>
 #include <set>
 #include <string>
+#include <unordered_map>
 
 #include "common/ceph_mutex.h"
 #include "common/LogClient.h"
@@ -149,7 +150,7 @@ protected:
   std::set<ConnectionRef> daemon_connections;
 
   /// connections for osds
-  ceph::unordered_map<int,std::set<ConnectionRef>> osd_cons;
+  std::unordered_map<int, std::set<ConnectionRef>> osd_cons;
 
   ServiceMap pending_service_map;  // uncommitted
 
index e9858523a73a38606c6e71282c03b99344409d82..7afd8cc5c46848e7f9c3b4ea414a8d707a5fac83 100644 (file)
@@ -44,7 +44,7 @@ class LogMonitor : public PaxosService,
                    public md_config_obs_t {
 private:
   std::multimap<utime_t,LogEntry> pending_log;
-  unordered_set<LogEntryKey> pending_keys;
+  std::unordered_set<LogEntryKey> pending_keys;
 
   LogSummary summary;
 
index a97f81c36b5699156c23cf1be385c6955711ad88..1ee81ce011472b8cc3c2f4124123aee0551cd782 100644 (file)
@@ -5224,9 +5224,7 @@ void OSDMonitor::tick()
   }
 
   // expire blocklisted items?
-  for (ceph::unordered_map<entity_addr_t,utime_t>::iterator p = osdmap.blocklist.begin();
-       p != osdmap.blocklist.end();
-       ++p) {
+  for (auto p = osdmap.blocklist.begin(); p != osdmap.blocklist.end(); ++p) {
     if (p->second < now) {
       dout(10) << "expiring blocklist item " << p->first << " expired " << p->second << " < now " << now << dendl;
       pending_inc.old_blocklist.push_back(p->first);
@@ -5992,9 +5990,7 @@ bool OSDMonitor::preprocess_command(MonOpRequestRef op)
     if (f)
       f->open_array_section("blocklist");
 
-    for (ceph::unordered_map<entity_addr_t,utime_t>::iterator p = osdmap.blocklist.begin();
-        p != osdmap.blocklist.end();
-        ++p) {
+    for (auto p = osdmap.blocklist.begin(); p != osdmap.blocklist.end(); ++p) {
       if (f) {
        f->open_object_section("entry");
        f->dump_string("addr", p->first.get_legacy_str());
index 0a3227dec5d313d53e8a534ce2ae9f47f56b271e..69909e8f4113f7a04992b4108737f77a7643b5a3 100644 (file)
 
 #include <map>
 #include <optional>
+#include <unordered_map>
 
 #include "include/types.h"
 #include "include/xlist.h"
 #include "include/spinlock.h"
-#include "include/unordered_map.h"
-#include "include/unordered_set.h"
 
 #include "common/ceph_mutex.h"
 #include "common/Cond.h"
@@ -271,7 +270,7 @@ private:
    * NOTE: a Asyncconnection* with state CLOSED may still be in the map but is considered
    * invalid and can be replaced by anyone holding the msgr lock
    */
-  ceph::unordered_map<entity_addrvec_t, AsyncConnectionRef> conns;
+  std::unordered_map<entity_addrvec_t, AsyncConnectionRef> conns;
 
   /**
    * list of connection are in the process of accepting
index a36fd5fb7f9102c5f5e571ed542b8dab4c83f95e..3569765050c2dc113b3c95c5240297a809abd3b5 100644 (file)
@@ -22,6 +22,7 @@
 #include <list>
 #include <vector>
 #include <thread>
+#include <unordered_map>
 
 #include "common/ceph_context.h"
 #include "common/debug.h"
@@ -61,7 +62,7 @@ class RDMADispatcher {
    *
    * @param qp The qp needed to dead
    */
-  ceph::unordered_map<uint32_t, std::pair<QueuePair*, RDMAConnectedSocketImpl*> > qp_conns;
+  std::unordered_map<uint32_t, std::pair<QueuePair*, RDMAConnectedSocketImpl*> > qp_conns;
 
   /// if a queue pair is closed when transmit buffers are active
   /// on it, the transmit buffers never get returned via tx_cq.  To
index ba1e0aa4c25d7220716ba1e2460d3b39088882e3..6f65e2045cf6f889b942f01db5df5410de6d6f91 100644 (file)
@@ -2077,7 +2077,7 @@ BlueStore::OnodeRef BlueStore::OnodeSpace::lookup(const ghobject_t& oid)
 
   {
     std::lock_guard l(cache->lock);
-    ceph::unordered_map<ghobject_t,OnodeRef>::iterator p = onode_map.find(oid);
+    auto p = onode_map.find(oid);
     if (p == onode_map.end()) {
       ldout(cache->cct, 30) << __func__ << " " << oid << " miss" << dendl;
       cache->logger->inc(l_bluestore_onode_misses);
@@ -2122,9 +2122,8 @@ void BlueStore::OnodeSpace::rename(
   std::lock_guard l(cache->lock);
   ldout(cache->cct, 30) << __func__ << " " << old_oid << " -> " << new_oid
                        << dendl;
-  ceph::unordered_map<ghobject_t,OnodeRef>::iterator po, pn;
-  po = onode_map.find(old_oid);
-  pn = onode_map.find(new_oid);
+  auto po = onode_map.find(old_oid);
+  auto pn = onode_map.find(new_oid);
   ceph_assert(po != pn);
 
   ceph_assert(po != onode_map.end());
@@ -12147,7 +12146,7 @@ void BlueStore::_check_no_per_pg_or_pool_omap_alert()
 BlueStore::CollectionRef BlueStore::_get_collection(const coll_t& cid)
 {
   std::shared_lock l(coll_lock);
-  ceph::unordered_map<coll_t,CollectionRef>::iterator cp = coll_map.find(cid);
+  auto cp = coll_map.find(cid);
   if (cp == coll_map.end())
     return CollectionRef();
   return cp->second;
@@ -13261,9 +13260,7 @@ int BlueStore::list_collections(vector<coll_t>& ls)
 {
   std::shared_lock l(coll_lock);
   ls.reserve(coll_map.size());
-  for (ceph::unordered_map<coll_t, CollectionRef>::iterator p = coll_map.begin();
-       p != coll_map.end();
-       ++p)
+  for (auto p = coll_map.begin(); p != coll_map.end(); ++p)
     ls.push_back(p->first);
   return 0;
 }
index cb8b1426971112badb9b6f222e917ecf74ea130f..33b057e7eaad3c966b90aa0579e7e75a9e879976 100644 (file)
@@ -27,6 +27,7 @@
 #include <mutex>
 #include <queue>
 #include <shared_mutex> // for std::shared_lock
+#include <unordered_map>
 #include <condition_variable>
 
 #include <boost/intrusive/list.hpp>
@@ -42,7 +43,6 @@
 
 #include "include/ceph_assert.h"
 #include "include/interval_set.h"
-#include "include/unordered_map.h"
 #include "include/mempool.h"
 #include "include/hash.h"
 #include "common/bloom_filter.hpp"
index a069d429155a80f85bf3bcbc17d428e2962000f1..93c268884da2a2c20697c8aac010b93f35cccbf0 100644 (file)
@@ -409,7 +409,7 @@ KStore::OnodeRef KStore::OnodeHashLRU::lookup(const ghobject_t& oid)
 {
   std::lock_guard<std::mutex> l(lock);
   dout(30) << __func__ << dendl;
-  ceph::unordered_map<ghobject_t,OnodeRef>::iterator p = onode_map.find(oid);
+  auto p = onode_map.find(oid);
   if (p == onode_map.end()) {
     dout(30) << __func__ << " " << oid << " miss" << dendl;
     return OnodeRef();
@@ -432,9 +432,8 @@ void KStore::OnodeHashLRU::rename(const ghobject_t& old_oid,
 {
   std::lock_guard<std::mutex> l(lock);
   dout(30) << __func__ << " " << old_oid << " -> " << new_oid << dendl;
-  ceph::unordered_map<ghobject_t,OnodeRef>::iterator po, pn;
-  po = onode_map.find(old_oid);
-  pn = onode_map.find(new_oid);
+  auto po = onode_map.find(old_oid);
+  auto pn = onode_map.find(new_oid);
 
   ceph_assert(po != onode_map.end());
   if (pn != onode_map.end()) {
@@ -466,14 +465,14 @@ bool KStore::OnodeHashLRU::get_next(
     if (lru.empty()) {
       return false;
     }
-    ceph::unordered_map<ghobject_t,OnodeRef>::iterator p = onode_map.begin();
+    auto p = onode_map.begin();
     ceph_assert(p != onode_map.end());
     next->first = p->first;
     next->second = p->second;
     return true;
   }
 
-  ceph::unordered_map<ghobject_t,OnodeRef>::iterator p = onode_map.find(after);
+  auto p = onode_map.find(after);
   ceph_assert(p != onode_map.end()); // for now
   lru_list_t::iterator pi = lru.iterator_to(*p->second);
   ++pi;
@@ -1090,7 +1089,7 @@ int KStore::pool_statfs(uint64_t pool_id, struct store_statfs_t *buf,
 KStore::CollectionRef KStore::_get_collection(coll_t cid)
 {
   std::shared_lock l{coll_lock};
-  ceph::unordered_map<coll_t,CollectionRef>::iterator cp = coll_map.find(cid);
+  auto cp = coll_map.find(cid);
   if (cp == coll_map.end())
     return CollectionRef();
   return cp->second;
@@ -1386,9 +1385,7 @@ int KStore::getattrs(
 int KStore::list_collections(vector<coll_t>& ls)
 {
   std::shared_lock l{coll_lock};
-  for (ceph::unordered_map<coll_t, CollectionRef>::iterator p = coll_map.begin();
-       p != coll_map.end();
-       ++p)
+  for (auto p = coll_map.begin(); p != coll_map.end(); ++p)
     ls.push_back(p->first);
   return 0;
 }
index 05374e5ff8ddcb4f3205b2bae5e706d83b98578c..3aebd328df2b4cb0db6634238ecca92bc2d84c88 100644 (file)
 
 #include <atomic>
 #include <mutex>
+#include <unordered_map>
 #include <condition_variable>
 
 #include "include/ceph_assert.h"
-#include "include/unordered_map.h"
 #include "common/Finisher.h"
 #include "common/Throttle.h"
 #include "common/WorkQueue.h"
@@ -115,7 +115,7 @@ public:
        &Onode::lru_item> > lru_list_t;
 
     std::mutex lock;
-    ceph::unordered_map<ghobject_t,OnodeRef> onode_map;  ///< forward lookups
+    std::unordered_map<ghobject_t, OnodeRef> onode_map;  ///< forward lookups
     lru_list_t lru;                                      ///< lru
 
     OnodeHashLRU(CephContext* cct) : cct(cct) {}
@@ -325,7 +325,7 @@ private:
 
   /// rwlock to protect coll_map
   ceph::shared_mutex coll_lock = ceph::make_shared_mutex("KStore::coll_lock");
-  ceph::unordered_map<coll_t, CollectionRef> coll_map;
+  std::unordered_map<coll_t, CollectionRef> coll_map;
   std::map<coll_t,CollectionRef> new_coll_map;
 
   std::mutex nid_lock;
index f9d3bf0d8a28723e57251839b41d7e031d48504e..01ca4c3fa513ac328f3512e31db1f73ef662b040 100644 (file)
@@ -23,7 +23,6 @@
 
 #include "include/types.h"
 #include "include/stringify.h"
-#include "include/unordered_map.h"
 #include "common/errno.h"
 #include "MemStore.h"
 #include "include/compat.h"
@@ -248,7 +247,7 @@ objectstore_perf_stat_t MemStore::get_cur_stats()
 MemStore::CollectionRef MemStore::get_collection(const coll_t& cid)
 {
   std::shared_lock l{coll_lock};
-  ceph::unordered_map<coll_t,CollectionRef>::iterator cp = coll_map.find(cid);
+  auto cp = coll_map.find(cid);
   if (cp == coll_map.end())
     return CollectionRef();
   return cp->second;
@@ -403,9 +402,7 @@ int MemStore::list_collections(std::vector<coll_t>& ls)
 {
   dout(10) << __func__ << dendl;
   std::shared_lock l{coll_lock};
-  for (ceph::unordered_map<coll_t,CollectionRef>::iterator p = coll_map.begin();
-       p != coll_map.end();
-       ++p) {
+  for (auto p = coll_map.begin(); p != coll_map.end(); ++p) {
     ls.push_back(p->first);
   }
   return 0;
@@ -1373,7 +1370,7 @@ int MemStore::_destroy_collection(const coll_t& cid)
 {
   dout(10) << __func__ << " " << cid << dendl;
   std::lock_guard l{coll_lock};
-  ceph::unordered_map<coll_t,CollectionRef>::iterator cp = coll_map.find(cid);
+  auto cp = coll_map.find(cid);
   if (cp == coll_map.end())
     return -ENOENT;
   {
@@ -1502,7 +1499,7 @@ int MemStore::_merge_collection(const coll_t& cid, uint32_t bits, coll_t dest)
 
   {
     std::lock_guard l{coll_lock};
-    ceph::unordered_map<coll_t,CollectionRef>::iterator cp = coll_map.find(cid);
+    auto cp = coll_map.find(cid);
     ceph_assert(cp != coll_map.end());
     used_bytes -= cp->second->used_bytes();
     coll_map.erase(cp);
index 9621773598f99ceef83786e5c8b1d6ccc1b90c94..d9f04501b29523f82ada51b7edd1427cc5342d29 100644 (file)
 
 #include <atomic>
 #include <mutex>
+#include <unordered_map>
+
 #include <boost/intrusive_ptr.hpp>
 
-#include "include/unordered_map.h"
 #include "common/Finisher.h"
 #include "common/RefCountedObj.h"
 #include "os/ObjectStore.h"
@@ -93,7 +94,7 @@ public:
     int bits = 0;
     CephContext *cct;
     bool use_page_set;
-    ceph::unordered_map<ghobject_t, ObjectRef> object_hash;  ///< for lookup
+    std::unordered_map<ghobject_t, ObjectRef> object_hash;  ///< for lookup
     std::map<ghobject_t, ObjectRef> object_map;        ///< for iteration
     std::map<std::string,ceph::buffer::ptr> xattr;
     /// for object_{map,hash}
@@ -186,7 +187,7 @@ private:
   class OmapIteratorImpl;
 
 
-  ceph::unordered_map<coll_t, CollectionRef> coll_map;
+  std::unordered_map<coll_t, CollectionRef> coll_map;
   /// rwlock to protect coll_map
   ceph::shared_mutex coll_lock{
     ceph::make_shared_mutex("MemStore::coll_lock")};
index 03475d36fba8b15e041b58363f680e37aee5ee99..1152faeec03045e9053de43c314202ec6c0c2b91 100644 (file)
@@ -223,9 +223,7 @@ ostream& operator<<(ostream& out, const HitSet::Params& p) {
 void ExplicitHashHitSet::dump(Formatter *f) const {
   f->dump_unsigned("insert_count", count);
   f->open_array_section("hash_set");
-  for (ceph::unordered_set<uint32_t>::const_iterator p = hits.begin();
-       p != hits.end();
-       ++p)
+  for (auto p = hits.cbegin(); p != hits.cend(); ++p)
     f->dump_unsigned("hash", *p);
   f->close_section();
 }
@@ -233,9 +231,7 @@ void ExplicitHashHitSet::dump(Formatter *f) const {
 void ExplicitObjectHitSet::dump(Formatter *f) const {
   f->dump_unsigned("insert_count", count);
   f->open_array_section("set");
-  for (ceph::unordered_set<hobject_t>::const_iterator p = hits.begin();
-       p != hits.end();
-       ++p) {
+  for (auto p = hits.cbegin(); p != hits.cend(); ++p) {
     f->open_object_section("object");
     p->dump(f);
     f->close_section();
index dedc45ed471dd2dd398f34b74f649c4d55c5919d..0972075df4dd5edbdde699206c8208f055922394 100644 (file)
 #define CEPH_OSD_HITSET_H
 
 #include <string_view>
+#include <unordered_set>
 
 #include <boost/scoped_ptr.hpp>
 
 #include "include/encoding.h"
-#include "include/unordered_set.h"
 #include "common/bloom_filter.hpp"
 #include "common/hobject.h"
 
@@ -180,7 +180,7 @@ std::ostream& operator<<(std::ostream& out, const HitSet::Params& p);
  */
 class ExplicitHashHitSet : public HitSet::Impl {
   uint64_t count;
-  ceph::unordered_set<uint32_t> hits;
+  std::unordered_set<uint32_t> hits;
 public:
   class Params : public HitSet::Params::Impl {
   public:
@@ -251,7 +251,7 @@ WRITE_CLASS_ENCODER(ExplicitHashHitSet)
  */
 class ExplicitObjectHitSet : public HitSet::Impl {
   uint64_t count;
-  ceph::unordered_set<hobject_t> hits;
+  std::unordered_set<hobject_t> hits;
 public:
   class Params : public HitSet::Params::Impl {
   public:
index 0a4928fc20af6a26de8901562dd773f3ff942d9b..f338319699defcd1829a421634af30c874ca3b51 100644 (file)
@@ -45,8 +45,7 @@
 #include <map>
 #include <memory>
 #include <string>
-
-#include "include/unordered_map.h"
+#include <unordered_map>
 
 #include "common/intrusive_timer.h"
 #include "common/shared_cache.hpp"
index b759a42290cdacf7023a0b676b53f3ffe799c949..02813e226277e72cea763e5b7158f7e5198d1ffa 100644 (file)
@@ -16,7 +16,6 @@
  */
 
 #include "PGLog.h"
-#include "include/unordered_map.h"
 #include "common/ceph_context.h"
 
 using std::make_pair;
index 497805c1811bd5d3eef58f71b677bd68c983a6e3..4f2a17b1778e17842b7603e37d99dcc01362bf04 100644 (file)
@@ -22,6 +22,7 @@
 #include "osd_types.h"
 #include "os/ObjectStore.h"
 #include <list>
+#include <unordered_map>
 
 #ifdef WITH_SEASTAR
 #include <seastar/core/future.hh>
@@ -146,10 +147,10 @@ public:
    * plus some methods to manipulate it all.
    */
   struct IndexedLog : public pg_log_t {
-    mutable ceph::unordered_map<hobject_t,pg_log_entry_t*> objects;  // ptrs into log.  be careful!
-    mutable ceph::unordered_map<osd_reqid_t,pg_log_entry_t*> caller_ops;
-    mutable ceph::unordered_multimap<osd_reqid_t,pg_log_entry_t*> extra_caller_ops;
-    mutable ceph::unordered_map<osd_reqid_t,pg_log_dup_t*> dup_index;
+    mutable std::unordered_map<hobject_t, pg_log_entry_t*> objects;  // ptrs into log.  be careful!
+    mutable std::unordered_map<osd_reqid_t, pg_log_entry_t*> caller_ops;
+    mutable std::unordered_multimap<osd_reqid_t, pg_log_entry_t*> extra_caller_ops;
+    mutable std::unordered_map<osd_reqid_t, pg_log_dup_t*> dup_index;
 
     // recovery pointers
     std::list<pg_log_entry_t>::iterator complete_to; // not inclusive of referenced item
index e850f9a7cb0f38df43899c504d0ad16518e19781..7cf6d851e0e792899fe26f4bdda25888f670e841 100644 (file)
@@ -11,6 +11,8 @@
 
 #include "include/ceph_assert.h"
 
+#include <unordered_map>
+
 #define MAX_FLUSH_UNDER_LOCK 20  ///< max bh's we start writeback on
 #define BUFFER_MEMORY_WEIGHT CEPH_PAGE_SHIFT  // memory usage of BufferHead, count in (1<<n)
                                 /// while holding the lock
@@ -2463,12 +2465,11 @@ uint64_t ObjectCacher::release_all()
   ldout(cct, 10) << "release_all" << dendl;
   uint64_t unclean = 0;
 
-  vector<ceph::unordered_map<sobject_t, Object*> >::iterator i
-    = objects.begin();
+  auto i = objects.begin();
   while (i != objects.end()) {
-    ceph::unordered_map<sobject_t, Object*>::iterator p = i->begin();
+    auto p = i->begin();
     while (p != i->end()) {
-      ceph::unordered_map<sobject_t, Object*>::iterator n = p;
+      auto n = p;
       ++n;
 
       Object *ob = p->second;
@@ -2603,14 +2604,8 @@ void ObjectCacher::verify_stats() const
 
   loff_t clean = 0, zero = 0, dirty = 0, rx = 0, tx = 0, missing = 0,
     error = 0;
-  for (vector<ceph::unordered_map<sobject_t, Object*> >::const_iterator i
-        = objects.begin();
-       i != objects.end();
-       ++i) {
-    for (ceph::unordered_map<sobject_t, Object*>::const_iterator p
-          = i->begin();
-        p != i->end();
-        ++p) {
+  for (auto i = objects.cbegin(); i != objects.cend(); ++i) {
+    for (auto p = i->cbegin(); p != i->cend(); ++p) {
       Object *ob = p->second;
       for (map<loff_t, BufferHead*>::const_iterator q = ob->data.begin();
           q != ob->data.end();
index 68f796c32832c962fc1a5efb92f9f462e0562a71..535b52ed8dfd0c845d9d8042fa149c458b9ec2ff 100644 (file)
@@ -17,6 +17,8 @@
 #include "Objecter.h"
 #include "Striper.h"
 
+#include <unordered_map>
+
 class WritebackHandler;
 
 enum {
@@ -418,7 +420,7 @@ class ObjectCacher {
   void *flush_set_callback_arg;
 
   // indexed by pool_id
-  std::vector<ceph::unordered_map<sobject_t, Object*> > objects;
+  std::vector<std::unordered_map<sobject_t, Object*>> objects;
 
   std::list<Context*> waitfor_read;
 
index 14eeb73dac26b559ca4c50a34f45fa121416ebbb..dcf6a74ea509ba8ae322e6ea82e9435be39d9b94 100644 (file)
@@ -23,6 +23,8 @@
 #include <chrono>
 #include <fmt/format.h>
 
+#include <unordered_map>
+
 #define dout_subsys ceph_subsys_rgw_notification
 
 namespace rgw::notify {
@@ -49,8 +51,8 @@ struct persistency_tracker {
 };
 
 using queues_t = std::set<std::string>;
-using entries_persistency_tracker = ceph::unordered_map<std::string, persistency_tracker>;
-using queues_persistency_tracker = ceph::unordered_map<std::string, entries_persistency_tracker>;
+using entries_persistency_tracker = std::unordered_map<std::string, persistency_tracker>;
+using queues_persistency_tracker = std::unordered_map<std::string, entries_persistency_tracker>;
 using rgw::persistent_topic_counters::CountersManager;
 
 // use mmap/mprotect to allocate 128k coroutine stacks
index 98ef1722071c07ee7fc9875f6d29d0393bad0bf7..52c523f900816a9f5dce26d32d9359382dfb7e9d 100644 (file)
@@ -2,11 +2,11 @@
 // vim: ts=8 sw=2 smarttab
 
 #include <iostream>
+#include <unordered_set>
 #include <unistd.h>
 
 #include "gtest/gtest.h"
 #include "include/Context.h"
-#include "include/unordered_set.h"
 #include "global/global_init.h"
 #include "global/global_context.h"
 
@@ -14,7 +14,6 @@
 #include "tools/immutable_object_cache/CacheClient.h"
 #include "tools/immutable_object_cache/CacheServer.h"
 
-using ceph::unordered_set;
 using namespace ceph::immutable_obj_cache;
 
 class TestCommunication :public ::testing::Test {
@@ -28,7 +27,7 @@ public:
   std::atomic<uint64_t> m_send_request_index;
   std::atomic<uint64_t> m_recv_ack_index;
   WaitEvent m_wait_event;
-  unordered_set<std::string> m_hit_entry_set;
+  std::unordered_set<std::string> m_hit_entry_set;
 
   TestCommunication()
     : m_cache_server(nullptr), m_cache_client(nullptr),
index 14cc20c1622679a75d5d3a2910885d7d0650da34..1f5b2c657c748b889027befb73cddcc01ddef540 100644 (file)
@@ -318,7 +318,7 @@ int ObjectStoreImitator::queue_transactions(CollectionHandle &ch,
 ObjectStoreImitator::CollectionRef
 ObjectStoreImitator::_get_collection(const coll_t &cid) {
   std::shared_lock l(coll_lock);
-  ceph::unordered_map<coll_t, CollectionRef>::iterator cp = coll_map.find(cid);
+  auto cp = coll_map.find(cid);
   if (cp == coll_map.end())
     return CollectionRef();
   return cp->second;
@@ -939,7 +939,7 @@ int ObjectStoreImitator::_split_collection(CollectionRef &c, CollectionRef &d,
 ObjectStore::CollectionHandle
 ObjectStoreImitator::open_collection(const coll_t &cid) {
   std::shared_lock l(coll_lock);
-  ceph::unordered_map<coll_t, CollectionRef>::iterator cp = coll_map.find(cid);
+  auto cp = coll_map.find(cid);
   if (cp == coll_map.end())
     return CollectionRef();
   return cp->second;
@@ -996,9 +996,7 @@ int ObjectStoreImitator::set_collection_opts(CollectionHandle &ch,
 int ObjectStoreImitator::list_collections(std::vector<coll_t> &ls) {
   std::shared_lock l(coll_lock);
   ls.reserve(coll_map.size());
-  for (ceph::unordered_map<coll_t, CollectionRef>::iterator p =
-           coll_map.begin();
-       p != coll_map.end(); ++p)
+  for (auto p = coll_map.begin(); p != coll_map.end(); ++p)
     ls.push_back(p->first);
   return 0;
 }
index 9c8368cbcc430b8ca3f9fe7b853c4d22717408c6..cde3a803bd2deb56c40b641f8cad1a757322795a 100644 (file)
@@ -45,7 +45,6 @@
 #include "common/pretty_binary.h"
 #include "include/stringify.h"
 #include "include/coredumpctl.h"
-#include "include/unordered_map.h"
 #include "os/kv.h"
 #include "store_test_fixture.h"
 
index b117e16f26ac10f25fdd6bb52b8767669dba6bfe..0fde5b0c886b1d38a3bf26c44228fb66d4bf94d7 100644 (file)
@@ -30,8 +30,6 @@
 #include <boost/random/binomial_distribution.hpp>
 #include <gtest/gtest.h>
 
-#include "include/unordered_map.h"
-
 void usage(const string &name) {
   std::cerr << "Usage: " << name << " [xattr|omap] store_path"
            << std::endl;
index b1e594d14f4e73f4f0c9d4384a7fa65c1b0c7f6a..be75a326c825b812386ed1de84735f0639f7346e 100644 (file)
 #include "common/safe_io.h"
 #include "common/strtol.h" // for strict_strtoll()
 #include "crush/CrushWrapper.h"
-#include "include/unordered_map.h"
 #include "include/random.h"
 #include "mon/health_check.h"
 #include <time.h>
 #include <algorithm>
+#include <unordered_map>
 
 #include "global/global_init.h"
 #include "osd/OSDMap.h"
@@ -890,7 +890,7 @@ skip_upmap:
     while (1) {
       cout << "pass " << ++pass << std::endl;
 
-      ceph::unordered_map<pg_t,vector<int> > m;
+      std::unordered_map<pg_t, vector<int>> m;
       for (map<int64_t,pg_pool_t>::const_iterator p = osdmap.get_pools().begin();
           p != osdmap.get_pools().end();
           ++p) {