]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
libc++: use ceph:: namespaced data types
authorNoah Watkins <noahwatkins@gmail.com>
Tue, 29 Oct 2013 14:46:24 +0000 (07:46 -0700)
committerNoah Watkins <noahwatkins@gmail.com>
Sat, 18 Jan 2014 22:03:20 +0000 (14:03 -0800)
Switches the implemetnation of smart pointers and unordered map/set to
use the ceph:: versions.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
99 files changed:
fusetrace/fusetrace_ll.cc
src/client/Client.cc
src/client/Client.h
src/client/Dir.h
src/client/SyntheticClient.cc
src/client/Trace.cc
src/client/fuse_ll.cc
src/common/TrackedOp.h
src/common/hobject.h
src/common/lockdep.cc
src/common/map_cacher.hpp
src/common/shared_cache.hpp
src/common/sharedptr_registry.hpp
src/include/Context.h
src/include/encoding.h
src/include/object.h
src/include/types.h
src/librbd/LibrbdWriteback.h
src/mds/LogSegment.h
src/mds/MDCache.cc
src/mds/MDCache.h
src/mds/SessionMap.cc
src/mds/SessionMap.h
src/mds/events/EMetaBlob.h
src/mds/journal.cc
src/mds/mdstypes.h
src/mon/DataHealthService.cc
src/mon/LogMonitor.cc
src/mon/Monitor.h
src/mon/MonitorDBStore.h
src/mon/OSDMonitor.cc
src/mon/PGMap.cc
src/mon/PGMap.h
src/mon/PGMonitor.cc
src/msg/Pipe.cc
src/msg/SimpleMessenger.cc
src/msg/SimpleMessenger.h
src/msg/msg_types.h
src/os/CollectionIndex.h
src/os/DBObjectMap.cc
src/os/DBObjectMap.h
src/os/FDCache.h
src/os/FileStore.h
src/os/FlatIndex.cc
src/os/FlatIndex.h
src/os/HashIndex.cc
src/os/HashIndex.h
src/os/IndexManager.cc
src/os/IndexManager.h
src/os/KeyValueDB.h
src/os/LFNIndex.cc
src/os/LFNIndex.h
src/os/LevelDBStore.cc
src/os/LevelDBStore.h
src/os/MemStore.cc
src/os/MemStore.h
src/os/ObjectMap.h
src/os/ObjectStore.cc
src/os/WBThrottle.h
src/osd/ErasureCodeInterface.h
src/osd/HitSet.h
src/osd/OSD.cc
src/osd/OSD.h
src/osd/OSDMap.cc
src/osd/OSDMap.h
src/osd/OpRequest.h
src/osd/PG.cc
src/osd/PG.h
src/osd/PGLog.h
src/osd/Watch.h
src/osd/osd_types.h
src/osdc/ObjectCacher.cc
src/osdc/ObjectCacher.h
src/osdc/Objecter.h
src/rbd.cc
src/rgw/rgw_bucket.h
src/test/ObjectMap/KeyValueDBMemory.cc
src/test/ObjectMap/KeyValueDBMemory.h
src/test/ObjectMap/test_keyvaluedb_atomicity.cc
src/test/ObjectMap/test_keyvaluedb_iterators.cc
src/test/ObjectMap/test_object_map.cc
src/test/bench/bencher.cc
src/test/bench/bencher.h
src/test/bench/rbd_backend.cc
src/test/bench/rbd_backend.h
src/test/bench/small_io_bench_fs.cc
src/test/bench/small_io_bench_rbd.cc
src/test/bufferlist.cc
src/test/confutils.cc
src/test/filestore/store_test.cc
src/test/os/TestFlatIndex.cc
src/test/os/TestLFNIndex.cc
src/test/osd/RadosModel.h
src/test/osdc/object_cacher_stress.cc
src/test/test_osd_types.cc
src/test/test_snap_mapper.cc
src/test/xattr_bench.cc
src/tools/dupstore.cc
src/tools/osdmaptool.cc

index 7f2b8438f1f76767664dbfc914accb4083c47377..a60a14ca6c18a5a23d0d263acb983d614175e116 100644 (file)
 #include <time.h>
 
 
-#include <ext/hash_map>
-using namespace __gnu_cxx;
+#include "include/unordered_map.h"
+#include "include/hash_namespace.h"
 
 #ifndef __LP64__
-namespace __gnu_cxx {
+CEPH_HASH_NAMESPACE_START
   template<> struct hash<uint64_t> {
     size_t operator()(uint64_t __x) const { 
       static hash<uint32_t> H;
       return H((__x >> 32) ^ (__x & 0xffffffff)); 
     }
   };
-}
+CEPH_HASH_NAMESPACE_END
 #endif
 
 
@@ -89,7 +89,7 @@ struct Inode {
 };
 
 Inode *root = 0;
-hash_map<ino_t, Inode*> inode_map;
+ceph::unordered_map<ino_t, Inode*> inode_map;
 
 bool make_inode_path(string &buf, Inode *in)
 {
index db050b94d8958bba06f8172f248e6ede009b1b20..eadb4a0368bbb5d03d537aea1f9a0aef4e8544c1 100644 (file)
@@ -226,7 +226,7 @@ Client::~Client()
 void Client::tear_down_cache()
 {
   // fd's
-  for (hash_map<int, Fh*>::iterator it = fd_map.begin();
+  for (ceph::unordered_map<int, Fh*>::iterator it = fd_map.begin();
        it != fd_map.end();
        ++it) {
     Fh *fh = it->second;
@@ -286,7 +286,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 (hash_map<string, Dentry*>::iterator it = in->dir->dentries.begin();
+    for (ceph::unordered_map<string, Dentry*>::iterator 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;
@@ -314,7 +314,7 @@ void Client::dump_cache(Formatter *f)
     dump_inode(f, root, did, true);
 
   // make a second pass to catch anything disconnected
-  for (hash_map<vinodeno_t, Inode*>::iterator it = inode_map.begin();
+  for (ceph::unordered_map<vinodeno_t, Inode*>::iterator it = inode_map.begin();
        it != inode_map.end();
        ++it) {
     if (did.count(it->second))
@@ -1184,7 +1184,7 @@ int Client::verify_reply_trace(int r,
   bufferlist extra_bl;
   inodeno_t created_ino;
   bool got_created_ino = false;
-  hash_map<vinodeno_t, Inode*>::iterator p;
+  ceph::unordered_map<vinodeno_t, Inode*>::iterator p;
 
   extra_bl.claim(reply->get_extra_bl());
   if (extra_bl.length() >= 8) {
@@ -1958,8 +1958,8 @@ void Client::send_reconnect(MetaSession *session)
   MClientReconnect *m = new MClientReconnect;
 
   // i have an open session.
-  hash_set<inodeno_t> did_snaprealm;
-  for (hash_map<vinodeno_t, Inode*>::iterator p = inode_map.begin();
+  ceph::unordered_set<inodeno_t> did_snaprealm;
+  for (ceph::unordered_map<vinodeno_t, Inode*>::iterator p = inode_map.begin();
        p != inode_map.end();
        ++p) {
     Inode *in = p->second;
@@ -3859,8 +3859,8 @@ void Client::unmount()
 
   if (cct->_conf->client_oc) {
     // flush/release all buffered data
-    hash_map<vinodeno_t, Inode*>::iterator next;
-    for (hash_map<vinodeno_t, Inode*>::iterator p = inode_map.begin();
+    ceph::unordered_map<vinodeno_t, Inode*>::iterator next;
+    for (ceph::unordered_map<vinodeno_t, Inode*>::iterator p = inode_map.begin();
          p != inode_map.end(); 
          p = next) {
       next = p;
@@ -6655,8 +6655,8 @@ int Client::_ll_put(Inode *in, int num)
 void Client::_ll_drop_pins()
 {
   ldout(cct, 10) << "_ll_drop_pins" << dendl;
-  hash_map<vinodeno_t, Inode*>::iterator next;
-  for (hash_map<vinodeno_t, Inode*>::iterator it = inode_map.begin();
+  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) {
     Inode *in = it->second;
index 649bacc5ba69461a03e08551715709051424c0b9..e48c19f8cd112638fbfa05bf411ee85ec4e4c378 100644 (file)
@@ -27,8 +27,7 @@ using std::set;
 using std::map;
 using std::fstream;
 
-#include <ext/hash_map>
-using namespace __gnu_cxx;
+#include "include/unordered_map.h"
 
 #include "include/filepath.h"
 #include "include/interval_set.h"
@@ -302,14 +301,14 @@ protected:
   WritebackHandler      *writeback_handler;
 
   // cache
-  hash_map<vinodeno_t, Inode*> inode_map;
+  ceph::unordered_map<vinodeno_t, Inode*> inode_map;
   Inode*                 root;
   LRU                    lru;    // lru list of Dentry's in our local metadata cache.
 
   // all inodes with caps sit on either cap_list or delayed_caps.
   xlist<Inode*> delayed_caps, cap_list;
   int num_flushing_caps;
-  hash_map<inodeno_t,SnapRealm*> snap_realms;
+  ceph::unordered_map<inodeno_t,SnapRealm*> snap_realms;
 
   SnapRealm *get_snap_realm(inodeno_t r);
   SnapRealm *get_snap_realm_maybe(inodeno_t r);
@@ -324,7 +323,7 @@ protected:
 
   // file handles, etc.
   interval_set<int> free_fd_set;  // unused fds
-  hash_map<int, Fh*> fd_map;
+  ceph::unordered_map<int, Fh*> fd_map;
   
   int get_fd() {
     int fd = free_fd_set.range_start();
@@ -339,7 +338,7 @@ protected:
    * Resolve file descriptor, or return NULL.
    */
   Fh *get_filehandle(int fd) {
-    hash_map<int, Fh*>::iterator p = fd_map.find(fd);
+    ceph::unordered_map<int, Fh*>::iterator p = fd_map.find(fd);
     if (p == fd_map.end())
       return NULL;
     return p->second;
index 7e05d375f2f5151e8afcc1f07f6d9392ac386ca8..f0029b1900cd04ec3a00adca84c1e50f9aeef6b7 100644 (file)
@@ -6,7 +6,7 @@ class Inode;
 class Dir {
  public:
   Inode    *parent_inode;  // my inode
-  hash_map<string, Dentry*> dentries;
+  ceph::unordered_map<string, Dentry*> dentries;
   map<string, Dentry*> dentry_map;
   uint64_t release_count;
   uint64_t max_offset;
index 6b42f8eff1afc628c5b7140464140e289d5e3ab5..aac509cc9f6ad12fbc3c4a676f1483eaad3fd02e 100644 (file)
@@ -1014,12 +1014,12 @@ int SyntheticClient::play_trace(Trace& t, string& prefix, bool metadata_only)
 
   utime_t start = ceph_clock_now(client->cct);
 
-  hash_map<int64_t, int64_t> open_files;
-  hash_map<int64_t, dir_result_t*>    open_dirs;
+  ceph::unordered_map<int64_t, int64_t> open_files;
+  ceph::unordered_map<int64_t, dir_result_t*>    open_dirs;
 
-  hash_map<int64_t, Fh*> ll_files;
-  hash_map<int64_t, void*> ll_dirs;
-  hash_map<uint64_t, int64_t> ll_inos;
+  ceph::unordered_map<int64_t, Fh*> ll_files;
+  ceph::unordered_map<int64_t, void*> ll_dirs;
+  ceph::unordered_map<uint64_t, int64_t> ll_inos;
 
   ll_inos[1] = 1; // root inode is known.
 
@@ -1479,25 +1479,25 @@ int SyntheticClient::play_trace(Trace& t, string& prefix, bool metadata_only)
   lock.Unlock();
 
   // close open files
-  for (hash_map<int64_t, int64_t>::iterator fi = open_files.begin();
+  for (ceph::unordered_map<int64_t, int64_t>::iterator 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 (hash_map<int64_t, dir_result_t*>::iterator fi = open_dirs.begin();
+  for (ceph::unordered_map<int64_t, dir_result_t*>::iterator 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 (hash_map<int64_t,Fh*>::iterator fi = ll_files.begin();
+  for (ceph::unordered_map<int64_t,Fh*>::iterator 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 (hash_map<int64_t,void*>::iterator fi = ll_dirs.begin();
+  for (ceph::unordered_map<int64_t,void*>::iterator fi = ll_dirs.begin();
        fi != ll_dirs.end();
        ++fi) {
     dout(1) << "leftover ll_releasedir " << fi->second << dendl;
@@ -1559,8 +1559,8 @@ int SyntheticClient::full_walk(string& basedir)
   memset(&empty, 0, sizeof(empty));
   statq.push_back(empty);
 
-  hash_map<inodeno_t, int> nlink;
-  hash_map<inodeno_t, int> nlink_seen;
+  ceph::unordered_map<inodeno_t, int> nlink;
+  ceph::unordered_map<inodeno_t, int> nlink_seen;
 
   while (!dirq.empty()) {
     string dir = dirq.front();
@@ -1638,7 +1638,7 @@ int SyntheticClient::full_walk(string& basedir)
     }
   }
 
-  for (hash_map<inodeno_t,int>::iterator p = nlink.begin(); p != nlink.end(); ++p) {
+  for (ceph::unordered_map<inodeno_t,int>::iterator 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 61d34aa877f6e2a353a85b4fb14927978d017ad0..dbd9fce2c1efd53f5be0ce37d35e6ef0da3890da 100644 (file)
@@ -19,7 +19,6 @@
 
 #include <iostream>
 #include <map>
-using namespace __gnu_cxx;
 
 #include "common/Mutex.h"
 
index 88f727e454ee4f3a16bca45a655170051fdadf01..7d1a37b20efcd2ae775b45cd2cc7e6c84db69ef4 100644 (file)
@@ -81,8 +81,8 @@ public:
 
   Mutex stag_lock;
   int last_stag;
-  hash_map<uint64_t,int> snap_stag_map;
-  hash_map<int,uint64_t> stag_snap_map;
+  ceph::unordered_map<uint64_t,int> snap_stag_map;
+  ceph::unordered_map<int,uint64_t> stag_snap_map;
 
 };
 
index ef8a990bd3e910e4724099ee58502069ad8805c3..99184821e2a3f121cfa6aebedf6af578c09fd7b9 100644 (file)
 #include "include/histogram.h"
 #include "include/xlist.h"
 #include "msg/Message.h"
-#include <tr1/memory>
+#include "include/memory.h"
 
 class TrackedOp;
-typedef std::tr1::shared_ptr<TrackedOp> TrackedOpRef;
+typedef ceph::shared_ptr<TrackedOp> TrackedOpRef;
 
 class OpTracker;
 class OpHistory {
index 4081ceb8f852363aaae52ef0a9ab6d4a68b0fcfa..776d2dbcb1ad96b5ff9ffb0d12183d8dff0787cd 100644 (file)
@@ -116,7 +116,7 @@ public:
   /* Do not use when a particular hash function is needed */
   explicit hobject_t(const sobject_t &o) :
     oid(o.oid), snap(o.snap), max(false), pool(-1) {
-    hash = __gnu_cxx::hash<sobject_t>()(o);
+    hash = CEPH_HASH_NAMESPACE::hash<sobject_t>()(o);
   }
 
   // maximum sorted value.
@@ -198,7 +198,7 @@ public:
 };
 WRITE_CLASS_ENCODER(hobject_t)
 
-namespace __gnu_cxx {
+CEPH_HASH_NAMESPACE_START
   template<> struct hash<hobject_t> {
     size_t operator()(const hobject_t &r) const {
       static hash<object_t> H;
@@ -206,7 +206,7 @@ namespace __gnu_cxx {
       return H(r.oid) ^ I(r.snap);
     }
   };
-}
+CEPH_HASH_NAMESPACE_END
 
 ostream& operator<<(ostream& out, const hobject_t& o);
 
@@ -297,7 +297,7 @@ public:
 };
 WRITE_CLASS_ENCODER(ghobject_t)
 
-namespace __gnu_cxx {
+CEPH_HASH_NAMESPACE_START
   template<> struct hash<ghobject_t> {
     size_t operator()(const ghobject_t &r) const {
       static hash<object_t> H;
@@ -305,7 +305,7 @@ namespace __gnu_cxx {
       return H(r.hobj.oid) ^ I(r.hobj.snap);
     }
   };
-}
+CEPH_HASH_NAMESPACE_END
 
 ostream& operator<<(ostream& out, const ghobject_t& o);
 
index 7f34f801d1d5fda32b02d6c5ce7965d059e3c8e1..5c2ee55abaad60d7d5dcc1f6ce7d1efc0ab1425e 100644 (file)
 #include "include/types.h"
 #include "lockdep.h"
 
-#include <ext/hash_map>
+#include "include/unordered_map.h"
+#include "include/hash_namespace.h"
 
 #if defined(__FreeBSD__) && defined(__LP64__)  // On FreeBSD pthread_t is a pointer.
-namespace __gnu_cxx {
+CEPH_HASH_NAMESPACE_START
   template<>
     struct hash<pthread_t>
     {
@@ -29,7 +30,7 @@ namespace __gnu_cxx {
       operator()(pthread_t __x) const
       { return (uintptr_t)__x; }
     };
-}
+CEPH_HASH_NAMESPACE_END
 #endif
 
 /******* Constants **********/
@@ -50,10 +51,10 @@ 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 hash_map<const char *, int> lock_ids;
+static ceph::unordered_map<const char *, int> lock_ids;
 static map<int, const char *> lock_names;
 static int last_id = 0;
-static hash_map<pthread_t, map<int,BackTrace*> > held;
+static ceph::unordered_map<pthread_t, map<int,BackTrace*> > held;
 static BackTrace *follows[MAX_LOCKS][MAX_LOCKS];       // follows[a][b] means b taken after a
 
 /******* Functions **********/
@@ -79,7 +80,7 @@ int lockdep_dump_locks()
 {
   pthread_mutex_lock(&lockdep_mutex);
 
-  for (hash_map<pthread_t, map<int,BackTrace*> >::iterator p = held.begin();
+  for (ceph::unordered_map<pthread_t, map<int,BackTrace*> >::iterator p = held.begin();
        p != held.end();
        ++p) {
     lockdep_dout(0) << "--- thread " << p->first << " ---" << dendl;
@@ -109,7 +110,7 @@ int lockdep_register(const char *name)
       for (int j=0; j<MAX_LOCKS; j++)
        follows[i][j] = NULL;
 
-  hash_map<const char *, int>::iterator p = lock_ids.find(name);
+  ceph::unordered_map<const char *, int>::iterator p = lock_ids.find(name);
   if (p == lock_ids.end()) {
     assert(last_id < MAX_LOCKS);
     id = last_id++;
index 04c84cdb65afea27b8bd58a9937a13b472303e26..da79e8237b6c011235d8642461427862fc3ca7ef 100644 (file)
@@ -17,7 +17,7 @@
 
 #include <boost/scoped_ptr.hpp>
 #include <boost/optional.hpp>
-#include <tr1/memory>
+#include "include/memory.h"
 #include <set>
 #include <map>
 #include <utility>
index 178d1001be35b87ad46476a5e1a784a707ecccb1..a435ec4558f6437fe632594b217eadfe67daac49 100644 (file)
@@ -24,8 +24,8 @@
 
 template <class K, class V>
 class SharedLRU {
-  typedef std::tr1::shared_ptr<V> VPtr;
-  typedef std::tr1::weak_ptr<V> WeakVPtr;
+  typedef ceph::shared_ptr<V> VPtr;
+  typedef ceph::weak_ptr<V> WeakVPtr;
   Mutex lock;
   size_t max_size;
   Cond cond;
index 83396b8cc5f67e6fa506c7edab7754e19ce49ba4..b8c26ce1773914d8286d989fd9a7823c190d32ca 100644 (file)
@@ -27,8 +27,8 @@
 template <class K, class V>
 class SharedPtrRegistry {
 public:
-  typedef std::tr1::shared_ptr<V> VPtr;
-  typedef std::tr1::weak_ptr<V> WeakVPtr;
+  typedef ceph::shared_ptr<V> VPtr;
+  typedef ceph::weak_ptr<V> WeakVPtr;
   int waiting;
 private:
   Mutex lock;
index 663313ceec172fa9b507446e5b67ee04c7025153..38af84325aed12a8028a9eb158a63b84db1f7b6e 100644 (file)
@@ -23,7 +23,7 @@
 #include <set>
 
 #include <iostream>
-#include <tr1/memory>
+#include "include/memory.h"
 
 #define mydout(cct, v) lgeneric_subdout(cct, context, v)
 
@@ -95,7 +95,7 @@ struct RunOnDelete {
       to_run->complete(0);
   }
 };
-typedef std::tr1::shared_ptr<RunOnDelete> RunOnDeleteRef;
+typedef ceph::shared_ptr<RunOnDelete> RunOnDeleteRef;
 
 /*
  * finish and destroy a list of Contexts
index 51af378c56610cad8e93cf37efbda7968f12013a..76ef60c6e58d0db2021de85cf02e8764bb0e8215 100644 (file)
@@ -16,7 +16,7 @@
 
 #include "include/int_types.h"
 
-#include <tr1/memory>
+#include "include/memory.h"
 
 #include "byteorder.h"
 #include "buffer.h"
@@ -290,8 +290,8 @@ inline void decode(T &o, bufferlist& bl)
 #ifndef _BACKWARD_BACKWARD_WARNING_H
 #define _BACKWARD_BACKWARD_WARNING_H   // make gcc 4.3 shut up about hash_*
 #endif
-#include <ext/hash_map>
-#include <ext/hash_set>
+#include "include/unordered_map.h"
+#include "include/unordered_set.h"
 
 #include "triple.h"
 
@@ -363,14 +363,14 @@ inline void decode(std::list<T>& ls, bufferlist::iterator& p)
 }
 
 template<class T>
-inline void encode(const std::list<std::tr1::shared_ptr<T> >& ls, bufferlist& bl)
+inline void encode(const std::list<ceph::shared_ptr<T> >& ls, bufferlist& bl)
 {
   // should i pre- or post- count?
   if (!ls.empty()) {
     unsigned pos = bl.length();
     unsigned n = 0;
     encode(n, bl);
-    for (typename std::list<std::tr1::shared_ptr<T> >::const_iterator p = ls.begin(); p != ls.end(); ++p) {
+    for (typename std::list<ceph::shared_ptr<T> >::const_iterator p = ls.begin(); p != ls.end(); ++p) {
       n++;
       encode(**p, bl);
     }
@@ -380,18 +380,18 @@ inline void encode(const std::list<std::tr1::shared_ptr<T> >& ls, bufferlist& bl
   } else {
     __u32 n = ls.size();    // FIXME: this is slow on a list.
     encode(n, bl);
-    for (typename std::list<std::tr1::shared_ptr<T> >::const_iterator p = ls.begin(); p != ls.end(); ++p)
+    for (typename std::list<ceph::shared_ptr<T> >::const_iterator p = ls.begin(); p != ls.end(); ++p)
       encode(**p, bl);
   }
 }
 template<class T>
-inline void decode(std::list<std::tr1::shared_ptr<T> >& ls, bufferlist::iterator& p)
+inline void decode(std::list<ceph::shared_ptr<T> >& ls, bufferlist::iterator& p)
 {
   __u32 n;
   decode(n, p);
   ls.clear();
   while (n--) {
-    std::tr1::shared_ptr<T> v(new T);
+    ceph::shared_ptr<T> v(new T);
     decode(*v, p);
     ls.push_back(v);
   }
@@ -481,18 +481,18 @@ inline void decode_nohead(int len, std::vector<T>& v, bufferlist::iterator& p)
 
 // vector (shared_ptr)
 template<class T>
-inline void encode(const std::vector<std::tr1::shared_ptr<T> >& v, bufferlist& bl)
+inline void encode(const std::vector<ceph::shared_ptr<T> >& v, bufferlist& bl)
 {
   __u32 n = v.size();
   encode(n, bl);
-  for (typename std::vector<std::tr1::shared_ptr<T> >::const_iterator p = v.begin(); p != v.end(); ++p)
+  for (typename std::vector<ceph::shared_ptr<T> >::const_iterator p = v.begin(); p != v.end(); ++p)
     if (*p)
       encode(**p, bl);
     else
       encode(T(), bl);
 }
 template<class T>
-inline void decode(std::vector<std::tr1::shared_ptr<T> >& v, bufferlist::iterator& p)
+inline void decode(std::vector<ceph::shared_ptr<T> >& v, bufferlist::iterator& p)
 {
   __u32 n;
   decode(n, p);
@@ -624,19 +624,19 @@ inline void decode(std::multimap<T,U>& m, bufferlist::iterator& p)
   }
 }
 
-// hash_map
+// ceph::unordered_map
 template<class T, class U>
-inline void encode(const __gnu_cxx::hash_map<T,U>& m, bufferlist& bl)
+inline void encode(const unordered_map<T,U>& m, bufferlist& bl)
 {
   __u32 n = m.size();
   encode(n, bl);
-  for (typename __gnu_cxx::hash_map<T,U>::const_iterator p = m.begin(); p != m.end(); ++p) {
+  for (typename unordered_map<T,U>::const_iterator p = m.begin(); p != m.end(); ++p) {
     encode(p->first, bl);
     encode(p->second, bl);
   }
 }
 template<class T, class U>
-inline void decode(__gnu_cxx::hash_map<T,U>& m, bufferlist::iterator& p)
+inline void decode(unordered_map<T,U>& m, bufferlist::iterator& p)
 {
   __u32 n;
   decode(n, p);
@@ -648,17 +648,17 @@ inline void decode(__gnu_cxx::hash_map<T,U>& m, bufferlist::iterator& p)
   }
 }
 
-// hash_set
+// ceph::unordered_set
 template<class T>
-inline void encode(const __gnu_cxx::hash_set<T>& m, bufferlist& bl)
+inline void encode(const ceph::unordered_set<T>& m, bufferlist& bl)
 {
   __u32 n = m.size();
   encode(n, bl);
-  for (typename __gnu_cxx::hash_set<T>::const_iterator p = m.begin(); p != m.end(); ++p)
+  for (typename ceph::unordered_set<T>::const_iterator p = m.begin(); p != m.end(); ++p)
     encode(*p, bl);
 }
 template<class T>
-inline void decode(__gnu_cxx::hash_set<T>& m, bufferlist::iterator& p)
+inline void decode(ceph::unordered_set<T>& m, bufferlist::iterator& p)
 {
   __u32 n;
   decode(n, p);
index f81683f70afeccb5f87aadad9e557e9f0be29f75..d9fc27594deeda2e75c2abdb86b6c31ae6d28011 100644 (file)
@@ -22,8 +22,8 @@
 #include <iomanip>
 using namespace std;
 
-#include <ext/hash_map>
-using namespace __gnu_cxx;
+#include "include/unordered_map.h"
+#include "include/hash_namespace.h"
 
 #include "hash.h"
 #include "encoding.h"
@@ -78,7 +78,7 @@ inline ostream& operator<<(ostream& out, const object_t& o) {
   return out << o.name;
 }
 
-namespace __gnu_cxx {
+CEPH_HASH_NAMESPACE_START
   template<> struct hash<object_t> {
     size_t operator()(const object_t& r) const { 
       //static hash<string> H;
@@ -86,7 +86,7 @@ namespace __gnu_cxx {
       return ceph_str_hash_linux(r.name.c_str(), r.name.length());
     }
   };
-}
+CEPH_HASH_NAMESPACE_END
 
 
 struct file_object_t {
@@ -179,7 +179,7 @@ inline bool operator<=(const sobject_t &l, const sobject_t &r) {
 inline ostream& operator<<(ostream& out, const sobject_t &o) {
   return out << o.oid << "/" << o.snap;
 }
-namespace __gnu_cxx {
+CEPH_HASH_NAMESPACE_START
   template<> struct hash<sobject_t> {
     size_t operator()(const sobject_t &r) const {
       static hash<object_t> H;
@@ -187,6 +187,6 @@ namespace __gnu_cxx {
       return H(r.oid) ^ I(r.snap);
     }
   };
-}
+CEPH_HASH_NAMESPACE_END
 
 #endif
index 33304521f90967a553c22fbe9366d39594918464..8467c80f37510d2bebd920bbfd9661b5b6381ce8 100644 (file)
@@ -61,9 +61,8 @@ extern "C" {
 
 using namespace std;
 
-#include <ext/hash_map>
-using namespace __gnu_cxx;
-
+#include "include/unordered_map.h"
+#include "include/hash_namespace.h"
 
 #include "object.h"
 #include "intarith.h"
@@ -87,7 +86,8 @@ typedef off_t off64_t;
 
 // -- stl crap --
 
-namespace __gnu_cxx {
+
+CEPH_HASH_NAMESPACE_START
   template<> struct hash< std::string >
   {
     size_t operator()( const std::string& x ) const
@@ -111,8 +111,7 @@ namespace __gnu_cxx {
     }
   };
 #endif
-
-}
+CEPH_HASH_NAMESPACE_END
 
 
 
@@ -211,8 +210,8 @@ inline ostream& operator<<(ostream& out, const multimap<A,B>& m)
 /*
  * comparators for stl containers
  */
-// for hash_map:
-//   hash_map<const char*, long, hash<const char*>, eqstr> vals;
+// for ceph::unordered_map:
+//   ceph::unordered_map<const char*, long, hash<const char*>, eqstr> vals;
 struct eqstr
 {
   bool operator()(const char* s1, const char* s2) const
@@ -329,7 +328,7 @@ inline ostream& operator<<(ostream& out, inodeno_t ino) {
   return out << hex << ino.val << dec;
 }
 
-namespace __gnu_cxx {
+CEPH_HASH_NAMESPACE_START
   template<> struct hash< inodeno_t >
   {
     size_t operator()( const inodeno_t& x ) const
@@ -338,7 +337,7 @@ namespace __gnu_cxx {
       return H(x.val);
     }
   };
-}
+CEPH_HASH_NAMESPACE_END
 
 
 // file modes
index 4f35aa4b0673af2f501397a528c39b6f3ac85ff5..0967421e9e3c20dc96b39a598c9e2f93c9ec3e3f 100644 (file)
@@ -55,7 +55,7 @@ namespace librbd {
     tid_t m_tid;
     Mutex& m_lock;
     librbd::ImageCtx *m_ictx;
-    hash_map<std::string, std::queue<write_result_d*> > m_writes;
+    ceph::unordered_map<std::string, std::queue<write_result_d*> > m_writes;
     friend class C_OrderedWrite;
   };
 }
index 624c3bc2395e773a4a29506135597f2774fe26a6..c9fdfd7f4096e104779708a866af657cf6f977e8 100644 (file)
@@ -24,8 +24,8 @@
 #include "CDentry.h"
 #include "CDir.h"
 
-#include <ext/hash_set>
-using __gnu_cxx::hash_set;
+#include "include/unordered_set.h"
+using ceph::unordered_set;
 
 class CDir;
 class CInode;
@@ -54,7 +54,7 @@ class LogSegment {
   
   set<CInode*> truncating_inodes;
 
-  map<int, hash_set<version_t> > pending_commit_tids;  // mdstable
+  map<int, ceph::unordered_set<version_t> > pending_commit_tids;  // mdstable
   set<metareqid_t> uncommitted_masters;
   set<dirfrag_t> uncommitted_fragments;
 
index b12684364ba762f2395af5ee2ab2181f19cdbc9a..eb20c06085a0c8603bac1e6a3d80dc717b6f427d 100644 (file)
@@ -2503,7 +2503,7 @@ void MDCache::send_slave_resolves()
   } else {
     set<int> resolve_set;
     mds->mdsmap->get_mds_set(resolve_set, MDSMap::STATE_RESOLVE);
-    for (hash_map<metareqid_t, MDRequest*>::iterator p = active_requests.begin();
+    for (ceph::unordered_map<metareqid_t, MDRequest*>::iterator p = active_requests.begin();
         p != active_requests.end();
         ++p) {
       if (!p->second->is_slave() || !p->second->slave_did_prepare())
@@ -2657,7 +2657,7 @@ void MDCache::handle_mds_failure(int who)
 
   // clean up any requests slave to/from this node
   list<MDRequest*> finish;
-  for (hash_map<metareqid_t, MDRequest*>::iterator p = active_requests.begin();
+  for (ceph::unordered_map<metareqid_t, MDRequest*>::iterator p = active_requests.begin();
        p != active_requests.end();
        ++p) {
     // slave to the failed node?
@@ -3389,7 +3389,7 @@ void MDCache::trim_unlinked_inodes()
 {
   dout(7) << "trim_unlinked_inodes" << dendl;
   list<CInode*> q;
-  for (hash_map<vinodeno_t,CInode*>::iterator p = inode_map.begin();
+  for (ceph::unordered_map<vinodeno_t,CInode*>::iterator p = inode_map.begin();
        p != inode_map.end();
        ++p) {
     CInode *in = p->second;
@@ -3676,7 +3676,7 @@ void MDCache::rejoin_send_rejoins()
   if (!mds->is_rejoin()) {
     // i am survivor.  send strong rejoin.
     // note request remote_auth_pins, xlocks
-    for (hash_map<metareqid_t, MDRequest*>::iterator p = active_requests.begin();
+    for (ceph::unordered_map<metareqid_t, MDRequest*>::iterator p = active_requests.begin();
         p != active_requests.end();
         ++p) {
       if ( p->second->is_slave())
@@ -4263,7 +4263,7 @@ void MDCache::rejoin_scour_survivor_replicas(int from, MMDSCacheRejoin *ack,
 {
   dout(10) << "rejoin_scour_survivor_replicas from mds." << from << dendl;
 
-  for (hash_map<vinodeno_t,CInode*>::iterator p = inode_map.begin();
+  for (ceph::unordered_map<vinodeno_t,CInode*>::iterator p = inode_map.begin();
        p != inode_map.end();
        ++p) {
     CInode *in = p->second;
@@ -5172,7 +5172,7 @@ void MDCache::choose_lock_states_and_reconnect_caps()
 
   map<client_t,MClientSnap*> splits;
 
-  for (hash_map<vinodeno_t,CInode*>::iterator i = inode_map.begin();
+  for (ceph::unordered_map<vinodeno_t,CInode*>::iterator i = inode_map.begin();
        i != inode_map.end();
        ++i) {
     CInode *in = i->second;
@@ -5727,7 +5727,7 @@ void MDCache::reissue_all_caps()
 {
   dout(10) << "reissue_all_caps" << dendl;
 
-  for (hash_map<vinodeno_t,CInode*>::iterator p = inode_map.begin();
+  for (ceph::unordered_map<vinodeno_t,CInode*>::iterator p = inode_map.begin();
        p != inode_map.end();
        ++p) {
     CInode *in = p->second;
@@ -5829,7 +5829,7 @@ void MDCache::unqueue_file_recover(CInode *in)
 void MDCache::identify_files_to_recover(vector<CInode*>& recover_q, vector<CInode*>& check_q)
 {
   dout(10) << "identify_files_to_recover" << dendl;
-  for (hash_map<vinodeno_t,CInode*>::iterator p = inode_map.begin();
+  for (ceph::unordered_map<vinodeno_t,CInode*>::iterator p = inode_map.begin();
        p != inode_map.end();
        ++p) {
     CInode *in = p->second;
@@ -6506,9 +6506,9 @@ void MDCache::trim_non_auth()
 
   if (lru.lru_get_size() == 0) {
     // root, stray, etc.?
-    hash_map<vinodeno_t,CInode*>::iterator p = inode_map.begin();
+    ceph::unordered_map<vinodeno_t,CInode*>::iterator p = inode_map.begin();
     while (p != inode_map.end()) {
-      hash_map<vinodeno_t,CInode*>::iterator next = p;
+      ceph::unordered_map<vinodeno_t,CInode*>::iterator next = p;
       ++next;
       CInode *in = p->second;
       if (!in->is_auth()) {
@@ -8647,7 +8647,7 @@ void MDCache::kick_find_ino_peers(int who)
 int MDCache::get_num_client_requests()
 {
   int count = 0;
-  for (hash_map<metareqid_t, MDRequest*>::iterator p = active_requests.begin();
+  for (ceph::unordered_map<metareqid_t, MDRequest*>::iterator p = active_requests.begin();
       p != active_requests.end();
       ++p) {
     if (p->second->reqid.name.is_client() && !p->second->is_slave())
@@ -11803,7 +11803,7 @@ void MDCache::show_cache()
 {
   dout(7) << "show_cache" << dendl;
   
-  for (hash_map<vinodeno_t,CInode*>::iterator it = inode_map.begin();
+  for (ceph::unordered_map<vinodeno_t,CInode*>::iterator it = inode_map.begin();
        it != inode_map.end();
        ++it) {
     // unlinked?
@@ -11848,7 +11848,7 @@ void MDCache::dump_cache(const char *fn)
     return;
   }
   
-  for (hash_map<vinodeno_t,CInode*>::iterator it = inode_map.begin();
+  for (ceph::unordered_map<vinodeno_t,CInode*>::iterator it = inode_map.begin();
        it != inode_map.end();
        ++it) {
     CInode *in = it->second;
index 5e431c0456cc748d5ceed8682c5807461c09fc50..ad0f5ff734bbfa16afe0291f3caca9024b9c603e 100644 (file)
@@ -84,7 +84,7 @@ class MDCache {
   // -- my cache --
   LRU lru;   // dentry lru for expiring items from cache
  protected:
-  hash_map<vinodeno_t,CInode*> inode_map;  // map of inodes by ino
+  ceph::unordered_map<vinodeno_t,CInode*> inode_map;  // map of inodes by ino
   CInode *root;                            // root inode
   CInode *myin;                            // .ceph/mds%d dir
 
@@ -240,7 +240,7 @@ protected:
 
   // -- requests --
 protected:
-  hash_map<metareqid_t, MDRequest*> active_requests; 
+  ceph::unordered_map<metareqid_t, MDRequest*> active_requests; 
 
 public:
   int get_num_client_requests();
@@ -1025,7 +1025,7 @@ public:
   CInode *hack_pick_random_inode() {
     assert(!inode_map.empty());
     int n = rand() % inode_map.size();
-    hash_map<vinodeno_t,CInode*>::iterator p = inode_map.begin();
+    ceph::unordered_map<vinodeno_t,CInode*>::iterator p = inode_map.begin();
     while (n--) ++p;
     return p->second;
   }
index 4c17f5309b71c669780bdc04c0f019eef780039c..1b270290eaf26ff9351ac305425a80a08f6d79d9 100644 (file)
@@ -29,7 +29,7 @@
 void SessionMap::dump()
 {
   dout(10) << "dump" << dendl;
-  for (hash_map<entity_name_t,Session*>::iterator p = session_map.begin();
+  for (ceph::unordered_map<entity_name_t,Session*>::iterator p = session_map.begin();
        p != session_map.end();
        ++p) 
     dout(10) << p->first << " " << p->second
@@ -154,7 +154,7 @@ void SessionMap::encode(bufferlist& bl) const
   ENCODE_START(3, 3, bl);
   ::encode(version, bl);
 
-  for (hash_map<entity_name_t,Session*>::const_iterator p = session_map.begin(); 
+  for (ceph::unordered_map<entity_name_t,Session*>::const_iterator p = session_map.begin(); 
        p != session_map.end(); 
        ++p) {
     if (p->second->is_open() ||
@@ -221,7 +221,7 @@ void SessionMap::decode(bufferlist::iterator& p)
 void SessionMap::dump(Formatter *f) const
 {
   f->open_array_section("Sessions");
-  for (hash_map<entity_name_t,Session*>::const_iterator p = session_map.begin();
+  for (ceph::unordered_map<entity_name_t,Session*>::const_iterator p = session_map.begin();
        p != session_map.end();
        ++p)  {
     f->open_object_section("Session");
@@ -258,7 +258,7 @@ void SessionMap::wipe()
 
 void SessionMap::wipe_ino_prealloc()
 {
-  for (hash_map<entity_name_t,Session*>::iterator p = session_map.begin(); 
+  for (ceph::unordered_map<entity_name_t,Session*>::iterator p = session_map.begin(); 
        p != session_map.end(); 
        ++p) {
     p->second->pending_prealloc_inos.clear();
index 0eb7e7c909e27e61cc507a2cd20e572d0494dda3..8ddbacc666039ac5eee5934cf3e6df5fac3eeda1 100644 (file)
@@ -18,8 +18,7 @@
 #include <set>
 using std::set;
 
-#include <ext/hash_map>
-using __gnu_cxx::hash_map;
+#include "include/unordered_map.h"
 
 #include "include/Context.h"
 #include "include/xlist.h"
@@ -235,7 +234,7 @@ class MDS;
 class SessionMap {
 private:
   MDS *mds;
-  hash_map<entity_name_t, Session*> session_map;
+  ceph::unordered_map<entity_name_t, Session*> session_map;
 public:
   map<int,xlist<Session*>* > by_state;
   
@@ -332,14 +331,14 @@ public:
   void dump();
 
   void get_client_set(set<client_t>& s) {
-    for (hash_map<entity_name_t,Session*>::iterator p = session_map.begin();
+    for (ceph::unordered_map<entity_name_t,Session*>::iterator p = session_map.begin();
         p != session_map.end();
         ++p)
       if (p->second->info.inst.name.is_client())
        s.insert(p->second->info.inst.name.num());
   }
   void get_client_session_set(set<Session*>& s) {
-    for (hash_map<entity_name_t,Session*>::iterator p = session_map.begin();
+    for (ceph::unordered_map<entity_name_t,Session*>::iterator p = session_map.begin();
         p != session_map.end();
         ++p)
       if (p->second->info.inst.name.is_client())
index 143cfa9de6fdb40fd76c59f17cf70fe661142b38..685f5ff472d785e712b2c024a7c03c27a9dd7817 100644 (file)
@@ -234,7 +234,7 @@ public:
   private:
     mutable bufferlist dnbl;
     bool dn_decoded;
-    list<std::tr1::shared_ptr<fullbit> >   dfull;
+    list<ceph::shared_ptr<fullbit> >   dfull;
     list<remotebit> dremote;
     list<nullbit>   dnull;
 
@@ -250,7 +250,7 @@ public:
     bool is_importing() { return state & STATE_IMPORTING; }
     void mark_importing() { state |= STATE_IMPORTING; }
 
-    list<std::tr1::shared_ptr<fullbit> >   &get_dfull()   { return dfull; }
+    list<ceph::shared_ptr<fullbit> >   &get_dfull()   { return dfull; }
     list<remotebit> &get_dremote() { return dremote; }
     list<nullbit>   &get_dnull()   { return dnull; }
 
@@ -260,7 +260,7 @@ public:
          << " num " << nfull << "/" << nremote << "/" << nnull
          << std::endl;
       _decode_bits();
-      for (list<std::tr1::shared_ptr<fullbit> >::iterator p = dfull.begin(); p != dfull.end(); ++p)
+      for (list<ceph::shared_ptr<fullbit> >::iterator p = dfull.begin(); p != dfull.end(); ++p)
        (*p)->print(out);
       for (list<remotebit>::iterator p = dremote.begin(); p != dremote.end(); ++p)
        p->print(out);
@@ -312,7 +312,7 @@ private:
   // my lumps.  preserve the order we added them in a list.
   list<dirfrag_t>         lump_order;
   map<dirfrag_t, dirlump> lump_map;
-  list<std::tr1::shared_ptr<fullbit> > roots;
+  list<ceph::shared_ptr<fullbit> > roots;
 
   list<pair<__u8,version_t> > table_tids;  // tableclient transactions
 
@@ -454,7 +454,7 @@ private:
       sr->encode(snapbl);
 
     lump.nfull++;
-    lump.get_dfull().push_back(std::tr1::shared_ptr<fullbit>(new fullbit(dn->get_name(), 
+    lump.get_dfull().push_back(ceph::shared_ptr<fullbit>(new fullbit(dn->get_name(), 
                                                                         dn->first, dn->last,
                                                                         dn->get_projected_version(), 
                                                                         *pi, in->dirfragtree,
@@ -507,7 +507,7 @@ private:
     else
       in->encode_snap_blob(snapbl);
 
-    for (list<std::tr1::shared_ptr<fullbit> >::iterator p = roots.begin(); p != roots.end(); ++p) {
+    for (list<ceph::shared_ptr<fullbit> >::iterator p = roots.begin(); p != roots.end(); ++p) {
       if ((*p)->inode.ino == in->ino()) {
        roots.erase(p);
        break;
@@ -515,7 +515,7 @@ private:
     }
 
     string empty;
-    roots.push_back(std::tr1::shared_ptr<fullbit>(new fullbit(empty, in->first, in->last, 0, *pi,
+    roots.push_back(ceph::shared_ptr<fullbit>(new fullbit(empty, in->first, in->last, 0, *pi,
                                                              *pdft, *px, in->symlink, snapbl,
                                                              dirty ? fullbit::STATE_DIRTY : 0,
                                                              &in->old_inodes)));
index 41a79f9fb38b3c435cc3723e46937a8f5833923c..e6d530fc10109ea6aa9dbc11659758b18d111f13 100644 (file)
@@ -237,11 +237,11 @@ void LogSegment::try_to_expire(MDS *mds, C_GatherBuilder &gather_bld)
   }
 
   // pending commit atids
-  for (map<int, hash_set<version_t> >::iterator p = pending_commit_tids.begin();
+  for (map<int, ceph::unordered_set<version_t> >::iterator p = pending_commit_tids.begin();
        p != pending_commit_tids.end();
        ++p) {
     MDSTableClient *client = mds->get_table_client(p->first);
-    for (hash_set<version_t>::iterator q = p->second.begin();
+    for (ceph::unordered_set<version_t>::iterator q = p->second.begin();
         q != p->second.end();
         ++q) {
       dout(10) << "try_to_expire " << get_mdstable_name(p->first) << " transaction " << *q 
@@ -715,7 +715,7 @@ void EMetaBlob::dirlump::dump(Formatter *f) const
   f->dump_int("nnull", nnull);
 
   f->open_array_section("full bits");
-  for (list<std::tr1::shared_ptr<fullbit> >::const_iterator
+  for (list<ceph::shared_ptr<fullbit> >::const_iterator
       iter = dfull.begin(); iter != dfull.end(); ++iter) {
     f->open_object_section("fullbit");
     (*iter)->dump(f);
@@ -789,7 +789,7 @@ void EMetaBlob::decode(bufferlist::iterator &bl)
     ::decode(rootbl, bl);
     if (rootbl.length()) {
       bufferlist::iterator p = rootbl.begin();
-      roots.push_back(std::tr1::shared_ptr<fullbit>(new fullbit(p)));
+      roots.push_back(ceph::shared_ptr<fullbit>(new fullbit(p)));
     }
   }
   ::decode(table_tids, bl);
@@ -844,7 +844,7 @@ void EMetaBlob::dump(Formatter *f) const
   f->close_section(); // lumps
   
   f->open_array_section("roots");
-  for (list<std::tr1::shared_ptr<fullbit> >::const_iterator i = roots.begin();
+  for (list<ceph::shared_ptr<fullbit> >::const_iterator i = roots.begin();
        i != roots.end(); ++i) {
     f->open_object_section("root");
     (*i)->dump(f);
@@ -929,7 +929,7 @@ void EMetaBlob::replay(MDS *mds, LogSegment *logseg, MDSlaveUpdate *slaveup)
 
   assert(g_conf->mds_kill_journal_replay_at != 1);
 
-  for (list<std::tr1::shared_ptr<fullbit> >::iterator p = roots.begin(); p != roots.end(); ++p) {
+  for (list<ceph::shared_ptr<fullbit> >::iterator p = roots.begin(); p != roots.end(); ++p) {
     CInode *in = mds->mdcache->get_inode((*p)->inode.ino);
     bool isnew = in ? false:true;
     if (!in)
@@ -1032,10 +1032,10 @@ void EMetaBlob::replay(MDS *mds, LogSegment *logseg, MDSlaveUpdate *slaveup)
     lump._decode_bits();
 
     // full dentry+inode pairs
-    for (list<std::tr1::shared_ptr<fullbit> >::iterator pp = lump.get_dfull().begin();
+    for (list<ceph::shared_ptr<fullbit> >::iterator pp = lump.get_dfull().begin();
         pp != lump.get_dfull().end();
         ++pp) {
-      std::tr1::shared_ptr<fullbit> p = *pp;
+      ceph::shared_ptr<fullbit> p = *pp;
       CDentry *dn = dir->lookup_exact_snap(p->dn, p->dnlast);
       if (!dn) {
        dn = dir->add_null_dentry(p->dn, p->dnfirst, p->dnlast);
index b180abfb60a26fdbce70f9c4b1f6b6150572b69c..1c81dabe9189aaa0678e11a8794bf859eb772b4f 100644 (file)
@@ -24,6 +24,7 @@ using namespace std;
 
 #include <boost/pool/pool.hpp>
 #include "include/assert.h"
+#include "include/hash_namespace.h"
 
 #define CEPH_FS_ONDISK_MAGIC "ceph fs volume v011"
 
@@ -248,7 +249,7 @@ inline bool operator<(const vinodeno_t &l, const vinodeno_t &r) {
     (l.ino == r.ino && l.snapid < r.snapid);
 }
 
-namespace __gnu_cxx {
+CEPH_HASH_NAMESPACE_START
   template<> struct hash<vinodeno_t> {
     size_t operator()(const vinodeno_t &vino) const { 
       hash<inodeno_t> H;
@@ -256,7 +257,7 @@ namespace __gnu_cxx {
       return H(vino.ino) ^ I(vino.snapid);
     }
   };
-}
+CEPH_HASH_NAMESPACE_END
 
 
 
@@ -680,14 +681,14 @@ inline bool operator<=(const metareqid_t& l, const metareqid_t& r) {
 inline bool operator>(const metareqid_t& l, const metareqid_t& r) { return !(l <= r); }
 inline bool operator>=(const metareqid_t& l, const metareqid_t& r) { return !(l < r); }
 
-namespace __gnu_cxx {
+CEPH_HASH_NAMESPACE_START
   template<> struct hash<metareqid_t> {
     size_t operator()(const metareqid_t &r) const { 
       hash<uint64_t> H;
       return H(r.name.num()) ^ H(r.name.type()) ^ H(r.tid);
     }
   };
-}
+CEPH_HASH_NAMESPACE_END
 
 
 // cap info for client reconnect
@@ -803,7 +804,7 @@ inline bool operator==(dirfrag_t l, dirfrag_t r) {
   return l.ino == r.ino && l.frag == r.frag;
 }
 
-namespace __gnu_cxx {
+CEPH_HASH_NAMESPACE_START
   template<> struct hash<dirfrag_t> {
     size_t operator()(const dirfrag_t &df) const { 
       static rjhash<uint64_t> H;
@@ -811,7 +812,7 @@ namespace __gnu_cxx {
       return H(df.ino) ^ I(df.frag);
     }
   };
-}
+CEPH_HASH_NAMESPACE_END
 
 
 
index 3e421bc7c09ba253d282d117ec1b9d786a227bfb..9b707cd9ff9b316c90cd7fcc447339e99195462d 100644 (file)
@@ -12,7 +12,7 @@
  *
  */
 #include <memory>
-#include <tr1/memory>
+#include "include/memory.h"
 #include <errno.h>
 #include <map>
 #include <list>
index 65139d0bb5a156b3ffb420b2800b45a669afe9d5..8ed5ed95fa6290789567d1744d1e940f524381f6 100644 (file)
@@ -45,7 +45,7 @@ ostream& operator<<(ostream& out, LogMonitor& pm)
 {
   /*
   std::stringstream ss;
-  for (hash_map<int,int>::iterator p = pm.pg_map.num_pg_by_state.begin();
+  for (ceph::unordered_map<int,int>::iterator p = pm.pg_map.num_pg_by_state.begin();
        p != pm.pg_map.num_pg_by_state.end();
        ++p) {
     if (p != pm.pg_map.num_pg_by_state.begin())
index 0655110fb9906d2ebdc2ba1187d7dad24bad3b78..be16da83af3949cb7635567180cc895dd487da5f 100644 (file)
@@ -51,7 +51,7 @@
 #include "mon/MonitorDBStore.h"
 
 #include <memory>
-#include <tr1/memory>
+#include "include/memory.h"
 #include <errno.h>
 
 
index eda5aaf1802c82bc06dc9a9c31d8fe836c92f8da..213e8b94d6aaaf94e94f82890c8ae301c2390fa4 100644 (file)
@@ -322,7 +322,7 @@ class MonitorDBStore
     virtual void get_chunk_tx(Transaction &tx, uint64_t max) = 0;
     virtual pair<string,string> get_next_key() = 0;
   };
-  typedef std::tr1::shared_ptr<StoreIteratorImpl> Synchronizer;
+  typedef ceph::shared_ptr<StoreIteratorImpl> Synchronizer;
 
   class WholeStoreIteratorImpl : public StoreIteratorImpl {
     KeyValueDB::WholeSpaceIterator iter;
@@ -389,7 +389,7 @@ class MonitorDBStore
     else
       iter->seek_to_first();
 
-    return std::tr1::shared_ptr<StoreIteratorImpl>(
+    return ceph::shared_ptr<StoreIteratorImpl>(
        new WholeStoreIteratorImpl(iter, prefixes)
     );
   }
index 50f999d59f99451eab0a0433bc07b739b997c478..50db36be51a1ebc73d2288398e9a50f0e3d6b50d 100644 (file)
@@ -336,10 +336,10 @@ bool OSDMonitor::thrash()
   }
 
   // generate some pg_temp entries.
-  // let's assume the hash_map iterates in a random-ish order.
+  // let's assume the ceph::unordered_map iterates in a random-ish order.
   int n = rand() % mon->pgmon()->pg_map.pg_stat.size();
-  hash_map<pg_t,pg_stat_t>::iterator p = mon->pgmon()->pg_map.pg_stat.begin();
-  hash_map<pg_t,pg_stat_t>::iterator e = mon->pgmon()->pg_map.pg_stat.end();
+  ceph::unordered_map<pg_t,pg_stat_t>::iterator p = mon->pgmon()->pg_map.pg_stat.begin();
+  ceph::unordered_map<pg_t,pg_stat_t>::iterator e = mon->pgmon()->pg_map.pg_stat.end();
   while (n--)
     ++p;
   for (int i=0; i<50; i++) {
@@ -465,7 +465,7 @@ int OSDMonitor::reweight_by_utilization(int oload, std::string& out_str)
   std::string sep;
   oss << "overloaded osds: ";
   bool changed = false;
-  for (hash_map<int,osd_stat_t>::const_iterator p = pgm.osd_stat.begin();
+  for (ceph::unordered_map<int,osd_stat_t>::const_iterator p = pgm.osd_stat.begin();
        p != pgm.osd_stat.end();
        ++p) {
     float util = p->second.kb_used;
@@ -1816,7 +1816,7 @@ void OSDMonitor::tick()
   }
 
   // expire blacklisted items?
-  for (hash_map<entity_addr_t,utime_t>::iterator p = osdmap.blacklist.begin();
+  for (ceph::unordered_map<entity_addr_t,utime_t>::iterator p = osdmap.blacklist.begin();
        p != osdmap.blacklist.end();
        ++p) {
     if (p->second < now) {
@@ -2299,7 +2299,7 @@ bool OSDMonitor::preprocess_command(MMonCommand *m)
     if (f)
       f->open_array_section("blacklist");
 
-    for (hash_map<entity_addr_t,utime_t>::iterator p = osdmap.blacklist.begin();
+    for (ceph::unordered_map<entity_addr_t,utime_t>::iterator p = osdmap.blacklist.begin();
         p != osdmap.blacklist.end();
         ++p) {
       if (f) {
index db0c24e743392d2208b5800776ec67825e7d099d..56376d8b6ce3647770761fd213f36c6e2a65ad38 100644 (file)
@@ -180,7 +180,7 @@ void PGMap::apply_incremental(CephContext *cct, const Incremental& inc)
   stamp = inc.stamp;
 
   pool_stat_t pg_sum_old = pg_sum;
-  hash_map<uint64_t, pool_stat_t> pg_pool_sum_old;
+  ceph::unordered_map<uint64_t, pool_stat_t> pg_pool_sum_old;
 
   bool ratios_changed = false;
   if (inc.full_ratio != full_ratio && inc.full_ratio != -1) {
@@ -203,9 +203,9 @@ void PGMap::apply_incremental(CephContext *cct, const Incremental& inc)
     if (pg_pool_sum_old.count(update_pg.pool()) == 0)
       pg_pool_sum_old[update_pg.pool()] = pg_pool_sum[update_pg.pool()];
 
-    hash_map<pg_t,pg_stat_t>::iterator t = pg_stat.find(update_pg);
+    ceph::unordered_map<pg_t,pg_stat_t>::iterator t = pg_stat.find(update_pg);
     if (t == pg_stat.end()) {
-      hash_map<pg_t,pg_stat_t>::value_type v(update_pg, update_stat);
+      ceph::unordered_map<pg_t,pg_stat_t>::value_type v(update_pg, update_stat);
       pg_stat.insert(v);
     } else {
       stat_pg_sub(update_pg, t->second);
@@ -221,9 +221,9 @@ void PGMap::apply_incremental(CephContext *cct, const Incremental& inc)
     int osd = p->first;
     const osd_stat_t &new_stats(p->second);
 
-    hash_map<int32_t,osd_stat_t>::iterator t = osd_stat.find(osd);
+    ceph::unordered_map<int32_t,osd_stat_t>::iterator t = osd_stat.find(osd);
     if (t == osd_stat.end()) {
-      hash_map<int32_t,osd_stat_t>::value_type v(osd, new_stats);
+      ceph::unordered_map<int32_t,osd_stat_t>::value_type v(osd, new_stats);
       osd_stat.insert(v);
     } else {
       stat_osd_sub(t->second);
@@ -241,7 +241,7 @@ void PGMap::apply_incremental(CephContext *cct, const Incremental& inc)
        p != inc.pg_remove.end();
        ++p) {
     const pg_t &removed_pg(*p);
-    hash_map<pg_t,pg_stat_t>::iterator s = pg_stat.find(removed_pg);
+    ceph::unordered_map<pg_t,pg_stat_t>::iterator s = pg_stat.find(removed_pg);
     if (s != pg_stat.end()) {
       stat_pg_sub(removed_pg, s->second);
       pg_stat.erase(s);
@@ -251,7 +251,7 @@ void PGMap::apply_incremental(CephContext *cct, const Incremental& inc)
   for (set<int>::iterator p = inc.get_osd_stat_rm().begin();
        p != inc.get_osd_stat_rm().end();
        ++p) {
-    hash_map<int32_t,osd_stat_t>::iterator t = osd_stat.find(*p);
+    ceph::unordered_map<int32_t,osd_stat_t>::iterator t = osd_stat.find(*p);
     if (t != osd_stat.end()) {
       stat_osd_sub(t->second);
       osd_stat.erase(t);
@@ -287,7 +287,7 @@ void PGMap::redo_full_sets()
 {
   full_osds.clear();
   nearfull_osds.clear();
-  for (hash_map<int32_t, osd_stat_t>::iterator i = osd_stat.begin();
+  for (ceph::unordered_map<int32_t, osd_stat_t>::iterator i = osd_stat.begin();
        i != osd_stat.end();
        ++i) {
     register_nearfull_status(i->first, i->second);
@@ -322,12 +322,12 @@ void PGMap::calc_stats()
   pg_sum = pool_stat_t();
   osd_sum = osd_stat_t();
 
-  for (hash_map<pg_t,pg_stat_t>::iterator p = pg_stat.begin();
+  for (ceph::unordered_map<pg_t,pg_stat_t>::iterator p = pg_stat.begin();
        p != pg_stat.end();
        ++p) {
     stat_pg_add(p->first, p->second);
   }
-  for (hash_map<int32_t,osd_stat_t>::iterator p = osd_stat.begin();
+  for (ceph::unordered_map<int32_t,osd_stat_t>::iterator p = osd_stat.begin();
        p != osd_stat.end();
        ++p)
     stat_osd_add(p->second);
@@ -338,7 +338,7 @@ void PGMap::calc_stats()
 void PGMap::update_pg(pg_t pgid, bufferlist& bl)
 {
   bufferlist::iterator p = bl.begin();
-  hash_map<pg_t,pg_stat_t>::iterator s = pg_stat.find(pgid);
+  ceph::unordered_map<pg_t,pg_stat_t>::iterator s = pg_stat.find(pgid);
   if (s != pg_stat.end())
     stat_pg_sub(pgid, s->second);
   pg_stat_t& r = pg_stat[pgid];
@@ -348,7 +348,7 @@ void PGMap::update_pg(pg_t pgid, bufferlist& bl)
 
 void PGMap::remove_pg(pg_t pgid)
 {
-  hash_map<pg_t,pg_stat_t>::iterator s = pg_stat.find(pgid);
+  ceph::unordered_map<pg_t,pg_stat_t>::iterator s = pg_stat.find(pgid);
   if (s != pg_stat.end()) {
     stat_pg_sub(pgid, s->second);
     pg_stat.erase(s);
@@ -358,7 +358,7 @@ void PGMap::remove_pg(pg_t pgid)
 void PGMap::update_osd(int osd, bufferlist& bl)
 {
   bufferlist::iterator p = bl.begin();
-  hash_map<int32_t,osd_stat_t>::iterator o = osd_stat.find(osd);
+  ceph::unordered_map<int32_t,osd_stat_t>::iterator o = osd_stat.find(osd);
   if (o != osd_stat.end())
     stat_osd_sub(o->second);
   osd_stat_t& r = osd_stat[osd];
@@ -371,7 +371,7 @@ void PGMap::update_osd(int osd, bufferlist& bl)
 
 void PGMap::remove_osd(int osd)
 {
-  hash_map<int32_t,osd_stat_t>::iterator o = osd_stat.find(osd);
+  ceph::unordered_map<int32_t,osd_stat_t>::iterator o = osd_stat.find(osd);
   if (o != osd_stat.end()) {
     stat_osd_sub(o->second);
     osd_stat.erase(o);
@@ -433,7 +433,7 @@ epoch_t PGMap::calc_min_last_epoch_clean() const
 {
   if (pg_stat.empty())
     return 0;
-  hash_map<pg_t,pg_stat_t>::const_iterator p = pg_stat.begin();
+  ceph::unordered_map<pg_t,pg_stat_t>::const_iterator p = pg_stat.begin();
   epoch_t min = p->second.get_effective_last_epoch_clean();
   for (++p; p != pg_stat.end(); ++p) {
     epoch_t lec = p->second.get_effective_last_epoch_clean();
@@ -442,7 +442,7 @@ epoch_t PGMap::calc_min_last_epoch_clean() const
   }
   // also scan osd epochs
   // don't trim past the oldest reported osd epoch
-  for (hash_map<int32_t, epoch_t>::const_iterator i = osd_epochs.begin();
+  for (ceph::unordered_map<int32_t, epoch_t>::const_iterator i = osd_epochs.begin();
        i != osd_epochs.end();
        ++i) {
     if (i->second < min)
@@ -508,7 +508,7 @@ void PGMap::decode(bufferlist::iterator &bl)
   if (struct_v >= 6) {
     ::decode(osd_epochs, bl);
   } else {
-    for (hash_map<int32_t, osd_stat_t>::iterator i = osd_stat.begin();
+    for (ceph::unordered_map<int32_t, osd_stat_t>::iterator i = osd_stat.begin();
         i != osd_stat.end();
         ++i) {
       // This isn't accurate, but will cause trimming to behave like
@@ -528,10 +528,10 @@ void PGMap::dirty_all(Incremental& inc)
   inc.full_ratio = full_ratio;
   inc.nearfull_ratio = nearfull_ratio;
 
-  for (hash_map<pg_t,pg_stat_t>::const_iterator p = pg_stat.begin(); p != pg_stat.end(); ++p) {
+  for (ceph::unordered_map<pg_t,pg_stat_t>::const_iterator p = pg_stat.begin(); p != pg_stat.end(); ++p) {
     inc.pg_stat_updates[p->first] = p->second;
   }
-  for (hash_map<int32_t, osd_stat_t>::const_iterator p = osd_stat.begin(); p != osd_stat.end(); ++p) {
+  for (ceph::unordered_map<int32_t, osd_stat_t>::const_iterator p = osd_stat.begin(); p != osd_stat.end(); ++p) {
     assert(osd_epochs.count(p->first));
     inc.update_stat(p->first,
                   inc.get_osd_epochs().find(p->first)->second,
@@ -577,7 +577,7 @@ void PGMap::dump_delta(Formatter *f) const
 void PGMap::dump_pg_stats(Formatter *f, bool brief) const
 {
   f->open_array_section("pg_stats");
-  for (hash_map<pg_t,pg_stat_t>::const_iterator i = pg_stat.begin();
+  for (ceph::unordered_map<pg_t,pg_stat_t>::const_iterator i = pg_stat.begin();
        i != pg_stat.end();
        ++i) {
     f->open_object_section("pg_stat");
@@ -594,7 +594,7 @@ void PGMap::dump_pg_stats(Formatter *f, bool brief) const
 void PGMap::dump_pool_stats(Formatter *f) const
 {
   f->open_array_section("pool_stats");
-  for (hash_map<int,pool_stat_t>::const_iterator p = pg_pool_sum.begin();
+  for (ceph::unordered_map<int,pool_stat_t>::const_iterator p = pg_pool_sum.begin();
        p != pg_pool_sum.end();
        ++p) {
     f->open_object_section("pool_stat");
@@ -608,7 +608,7 @@ void PGMap::dump_pool_stats(Formatter *f) const
 void PGMap::dump_osd_stats(Formatter *f) const
 {
   f->open_array_section("osd_stats");
-  for (hash_map<int32_t,osd_stat_t>::const_iterator q = osd_stat.begin();
+  for (ceph::unordered_map<int32_t,osd_stat_t>::const_iterator q = osd_stat.begin();
        q != osd_stat.end();
        ++q) {
     f->open_object_section("osd_stat");
@@ -620,10 +620,10 @@ void PGMap::dump_osd_stats(Formatter *f) const
 }
 
 void PGMap::dump_pg_stats_plain(ostream& ss,
-                               const hash_map<pg_t, pg_stat_t>& pg_stats) const
+                               const ceph::unordered_map<pg_t, pg_stat_t>& pg_stats) const
 {
   ss << "pg_stat\tobjects\tmip\tdegr\tunf\tbytes\tlog\tdisklog\tstate\tstate_stamp\tv\treported\tup\tacting\tlast_scrub\tscrub_stamp\tlast_deep_scrub\tdeep_scrub_stamp" << std::endl;
-  for (hash_map<pg_t, pg_stat_t>::const_iterator i = pg_stats.begin();
+  for (ceph::unordered_map<pg_t, pg_stat_t>::const_iterator i = pg_stats.begin();
        i != pg_stats.end(); ++i) {
     const pg_stat_t &st(i->second);
     ss << i->first
@@ -656,7 +656,7 @@ void PGMap::dump(ostream& ss) const
   ss << "full_ratio " << full_ratio << std::endl;
   ss << "nearfull_ratio " << nearfull_ratio << std::endl;
   dump_pg_stats_plain(ss, pg_stat);
-  for (hash_map<int,pool_stat_t>::const_iterator p = pg_pool_sum.begin();
+  for (ceph::unordered_map<int,pool_stat_t>::const_iterator p = pg_pool_sum.begin();
        p != pg_pool_sum.end();
        ++p)
     ss << "pool " << p->first
@@ -679,7 +679,7 @@ void PGMap::dump(ostream& ss) const
      << "\t" << pg_sum.ondisk_log_size
      << std::endl;
   ss << "osdstat\tkbused\tkbavail\tkb\thb in\thb out" << std::endl;
-  for (hash_map<int32_t,osd_stat_t>::const_iterator p = osd_stat.begin();
+  for (ceph::unordered_map<int32_t,osd_stat_t>::const_iterator p = osd_stat.begin();
        p != osd_stat.end();
        ++p)
     ss << p->first
@@ -696,9 +696,9 @@ void PGMap::dump(ostream& ss) const
 }
 
 void PGMap::get_stuck_stats(PGMap::StuckPG type, utime_t cutoff,
-                           hash_map<pg_t, pg_stat_t>& stuck_pgs) const
+                           ceph::unordered_map<pg_t, pg_stat_t>& stuck_pgs) const
 {
-  for (hash_map<pg_t, pg_stat_t>::const_iterator i = pg_stat.begin();
+  for (ceph::unordered_map<pg_t, pg_stat_t>::const_iterator i = pg_stat.begin();
        i != pg_stat.end();
        ++i) {
     utime_t val;
@@ -730,10 +730,10 @@ void PGMap::get_stuck_stats(PGMap::StuckPG type, utime_t cutoff,
 
 void PGMap::dump_stuck(Formatter *f, PGMap::StuckPG type, utime_t cutoff) const
 {
-  hash_map<pg_t, pg_stat_t> stuck_pg_stats;
+  ceph::unordered_map<pg_t, pg_stat_t> stuck_pg_stats;
   get_stuck_stats(type, cutoff, stuck_pg_stats);
   f->open_array_section("stuck_pg_stats");
-  for (hash_map<pg_t,pg_stat_t>::const_iterator i = stuck_pg_stats.begin();
+  for (ceph::unordered_map<pg_t,pg_stat_t>::const_iterator i = stuck_pg_stats.begin();
        i != stuck_pg_stats.end();
        ++i) {
     f->open_object_section("pg_stat");
@@ -746,7 +746,7 @@ void PGMap::dump_stuck(Formatter *f, PGMap::StuckPG type, utime_t cutoff) const
 
 void PGMap::dump_stuck_plain(ostream& ss, PGMap::StuckPG type, utime_t cutoff) const
 {
-  hash_map<pg_t, pg_stat_t> stuck_pg_stats;
+  ceph::unordered_map<pg_t, pg_stat_t> stuck_pg_stats;
   get_stuck_stats(type, cutoff, stuck_pg_stats);
   if (!stuck_pg_stats.empty())
     dump_pg_stats_plain(ss, stuck_pg_stats);
@@ -755,7 +755,7 @@ void PGMap::dump_stuck_plain(ostream& ss, PGMap::StuckPG type, utime_t cutoff) c
 void PGMap::dump_osd_perf_stats(Formatter *f) const
 {
   f->open_array_section("osd_perf_infos");
-  for (hash_map<int32_t, osd_stat_t>::const_iterator i = osd_stat.begin();
+  for (ceph::unordered_map<int32_t, osd_stat_t>::const_iterator i = osd_stat.begin();
        i != osd_stat.end();
        ++i) {
     f->open_object_section("osd");
@@ -775,7 +775,7 @@ void PGMap::print_osd_perf_stats(std::ostream *ss) const
   tab.define_column("osdid", TextTable::LEFT, TextTable::RIGHT);
   tab.define_column("fs_commit_latency(ms)", TextTable::LEFT, TextTable::RIGHT);
   tab.define_column("fs_apply_latency(ms)", TextTable::LEFT, TextTable::RIGHT);
-  for (hash_map<int32_t, osd_stat_t>::const_iterator i = osd_stat.begin();
+  for (ceph::unordered_map<int32_t, osd_stat_t>::const_iterator i = osd_stat.begin();
        i != osd_stat.end();
        ++i) {
     tab << i->first;
@@ -865,11 +865,11 @@ void PGMap::overall_recovery_summary(Formatter *f, ostream *out) const
 void PGMap::pool_recovery_rate_summary(Formatter *f, ostream *out,
                                        uint64_t poolid) const
 {
-  hash_map<uint64_t,pair<pool_stat_t,utime_t> >::const_iterator p =
+  ceph::unordered_map<uint64_t,pair<pool_stat_t,utime_t> >::const_iterator p =
     per_pool_sum_delta.find(poolid);
   if (p == per_pool_sum_delta.end())
     return;
-  hash_map<uint64_t,utime_t>::const_iterator ts =
+  ceph::unordered_map<uint64_t,utime_t>::const_iterator ts =
     per_pool_sum_deltas_stamps.find(p->first);
   assert(ts != per_pool_sum_deltas_stamps.end());
   recovery_rate_summary(f, out, p->second.first, ts->second);
@@ -878,7 +878,7 @@ void PGMap::pool_recovery_rate_summary(Formatter *f, ostream *out,
 void PGMap::pool_recovery_summary(Formatter *f, ostream *out,
                                   uint64_t poolid) const
 {
-  hash_map<uint64_t,pair<pool_stat_t,utime_t> >::const_iterator p =
+  ceph::unordered_map<uint64_t,pair<pool_stat_t,utime_t> >::const_iterator p =
     per_pool_sum_delta.find(poolid);
   if (p == per_pool_sum_delta.end())
     return;
@@ -926,11 +926,11 @@ void PGMap::overall_client_io_rate_summary(Formatter *f, ostream *out) const
 void PGMap::pool_client_io_rate_summary(Formatter *f, ostream *out,
                                         uint64_t poolid) const
 {
-  hash_map<uint64_t,pair<pool_stat_t,utime_t> >::const_iterator p =
+  ceph::unordered_map<uint64_t,pair<pool_stat_t,utime_t> >::const_iterator p =
     per_pool_sum_delta.find(poolid);
   if (p == per_pool_sum_delta.end())
     return;
-  hash_map<uint64_t,utime_t>::const_iterator ts =
+  ceph::unordered_map<uint64_t,utime_t>::const_iterator ts =
     per_pool_sum_deltas_stamps.find(p->first);
   assert(ts != per_pool_sum_deltas_stamps.end());
   client_io_rate_summary(f, out, p->second.first, ts->second);
@@ -1035,9 +1035,9 @@ void PGMap::update_one_pool_delta(CephContext *cct,
  * @param pg_pool_sum_old   Map of pool stats for delta calcs.
  */
 void PGMap::update_pool_deltas(CephContext *cct, const utime_t ts,
-                               const hash_map<uint64_t,pool_stat_t>& pg_pool_sum_old)
+                               const ceph::unordered_map<uint64_t,pool_stat_t>& pg_pool_sum_old)
 {
-  for (hash_map<uint64_t,pool_stat_t>::const_iterator it = pg_pool_sum_old.begin();
+  for (ceph::unordered_map<uint64_t,pool_stat_t>::const_iterator it = pg_pool_sum_old.begin();
        it != pg_pool_sum_old.end(); ++it) {
     update_one_pool_delta(cct, ts, it->first, it->second);
   }
@@ -1056,7 +1056,7 @@ void PGMap::print_summary(Formatter *f, ostream *out) const
   if (f)
     f->open_array_section("pgs_by_state");
 
-  for (hash_map<int,int>::const_iterator p = num_pg_by_state.begin();
+  for (ceph::unordered_map<int,int>::const_iterator p = num_pg_by_state.begin();
        p != num_pg_by_state.end();
        ++p) {
     if (f) {
@@ -1119,7 +1119,7 @@ void PGMap::print_oneline_summary(ostream *out) const
 {
   std::stringstream ss;
 
-  for (hash_map<int,int>::const_iterator p = num_pg_by_state.begin();
+  for (ceph::unordered_map<int,int>::const_iterator p = num_pg_by_state.begin();
        p != num_pg_by_state.end();
        ++p) {
     if (p != num_pg_by_state.begin())
index 8a931ecbcca676fbddc285343ff780b73241d4b0..9c346403abec5775f371cb0d7bcc0cfb548e9455 100644 (file)
@@ -36,15 +36,15 @@ public:
   version_t version;
   epoch_t last_osdmap_epoch;   // last osdmap epoch i applied to the pgmap
   epoch_t last_pg_scan;  // osdmap epoch
-  hash_map<pg_t,pg_stat_t> pg_stat;
-  hash_map<int32_t,osd_stat_t> osd_stat;
+  ceph::unordered_map<pg_t,pg_stat_t> pg_stat;
+  ceph::unordered_map<int32_t,osd_stat_t> osd_stat;
   set<int32_t> full_osds;
   set<int32_t> nearfull_osds;
   float full_ratio;
   float nearfull_ratio;
 
   // mapping of osd to most recently reported osdmap epoch
-  hash_map<int32_t,epoch_t> osd_epochs;
+  ceph::unordered_map<int32_t,epoch_t> osd_epochs;
 
   class Incremental {
   public:
@@ -100,9 +100,9 @@ public:
 
 
   // aggregate stats (soft state), generated by calc_stats()
-  hash_map<int,int> num_pg_by_state;
+  ceph::unordered_map<int,int> num_pg_by_state;
   int64_t num_pg, num_osd;
-  hash_map<int,pool_stat_t> pg_pool_sum;
+  ceph::unordered_map<int,pool_stat_t> pg_pool_sum;
   pool_stat_t pg_sum;
   osd_stat_t osd_sum;
 
@@ -113,19 +113,19 @@ public:
    * keep track of last deltas for each pool, calculated using
    * @p pg_pool_sum as baseline.
    */
-  hash_map<uint64_t, list< pair<pool_stat_t, utime_t> > > per_pool_sum_deltas;
+  ceph::unordered_map<uint64_t, list< pair<pool_stat_t, utime_t> > > per_pool_sum_deltas;
   /**
    * keep track of per-pool timestamp deltas, according to last update on
    * each pool.
    */
-  hash_map<uint64_t, utime_t> per_pool_sum_deltas_stamps;
+  ceph::unordered_map<uint64_t, utime_t> per_pool_sum_deltas_stamps;
   /**
    * keep track of sum deltas, per-pool, taking into account any previous
    * deltas existing in @p per_pool_sum_deltas.  The utime_t as second member
    * of the pair is the timestamp refering to the last update (i.e., the first
    * member of the pair) for a given pool.
    */
-  hash_map<uint64_t, pair<pool_stat_t,utime_t> > per_pool_sum_delta;
+  ceph::unordered_map<uint64_t, pair<pool_stat_t,utime_t> > per_pool_sum_delta;
 
   list< pair<pool_stat_t, utime_t> > pg_sum_deltas;
   pool_stat_t pg_sum_delta;
@@ -135,7 +135,7 @@ public:
                            const utime_t ts, const pool_stat_t& pg_sum_old);
   void update_pool_deltas(CephContext *cct,
                           const utime_t ts,
-                          const hash_map<uint64_t, pool_stat_t>& pg_pool_sum_old);
+                          const ceph::unordered_map<uint64_t, pool_stat_t>& pg_pool_sum_old);
   void clear_delta();
 
  private:
@@ -232,9 +232,9 @@ public:
   void dump_delta(Formatter *f) const;
 
   void dump_pg_stats_plain(ostream& ss,
-                          const hash_map<pg_t, pg_stat_t>& pg_stats) const;
+                          const ceph::unordered_map<pg_t, pg_stat_t>& pg_stats) const;
   void get_stuck_stats(StuckPG type, utime_t cutoff,
-                      hash_map<pg_t, pg_stat_t>& stuck_pgs) const;
+                      ceph::unordered_map<pg_t, pg_stat_t>& stuck_pgs) const;
   void dump_stuck(Formatter *f, StuckPG type, utime_t cutoff) const;
   void dump_stuck_plain(ostream& ss, StuckPG type, utime_t cutoff) const;
 
index 8b077c18554f303756d2646f2e5407a1639a6244..cdfc83aa9bcbd7437565f3979801c643d89c6197 100644 (file)
@@ -95,7 +95,7 @@ void PGMonitor::update_logger()
   mon->cluster_logger->set(l_cluster_num_pg, pg_map.pg_stat.size());
 
   unsigned active = 0, active_clean = 0, peering = 0;
-  for (hash_map<int,int>::iterator p = pg_map.num_pg_by_state.begin();
+  for (ceph::unordered_map<int,int>::iterator p = pg_map.num_pg_by_state.begin();
        p != pg_map.num_pg_by_state.end();
        ++p) {
     if (p->first & PG_STATE_ACTIVE) {
@@ -149,7 +149,7 @@ void PGMonitor::tick()
    * obtained -- the timestamp IS NOT a delta itself.
    */
   if (!pg_map.per_pool_sum_deltas.empty()) {
-    hash_map<uint64_t,pair<pool_stat_t,utime_t> >::iterator it;
+    ceph::unordered_map<uint64_t,pair<pool_stat_t,utime_t> >::iterator it;
     for (it = pg_map.per_pool_sum_delta.begin();
          it != pg_map.per_pool_sum_delta.end(); ) {
       utime_t age = ceph_clock_now(g_ceph_context) - it->second.second;
@@ -427,7 +427,7 @@ void PGMonitor::apply_pgmap_delta(bufferlist& bl)
   }
 
   pool_stat_t pg_sum_old = pg_map.pg_sum;
-  hash_map<uint64_t, pool_stat_t> pg_pool_sum_old;
+  ceph::unordered_map<uint64_t, pool_stat_t> pg_pool_sum_old;
 
   // pgs
   bufferlist::iterator p = dirty_pgs.begin();
@@ -706,7 +706,7 @@ bool PGMonitor::preprocess_pg_stats(MPGStats *stats)
 bool PGMonitor::pg_stats_have_changed(int from, const MPGStats *stats) const
 {
   // any new osd info?
-  hash_map<int,osd_stat_t>::const_iterator s = pg_map.osd_stat.find(from);
+  ceph::unordered_map<int,osd_stat_t>::const_iterator s = pg_map.osd_stat.find(from);
   if (s == pg_map.osd_stat.end())
     return true;
   if (s->second != stats->osd_stat)
@@ -715,7 +715,7 @@ bool PGMonitor::pg_stats_have_changed(int from, const MPGStats *stats) const
   // any new pg info?
   for (map<pg_t,pg_stat_t>::const_iterator p = stats->pg_stat.begin();
        p != stats->pg_stat.end(); ++p) {
-    hash_map<pg_t,pg_stat_t>::const_iterator t = pg_map.pg_stat.find(p->first);
+    ceph::unordered_map<pg_t,pg_stat_t>::const_iterator t = pg_map.pg_stat.find(p->first);
     if (t == pg_map.pg_stat.end())
       return true;
     if (t->second.reported_epoch != p->second.reported_epoch ||
@@ -1028,7 +1028,7 @@ bool PGMonitor::register_new_pgs()
   }
 
   // deleted pools?
-  for (hash_map<pg_t,pg_stat_t>::const_iterator p = pg_map.pg_stat.begin();
+  for (ceph::unordered_map<pg_t,pg_stat_t>::const_iterator p = pg_map.pg_stat.begin();
        p != pg_map.pg_stat.end(); ++p) {
     if (!osdmap->have_pg_pool(p->first.pool())) {
       dout(20) << " removing pg_stat " << p->first << " because "
@@ -1155,7 +1155,7 @@ bool PGMonitor::check_down_pgs()
   OSDMap *osdmap = &mon->osdmon()->osdmap;
   bool ret = false;
 
-  for (hash_map<pg_t,pg_stat_t>::iterator p = pg_map.pg_stat.begin();
+  for (ceph::unordered_map<pg_t,pg_stat_t>::iterator p = pg_map.pg_stat.begin();
        p != pg_map.pg_stat.end();
        ++p) {
     if ((p->second.state & PG_STATE_STALE) == 0 &&
@@ -1550,8 +1550,8 @@ bool PGMonitor::preprocess_command(MMonCommand *m)
     cmd_getval(g_ceph_context, cmdmap, "debugop", debugop, string("unfound_objects_exist"));
     if (debugop == "unfound_objects_exist") {
       bool unfound_objects_exist = false;
-      hash_map<pg_t,pg_stat_t>::const_iterator end = pg_map.pg_stat.end();
-      for (hash_map<pg_t,pg_stat_t>::const_iterator s = pg_map.pg_stat.begin();
+      ceph::unordered_map<pg_t,pg_stat_t>::const_iterator end = pg_map.pg_stat.end();
+      for (ceph::unordered_map<pg_t,pg_stat_t>::const_iterator s = pg_map.pg_stat.begin();
           s != end; ++s) {
        if (s->second.stats.sum.num_objects_unfound > 0) {
          unfound_objects_exist = true;
@@ -1565,8 +1565,8 @@ bool PGMonitor::preprocess_command(MMonCommand *m)
       r = 0;
     } else if (debugop == "degraded_pgs_exist") {
       bool degraded_pgs_exist = false;
-      hash_map<pg_t,pg_stat_t>::const_iterator end = pg_map.pg_stat.end();
-      for (hash_map<pg_t,pg_stat_t>::const_iterator s = pg_map.pg_stat.begin();
+      ceph::unordered_map<pg_t,pg_stat_t>::const_iterator end = pg_map.pg_stat.end();
+      for (ceph::unordered_map<pg_t,pg_stat_t>::const_iterator s = pg_map.pg_stat.begin();
           s != end; ++s) {
        if (s->second.stats.sum.num_objects_degraded > 0) {
          degraded_pgs_exist = true;
@@ -1673,10 +1673,10 @@ bool PGMonitor::prepare_command(MMonCommand *m)
 }
 
 static void note_stuck_detail(enum PGMap::StuckPG what,
-                             hash_map<pg_t,pg_stat_t>& stuck_pgs,
+                             ceph::unordered_map<pg_t,pg_stat_t>& stuck_pgs,
                              list<pair<health_status_t,string> > *detail)
 {
-  for (hash_map<pg_t,pg_stat_t>::iterator p = stuck_pgs.begin();
+  for (ceph::unordered_map<pg_t,pg_stat_t>::iterator p = stuck_pgs.begin();
        p != stuck_pgs.end();
        ++p) {
     ostringstream ss;
@@ -1735,8 +1735,8 @@ void PGMonitor::get_health(list<pair<health_status_t,string> >& summary,
                           list<pair<health_status_t,string> > *detail) const
 {
   map<string,int> note;
-  hash_map<int,int>::const_iterator p = pg_map.num_pg_by_state.begin();
-  hash_map<int,int>::const_iterator p_end = pg_map.num_pg_by_state.end();
+  ceph::unordered_map<int,int>::const_iterator p = pg_map.num_pg_by_state.begin();
+  ceph::unordered_map<int,int>::const_iterator p_end = pg_map.num_pg_by_state.end();
   for (; p != p_end; ++p) {
     if (p->first & PG_STATE_STALE)
       note["stale"] += p->second;
@@ -1766,7 +1766,7 @@ void PGMonitor::get_health(list<pair<health_status_t,string> >& summary,
       note["backfill_toofull"] += p->second;
   }
 
-  hash_map<pg_t, pg_stat_t> stuck_pgs;
+  ceph::unordered_map<pg_t, pg_stat_t> stuck_pgs;
   utime_t now(ceph_clock_now(g_ceph_context));
   utime_t cutoff = now - utime_t(g_conf->mon_pg_stuck_threshold, 0);
 
@@ -1800,7 +1800,7 @@ void PGMonitor::get_health(list<pair<health_status_t,string> >& summary,
       summary.push_back(make_pair(HEALTH_WARN, ss.str()));
     }
     if (detail) {
-      for (hash_map<pg_t,pg_stat_t>::const_iterator p = pg_map.pg_stat.begin();
+      for (ceph::unordered_map<pg_t,pg_stat_t>::const_iterator p = pg_map.pg_stat.begin();
           p != pg_map.pg_stat.end();
           ++p) {
        if ((p->second.state & (PG_STATE_STALE |
@@ -1847,7 +1847,7 @@ void PGMonitor::get_health(list<pair<health_status_t,string> >& summary,
       if (detail) {
         unsigned num_slow_osds = 0;
        // do per-osd warnings
-       for (hash_map<int32_t,osd_stat_t>::const_iterator p = pg_map.osd_stat.begin();
+       for (ceph::unordered_map<int32_t,osd_stat_t>::const_iterator p = pg_map.osd_stat.begin();
             p != pg_map.osd_stat.end();
             ++p) {
          if (_warn_slow_request_histogram(p->second.op_queue_age_hist,
@@ -1899,7 +1899,7 @@ void PGMonitor::get_health(list<pair<health_status_t,string> >& summary,
     }
   }
   if (!pg_map.pg_stat.empty()) {
-    for (hash_map<int,pool_stat_t>::const_iterator p = pg_map.pg_pool_sum.begin();
+    for (ceph::unordered_map<int,pool_stat_t>::const_iterator p = pg_map.pg_pool_sum.begin();
         p != pg_map.pg_pool_sum.end();
         ++p) {
       const pg_pool_t *pi = mon->osdmon()->osdmap.get_pg_pool(p->first);
index 4b9dcae8d17d2ade494deb2ad21cfd3e49d2c112..6389e207ba7e29cd2368a5c032102450b50f4838 100644 (file)
@@ -1154,7 +1154,7 @@ void Pipe::register_pipe()
 void Pipe::unregister_pipe()
 {
   assert(msgr->lock.is_locked());
-  hash_map<entity_addr_t,Pipe*>::iterator p = msgr->rank_pipe.find(peer_addr);
+  ceph::unordered_map<entity_addr_t,Pipe*>::iterator p = msgr->rank_pipe.find(peer_addr);
   if (p != msgr->rank_pipe.end() && p->second == this) {
     ldout(msgr->cct,10) << "unregister_pipe" << dendl;
     msgr->rank_pipe.erase(p);
index 8536f850dcace4f94e7d6aedc4d834c5b74272eb..ef97b015adbcab986afead3b88e803421e9d6e19 100644 (file)
@@ -575,7 +575,7 @@ void SimpleMessenger::mark_down_all()
   accepting_pipes.clear();
 
   while (!rank_pipe.empty()) {
-    hash_map<entity_addr_t,Pipe*>::iterator it = rank_pipe.begin();
+    ceph::unordered_map<entity_addr_t,Pipe*>::iterator it = rank_pipe.begin();
     Pipe *p = it->second;
     ldout(cct,5) << "mark_down_all " << it->first << " " << p << dendl;
     rank_pipe.erase(it);
index 6c29999344959200e501e9de73692898dab5af78..e6e1fb1d0cb86d2e89cf6b9e1ebe298f6361acdf 100644 (file)
@@ -21,9 +21,8 @@
 #include <list>
 #include <map>
 using namespace std;
-#include <ext/hash_map>
-#include <ext/hash_set>
-using namespace __gnu_cxx;
+#include "include/unordered_map.h"
+#include "include/unordered_set.h"
 
 #include "common/Mutex.h"
 #include "include/atomic.h"
@@ -317,7 +316,7 @@ private:
    * NOTE: a Pipe* with state CLOSED may still be in the map but is considered
    * invalid and can be replaced by anyone holding the msgr lock
    */
-  hash_map<entity_addr_t, Pipe*> rank_pipe;
+  ceph::unordered_map<entity_addr_t, Pipe*> rank_pipe;
   /**
    * list of pipes are in teh process of accepting
    *
@@ -351,7 +350,7 @@ private:
   friend class Pipe;
 
   Pipe *_lookup_pipe(const entity_addr_t& k) {
-    hash_map<entity_addr_t, Pipe*>::iterator p = rank_pipe.find(k);
+    ceph::unordered_map<entity_addr_t, Pipe*>::iterator p = rank_pipe.find(k);
     if (p == rank_pipe.end())
       return NULL;
     // see lock cribbing in Pipe::fault()
index 40b3f0bfedcc1ecdcd2233fd7aaf2e46132e809e..5d86b3a229e29c1e0ff70fa9ae41a09904de6e53 100644 (file)
@@ -20,6 +20,7 @@
 #include "include/types.h"
 #include "include/blobhash.h"
 #include "include/encoding.h"
+#include "include/hash_namespace.h"
 
 namespace ceph {
   class Formatter;
@@ -139,7 +140,7 @@ inline std::ostream& operator<<(std::ostream& out, const ceph_entity_name& addr)
   return out << *(const entity_name_t*)&addr;
 }
 
-namespace __gnu_cxx {
+CEPH_HASH_NAMESPACE_START
   template<> struct hash< entity_name_t >
   {
     size_t operator()( const entity_name_t &m ) const
@@ -147,7 +148,7 @@ namespace __gnu_cxx {
       return rjhash32(m.type() ^ m.num());
     }
   };
-}
+CEPH_HASH_NAMESPACE_END
 
 
 
@@ -359,7 +360,7 @@ inline bool operator<=(const entity_addr_t& a, const entity_addr_t& b) { return
 inline bool operator>(const entity_addr_t& a, const entity_addr_t& b) { return memcmp(&a, &b, sizeof(a)) > 0; }
 inline bool operator>=(const entity_addr_t& a, const entity_addr_t& b) { return memcmp(&a, &b, sizeof(a)) >= 0; }
 
-namespace __gnu_cxx {
+CEPH_HASH_NAMESPACE_START
   template<> struct hash< entity_addr_t >
   {
     size_t operator()( const entity_addr_t& x ) const
@@ -368,7 +369,7 @@ namespace __gnu_cxx {
       return H((const char*)&x, sizeof(x));
     }
   };
-}
+CEPH_HASH_NAMESPACE_END
 
 
 /*
@@ -413,7 +414,7 @@ inline bool operator<=(const entity_inst_t& a, const entity_inst_t& b) {
 inline bool operator>(const entity_inst_t& a, const entity_inst_t& b) { return b < a; }
 inline bool operator>=(const entity_inst_t& a, const entity_inst_t& b) { return b <= a; }
 
-namespace __gnu_cxx {
+CEPH_HASH_NAMESPACE_START
   template<> struct hash< entity_inst_t >
   {
     size_t operator()( const entity_inst_t& x ) const
@@ -423,7 +424,7 @@ namespace __gnu_cxx {
       return H(x.name) ^ I(x.addr);
     }
   };
-}
+CEPH_HASH_NAMESPACE_END
 
 
 inline ostream& operator<<(ostream& out, const entity_inst_t &i)
index 89b7b86263227309b2e555ce799483fb25ba23fd..529db015bf039938cd26b2824bc8212310ef7cbf 100644 (file)
@@ -17,7 +17,7 @@
 
 #include <string>
 #include <vector>
-#include <tr1/memory>
+#include "include/memory.h"
 
 #include "osd/osd_types.h"
 #include "include/object.h"
@@ -43,14 +43,14 @@ protected:
     /// Returned path
     string full_path;
     /// Ref to parent Index
-    std::tr1::shared_ptr<CollectionIndex> parent_ref;
+    ceph::shared_ptr<CollectionIndex> parent_ref;
     /// coll_t for parent Index
     coll_t parent_coll;
 
     /// Normal Constructor
     Path(
       string path,                              ///< [in] Path to return.
-      std::tr1::weak_ptr<CollectionIndex> ref)  ///< [in] weak_ptr to parent.
+      ceph::weak_ptr<CollectionIndex> ref)  ///< [in] weak_ptr to parent.
       : full_path(path), parent_ref(ref), parent_coll(parent_ref->coll()) {}
 
     /// Debugging Constructor
@@ -66,13 +66,13 @@ protected:
     coll_t coll() const { return parent_coll; }
 
     /// Getter for parent
-    std::tr1::shared_ptr<CollectionIndex> get_index() const {
+    ceph::shared_ptr<CollectionIndex> get_index() const {
       return parent_ref;
     }
   };
  public:
   /// Type of returned paths
-  typedef std::tr1::shared_ptr<Path> IndexedPath;
+  typedef ceph::shared_ptr<Path> IndexedPath;
 
   static IndexedPath get_testing_path(string path, coll_t collection) {
     return IndexedPath(new Path(path, collection));
@@ -99,7 +99,7 @@ protected:
    *
    * @see IndexManager
    */
-  virtual void set_ref(std::tr1::shared_ptr<CollectionIndex> ref) = 0;
+  virtual void set_ref(ceph::shared_ptr<CollectionIndex> ref) = 0;
 
   /** 
    * Initializes the index.
@@ -161,7 +161,7 @@ protected:
   virtual int split(
     uint32_t match,                             //< [in] value to match
     uint32_t bits,                              //< [in] bits to check
-    std::tr1::shared_ptr<CollectionIndex> dest  //< [in] destination index
+    ceph::shared_ptr<CollectionIndex> dest  //< [in] destination index
     ) { assert(0); return 0; }
 
 
index 9057748341f7f0192654364305fa3d22a31067f9..886658f9aa760a9305fcdfc625596ad265dadd33 100644 (file)
@@ -7,7 +7,7 @@
 #include <set>
 #include <map>
 #include <string>
-#include <tr1/memory>
+#include "include/memory.h"
 #include <vector>
 
 #include "ObjectMap.h"
index eb3950cfa3be0e316799f8997e4ca32383a1d837..a71c369fc028ed1cf66fda87c181739334df57b1 100644 (file)
@@ -8,7 +8,7 @@
 #include <string>
 
 #include <vector>
-#include <tr1/memory>
+#include "include/memory.h"
 #include <boost/scoped_ptr.hpp>
 
 #include "ObjectMap.h"
@@ -280,7 +280,7 @@ public:
                                   coll_t *c, ghobject_t *oid);
 private:
   /// Implicit lock on Header->seq
-  typedef std::tr1::shared_ptr<_Header> Header;
+  typedef ceph::shared_ptr<_Header> Header;
 
   string map_header_key(const ghobject_t &oid);
   string header_key(uint64_t seq);
@@ -316,12 +316,12 @@ private:
     Header header;
 
     /// parent_iter == NULL iff no parent
-    std::tr1::shared_ptr<DBObjectMapIteratorImpl> parent_iter;
+    ceph::shared_ptr<DBObjectMapIteratorImpl> parent_iter;
     KeyValueDB::Iterator key_iter;
     KeyValueDB::Iterator complete_iter;
 
     /// cur_iter points to currently valid iterator
-    std::tr1::shared_ptr<ObjectMapIteratorImpl> cur_iter;
+    ceph::shared_ptr<ObjectMapIteratorImpl> cur_iter;
     int r;
 
     /// init() called, key_iter, complete_iter, parent_iter filled in
@@ -360,7 +360,7 @@ private:
     int adjust();
   };
 
-  typedef std::tr1::shared_ptr<DBObjectMapIteratorImpl> DBObjectMapIterator;
+  typedef ceph::shared_ptr<DBObjectMapIteratorImpl> DBObjectMapIterator;
   DBObjectMapIterator _get_iterator(Header header) {
     return DBObjectMapIterator(new DBObjectMapIteratorImpl(this, header));
   }
index 93557d43c4730531cfdde860253db1ad23484d32..13d7445e85bfab8ff9d61bbf7c505785eec54ca8 100644 (file)
@@ -61,7 +61,7 @@ public:
   ~FDCache() {
     cct->_conf->remove_observer(this);
   }
-  typedef std::tr1::shared_ptr<FD> FDRef;
+  typedef ceph::shared_ptr<FD> FDRef;
 
   FDRef lookup(const ghobject_t &hoid) {
     return registry.lookup(hoid);
index 88e6c66e9c3bc17a3923b8d4cb261e814fa637f1..d30eeba74e0e544307c65b28874eff8b543aa536 100644 (file)
@@ -24,8 +24,7 @@
 #include <fstream>
 using namespace std;
 
-#include <ext/hash_map>
-using namespace __gnu_cxx;
+#include "include/unordered_map.h"
 
 #include "include/assert.h"
 
index d4644abc627dae1d45c78b379d357b115935d31a..2f1a1d16c6fcc1acfa8c6970616dab3cd217e187 100644 (file)
@@ -49,7 +49,7 @@ using ceph::crypto::SHA1;
 
 #define FILENAME_PREFIX_LEN (FILENAME_SHORT_LEN - FILENAME_HASH_LEN - (sizeof(FILENAME_COOKIE) - 1) - FILENAME_EXTRA)
 
-void FlatIndex::set_ref(std::tr1::shared_ptr<CollectionIndex> ref) {
+void FlatIndex::set_ref(ceph::shared_ptr<CollectionIndex> ref) {
   self_ref = ref;
 }
 
index 657c273468b4387657060c5e6bc8e092f66ae3af..e55bd142c065e26b4b56c71918ee6fdda5262f24 100644 (file)
@@ -19,7 +19,7 @@
 #include <map>
 #include <set>
 #include <vector>
-#include <tr1/memory>
+#include "include/memory.h"
 
 #include "CollectionIndex.h"
 
@@ -29,7 +29,7 @@
  * This class should only be used for converting old filestores.
  */
 class FlatIndex : public CollectionIndex {
-  std::tr1::weak_ptr<CollectionIndex> self_ref;
+  ceph::weak_ptr<CollectionIndex> self_ref;
   string base_path;
   coll_t collection;
 public:
@@ -42,7 +42,7 @@ public:
   coll_t coll() const { return collection; }
 
   /// @see CollectionIndex
-  void set_ref(std::tr1::shared_ptr<CollectionIndex> ref);
+  void set_ref(ceph::shared_ptr<CollectionIndex> ref);
 
   /// @see CollectionIndex
   int cleanup();
index ea50cd038ca593b2138808fb47530e8d5d74a8fa..134deb9d5a70a44ff382621fa13b03ba5c78102a 100644 (file)
@@ -224,7 +224,7 @@ int HashIndex::col_split_level(
 int HashIndex::_split(
   uint32_t match,
   uint32_t bits,
-  std::tr1::shared_ptr<CollectionIndex> dest) {
+  ceph::shared_ptr<CollectionIndex> dest) {
   assert(collection_version() == dest->collection_version());
   unsigned mkdirred = 0;
   return col_split_level(
index 6f5bca077d4e877071a00282dfeed04fc353107e..bdfee2ed453619abe96b7c0e9b3199cc987010b1 100644 (file)
@@ -155,7 +155,7 @@ public:
   int _split(
     uint32_t match,
     uint32_t bits,
-    std::tr1::shared_ptr<CollectionIndex> dest
+    ceph::shared_ptr<CollectionIndex> dest
     );
        
 protected:
index 83bbfc9703e677db49c0ca5ead4fcfead500989f..e8a3785865f4fd0b6123000837ff0c28f1dfcbf7 100644 (file)
@@ -12,7 +12,7 @@
  * 
  */
 
-#include <tr1/memory>
+#include "include/memory.h"
 #include <map>
 
 #if defined(__FreeBSD__)
index 43de7ee49c8f21c82f52596145dbbf403404fb09..2aa7c66a754f83a04194ecb8ffcb1093372490f8 100644 (file)
@@ -14,7 +14,7 @@
 #ifndef OS_INDEXMANAGER_H
 #define OS_INDEXMANAGER_H
 
-#include <tr1/memory>
+#include "include/memory.h"
 #include <map>
 
 #include "common/Mutex.h"
@@ -28,7 +28,7 @@
 
 
 /// Public type for Index
-typedef std::tr1::shared_ptr<CollectionIndex> Index;
+typedef ceph::shared_ptr<CollectionIndex> Index;
 /**
  * Encapsulates mutual exclusion for CollectionIndexes.
  *
@@ -50,7 +50,7 @@ class IndexManager {
   bool upgrade;
 
   /// Currently in use CollectionIndices
-  map<coll_t,std::tr1::weak_ptr<CollectionIndex> > col_indices;
+  map<coll_t,ceph::weak_ptr<CollectionIndex> > col_indices;
 
   /// Cleans up state for c @see RemoveOnDelete
   void put_index(
index e98463aa763a60d90bf4de5dff1ff7403bdd49ca..8b2cefb3aba6d2a81656e2b5e5719a24deeb811f 100644 (file)
@@ -7,7 +7,7 @@
 #include <set>
 #include <map>
 #include <string>
-#include <tr1/memory>
+#include "include/memory.h"
 #include <boost/scoped_ptr.hpp>
 #include "ObjectMap.h"
 
@@ -62,7 +62,7 @@ public:
 
     virtual ~TransactionImpl() {};
   };
-  typedef std::tr1::shared_ptr< TransactionImpl > Transaction;
+  typedef ceph::shared_ptr< TransactionImpl > Transaction;
 
   virtual Transaction get_transaction() = 0;
   virtual int submit_transaction(Transaction) = 0;
@@ -94,7 +94,7 @@ public:
     virtual int status() = 0;
     virtual ~WholeSpaceIteratorImpl() { }
   };
-  typedef std::tr1::shared_ptr< WholeSpaceIteratorImpl > WholeSpaceIterator;
+  typedef ceph::shared_ptr< WholeSpaceIteratorImpl > WholeSpaceIterator;
 
   class IteratorImpl : public ObjectMap::ObjectMapIteratorImpl {
     const string prefix;
@@ -143,14 +143,14 @@ public:
     }
   };
 
-  typedef std::tr1::shared_ptr< IteratorImpl > Iterator;
+  typedef ceph::shared_ptr< IteratorImpl > Iterator;
 
   WholeSpaceIterator get_iterator() {
     return _get_iterator();
   }
 
   Iterator get_iterator(const string &prefix) {
-    return std::tr1::shared_ptr<IteratorImpl>(
+    return ceph::shared_ptr<IteratorImpl>(
       new IteratorImpl(prefix, get_iterator())
     );
   }
@@ -160,7 +160,7 @@ public:
   }
 
   Iterator get_snapshot_iterator(const string &prefix) {
-    return std::tr1::shared_ptr<IteratorImpl>(
+    return ceph::shared_ptr<IteratorImpl>(
       new IteratorImpl(prefix, get_snapshot_iterator())
     );
   }
index 83e1c144754355b941d747dcccde453a83d25f1a..a250016e8e9dfde120e52c439e5d251ac3274a74 100644 (file)
@@ -63,7 +63,7 @@ void LFNIndex::maybe_inject_failure()
 
 /* Public methods */
 
-void LFNIndex::set_ref(std::tr1::shared_ptr<CollectionIndex> ref)
+void LFNIndex::set_ref(ceph::shared_ptr<CollectionIndex> ref)
 {
   self_ref = ref;
 }
index f436446bf0f6fc0454c5f3cd9eb4db6deaf7c1d1..c9c7f5ed141db6cee7ee090782a6ab94a4f27d33 100644 (file)
@@ -20,7 +20,7 @@
 #include <map>
 #include <set>
 #include <vector>
-#include <tr1/memory>
+#include "include/memory.h"
 #include <exception>
 
 #include "osd/osd_types.h"
@@ -99,7 +99,7 @@ class LFNIndex : public CollectionIndex {
   /// Path to Index base.
   const string base_path;
   /// For reference counting the collection @see Path
-  std::tr1::weak_ptr<CollectionIndex> self_ref;
+  ceph::weak_ptr<CollectionIndex> self_ref;
 
 protected:
   const uint32_t index_version;
@@ -155,7 +155,7 @@ public:
   virtual ~LFNIndex() {}
 
   /// @see CollectionIndex
-  void set_ref(std::tr1::shared_ptr<CollectionIndex> ref);
+  void set_ref(ceph::shared_ptr<CollectionIndex> ref);
 
   /// @see CollectionIndex
   int init();
@@ -199,14 +199,14 @@ public:
   virtual int _split(
     uint32_t match,                             //< [in] value to match
     uint32_t bits,                              //< [in] bits to check
-    std::tr1::shared_ptr<CollectionIndex> dest  //< [in] destination index
+    ceph::shared_ptr<CollectionIndex> dest  //< [in] destination index
     ) = 0;
   
   /// @see CollectionIndex
   int split(
     uint32_t match,
     uint32_t bits,
-    std::tr1::shared_ptr<CollectionIndex> dest
+    ceph::shared_ptr<CollectionIndex> dest
     ) {
     WRAP_RETRY(
       r = _split(match, bits, dest);
index bf98b67ad67dbd0f8714cb2fd0a3cbe9b2c6c073..668f196675fafabe4593c4958002d197c43a1874 100644 (file)
@@ -5,7 +5,7 @@
 #include <set>
 #include <map>
 #include <string>
-#include <tr1/memory>
+#include "include/memory.h"
 #include <errno.h>
 using std::string;
 #include "common/perf_counters.h"
index d0a41f27960ba3a2fe70e75a5546f84c5d9cb2d5..8b5947af7e28a599dbcf15841f19480d2e16402a 100644 (file)
@@ -9,7 +9,7 @@
 #include <set>
 #include <map>
 #include <string>
-#include <tr1/memory>
+#include "include/memory.h"
 #include <boost/scoped_ptr.hpp>
 #include "leveldb/db.h"
 #include "leveldb/env.h"
@@ -186,7 +186,7 @@ public:
   };
 
   KeyValueDB::Transaction get_transaction() {
-    return std::tr1::shared_ptr< LevelDBTransactionImpl >(
+    return ceph::shared_ptr< LevelDBTransactionImpl >(
       new LevelDBTransactionImpl(this));
   }
 
@@ -372,7 +372,7 @@ err:
 
 protected:
   WholeSpaceIterator _get_iterator() {
-    return std::tr1::shared_ptr<KeyValueDB::WholeSpaceIteratorImpl>(
+    return ceph::shared_ptr<KeyValueDB::WholeSpaceIteratorImpl>(
       new LevelDBWholeSpaceIteratorImpl(
        db->NewIterator(leveldb::ReadOptions())
       )
@@ -386,7 +386,7 @@ protected:
     snapshot = db->GetSnapshot();
     options.snapshot = snapshot;
 
-    return std::tr1::shared_ptr<KeyValueDB::WholeSpaceIteratorImpl>(
+    return ceph::shared_ptr<KeyValueDB::WholeSpaceIteratorImpl>(
       new LevelDBSnapshotIteratorImpl(db.get(), snapshot,
        db->NewIterator(options))
     );
index 89b148712fd3220041a4216569700940ccd643f0..4bcd93f406a9b5e8c145f9812df5638ba008885c 100644 (file)
@@ -23,6 +23,8 @@
 
 #include "include/types.h"
 #include "include/stringify.h"
+#include "include/unordered_map.h"
+#include "include/memory.h"
 #include "common/errno.h"
 #include "MemStore.h"
 
@@ -65,7 +67,7 @@ int MemStore::_save()
   Mutex::Locker l(apply_lock); // block any writer
   dump_all();
   set<coll_t> collections;
-  for (hash_map<coll_t,CollectionRef>::iterator p = coll_map.begin();
+  for (ceph::unordered_map<coll_t,CollectionRef>::iterator p = coll_map.begin();
        p != coll_map.end();
        ++p) {
     dout(20) << __func__ << " coll " << p->first << " " << p->second << dendl;
@@ -104,7 +106,7 @@ void MemStore::dump_all()
 void MemStore::dump(Formatter *f)
 {
   f->open_array_section("collections");
-  for (hash_map<coll_t,CollectionRef>::iterator p = coll_map.begin();
+  for (ceph::unordered_map<coll_t,CollectionRef>::iterator p = coll_map.begin();
        p != coll_map.end();
        ++p) {
     f->open_object_section("collection");
@@ -236,7 +238,7 @@ objectstore_perf_stat_t MemStore::get_cur_stats()
 MemStore::CollectionRef MemStore::get_collection(coll_t cid)
 {
   RWLock::RLocker l(coll_lock);
-  hash_map<coll_t,CollectionRef>::iterator cp = coll_map.find(cid);
+  ceph::unordered_map<coll_t,CollectionRef>::iterator cp = coll_map.find(cid);
   if (cp == coll_map.end())
     return CollectionRef();
   return cp->second;
@@ -383,7 +385,7 @@ int MemStore::list_collections(vector<coll_t>& ls)
 {
   dout(10) << __func__ << dendl;
   RWLock::RLocker l(coll_lock);
-  for (hash_map<coll_t,CollectionRef>::iterator p = coll_map.begin();
+  for (ceph::unordered_map<coll_t,CollectionRef>::iterator p = coll_map.begin();
        p != coll_map.end();
        ++p) {
     ls.push_back(p->first);
@@ -1315,7 +1317,7 @@ int MemStore::_create_collection(coll_t cid)
 {
   dout(10) << __func__ << " " << cid << dendl;
   RWLock::WLocker l(coll_lock);
-  hash_map<coll_t,CollectionRef>::iterator cp = coll_map.find(cid);
+  ceph::unordered_map<coll_t,CollectionRef>::iterator cp = coll_map.find(cid);
   if (cp != coll_map.end())
     return -EEXIST;
   coll_map[cid].reset(new Collection);
@@ -1326,7 +1328,7 @@ int MemStore::_destroy_collection(coll_t cid)
 {
   dout(10) << __func__ << " " << cid << dendl;
   RWLock::WLocker l(coll_lock);
-  hash_map<coll_t,CollectionRef>::iterator cp = coll_map.find(cid);
+  ceph::unordered_map<coll_t,CollectionRef>::iterator cp = coll_map.find(cid);
   if (cp == coll_map.end())
     return -ENOENT;
   {
@@ -1390,7 +1392,7 @@ int MemStore::_collection_setattr(coll_t cid, const char *name,
                                  const void *value, size_t size)
 {
   dout(10) << __func__ << " " << cid << " " << name << dendl;
-  hash_map<coll_t,CollectionRef>::iterator cp = coll_map.find(cid);
+  ceph::unordered_map<coll_t,CollectionRef>::iterator cp = coll_map.find(cid);
   if (cp == coll_map.end())
     return -ENOENT;
   RWLock::WLocker l(cp->second->lock);
@@ -1402,7 +1404,7 @@ int MemStore::_collection_setattr(coll_t cid, const char *name,
 int MemStore::_collection_setattrs(coll_t cid, map<string,bufferptr> &aset)
 {
   dout(10) << __func__ << " " << cid << dendl;
-  hash_map<coll_t,CollectionRef>::iterator cp = coll_map.find(cid);
+  ceph::unordered_map<coll_t,CollectionRef>::iterator cp = coll_map.find(cid);
   if (cp == coll_map.end())
     return -ENOENT;
   RWLock::WLocker l(cp->second->lock);
@@ -1418,7 +1420,7 @@ int MemStore::_collection_setattrs(coll_t cid, map<string,bufferptr> &aset)
 int MemStore::_collection_rmattr(coll_t cid, const char *name)
 {
   dout(10) << __func__ << " " << cid << " " << name << dendl;
-  hash_map<coll_t,CollectionRef>::iterator cp = coll_map.find(cid);
+  ceph::unordered_map<coll_t,CollectionRef>::iterator cp = coll_map.find(cid);
   if (cp == coll_map.end())
     return -ENOENT;
   RWLock::WLocker l(cp->second->lock);
index 6b212ee28f13ec1d80369cca52db598b91069f49..c33dd04ca9353e217c96b987a73be84585a0ac80 100644 (file)
 #ifndef CEPH_MEMSTORE_H
 #define CEPH_MEMSTORE_H
 
-#include <ext/hash_map>
-using namespace __gnu_cxx;
-
 #include "include/assert.h"
+#include "include/unordered_map.h"
+#include "include/memory.h"
 #include "common/Finisher.h"
 #include "common/RWLock.h"
 #include "ObjectStore.h"
@@ -75,10 +74,10 @@ public:
       f->close_section();
     }
   };
-  typedef std::tr1::shared_ptr<Object> ObjectRef;
+  typedef ceph::shared_ptr<Object> ObjectRef;
 
   struct Collection {
-    hash_map<ghobject_t, ObjectRef> object_hash;  ///< for lookup
+    ceph::unordered_map<ghobject_t, ObjectRef> object_hash;  ///< for lookup
     map<ghobject_t, ObjectRef> object_map;        ///< for iteration
     map<string,bufferptr> xattr;
     RWLock lock;   ///< for object_{map,hash}
@@ -89,7 +88,7 @@ public:
     // level.
 
     ObjectRef get_object(ghobject_t oid) {
-      hash_map<ghobject_t,ObjectRef>::iterator o = object_hash.find(oid);
+      ceph::unordered_map<ghobject_t,ObjectRef>::iterator o = object_hash.find(oid);
       if (o == object_hash.end())
        return ObjectRef();
       return o->second;
@@ -126,7 +125,7 @@ public:
 
     Collection() : lock("MemStore::Collection::lock") {}
   };
-  typedef std::tr1::shared_ptr<Collection> CollectionRef;
+  typedef ceph::shared_ptr<Collection> CollectionRef;
 
 private:
   class OmapIteratorImpl : public ObjectMap::ObjectMapIteratorImpl {
@@ -175,7 +174,7 @@ private:
   };
 
 
-  hash_map<coll_t, CollectionRef> coll_map;
+  ceph::unordered_map<coll_t, CollectionRef> coll_map;
   RWLock coll_lock;    ///< rwlock to protect coll_map
   Mutex apply_lock;    ///< serialize all updates
 
index b460a95663687673e16b8d82821d9c8b1c8059ce..86f9e3e51fac6e67ad0b6dd1b7ffc8d5bde5c2ae 100644 (file)
@@ -19,7 +19,7 @@
 #include "SequencerPosition.h"
 #include <string>
 #include <vector>
-#include <tr1/memory>
+#include "include/memory.h"
 
 /**
  * Encapsulates the FileStore key value store
@@ -149,7 +149,7 @@ public:
     virtual int status() = 0;
     virtual ~ObjectMapIteratorImpl() {}
   };
-  typedef std::tr1::shared_ptr<ObjectMapIteratorImpl> ObjectMapIterator;
+  typedef ceph::shared_ptr<ObjectMapIteratorImpl> ObjectMapIterator;
   virtual ObjectMapIterator get_iterator(const ghobject_t &oid) {
     return ObjectMapIterator();
   }
index db22d978497dfec68afd7a56a4475438cc917663..8a8375f569974faabdee0748b2d66722c1e307ad 100644 (file)
@@ -13,7 +13,7 @@
  */
 #include <ctype.h>
 #include <sstream>
-#include <tr1/memory>
+#include "include/memory.h"
 #include "ObjectStore.h"
 #include "common/Formatter.h"
 #include "FileStore.h"
index d1feb9bf848e81000619fc758ee903433ba799bb..f643e39fad88c2bbfb03c6c255da0ccaa5cbaf59 100644 (file)
@@ -17,7 +17,7 @@
 
 #include <map>
 #include <boost/tuple/tuple.hpp>
-#include <tr1/memory>
+#include "include/memory.h"
 #include "include/buffer.h"
 #include "common/Formatter.h"
 #include "common/hobject.h"
index f123adefded3213049564716d41cf1d180f43379..9a44be71bb88f7f2ef28ac18248a35323d395bbd 100644 (file)
 
 #include <map>
 #include <set>
-#include <tr1/memory>
+#include "include/memory.h"
 #include "include/buffer.h"
 
 using namespace std;
@@ -343,7 +343,7 @@ namespace ceph {
     }
   };
 
-  typedef std::tr1::shared_ptr<ErasureCodeInterface> ErasureCodeInterfaceRef;
+  typedef ceph::shared_ptr<ErasureCodeInterface> ErasureCodeInterfaceRef;
 
 }
 
index d30c9b712936849f956c296c2b2a776c26dce5de..b6acce9485058ce7b824254c42563d2261424d29 100644 (file)
@@ -18,6 +18,7 @@
 #include <boost/scoped_ptr.hpp>
 
 #include "include/encoding.h"
+#include "include/unordered_set.h"
 #include "common/bloom_filter.hpp"
 #include "common/hobject.h"
 #include "common/Formatter.h"
@@ -176,7 +177,7 @@ ostream& operator<<(ostream& out, const HitSet::Params& p);
  */
 class ExplicitHashHitSet : public HitSet::Impl {
   uint64_t count;
-  hash_set<uint32_t> hits;
+  ceph::unordered_set<uint32_t> hits;
 public:
   class Params : public HitSet::Params::Impl {
   public:
@@ -234,7 +235,7 @@ public:
   void dump(Formatter *f) const {
     f->dump_unsigned("insert_count", count);
     f->open_array_section("hash_set");
-    for (hash_set<uint32_t>::const_iterator p = hits.begin(); p != hits.end(); ++p)
+    for (ceph::unordered_set<uint32_t>::const_iterator p = hits.begin(); p != hits.end(); ++p)
       f->dump_unsigned("hash", *p);
     f->close_section();
   }
@@ -253,7 +254,7 @@ WRITE_CLASS_ENCODER(ExplicitHashHitSet)
  */
 class ExplicitObjectHitSet : public HitSet::Impl {
   uint64_t count;
-  hash_set<hobject_t> hits;
+  ceph::unordered_set<hobject_t> hits;
 public:
   class Params : public HitSet::Params::Impl {
   public:
@@ -311,7 +312,7 @@ public:
   void dump(Formatter *f) const {
     f->dump_unsigned("insert_count", count);
     f->open_array_section("set");
-    for (hash_set<hobject_t>::const_iterator p = hits.begin(); p != hits.end(); ++p) {
+    for (ceph::unordered_set<hobject_t>::const_iterator p = hits.begin(); p != hits.end(); ++p) {
       f->open_object_section("object");
       p->dump(f);
       f->close_section();
index f192f479c2ecf7a6fe75ae6c3fbdf702b5d587ac..dee18bdb1d657dda64e3f2a7762ed4460fc09a56 100644 (file)
@@ -937,7 +937,7 @@ bool OSD::asok_command(string command, cmdmap_t& cmdmap, string format,
     list<obj_watch_item_t> watchers;
     osd_lock.Lock();
     // scan pg's
-    for (hash_map<pg_t,PG*>::iterator it = pg_map.begin();
+    for (ceph::unordered_map<pg_t,PG*>::iterator it = pg_map.begin();
         it != pg_map.end();
         ++it) {
 
@@ -1447,7 +1447,7 @@ int OSD::shutdown()
   cct->_conf->apply_changes(NULL);
   
   // Shutdown PGs
-  for (hash_map<pg_t, PG*>::iterator p = pg_map.begin();
+  for (ceph::unordered_map<pg_t, PG*>::iterator p = pg_map.begin();
        p != pg_map.end();
        ++p) {
     dout(20) << " kicking pg " << p->first << dendl;
@@ -1543,7 +1543,7 @@ int OSD::shutdown()
 #ifdef PG_DEBUG_REFS
   service.dump_live_pgids();
 #endif
-  for (hash_map<pg_t, PG*>::iterator p = pg_map.begin();
+  for (ceph::unordered_map<pg_t, PG*>::iterator p = pg_map.begin();
        p != pg_map.end();
        ++p) {
     dout(20) << " kicking pg " << p->first << dendl;
@@ -2004,7 +2004,7 @@ void OSD::build_past_intervals_parallel()
   // calculate untion of map range
   epoch_t end_epoch = superblock.oldest_map;
   epoch_t cur_epoch = superblock.newest_map;
-  for (hash_map<pg_t, PG*>::iterator i = pg_map.begin();
+  for (ceph::unordered_map<pg_t, PG*>::iterator i = pg_map.begin();
        i != pg_map.end();
        ++i) {
     PG *pg = i->second;
@@ -2582,7 +2582,7 @@ void OSD::maybe_update_heartbeat_peers()
 
   // build heartbeat from set
   if (is_active()) {
-    for (hash_map<pg_t, PG*>::iterator i = pg_map.begin();
+    for (ceph::unordered_map<pg_t, PG*>::iterator i = pg_map.begin();
         i != pg_map.end();
         ++i) {
       PG *pg = i->second;
@@ -4169,7 +4169,7 @@ void OSD::do_command(Connection *con, tid_t tid, vector<string>& cmd, bufferlist
     }
 
     std::set <pg_t> keys;
-    for (hash_map<pg_t, PG*>::const_iterator pg_map_e = pg_map.begin();
+    for (ceph::unordered_map<pg_t, PG*>::const_iterator pg_map_e = pg_map.begin();
         pg_map_e != pg_map.end(); ++pg_map_e) {
       keys.insert(pg_map_e->first);
     }
@@ -4177,7 +4177,7 @@ void OSD::do_command(Connection *con, tid_t tid, vector<string>& cmd, bufferlist
     fout << "*** osd " << whoami << ": dump_missing ***" << std::endl;
     for (std::set <pg_t>::iterator p = keys.begin();
         p != keys.end(); ++p) {
-      hash_map<pg_t, PG*>::iterator q = pg_map.find(*p);
+      ceph::unordered_map<pg_t, PG*>::iterator q = pg_map.find(*p);
       assert(q != pg_map.end());
       PG *pg = q->second;
       pg->lock();
@@ -4749,7 +4749,7 @@ void OSD::handle_scrub(MOSDScrub *m)
   }
 
   if (m->scrub_pgs.empty()) {
-    for (hash_map<pg_t, PG*>::iterator p = pg_map.begin();
+    for (ceph::unordered_map<pg_t, PG*>::iterator p = pg_map.begin();
         p != pg_map.end();
         ++p) {
       PG *pg = p->second;
@@ -5459,9 +5459,9 @@ void OSD::advance_map(ObjectStore::Transaction& t, C_Contexts *tfin)
   }
 
   // scan pg creations
-  hash_map<pg_t, create_pg_info>::iterator n = creating_pgs.begin();
+  ceph::unordered_map<pg_t, create_pg_info>::iterator n = creating_pgs.begin();
   while (n != creating_pgs.end()) {
-    hash_map<pg_t, create_pg_info>::iterator p = n++;
+    ceph::unordered_map<pg_t, create_pg_info>::iterator p = n++;
     pg_t pgid = p->first;
 
     // am i still primary?
@@ -5509,7 +5509,7 @@ void OSD::consume_map()
   list<PGRef> to_remove;
 
   // scan pg's
-  for (hash_map<pg_t,PG*>::iterator it = pg_map.begin();
+  for (ceph::unordered_map<pg_t,PG*>::iterator it = pg_map.begin();
        it != pg_map.end();
        ++it) {
     PG *pg = it->second;
@@ -5546,7 +5546,7 @@ void OSD::consume_map()
   service.publish_map(osdmap);
 
   // scan pg's
-  for (hash_map<pg_t,PG*>::iterator it = pg_map.begin();
+  for (ceph::unordered_map<pg_t,PG*>::iterator it = pg_map.begin();
        it != pg_map.end();
        ++it) {
     PG *pg = it->second;
index 889822b39949bf5ef70d58084bab13821b5ef80a..1dbd70bf1977bb6a68bea538d1b82e6cbff662c9 100644 (file)
 
 #include <map>
 #include <memory>
-#include <tr1/memory>
+#include "include/memory.h"
 using namespace std;
 
-#include <ext/hash_map>
-#include <ext/hash_set>
-using namespace __gnu_cxx;
+#include "include/unordered_map.h"
+#include "include/unordered_set.h"
 
 #include "Watch.h"
 #include "common/shared_cache.hpp"
@@ -179,7 +178,7 @@ class HistoricOpsSocketHook;
 class TestOpsSocketHook;
 struct C_CompleteSplits;
 
-typedef std::tr1::shared_ptr<ObjectStore::Sequencer> SequencerRef;
+typedef ceph::shared_ptr<ObjectStore::Sequencer> SequencerRef;
 
 class DeletingState {
   Mutex lock;
@@ -279,7 +278,7 @@ public:
     return status != DELETED_DIR;
   } ///< @return true if we don't need to recreate the collection
 };
-typedef std::tr1::shared_ptr<DeletingState> DeletingStateRef;
+typedef ceph::shared_ptr<DeletingState> DeletingStateRef;
 
 class OSD;
 class OSDService {
@@ -1142,7 +1141,7 @@ private:
 
 protected:
   // -- placement groups --
-  hash_map<pg_t, PG*> pg_map;
+  ceph::unordered_map<pg_t, PG*> pg_map;
   map<pg_t, list<OpRequestRef> > waiting_for_pg;
   map<pg_t, list<PG::CephPeeringEvtRef> > peering_wait_for_split;
   PGRecoveryStats pg_recovery_stats;
@@ -1220,7 +1219,7 @@ protected:
     set<int> prior;
     pg_t parent;
   };
-  hash_map<pg_t, create_pg_info> creating_pgs;
+  ceph::unordered_map<pg_t, create_pg_info> creating_pgs;
   double debug_drop_pg_create_probability;
   int debug_drop_pg_create_duration;
   int debug_drop_pg_create_left;  // 0 if we just dropped the last one, -1 if we can drop more
index 3f7e12945bd8d4f8e5d608942a2326a203851095..728d748ac240a8f206ccc7ee35e5a62295923be7 100644 (file)
@@ -795,7 +795,7 @@ bool OSDMap::is_blacklisted(const entity_addr_t& a) const
 
 void OSDMap::get_blacklist(list<pair<entity_addr_t,utime_t> > *bl) const
 {
-  for (hash_map<entity_addr_t,utime_t>::const_iterator it = blacklist.begin() ;
+  for (ceph::unordered_map<entity_addr_t,utime_t>::const_iterator it = blacklist.begin() ;
                         it != blacklist.end(); ++it) {
     bl->push_back(*it);
   }
@@ -1898,7 +1898,7 @@ void OSDMap::dump(Formatter *f) const
   f->close_section(); // primary_temp
 
   f->open_array_section("blacklist");
-  for (hash_map<entity_addr_t,utime_t>::const_iterator p = blacklist.begin();
+  for (ceph::unordered_map<entity_addr_t,utime_t>::const_iterator p = blacklist.begin();
        p != blacklist.end();
        ++p) {
     stringstream ss;
@@ -2027,7 +2027,7 @@ void OSDMap::print(ostream& out) const
       ++p)
     out << "primary_temp " << p->first << " " << p->second << "\n";
 
-  for (hash_map<entity_addr_t,utime_t>::const_iterator p = blacklist.begin();
+  for (ceph::unordered_map<entity_addr_t,utime_t>::const_iterator p = blacklist.begin();
        p != blacklist.end();
        ++p)
     out << "blacklist " << p->first << " expires " << p->second << "\n";
index b9690e8186bbdf331579ecaed4a8932dee97dcf7..927ab182bfd2b89d920ac2a2be84ec9646d8bb66 100644 (file)
 #include <list>
 #include <set>
 #include <map>
-#include <tr1/memory>
+#include "include/memory.h"
 using namespace std;
 
-#include <ext/hash_set>
-using __gnu_cxx::hash_set;
+#include "include/unordered_set.h"
 
 /*
  * we track up to two intervals during which the osd was alive and
@@ -193,34 +192,34 @@ private:
   vector<uint8_t> osd_state;
 
   struct addrs_s {
-    vector<std::tr1::shared_ptr<entity_addr_t> > client_addr;
-    vector<std::tr1::shared_ptr<entity_addr_t> > cluster_addr;
-    vector<std::tr1::shared_ptr<entity_addr_t> > hb_back_addr;
-    vector<std::tr1::shared_ptr<entity_addr_t> > hb_front_addr;
+    vector<ceph::shared_ptr<entity_addr_t> > client_addr;
+    vector<ceph::shared_ptr<entity_addr_t> > cluster_addr;
+    vector<ceph::shared_ptr<entity_addr_t> > hb_back_addr;
+    vector<ceph::shared_ptr<entity_addr_t> > hb_front_addr;
     entity_addr_t blank;
   };
-  std::tr1::shared_ptr<addrs_s> osd_addrs;
+  ceph::shared_ptr<addrs_s> osd_addrs;
 
   vector<__u32>   osd_weight;   // 16.16 fixed point, 0x10000 = "in", 0 = "out"
   vector<osd_info_t> osd_info;
-  std::tr1::shared_ptr< map<pg_t,vector<int> > > pg_temp;  // temp pg mapping (e.g. while we rebuild)
-  std::tr1::shared_ptr< map<pg_t,int > > primary_temp;  // temp primary mapping (e.g. while we rebuild)
+  ceph::shared_ptr< map<pg_t,vector<int> > > pg_temp;  // temp pg mapping (e.g. while we rebuild)
+  ceph::shared_ptr< map<pg_t,int > > primary_temp;  // temp primary mapping (e.g. while we rebuild)
 
   map<int64_t,pg_pool_t> pools;
   map<int64_t,string> pool_name;
   map<string,int64_t> name_pool;
 
-  std::tr1::shared_ptr< vector<uuid_d> > osd_uuid;
+  ceph::shared_ptr< vector<uuid_d> > osd_uuid;
   vector<osd_xinfo_t> osd_xinfo;
 
-  hash_map<entity_addr_t,utime_t> blacklist;
+  ceph::unordered_map<entity_addr_t,utime_t> blacklist;
 
   epoch_t cluster_snapshot_epoch;
   string cluster_snapshot;
   bool new_blacklist_entries;
 
  public:
-  std::tr1::shared_ptr<CrushWrapper> crush;       // hierarchical map
+  ceph::shared_ptr<CrushWrapper> crush;       // hierarchical map
 
   friend class OSDMonitor;
   friend class PGMonitor;
@@ -706,7 +705,7 @@ public:
 WRITE_CLASS_ENCODER_FEATURES(OSDMap)
 WRITE_CLASS_ENCODER_FEATURES(OSDMap::Incremental)
 
-typedef std::tr1::shared_ptr<const OSDMap> OSDMapRef;
+typedef ceph::shared_ptr<const OSDMap> OSDMapRef;
 
 inline ostream& operator<<(ostream& out, const OSDMap& m) {
   m.print_oneline_summary(out);
index 96bb5a4864f6951503ea117278bb8b9337024566..96ae305a623458283ddbec256a313f7262c46890 100644 (file)
@@ -21,7 +21,7 @@
 #include "common/Mutex.h"
 #include "include/xlist.h"
 #include "msg/Message.h"
-#include <tr1/memory>
+#include "include/memory.h"
 #include "common/TrackedOp.h"
 
 /**
@@ -157,7 +157,7 @@ public:
 
   void init_from_message();
 
-  typedef std::tr1::shared_ptr<OpRequest> Ref;
+  typedef ceph::shared_ptr<OpRequest> Ref;
 };
 
 typedef OpRequest::Ref OpRequestRef;
index 5e9dd7bbbf8fb61082d6a512c11e8236dbdde3e2..3e66ad351574bcbba5de115ecbf59003e1ccd5c1 100644 (file)
@@ -4501,7 +4501,7 @@ struct FlushState {
     pg->unlock();
   }
 };
-typedef std::tr1::shared_ptr<FlushState> FlushStateRef;
+typedef ceph::shared_ptr<FlushState> FlushStateRef;
 
 void PG::start_flush(ObjectStore::Transaction *t,
                     list<Context *> *on_applied,
index 40417cf60f9f3a80eabf720adb3490dd9af24680..1c338e853a4e618562973ad14d18c6f52251d7d6 100644 (file)
@@ -23,7 +23,7 @@
 #include <boost/statechart/transition.hpp>
 #include <boost/statechart/event_base.hpp>
 #include <boost/scoped_ptr.hpp>
-#include <tr1/memory>
+#include "include/memory.h"
 
 // re-include our assert to clobber boost's
 #include "include/assert.h" 
@@ -55,9 +55,8 @@
 #include <string>
 using namespace std;
 
-#include <ext/hash_map>
-#include <ext/hash_set>
-using namespace __gnu_cxx;
+#include "include/unordered_map.h"
+#include "include/unordered_set.h"
 
 
 //#define DEBUG_RECOVERY_OIDS   // track set of recovering oids explicitly, to find counting bugs
@@ -554,7 +553,7 @@ protected:
   pg_stat_t pg_stats_publish;
 
   // for ordering writes
-  std::tr1::shared_ptr<ObjectStore::Sequencer> osr;
+  ceph::shared_ptr<ObjectStore::Sequencer> osr;
 
   void _update_calc_stats();
   void publish_stats_to_osd();
@@ -967,7 +966,7 @@ public:
     const boost::statechart::event_base &get_event() { return *evt; }
     string get_desc() { return desc; }
   };
-  typedef std::tr1::shared_ptr<CephPeeringEvt> CephPeeringEvtRef;
+  typedef ceph::shared_ptr<CephPeeringEvt> CephPeeringEvtRef;
   list<CephPeeringEvtRef> peering_queue;  // op queue
   list<CephPeeringEvtRef> peering_waiters;
 
index 792191bea2a3035b1cd73195d1fa1a4c6555c2f7..815d0c235e298e84a72bb093f2ac1913f03bae20 100644 (file)
@@ -46,8 +46,8 @@ struct PGLog {
    * plus some methods to manipulate it all.
    */
   struct IndexedLog : public pg_log_t {
-    hash_map<hobject_t,pg_log_entry_t*> objects;  // ptrs into log.  be careful!
-    hash_map<osd_reqid_t,pg_log_entry_t*> caller_ops;
+    ceph::unordered_map<hobject_t,pg_log_entry_t*> objects;  // ptrs into log.  be careful!
+    ceph::unordered_map<osd_reqid_t,pg_log_entry_t*> caller_ops;
 
     // recovery pointers
     list<pg_log_entry_t>::iterator complete_to;  // not inclusive of referenced item
@@ -85,7 +85,7 @@ struct PGLog {
       return caller_ops.count(r);
     }
     const pg_log_entry_t *get_request(const osd_reqid_t &r) const {
-      hash_map<osd_reqid_t,pg_log_entry_t*>::const_iterator p = caller_ops.find(r);
+      ceph::unordered_map<osd_reqid_t,pg_log_entry_t*>::const_iterator p = caller_ops.find(r);
       if (p == caller_ops.end())
        return NULL;
       return p->second;
index ecb61ad8b729250eb17517121d24d6123cd3e09f..8e98c9de37bdd1061537fcfe235d004bf27516b8 100644 (file)
@@ -15,7 +15,7 @@
 #define CEPH_WATCH_H
 
 #include <boost/intrusive_ptr.hpp>
-#include <tr1/memory>
+#include "include/memory.h"
 #include <set>
 
 #include "msg/Messenger.h"
@@ -35,12 +35,12 @@ struct ObjectContext;
 class MWatchNotify;
 
 class Watch;
-typedef std::tr1::shared_ptr<Watch> WatchRef;
-typedef std::tr1::weak_ptr<Watch> WWatchRef;
+typedef ceph::shared_ptr<Watch> WatchRef;
+typedef ceph::weak_ptr<Watch> WWatchRef;
 
 class Notify;
-typedef std::tr1::shared_ptr<Notify> NotifyRef;
-typedef std::tr1::weak_ptr<Notify> WNotifyRef;
+typedef ceph::shared_ptr<Notify> NotifyRef;
+typedef ceph::weak_ptr<Notify> WNotifyRef;
 
 struct CancelableContext;
 
@@ -151,7 +151,7 @@ class Watch {
 
   OSDService *osd;
   boost::intrusive_ptr<ReplicatedPG> pg;
-  std::tr1::shared_ptr<ObjectContext> obc;
+  ceph::shared_ptr<ObjectContext> obc;
 
   std::map<uint64_t, NotifyRef> in_progress_notifies;
 
@@ -165,7 +165,7 @@ class Watch {
 
   Watch(
     ReplicatedPG *pg, OSDService *osd,
-    std::tr1::shared_ptr<ObjectContext> obc, uint32_t timeout,
+    ceph::shared_ptr<ObjectContext> obc, uint32_t timeout,
     uint64_t cookie, entity_name_t entity,
     entity_addr_t addr);
 
@@ -187,7 +187,7 @@ public:
   string gen_dbg_prefix();
   static WatchRef makeWatchRef(
     ReplicatedPG *pg, OSDService *osd,
-    std::tr1::shared_ptr<ObjectContext> obc, uint32_t timeout, uint64_t cookie, entity_name_t entity, entity_addr_t addr);
+    ceph::shared_ptr<ObjectContext> obc, uint32_t timeout, uint64_t cookie, entity_name_t entity, entity_addr_t addr);
   void set_self(WatchRef _self) {
     self = _self;
   }
@@ -195,7 +195,7 @@ public:
   /// Does not grant a ref count!
   boost::intrusive_ptr<ReplicatedPG> get_pg() { return pg; }
 
-  std::tr1::shared_ptr<ObjectContext> get_obc() { return obc; }
+  ceph::shared_ptr<ObjectContext> get_obc() { return obc; }
 
   uint64_t get_cookie() const { return cookie; }
   entity_name_t get_entity() const { return entity; }
index cf11aa1437e76d79b12abc7780dc0dbd7b17ae1c..bb58fa557016d396e53ba2b6b44770672a45a9fb 100644 (file)
@@ -35,6 +35,7 @@
 #include "HitSet.h"
 #include "Watch.h"
 #include "OpRequest.h"
+#include "include/hash_namespace.h"
 
 #define CEPH_OSD_ONDISK_MAGIC "ceph osd volume v026"
 
@@ -82,14 +83,14 @@ inline bool operator<=(const osd_reqid_t& l, const osd_reqid_t& r) {
 inline bool operator>(const osd_reqid_t& l, const osd_reqid_t& r) { return !(l <= r); }
 inline bool operator>=(const osd_reqid_t& l, const osd_reqid_t& r) { return !(l < r); }
 
-namespace __gnu_cxx {
+CEPH_HASH_NAMESPACE_START
   template<> struct hash<osd_reqid_t> {
     size_t operator()(const osd_reqid_t &r) const { 
       static hash<uint64_t> H;
       return H(r.name.num() ^ r.tid ^ r.inc);
     }
   };
-}
+CEPH_HASH_NAMESPACE_END
 
 
 // -----
@@ -355,7 +356,7 @@ inline bool operator>=(const pg_t& l, const pg_t& r) {
 
 ostream& operator<<(ostream& out, const pg_t &pg);
 
-namespace __gnu_cxx {
+CEPH_HASH_NAMESPACE_START
   template<> struct hash< pg_t >
   {
     size_t operator()( const pg_t& x ) const
@@ -364,7 +365,7 @@ namespace __gnu_cxx {
       return H((x.pool() & 0xffffffff) ^ (x.pool() >> 32) ^ x.ps() ^ x.preferred());
     }
   };
-}
+CEPH_HASH_NAMESPACE_END
 
 
 // ----------------------
@@ -448,7 +449,7 @@ inline ostream& operator<<(ostream& out, const coll_t& c) {
   return out;
 }
 
-namespace __gnu_cxx {
+CEPH_HASH_NAMESPACE_START
   template<> struct hash<coll_t> {
     size_t operator()(const coll_t &c) const { 
       size_t h = 0;
@@ -465,7 +466,7 @@ namespace __gnu_cxx {
       return h;
     }
   };
-}
+CEPH_HASH_NAMESPACE_END
 
 inline ostream& operator<<(ostream& out, const ceph_object_layout &ol)
 {
@@ -1502,8 +1503,8 @@ struct pg_interval_t {
     const vector<int> &new_up,                  ///< [in] up as of osdmap
     epoch_t same_interval_since,                ///< [in] as of osdmap
     epoch_t last_epoch_clean,                   ///< [in] current
-    std::tr1::shared_ptr<const OSDMap> osdmap,  ///< [in] current map
-    std::tr1::shared_ptr<const OSDMap> lastmap, ///< [in] last map
+    ceph::shared_ptr<const OSDMap> osdmap,  ///< [in] current map
+    ceph::shared_ptr<const OSDMap> lastmap, ///< [in] last map
     int64_t poolid,                             ///< [in] pool for pg
     pg_t pgid,                                  ///< [in] pgid for pg
     map<epoch_t, pg_interval_t> *past_intervals,///< [out] intervals
@@ -2296,7 +2297,7 @@ struct SnapSetContext {
 
 struct ObjectContext;
 
-typedef std::tr1::shared_ptr<ObjectContext> ObjectContextRef;
+typedef ceph::shared_ptr<ObjectContext> ObjectContextRef;
 
 struct ObjectContext {
   ObjectState obs;
index d518c6efaaedc8978b516e893da067d7f081de62..6160d7005f13b0330d88b99107662f82692bf9bf 100644 (file)
@@ -522,7 +522,7 @@ ObjectCacher::~ObjectCacher()
   finisher.stop();
   perf_stop();
   // we should be empty.
-  for (vector<hash_map<sobject_t, Object *> >::iterator i = objects.begin();
+  for (vector<ceph::unordered_map<sobject_t, Object *> >::iterator i = objects.begin();
       i != objects.end();
       ++i)
     assert(i->empty());
@@ -1764,11 +1764,11 @@ uint64_t ObjectCacher::release_all()
   ldout(cct, 10) << "release_all" << dendl;
   uint64_t unclean = 0;
   
-  vector<hash_map<sobject_t, Object*> >::iterator i = objects.begin();
+  vector<ceph::unordered_map<sobject_t, Object*> >::iterator i = objects.begin();
   while (i != objects.end()) {
-    hash_map<sobject_t, Object*>::iterator p = i->begin();
+    ceph::unordered_map<sobject_t, Object*>::iterator p = i->begin();
     while (p != i->end()) {
-      hash_map<sobject_t, Object*>::iterator n = p;
+      ceph::unordered_map<sobject_t, Object*>::iterator n = p;
       ++n;
 
       Object *ob = p->second;
@@ -1853,10 +1853,10 @@ void ObjectCacher::verify_stats() const
   ldout(cct, 10) << "verify_stats" << dendl;
 
   loff_t clean = 0, zero = 0, dirty = 0, rx = 0, tx = 0, missing = 0, error = 0;
-  for (vector<hash_map<sobject_t, Object*> >::const_iterator i = objects.begin();
+  for (vector<ceph::unordered_map<sobject_t, Object*> >::const_iterator i = objects.begin();
       i != objects.end();
       ++i) {
-    for (hash_map<sobject_t, Object*>::const_iterator p = i->begin();
+    for (ceph::unordered_map<sobject_t, Object*>::const_iterator p = i->begin();
         p != i->end();
         ++p) {
       Object *ob = p->second;
index a62a41fd8ced08c12c564ce7a3d4243a452bb618..d7ba9d8a50b37d687424166fecffd5a99da6322f 100644 (file)
@@ -339,7 +339,7 @@ class ObjectCacher {
   flush_set_callback_t flush_set_callback;
   void *flush_set_callback_arg;
 
-  vector<hash_map<sobject_t, Object*> > objects; // indexed by pool_id
+  vector<ceph::unordered_map<sobject_t, Object*> > objects; // indexed by pool_id
 
   tid_t last_read_tid;
 
index 508cc379cb8e0e449ea36e98da498e3eaf929f84..a76580d1fd644f26241a2c25e0df30072b36e47c 100644 (file)
@@ -32,7 +32,6 @@
 #include <memory>
 #include <sstream>
 using namespace std;
-using namespace __gnu_cxx;
 
 class Context;
 class Messenger;
index a7243f438884dde978bedbd221d3a82f223db764..c6a3dcfef44cf8312c2040de6f836330214198ce 100644 (file)
@@ -40,7 +40,7 @@
 #include <stdlib.h>
 #include <sys/types.h>
 #include <time.h>
-#include <tr1/memory>
+#include "include/memory.h"
 #include <sys/ioctl.h>
 
 #include "include/rbd_types.h"
@@ -1827,7 +1827,7 @@ static int do_kernel_showmapped(Formatter *f)
   TextTable tbl;
 
   const char *devices_path = "/sys/bus/rbd/devices";
-  std::tr1::shared_ptr<DIR> device_dir(opendir(devices_path), do_closedir);
+  ceph::shared_ptr<DIR> device_dir(opendir(devices_path), do_closedir);
   if (!device_dir.get()) {
     r = -errno;
     cerr << "rbd: could not open " << devices_path << ": "
index f3fb4f22480f69e56f3fd00e5312e548cca24484..7cd62365b997ad87a716ae8af70dca1545fc3468 100644 (file)
@@ -299,7 +299,7 @@ class RGWDataChangesLog {
     }
   };
 
-  typedef std::tr1::shared_ptr<ChangeStatus> ChangeStatusPtr;
+  typedef ceph::shared_ptr<ChangeStatus> ChangeStatusPtr;
 
   lru_map<string, ChangeStatusPtr> changes;
 
index 43fa60c47a1d191012e95976f1ffc28bc78180ee..c03e16968a5cf4c8b47be08cfc49bb7d414d7fc6 100644 (file)
@@ -4,7 +4,7 @@
 #include "KeyValueDBMemory.h"
 #include <map>
 #include <set>
-#include <tr1/memory>
+#include "include/memory.h"
 #include <iostream>
 
 using namespace std;
@@ -214,7 +214,7 @@ int KeyValueDBMemory::rmkeys_by_prefix(const string &prefix) {
 }
 
 KeyValueDB::WholeSpaceIterator KeyValueDBMemory::_get_iterator() {
-  return std::tr1::shared_ptr<KeyValueDB::WholeSpaceIteratorImpl>(
+  return ceph::shared_ptr<KeyValueDB::WholeSpaceIteratorImpl>(
     new WholeSpaceMemIterator(this)
   );
 }
@@ -243,7 +243,7 @@ public:
 
 KeyValueDB::WholeSpaceIterator KeyValueDBMemory::_get_snapshot_iterator() {
   KeyValueDBMemory *snap_db = new KeyValueDBMemory(this);
-  return std::tr1::shared_ptr<KeyValueDB::WholeSpaceIteratorImpl>(
+  return ceph::shared_ptr<KeyValueDB::WholeSpaceIteratorImpl>(
     new WholeSpaceSnapshotMemIterator(snap_db)
   );
 }
index 5cffce3ef04a9acd2f82705f7f5b1eaa9ac80df4..c67f9b5cc059f487f7e92092d2e14fb3f911b3db 100644 (file)
@@ -3,7 +3,7 @@
 #include <map>
 #include <set>
 #include <string>
-#include <tr1/memory>
+#include "include/memory.h"
 
 #include "os/KeyValueDB.h"
 #include "include/buffer.h"
index e06a9ff9ecf167f9d37c469e2fc496113d6babb9..04cef95d90ca5e946abc5d226eb651d329ab90f7 100644 (file)
@@ -6,7 +6,7 @@
 #include <dirent.h>
 #include <string>
 #include <vector>
-#include <tr1/memory>
+#include "include/memory.h"
 #include <boost/scoped_ptr.hpp>
 #include <sstream>
 #include "stdlib.h"
index c4a5e384fccae3aab8dfda4c1a3a54366a253340..cbe2ab1fb47a9a31e4ac487ee5c0c7107e9ee3ea 100644 (file)
@@ -10,7 +10,7 @@
 * License version 2.1, as published by the Free Software
 * Foundation. See file COPYING.
 */
-#include <tr1/memory>
+#include "include/memory.h"
 #include <map>
 #include <set>
 #include <deque>
index b31455ea4102a3d3dc342e9e419b685cf3e57b5c..eecd9ea4cf1efe0ac36e02e7eb9ff60f93da9005 100644 (file)
@@ -1,5 +1,5 @@
 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-#include <tr1/memory>
+#include "include/memory.h"
 #include <map>
 #include <set>
 #include <boost/scoped_ptr.hpp>
index 32c3538fd026bcd6cafee4a15c0fc8d52cf0a712..c1781466a327e90ef3dfa6f2a1807352956bfaac 100644 (file)
@@ -3,7 +3,7 @@
 #include "bencher.h"
 #include "include/utime.h"
 #include <unistd.h>
-#include <tr1/memory>
+#include "include/memory.h"
 #include "common/Mutex.h"
 #include "common/Cond.h"
 
@@ -35,10 +35,10 @@ struct Cleanup : public Context {
 struct OnWriteApplied : public Context {
   Bencher *bench;
   uint64_t seq;
-  std::tr1::shared_ptr<OnDelete> on_delete;
+  ceph::shared_ptr<OnDelete> on_delete;
   OnWriteApplied(
     Bencher *bench, uint64_t seq,
-    std::tr1::shared_ptr<OnDelete> on_delete
+    ceph::shared_ptr<OnDelete> on_delete
     ) : bench(bench), seq(seq), on_delete(on_delete) {}
   void finish(int r) {
     bench->stat_collector->write_applied(seq);
@@ -48,10 +48,10 @@ struct OnWriteApplied : public Context {
 struct OnWriteCommit : public Context {
   Bencher *bench;
   uint64_t seq;
-  std::tr1::shared_ptr<OnDelete> on_delete;
+  ceph::shared_ptr<OnDelete> on_delete;
   OnWriteCommit(
     Bencher *bench, uint64_t seq,
-    std::tr1::shared_ptr<OnDelete> on_delete
+    ceph::shared_ptr<OnDelete> on_delete
     ) : bench(bench), seq(seq), on_delete(on_delete) {}
   void finish(int r) {
     bench->stat_collector->write_committed(seq);
@@ -120,7 +120,7 @@ void Bencher::init(
   Cond cond;
   bool done = 0;
   {
-    std::tr1::shared_ptr<OnFinish> on_finish(
+    ceph::shared_ptr<OnFinish> on_finish(
       new OnFinish(&done, &lock, &cond));
     uint64_t num = 0;
     for (set<std::string>::const_iterator i = objects.begin();
@@ -132,8 +132,8 @@ void Bencher::init(
        *i,
        0,
        bl,
-       new C_Holder<std::tr1::shared_ptr<OnFinish> >(on_finish),
-       new C_Holder<std::tr1::shared_ptr<OnFinish> >(on_finish)
+       new C_Holder<ceph::shared_ptr<OnFinish> >(on_finish),
+       new C_Holder<ceph::shared_ptr<OnFinish> >(on_finish)
        );
     }
   }
@@ -162,7 +162,7 @@ void Bencher::run_bench()
     OpType op_type = next.get<3>();
     switch (op_type) {
       case WRITE: {
-       std::tr1::shared_ptr<OnDelete> on_delete(
+       ceph::shared_ptr<OnDelete> on_delete(
          new OnDelete(new Cleanup(this)));
        stat_collector->start_write(seq, length);
        while (bl.length() < length) {
index 3e18fc64d0a6cf6b84589e52e9f2c5586bcf8530..a4f6321b7b8f0873903667b148a1f74fb71280e0 100644 (file)
@@ -27,7 +27,7 @@ public:
 private:
   boost::scoped_ptr<
     Distribution<boost::tuple<std::string,uint64_t,uint64_t, OpType> > > op_dist;
-  std::tr1::shared_ptr<StatCollector> stat_collector;
+  ceph::shared_ptr<StatCollector> stat_collector;
   boost::scoped_ptr<Backend> backend;
   const uint64_t max_in_flight;
   const uint64_t max_duration;
@@ -42,7 +42,7 @@ private:
 public:
   Bencher(
     Distribution<boost::tuple<std::string, uint64_t, uint64_t, OpType> > *op_gen,
-    std::tr1::shared_ptr<StatCollector> stat_collector,
+    ceph::shared_ptr<StatCollector> stat_collector,
     Backend *backend,
     uint64_t max_in_flight,
     uint64_t max_duration,
index 51df9b9eba59ea82eb9d8998d654036eef4430b5..792889688155a1fc660b3982597365393c78fdf8 100644 (file)
@@ -26,7 +26,7 @@ void RBDBackend::write(
   Context *on_commit)
 {
   bufferlist &bl_non_const = const_cast<bufferlist&>(bl);
-  std::tr1::shared_ptr<librbd::Image> image = (*m_images)[oid];
+  ceph::shared_ptr<librbd::Image> image = (*m_images)[oid];
   void *arg = static_cast<void *>(new arg_type(on_commit, on_write_applied));
   librbd::RBD::AioCompletion *completion =
     new librbd::RBD::AioCompletion(arg, on_complete);
@@ -42,7 +42,7 @@ void RBDBackend::read(
   bufferlist *bl,
   Context *on_read_complete)
 {
-  std::tr1::shared_ptr<librbd::Image> image = (*m_images)[oid];
+  ceph::shared_ptr<librbd::Image> image = (*m_images)[oid];
   void *arg = static_cast<void *>(new arg_type(on_read_complete, NULL));
   librbd::RBD::AioCompletion *completion =
     new librbd::RBD::AioCompletion(arg, on_complete);
index 981c8d715fd50b1e4b3ed4fccf01191b0bac8b8a..9c3bc8bbc1c9bcb99d8b2d06ba07446328700bb7 100644 (file)
@@ -8,9 +8,9 @@
 #include "include/rbd/librbd.hpp"
 
 class RBDBackend : public Backend {
-  map<string, std::tr1::shared_ptr<librbd::Image> > *m_images;
+  map<string, ceph::shared_ptr<librbd::Image> > *m_images;
 public:
-  RBDBackend(map<string, std::tr1::shared_ptr<librbd::Image> > *images)
+  RBDBackend(map<string, ceph::shared_ptr<librbd::Image> > *images)
     : m_images(images) {}
   void write(
     const string &oid,
index 6f4ac07d3620a8bef0830ee1b1e712c79c985436..7f03f5ad2a3c6c904ba559255f10ae87bce15849 100644 (file)
@@ -150,7 +150,7 @@ int main(int argc, char **argv)
     detailed_ops = &cerr;
   }
 
-  std::tr1::shared_ptr<StatCollector> col(
+  ceph::shared_ptr<StatCollector> col(
     new DetailedStatCollector(
       1, new JSONFormatter, detailed_ops, &cout,
       new MorePrinting(g_ceph_context)));
@@ -175,9 +175,9 @@ int main(int argc, char **argv)
     fs.apply_transaction(t);
   }
 
-  vector<std::tr1::shared_ptr<Bencher> > benchers(
+  vector<ceph::shared_ptr<Bencher> > benchers(
     vm["num-writers"].as<unsigned>());
-  for (vector<std::tr1::shared_ptr<Bencher> >::iterator i = benchers.begin();
+  for (vector<ceph::shared_ptr<Bencher> >::iterator i = benchers.begin();
        i != benchers.end();
        ++i) {
     set<string> objects;
@@ -227,12 +227,12 @@ int main(int argc, char **argv)
     (*i).reset(bencher);
   }
 
-  for (vector<std::tr1::shared_ptr<Bencher> >::iterator i = benchers.begin();
+  for (vector<ceph::shared_ptr<Bencher> >::iterator i = benchers.begin();
        i != benchers.end();
        ++i) {
     (*i)->create();
   }
-  for (vector<std::tr1::shared_ptr<Bencher> >::iterator i = benchers.begin();
+  for (vector<ceph::shared_ptr<Bencher> >::iterator i = benchers.begin();
        i != benchers.end();
        ++i) {
     (*i)->join();
index 4c56ffd4e220bffbaca5b3a396dc5c7e3cb42234..ba7071ed3833a040ceb4a9be63c44b63ee848473 100644 (file)
@@ -132,7 +132,7 @@ int main(int argc, char **argv)
 
   librbd::RBD rbd;
   {
-    map<string, std::tr1::shared_ptr<librbd::Image> > images;
+    map<string, ceph::shared_ptr<librbd::Image> > images;
     int order = vm["order"].as<unsigned>();
     uint64_t image_size = ((uint64_t)vm["image-size"].as<unsigned>()) << 20;
     for (set<string>::const_iterator i = image_names.begin();
@@ -142,7 +142,7 @@ int main(int argc, char **argv)
        cerr << "error creating image " << *i << " r=" << r << std::endl;
        return -r;
       }
-      std::tr1::shared_ptr<librbd::Image> image(new librbd::Image());
+      ceph::shared_ptr<librbd::Image> image(new librbd::Image());
       r = rbd.open(ioctx, *image, i->c_str());
       if (r < 0) {
        cerr << "error opening image " << *i << " r=" << r << std::endl;
index 506a0c6ab59c0ea5edc47e133cdb44eb0c07b286..cf63f2fccfc41972e364d775ce8d406beb29b7ad 100644 (file)
@@ -19,7 +19,7 @@
  *
  */
 
-#include <tr1/memory>
+#include "include/memory.h"
 #include <limits.h>
 #include <errno.h>
 #include <sys/uio.h>
@@ -2144,7 +2144,7 @@ TEST(BufferList, TestDirectAppend) {
 
 TEST(BufferList, TestCopyAll) {
   const static size_t BIG_SZ = 10737414;
-  std::tr1::shared_ptr <unsigned char> big(
+  ceph::shared_ptr <unsigned char> big(
       (unsigned char*)malloc(BIG_SZ), free);
   unsigned char c = 0;
   for (size_t i = 0; i < BIG_SZ; ++i) {
@@ -2156,7 +2156,7 @@ TEST(BufferList, TestCopyAll) {
   bufferlist bl2;
   i.copy_all(bl2);
   ASSERT_EQ(bl2.length(), BIG_SZ);
-  std::tr1::shared_ptr <unsigned char> big2(
+  ceph::shared_ptr <unsigned char> big2(
       (unsigned char*)malloc(BIG_SZ), free);
   bl2.copy(0, BIG_SZ, (char*)big2.get());
   ASSERT_EQ(memcmp(big.get(), big2.get(), BIG_SZ), 0);
index af33ca560d99712a81c08ed0187bed56c225089f..61b92d44a766a875c5a5520aefc1c690ae99dd81 100644 (file)
@@ -24,7 +24,7 @@
 #include <stdint.h>
 #include <sys/stat.h>
 #include <sys/types.h>
-#include <tr1/memory>
+#include "include/memory.h"
 
 using ceph::bufferlist;
 using std::cerr;
@@ -78,7 +78,7 @@ static int create_tempfile(const std::string &fname, const char *text)
         << get_temp_dir() << "'. " << cpp_strerror(err) << std::endl;
     return err;
   }
-  std::tr1::shared_ptr<FILE> fpp(fp, fclose);
+  ceph::shared_ptr<FILE> fpp(fp, fclose);
   if (unlink_idx >= MAX_FILES_TO_DELETE)
     return -ENOBUFS;
   if (unlink_idx == 0) {
index 386259de529cfd2b3234e9fc34acb0e6a20a931e..c44711c08add7aef345b972dc19af64e1f9237d2 100644 (file)
@@ -30,8 +30,7 @@
 #include <boost/random/binomial_distribution.hpp>
 #include <gtest/gtest.h>
 
-#include <ext/hash_map>
-using __gnu_cxx::hash_map;
+#include "include/unordered_map.h"
 typedef boost::mt11213b gen_type;
 
 class StoreTest : public ::testing::Test {
index 1326bc663772eb57b80e0cad35c483e95eae6d25..7bb2d42f225a9454f2607b49e7fb4b35680c5566 100644 (file)
@@ -61,7 +61,7 @@ TEST(FlatIndex, created_unlink) {
   const std::string base_path("PATH");
   EXPECT_EQ(0, ::system("rm -fr PATH"));
   EXPECT_EQ(0, ::mkdir("PATH", 0700));
-  std::tr1::shared_ptr<CollectionIndex> index(new FlatIndex(collection, base_path));
+  ceph::shared_ptr<CollectionIndex> index(new FlatIndex(collection, base_path));
   const std::string key("KEY");
   uint64_t hash = 111;
   uint64_t pool = 222;
@@ -111,7 +111,7 @@ TEST(FlatIndex, collection_list) {
   const std::string object_name("ABC");
   const std::string filename("PATH/" + object_name + "_head");
   EXPECT_EQ(0, ::close(::creat(filename.c_str(), 0600)));
-  std::tr1::shared_ptr<CollectionIndex> index(new FlatIndex(collection, base_path));
+  ceph::shared_ptr<CollectionIndex> index(new FlatIndex(collection, base_path));
   vector<ghobject_t> ls;
   index->collection_list(&ls);
   EXPECT_EQ((unsigned)1, ls.size());
index 02578eb4a714e7f10d6389edf94d7eb8dc402841..74fdf66d87f4e069154d3df6b996a95377357eb0 100644 (file)
@@ -42,7 +42,7 @@ public:
   virtual int _split(
                     uint32_t match,                           
                     uint32_t bits,                            
-                    std::tr1::shared_ptr<CollectionIndex> dest
+                    ceph::shared_ptr<CollectionIndex> dest
                     ) { return 0; }
 
   void test_generate_and_parse(const ghobject_t &hoid, const std::string &mangled_expected) {
index 97cfd786dbc7e7afee244e9f3c0447e356a0a1ec..4deb2f72039559c68f1d6a0e12098a22d1badb69 100644 (file)
@@ -18,6 +18,7 @@
 #include "Object.h"
 #include "TestOpStat.h"
 #include "test/librados/test.h"
+#include "include/memory.h"
 #include "common/sharedptr_registry.hpp"
 #include "common/errno.h"
 #include "osd/HitSet.h"
@@ -985,7 +986,7 @@ public:
   ObjectDesc old_value;
   int snap;
 
-  std::tr1::shared_ptr<int> in_use;
+  ceph::shared_ptr<int> in_use;
 
   bufferlist result;
   int retval;
@@ -1345,7 +1346,7 @@ public:
   bool done;
   librados::ObjectWriteOperation op;
   librados::AioCompletion *comp;
-  std::tr1::shared_ptr<int> in_use;
+  ceph::shared_ptr<int> in_use;
 
   RollbackOp(int n,
             RadosTestContext *context,
@@ -1410,7 +1411,7 @@ public:
     context->update_object_version(oid, comp->get_version64());
     context->oid_in_use.erase(oid);
     context->oid_not_in_use.insert(oid);
-    in_use = std::tr1::shared_ptr<int>();
+    in_use = ceph::shared_ptr<int>();
     context->kick();
   }
 
@@ -1433,7 +1434,7 @@ public:
   librados::ObjectReadOperation rd_op;
   librados::AioCompletion *comp;
   librados::AioCompletion *comp_racing_read;
-  std::tr1::shared_ptr<int> in_use;
+  ceph::shared_ptr<int> in_use;
   int snap;
   int done;
   uint64_t version;
@@ -1698,7 +1699,7 @@ public:
   bool dirty;
   ObjectDesc old_value;
   int snap;
-  std::tr1::shared_ptr<int> in_use;
+  ceph::shared_ptr<int> in_use;
 
   IsDirtyOp(int n,
            RadosTestContext *context,
@@ -1794,7 +1795,7 @@ public:
   bool blocking;
   int snap;
   bool can_fail;
-  std::tr1::shared_ptr<int> in_use;
+  ceph::shared_ptr<int> in_use;
 
   CacheFlushOp(int n,
               RadosTestContext *context,
@@ -1903,7 +1904,7 @@ public:
   librados::AioCompletion *completion;
   librados::ObjectReadOperation op;
   string oid;
-  std::tr1::shared_ptr<int> in_use;
+  ceph::shared_ptr<int> in_use;
 
   CacheEvictOp(int n,
               RadosTestContext *context,
index ee71b0e898cf8e47f4ace29f8f8ff1133dd19631..4f6fffe05c998a447a6dc347bce09e6cafbe42b7 100644 (file)
@@ -67,7 +67,7 @@ int stress_test(uint64_t num_ops, uint64_t num_objs,
   obc.start();
 
   atomic_t outstanding_reads;
-  vector<std::tr1::shared_ptr<op_data> > ops;
+  vector<ceph::shared_ptr<op_data> > ops;
   ObjectCacher::ObjectSet object_set(NULL, 0, 0);
   SnapContext snapc;
   ceph::buffer::ptr bp(max_op_len);
@@ -91,7 +91,7 @@ int stress_test(uint64_t num_ops, uint64_t num_objs,
     uint64_t length = random() % (MAX(max_len - 1, 1)) + 1;
     std::string oid = "test" + stringify(random() % num_objs);
     bool is_read = random() < percent_reads * RAND_MAX;
-    std::tr1::shared_ptr<op_data> op(new op_data(oid, offset, length, is_read));
+    ceph::shared_ptr<op_data> op(new op_data(oid, offset, length, is_read));
     ops.push_back(op);
     std::cout << "op " << i << " " << (is_read ? "read" : "write")
              << " " << op->extent << "\n";
index 65726ea46a3959bafb394c82de13710729126c9a..bcc71c37bd136b24c683adddf939260dfbffb604 100644 (file)
@@ -126,11 +126,11 @@ TEST(pg_interval_t, check_new_interval)
   //
   int osd_id = 1;
   epoch_t epoch = 40;
-  std::tr1::shared_ptr<OSDMap> osdmap(new OSDMap());
+  ceph::shared_ptr<OSDMap> osdmap(new OSDMap());
   osdmap->set_max_osd(10);
   osdmap->set_state(osd_id, CEPH_OSD_EXISTS);
   osdmap->set_epoch(epoch);
-  std::tr1::shared_ptr<OSDMap> lastmap(new OSDMap());
+  ceph::shared_ptr<OSDMap> lastmap(new OSDMap());
   lastmap->set_max_osd(10);
   lastmap->set_state(osd_id, CEPH_OSD_EXISTS);
   lastmap->set_epoch(epoch);
@@ -184,7 +184,7 @@ TEST(pg_interval_t, check_new_interval)
   // pool did not exist in the old osdmap
   //
   {
-    std::tr1::shared_ptr<OSDMap> lastmap(new OSDMap());
+    ceph::shared_ptr<OSDMap> lastmap(new OSDMap());
     lastmap->set_max_osd(10);
     lastmap->set_state(osd_id, CEPH_OSD_EXISTS);
     lastmap->set_epoch(epoch);
@@ -272,7 +272,7 @@ TEST(pg_interval_t, check_new_interval)
   // PG is splitting
   //
   {
-    std::tr1::shared_ptr<OSDMap> osdmap(new OSDMap());
+    ceph::shared_ptr<OSDMap> osdmap(new OSDMap());
     osdmap->set_max_osd(10);
     osdmap->set_state(osd_id, CEPH_OSD_EXISTS);
     osdmap->set_epoch(epoch);
@@ -307,7 +307,7 @@ TEST(pg_interval_t, check_new_interval)
   // PG size has changed
   //
   {
-    std::tr1::shared_ptr<OSDMap> osdmap(new OSDMap());
+    ceph::shared_ptr<OSDMap> osdmap(new OSDMap());
     osdmap->set_max_osd(10);
     osdmap->set_state(osd_id, CEPH_OSD_EXISTS);
     osdmap->set_epoch(epoch);
@@ -383,7 +383,7 @@ TEST(pg_interval_t, check_new_interval)
     // The new osdmap is created so that it triggers the
     // bug.
     //
-    std::tr1::shared_ptr<OSDMap> osdmap(new OSDMap());
+    ceph::shared_ptr<OSDMap> osdmap(new OSDMap());
     osdmap->set_max_osd(10);
     osdmap->set_state(osd_id, CEPH_OSD_EXISTS);
     osdmap->set_epoch(epoch);
@@ -455,7 +455,7 @@ TEST(pg_interval_t, check_new_interval)
     new_acting.push_back(osd_id + 4); 
     new_acting.push_back(osd_id + 5); 
 
-    std::tr1::shared_ptr<OSDMap> lastmap(new OSDMap());
+    ceph::shared_ptr<OSDMap> lastmap(new OSDMap());
     lastmap->set_max_osd(10);
     lastmap->set_state(osd_id, CEPH_OSD_EXISTS);
     lastmap->set_epoch(epoch);
@@ -500,7 +500,7 @@ TEST(pg_interval_t, check_new_interval)
 
     epoch_t last_epoch_clean = epoch - 10;
 
-    std::tr1::shared_ptr<OSDMap> lastmap(new OSDMap());
+    ceph::shared_ptr<OSDMap> lastmap(new OSDMap());
     lastmap->set_max_osd(10);
     lastmap->set_state(osd_id, CEPH_OSD_EXISTS);
     lastmap->set_epoch(epoch);
index 41ba0446961e7f72dd0f2a1759a570ec5671f666..eaf308cbb5f9f30f1ccb4c9ffd63e6c4301da969 100644 (file)
@@ -1,5 +1,5 @@
 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-#include <tr1/memory>
+#include "include/memory.h"
 #include <map>
 #include <set>
 #include <boost/scoped_ptr.hpp>
@@ -42,7 +42,7 @@ class PausyAsyncMap : public MapCacher::StoreDriver<string, bufferlist> {
     virtual void operate(map<string, bufferlist> *store) = 0;
     virtual ~_Op() {}
   };
-  typedef std::tr1::shared_ptr<_Op> Op;
+  typedef ceph::shared_ptr<_Op> Op;
   struct Remove : public _Op {
     set<string> to_remove;
     Remove(const set<string> &to_remove) : to_remove(to_remove) {}
@@ -582,7 +582,7 @@ public:
 class SnapMapperTest : public ::testing::Test {
 protected:
   boost::scoped_ptr< PausyAsyncMap > driver;
-  map<pg_t, std::tr1::shared_ptr<MapperVerifier> > mappers;
+  map<pg_t, ceph::shared_ptr<MapperVerifier> > mappers;
   uint32_t pgnum;
 
   virtual void SetUp() {
index 2baaee82ccb7fe9c8d1a6565b96af9766edc31d1..2b8d09ff29dcf6630706817c689777c32f76a97f 100644 (file)
@@ -29,7 +29,7 @@
 #include <boost/random/binomial_distribution.hpp>
 #include <gtest/gtest.h>
 
-#include <ext/hash_map>
+#include "include/unordered_map.h"
 
 void usage(const string &name) {
   std::cerr << "Usage: " << name << " [xattr|omap] store_path store_journal"
index c8b8ece31c8c5f6a68b7f7250de7c0db0f081c2d..592b4b716d3183fda25814a742c4fd2647ab08fc 100644 (file)
@@ -17,8 +17,7 @@
 #include "common/ceph_argparse.h"
 #include "global/global_init.h"
 
-#include <ext/hash_map>
-using __gnu_cxx::hash_map;
+#include "include/unordered_map.h"
 
 int dupstore(ObjectStore* src, ObjectStore* dst)
 {
@@ -27,7 +26,7 @@ int dupstore(ObjectStore* src, ObjectStore* dst)
   if (dst->mount() < 0) return 1;
 
   // objects
-  hash_map<ghobject_t, coll_t> did_object;
+  ceph::unordered_map<ghobject_t, coll_t> did_object;
 
   // collections
   vector<coll_t> collections;
index c2f4ba1564be23b7aa9480f72088903fd6bfe5bc..71485729eb700a935ab381c656481cb0c7a373e7 100644 (file)
@@ -280,7 +280,7 @@ int main(int argc, const char **argv)
     while (1) {
       cout << "pass " << ++pass << std::endl;
 
-      hash_map<pg_t,vector<int> > m;
+      ceph::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) {