From da5d156b6bdffdd31e4edbadc1cdfc69197bef49 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 19 Jun 2018 14:30:57 +0800 Subject: [PATCH] include/memory.h: remove memory.h memory.h was introduced back when the shared_ptrs were still in TR1, but we've moved to C++17 now. and the C++ clients should be compiled with a C++11 compatible compiler. so there is no need to have this file anymore. also replace all references of ceph::shared_ptr and ceph::weak_ptr with std::shared_ptr and std::weak_ptr accordingly. Signed-off-by: Kefu Chai --- alpine/APKBUILD.in | 3 +- ceph.spec.in | 1 - debian/librados-dev.install | 1 - src/auth/Crypto.h | 3 +- src/common/Graylog.h | 3 +- src/common/shared_cache.hpp | 4 +- src/common/sharedptr_registry.hpp | 4 +- src/crypto/crypto_accel.h | 2 +- src/crypto/crypto_plugin.h | 1 - src/include/CMakeLists.txt | 1 - src/include/Context.h | 3 +- src/include/denc.h | 1 - src/include/encoding.h | 30 ++++++------ src/include/memory.h | 13 ----- src/include/rados/librados.hpp | 1 - src/kv/KeyValueDB.h | 7 ++- src/kv/KineticStore.cc | 1 - src/kv/KineticStore.h | 1 - src/kv/LevelDBStore.cc | 2 - src/kv/LevelDBStore.h | 1 - src/kv/MemDB.h | 1 - src/librados/ListObjectImpl.h | 2 +- src/mds/DamageTable.h | 2 +- src/mds/ScrubHeader.h | 4 +- src/mds/SimpleLock.h | 1 - src/mds/events/EMetaBlob.h | 16 +++---- src/mds/journal.cc | 28 +++++------ src/mgr/PyOSDMap.cc | 4 +- src/mon/MonOpRequest.h | 1 - src/mon/Monitor.h | 3 +- src/mon/MonitorDBStore.h | 6 +-- src/msg/async/AsyncConnection.h | 2 +- src/msg/async/dpdk/DPDK.h | 1 - src/msg/simple/Pipe.cc | 2 +- src/msg/simple/Pipe.h | 3 +- src/msg/xio/XioConnection.h | 2 +- src/os/ObjectMap.h | 4 +- src/os/ObjectStore.cc | 1 - src/os/bluestore/BitmapFreelistManager.cc | 2 +- src/os/bluestore/BitmapFreelistManager.h | 2 +- src/os/bluestore/BlueStore.cc | 2 +- src/os/bluestore/BlueStore.h | 1 - src/os/filestore/CollectionIndex.h | 3 +- src/os/filestore/DBObjectMap.cc | 1 - src/os/filestore/DBObjectMap.h | 9 ++-- src/os/filestore/FDCache.h | 2 +- src/os/filestore/IndexManager.cc | 1 - src/os/filestore/IndexManager.h | 1 - src/os/filestore/LFNIndex.h | 1 - src/os/filestore/WBThrottle.h | 1 - src/os/kstore/KStore.h | 1 - src/os/memstore/MemStore.cc | 1 - src/os/memstore/MemStore.h | 1 - src/osd/ECUtil.h | 2 +- src/osd/OSD.h | 1 - src/osd/OSDMap.h | 24 +++++----- src/osd/PG.cc | 2 +- src/osd/PG.h | 1 - src/osd/PGBackend.h | 2 +- src/osd/PGPeeringEvent.h | 2 +- src/osd/PrimaryLogPG.h | 8 ++-- src/osd/ReplicatedBackend.h | 3 +- src/osd/Watch.h | 17 ++++--- src/osd/osd_internal_types.h | 2 +- src/osd/osd_types.h | 8 ++-- src/rgw/rgw_bucket.h | 2 +- src/test/ObjectMap/KeyValueDBMemory.cc | 3 +- src/test/ObjectMap/KeyValueDBMemory.h | 1 - .../ObjectMap/test_keyvaluedb_atomicity.cc | 1 - .../ObjectMap/test_keyvaluedb_iterators.cc | 1 - src/test/ObjectMap/test_object_map.cc | 1 - src/test/bufferlist.cc | 7 ++- src/test/common/test_shared_cache.cc | 48 +++++++++---------- src/test/common/test_sharedptr_registry.cc | 48 +++++++++---------- src/test/confutils.cc | 3 +- src/test/osd/Object.cc | 2 +- src/test/osd/Object.h | 8 ++-- src/test/osd/RadosModel.h | 23 +++++---- src/test/osd/types.cc | 14 +++--- src/test/osdc/object_cacher_stress.cc | 4 +- src/test/rbd_mirror/test_fixture.h | 1 + src/test/test_snap_mapper.cc | 5 +- src/tools/ceph_monstore_tool.cc | 4 +- src/tools/cephfs/JournalTool.cc | 8 ++-- src/tools/rbd_ggate/Server.cc | 6 +-- src/tools/rbd_mirror/types.h | 6 +-- src/tools/rbd_nbd/rbd-nbd.cc | 6 +-- 87 files changed, 204 insertions(+), 265 deletions(-) delete mode 100644 src/include/memory.h diff --git a/alpine/APKBUILD.in b/alpine/APKBUILD.in index 1b6d964db0d69..64908a3beedd7 100644 --- a/alpine/APKBUILD.in +++ b/alpine/APKBUILD.in @@ -315,8 +315,7 @@ librados_dev() { page.h \ crc32c.h \ rados_types.h \ - rados_types.hpp \ - memory.h + rados_types.hpp _pkg $_libdir librados.so _pkg $_bindir librados-config } diff --git a/ceph.spec.in b/ceph.spec.in index ace3a692a5c9b..158bb29bb5857 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -1583,7 +1583,6 @@ fi %{_includedir}/rados/crc32c.h %{_includedir}/rados/rados_types.h %{_includedir}/rados/rados_types.hpp -%{_includedir}/rados/memory.h %{_libdir}/librados.so %if %{with lttng} %{_libdir}/librados_tp.so diff --git a/debian/librados-dev.install b/debian/librados-dev.install index 19ce3914fbd10..d9410cae0e289 100644 --- a/debian/librados-dev.install +++ b/debian/librados-dev.install @@ -5,7 +5,6 @@ usr/include/rados/crc32c.h usr/include/rados/inline_memory.h usr/include/rados/librados.h usr/include/rados/librados.hpp -usr/include/rados/memory.h usr/include/rados/page.h usr/include/rados/rados_types.h usr/include/rados/rados_types.hpp diff --git a/src/auth/Crypto.h b/src/auth/Crypto.h index fa1941233a024..cc999b0a1a4cb 100644 --- a/src/auth/Crypto.h +++ b/src/auth/Crypto.h @@ -17,7 +17,6 @@ #include "include/types.h" #include "include/utime.h" -#include "include/memory.h" #include "include/buffer.h" #include @@ -94,7 +93,7 @@ protected: // cache a pointer to the implementation-specific key handler, so we // don't have to create it for every crypto operation. - mutable ceph::shared_ptr ckh; + mutable std::shared_ptr ckh; int _set_secret(int type, const bufferptr& s); diff --git a/src/common/Graylog.h b/src/common/Graylog.h index 4f06803855c62..70cd770504ebc 100644 --- a/src/common/Graylog.h +++ b/src/common/Graylog.h @@ -8,7 +8,6 @@ #include #include -#include "include/memory.h" #include "include/assert.h" // boost clobbers this struct uuid_d; @@ -55,7 +54,7 @@ class Graylog void log_entry(Entry const * const e); void log_log_entry(LogEntry const * const e); - typedef ceph::shared_ptr Ref; + typedef std::shared_ptr Ref; private: SubsystemMap const * const m_subs; diff --git a/src/common/shared_cache.hpp b/src/common/shared_cache.hpp index 8d923eefc4de7..59179bfbad14f 100644 --- a/src/common/shared_cache.hpp +++ b/src/common/shared_cache.hpp @@ -27,8 +27,8 @@ template , class H = std::hash > class SharedLRU { CephContext *cct; - typedef ceph::shared_ptr VPtr; - typedef ceph::weak_ptr WeakVPtr; + typedef std::shared_ptr VPtr; + typedef std::weak_ptr WeakVPtr; Mutex lock; size_t max_size; Cond cond; diff --git a/src/common/sharedptr_registry.hpp b/src/common/sharedptr_registry.hpp index bb0fcadefd2a5..df9123ff37589 100644 --- a/src/common/sharedptr_registry.hpp +++ b/src/common/sharedptr_registry.hpp @@ -27,8 +27,8 @@ template > class SharedPtrRegistry { public: - typedef ceph::shared_ptr VPtr; - typedef ceph::weak_ptr WeakVPtr; + typedef std::shared_ptr VPtr; + typedef std::weak_ptr WeakVPtr; int waiting; private: Mutex lock; diff --git a/src/crypto/crypto_accel.h b/src/crypto/crypto_accel.h index caefa38a366fa..5c15936099273 100644 --- a/src/crypto/crypto_accel.h +++ b/src/crypto/crypto_accel.h @@ -18,7 +18,7 @@ #include "include/Context.h" class CryptoAccel; -typedef ceph::shared_ptr CryptoAccelRef; +typedef std::shared_ptr CryptoAccelRef; class CryptoAccel { public: diff --git a/src/crypto/crypto_plugin.h b/src/crypto/crypto_plugin.h index ff91b11b27631..f0f37427f2b3c 100644 --- a/src/crypto/crypto_plugin.h +++ b/src/crypto/crypto_plugin.h @@ -16,7 +16,6 @@ #define CRYPTO_PLUGIN_H // ----------------------------------------------------------------------------- -#include "include/memory.h" #include "common/PluginRegistry.h" #include "ostream" diff --git a/src/include/CMakeLists.txt b/src/include/CMakeLists.txt index 23aec6ba69828..581b3ebe03ef4 100644 --- a/src/include/CMakeLists.txt +++ b/src/include/CMakeLists.txt @@ -5,7 +5,6 @@ install(FILES rados/librados.h buffer.h buffer_fwd.h inline_memory.h - memory.h page.h crc32c.h rados/objclass.h diff --git a/src/include/Context.h b/src/include/Context.h index 2eb008245c089..2dff7302d97ec 100644 --- a/src/include/Context.h +++ b/src/include/Context.h @@ -24,7 +24,6 @@ #include #include "include/assert.h" -#include "include/memory.h" #define mydout(cct, v) lgeneric_subdout(cct, context, v) @@ -119,7 +118,7 @@ struct RunOnDelete { to_run->complete(0); } }; -typedef ceph::shared_ptr RunOnDeleteRef; +typedef std::shared_ptr RunOnDeleteRef; template struct LambdaContext : public Context { diff --git a/src/include/denc.h b/src/include/denc.h index bbb830959ce84..b32502a960325 100644 --- a/src/include/denc.h +++ b/src/include/denc.h @@ -41,7 +41,6 @@ #include "include/assert.h" // boost clobbers this #include "include/intarith.h" #include "include/int_types.h" -#include "include/memory.h" #include "buffer.h" #include "byteorder.h" diff --git a/src/include/encoding.h b/src/include/encoding.h index 85ae2fe823aff..130d5dee379f2 100644 --- a/src/include/encoding.h +++ b/src/include/encoding.h @@ -30,8 +30,6 @@ #include "include/int_types.h" -#include "include/memory.h" - #include "common/convenience.h" #include "byteorder.h" @@ -364,13 +362,13 @@ template> inline std::enable_if_t decode(std::list& ls, bufferlist::const_iterator& p); template -inline void encode(const std::list, Alloc>& ls, +inline void encode(const std::list, Alloc>& ls, bufferlist& bl); template -inline void encode(const std::list, Alloc>& ls, +inline void encode(const std::list, Alloc>& ls, bufferlist& bl, uint64_t features); template -inline void decode(std::list, Alloc>& ls, +inline void decode(std::list, Alloc>& ls, bufferlist::const_iterator& p); template> inline std::enable_if_t @@ -418,14 +416,14 @@ template> inline std::enable_if_t decode_nohead(int len, std::vector& v, bufferlist::const_iterator& p); template -inline void encode(const std::vector,Alloc>& v, +inline void encode(const std::vector,Alloc>& v, bufferlist& bl, uint64_t features); template -inline void encode(const std::vector,Alloc>& v, +inline void encode(const std::vector,Alloc>& v, bufferlist& bl); template -inline void decode(std::vector,Alloc>& v, +inline void decode(std::vector,Alloc>& v, bufferlist::const_iterator& p); template, typename u_traits=denc_traits> @@ -659,9 +657,9 @@ inline std::enable_if_t } } -// std::list> +// std::list> template -inline void encode(const std::list, Alloc>& ls, +inline void encode(const std::list, Alloc>& ls, bufferlist& bl) { __u32 n = (__u32)(ls.size()); // c++11 std::list::size() is O(1) @@ -670,7 +668,7 @@ inline void encode(const std::list, Alloc>& ls, encode(**p, bl); } template -inline void encode(const std::list, Alloc>& ls, +inline void encode(const std::list, Alloc>& ls, bufferlist& bl, uint64_t features) { __u32 n = (__u32)(ls.size()); // c++11 std::list::size() is O(1) @@ -679,14 +677,14 @@ inline void encode(const std::list, Alloc>& ls, encode(**p, bl, features); } template -inline void decode(std::list, Alloc>& ls, +inline void decode(std::list, Alloc>& ls, bufferlist::const_iterator& p) { __u32 n; decode(n, p); ls.clear(); while (n--) { - ceph::shared_ptr v(std::make_shared()); + std::shared_ptr v(std::make_shared()); decode(*v, p); ls.push_back(v); } @@ -849,7 +847,7 @@ inline std::enable_if_t // vector (shared_ptr) template -inline void encode(const std::vector,Alloc>& v, +inline void encode(const std::vector,Alloc>& v, bufferlist& bl, uint64_t features) { @@ -862,7 +860,7 @@ inline void encode(const std::vector,Alloc>& v, encode(T(), bl, features); } template -inline void encode(const std::vector,Alloc>& v, +inline void encode(const std::vector,Alloc>& v, bufferlist& bl) { __u32 n = (__u32)(v.size()); @@ -874,7 +872,7 @@ inline void encode(const std::vector,Alloc>& v, encode(T(), bl); } template -inline void decode(std::vector,Alloc>& v, +inline void decode(std::vector,Alloc>& v, bufferlist::const_iterator& p) { __u32 n; diff --git a/src/include/memory.h b/src/include/memory.h deleted file mode 100644 index 409b49fd6b164..0000000000000 --- a/src/include/memory.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef CEPH_MEMORY_H -#define CEPH_MEMORY_H - -#include - -namespace ceph { - using std::shared_ptr; - using std::weak_ptr; - using std::unique_ptr; - using std::static_pointer_cast; -} - -#endif diff --git a/src/include/rados/librados.hpp b/src/include/rados/librados.hpp index a7aad81c9e430..004e61f5f33ab 100644 --- a/src/include/rados/librados.hpp +++ b/src/include/rados/librados.hpp @@ -7,7 +7,6 @@ #include #include #include -#include "memory.h" #include "buffer.h" #include "librados.h" diff --git a/src/kv/KeyValueDB.h b/src/kv/KeyValueDB.h index 7589f1c7adbed..a3fbe2fd54050 100644 --- a/src/kv/KeyValueDB.h +++ b/src/kv/KeyValueDB.h @@ -8,7 +8,6 @@ #include #include #include -#include "include/memory.h" #include #include "include/encoding.h" #include "common/Formatter.h" @@ -147,7 +146,7 @@ public: virtual ~TransactionImpl() {} }; - typedef ceph::shared_ptr< TransactionImpl > Transaction; + typedef std::shared_ptr< TransactionImpl > Transaction; /// create a new instance static KeyValueDB *create(CephContext *cct, const std::string& type, @@ -233,7 +232,7 @@ public: } } }; - typedef ceph::shared_ptr< IteratorImpl > Iterator; + typedef std::shared_ptr< IteratorImpl > Iterator; // This is the low-level iterator implemented by the underlying KV store. class WholeSpaceIteratorImpl { @@ -268,7 +267,7 @@ public: } virtual ~WholeSpaceIteratorImpl() { } }; - typedef ceph::shared_ptr< WholeSpaceIteratorImpl > WholeSpaceIterator; + typedef std::shared_ptr< WholeSpaceIteratorImpl > WholeSpaceIterator; private: int64_t cache_bytes[PriorityCache::Priority::LAST+1] = { 0 }; diff --git a/src/kv/KineticStore.cc b/src/kv/KineticStore.cc index 60dadacb2f2a6..682f3f1cf0d43 100644 --- a/src/kv/KineticStore.cc +++ b/src/kv/KineticStore.cc @@ -6,7 +6,6 @@ #include #include #include -#include "include/memory.h" #include using std::string; #include "common/perf_counters.h" diff --git a/src/kv/KineticStore.h b/src/kv/KineticStore.h index 4fe0eab851730..b7c669a66913b 100644 --- a/src/kv/KineticStore.h +++ b/src/kv/KineticStore.h @@ -9,7 +9,6 @@ #include #include #include -#include "include/memory.h" #include #include diff --git a/src/kv/LevelDBStore.cc b/src/kv/LevelDBStore.cc index 9f5158a7c7553..58cb2538db984 100644 --- a/src/kv/LevelDBStore.cc +++ b/src/kv/LevelDBStore.cc @@ -9,8 +9,6 @@ using std::string; -#include "include/memory.h" - #include "common/debug.h" #include "common/perf_counters.h" diff --git a/src/kv/LevelDBStore.h b/src/kv/LevelDBStore.h index 703f1eb519e8c..9700de62f78e4 100644 --- a/src/kv/LevelDBStore.h +++ b/src/kv/LevelDBStore.h @@ -9,7 +9,6 @@ #include #include #include -#include "include/memory.h" #include #include "leveldb/db.h" #include "leveldb/env.h" diff --git a/src/kv/MemDB.h b/src/kv/MemDB.h index 16b4aed8dd127..032b2ccb8e98f 100644 --- a/src/kv/MemDB.h +++ b/src/kv/MemDB.h @@ -14,7 +14,6 @@ #include #include #include -#include "include/memory.h" #include #include "include/encoding.h" #include "include/btree_map.h" diff --git a/src/librados/ListObjectImpl.h b/src/librados/ListObjectImpl.h index 7e6052546525a..c8c496b60b241 100644 --- a/src/librados/ListObjectImpl.h +++ b/src/librados/ListObjectImpl.h @@ -78,7 +78,7 @@ class NObjectIteratorImpl { private: NObjectIteratorImpl(ObjListCtx *ctx_); void get_next(); - ceph::shared_ptr < ObjListCtx > ctx; + std::shared_ptr < ObjListCtx > ctx; ListObject cur_obj; }; diff --git a/src/mds/DamageTable.h b/src/mds/DamageTable.h index be2a5331ea3fa..fee50644f900f 100644 --- a/src/mds/DamageTable.h +++ b/src/mds/DamageTable.h @@ -57,7 +57,7 @@ class DamageEntry }; -typedef ceph::shared_ptr DamageEntryRef; +typedef std::shared_ptr DamageEntryRef; class DirFragIdent diff --git a/src/mds/ScrubHeader.h b/src/mds/ScrubHeader.h index ea1ad7543295b..0c1cd6ae08a69 100644 --- a/src/mds/ScrubHeader.h +++ b/src/mds/ScrubHeader.h @@ -59,8 +59,8 @@ protected: bool repaired = false; // May be set during scrub if repairs happened }; -typedef ceph::shared_ptr ScrubHeaderRef; -typedef ceph::shared_ptr ScrubHeaderRefConst; +typedef std::shared_ptr ScrubHeaderRef; +typedef std::shared_ptr ScrubHeaderRefConst; #endif // SCRUB_HEADER_H_ diff --git a/src/mds/SimpleLock.h b/src/mds/SimpleLock.h index 0342e0cf113ae..17b3f85619496 100644 --- a/src/mds/SimpleLock.h +++ b/src/mds/SimpleLock.h @@ -43,7 +43,6 @@ inline const char *get_lock_type_name(int t) { } } -#include "include/memory.h" struct MutationImpl; typedef boost::intrusive_ptr MutationRef; diff --git a/src/mds/events/EMetaBlob.h b/src/mds/events/EMetaBlob.h index 9afa3f69a1ca0..1686bab37d3cd 100644 --- a/src/mds/events/EMetaBlob.h +++ b/src/mds/events/EMetaBlob.h @@ -207,7 +207,7 @@ public: private: mutable bufferlist dnbl; mutable bool dn_decoded; - mutable list > dfull; + mutable list > dfull; mutable list dremote; mutable list dnull; @@ -225,12 +225,12 @@ public: bool is_dirty_dft() { return state & STATE_DIRTYDFT; } void mark_dirty_dft() { state |= STATE_DIRTYDFT; } - const list > &get_dfull() const { return dfull; } + const list > &get_dfull() const { return dfull; } const list &get_dremote() const { return dremote; } const list &get_dnull() const { return dnull; } void add_dnull(nullbit const &n) { dnull.push_back(n); }; - void add_dfull(ceph::shared_ptr const &p) { dfull.push_back(p); }; + void add_dfull(std::shared_ptr const &p) { dfull.push_back(p); }; void add_dremote(remotebit const &r) { dremote.push_back(r); }; void print(dirfrag_t dirfrag, ostream& out) { @@ -239,7 +239,7 @@ public: << " num " << nfull << "/" << nremote << "/" << nnull << std::endl; _decode_bits(); - for (list >::iterator p = dfull.begin(); p != dfull.end(); ++p) + for (list >::iterator p = dfull.begin(); p != dfull.end(); ++p) (*p)->print(out); for (list::iterator p = dremote.begin(); p != dremote.end(); ++p) p->print(out); @@ -292,7 +292,7 @@ public: // my lumps. preserve the order we added them in a list. list lump_order; map lump_map; - list > roots; + list > roots; public: list > table_tids; // tableclient transactions @@ -455,7 +455,7 @@ private: sr->encode(snapbl); lump.nfull++; - lump.add_dfull(ceph::shared_ptr(new fullbit(dn->get_name(), + lump.add_dfull(std::shared_ptr(new fullbit(dn->get_name(), dn->first, dn->last, dn->get_projected_version(), *pi, in->dirfragtree, @@ -506,7 +506,7 @@ private: if (sr) sr->encode(snapbl); - for (list >::iterator p = roots.begin(); p != roots.end(); ++p) { + for (list >::iterator p = roots.begin(); p != roots.end(); ++p) { if ((*p)->inode.ino == in->ino()) { roots.erase(p); break; @@ -514,7 +514,7 @@ private: } string empty; - roots.push_back(ceph::shared_ptr(new fullbit(empty, in->first, in->last, 0, pi, + roots.push_back(std::shared_ptr(new fullbit(empty, in->first, in->last, 0, pi, pdft, px, in->symlink, in->oldest_snap, snapbl, dirty ? fullbit::STATE_DIRTY : 0, diff --git a/src/mds/journal.cc b/src/mds/journal.cc index e67c3858c17a9..5fc864b955806 100644 --- a/src/mds/journal.cc +++ b/src/mds/journal.cc @@ -731,7 +731,7 @@ void EMetaBlob::dirlump::dump(Formatter *f) const f->dump_int("nnull", nnull); f->open_array_section("full bits"); - for (list >::const_iterator + for (list >::const_iterator iter = dfull.begin(); iter != dfull.end(); ++iter) { f->open_object_section("fullbit"); (*iter)->dump(f); @@ -806,7 +806,7 @@ void EMetaBlob::decode(bufferlist::const_iterator &bl) decode(rootbl, bl); if (rootbl.length()) { auto p = rootbl.cbegin(); - roots.push_back(ceph::shared_ptr(new fullbit(p))); + roots.push_back(std::shared_ptr(new fullbit(p))); } } decode(table_tids, bl); @@ -866,8 +866,8 @@ void EMetaBlob::get_inodes( dl._decode_bits(); // Record inodes of fullbits - list > const &fb_list = dl.get_dfull(); - for (list >::const_iterator + list > const &fb_list = dl.get_dfull(); + for (list >::const_iterator iter = fb_list.begin(); iter != fb_list.end(); ++iter) { inodes.insert((*iter)->inode.ino); } @@ -894,12 +894,12 @@ void EMetaBlob::get_dentries(std::map > &dentri // Get all bits dl._decode_bits(); - list > const &fb_list = dl.get_dfull(); + list > const &fb_list = dl.get_dfull(); list const &nb_list = dl.get_dnull(); list const &rb_list = dl.get_dremote(); // For all bits, store dentry - for (list >::const_iterator + for (list >::const_iterator iter = fb_list.begin(); iter != fb_list.end(); ++iter) { dentries[df].insert((*iter)->dn); @@ -950,11 +950,11 @@ void EMetaBlob::get_paths( dirlump const &dl = i->second; dl._decode_bits(); - list > const &fb_list = dl.get_dfull(); + list > const &fb_list = dl.get_dfull(); list const &nb_list = dl.get_dnull(); list const &rb_list = dl.get_dremote(); - for (list >::const_iterator + for (list >::const_iterator iter = fb_list.begin(); iter != fb_list.end(); ++iter) { std::string_view dentry = (*iter)->dn; children[dir_ino].emplace_back(dentry); @@ -984,8 +984,8 @@ void EMetaBlob::get_paths( dirlump const &dl = i->second; dl._decode_bits(); - list > const &fb_list = dl.get_dfull(); - for (list >::const_iterator + list > const &fb_list = dl.get_dfull(); + for (list >::const_iterator iter = fb_list.begin(); iter != fb_list.end(); ++iter) { std::string_view dentry = (*iter)->dn; if (children.find((*iter)->inode.ino) == children.end()) { @@ -1046,7 +1046,7 @@ void EMetaBlob::dump(Formatter *f) const f->close_section(); // lumps f->open_array_section("roots"); - for (list >::const_iterator i = roots.begin(); + for (list >::const_iterator i = roots.begin(); i != roots.end(); ++i) { f->open_object_section("root"); (*i)->dump(f); @@ -1131,7 +1131,7 @@ void EMetaBlob::replay(MDSRank *mds, LogSegment *logseg, MDSlaveUpdate *slaveup) assert(g_conf->mds_kill_journal_replay_at != 1); - for (list >::iterator p = roots.begin(); p != roots.end(); ++p) { + for (list >::iterator p = roots.begin(); p != roots.end(); ++p) { CInode *in = mds->mdcache->get_inode((*p)->inode.ino); bool isnew = in ? false:true; if (!in) @@ -1244,10 +1244,10 @@ void EMetaBlob::replay(MDSRank *mds, LogSegment *logseg, MDSlaveUpdate *slaveup) lump._decode_bits(); // full dentry+inode pairs - for (list >::const_iterator pp = lump.get_dfull().begin(); + for (list >::const_iterator pp = lump.get_dfull().begin(); pp != lump.get_dfull().end(); ++pp) { - ceph::shared_ptr p = *pp; + std::shared_ptr 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); diff --git a/src/mgr/PyOSDMap.cc b/src/mgr/PyOSDMap.cc index f49f170df612c..3847176f0bd1e 100644 --- a/src/mgr/PyOSDMap.cc +++ b/src/mgr/PyOSDMap.cc @@ -28,7 +28,7 @@ typedef struct { typedef struct { PyObject_HEAD - ceph::shared_ptr crush; + std::shared_ptr crush; } BasePyCRUSH; // ---------- @@ -465,7 +465,7 @@ BasePyCRUSH_init(BasePyCRUSH *self, } assert(PyObject_TypeCheck(crush_capsule, &PyCapsule_Type)); - auto ptr_ref = (ceph::shared_ptr*)( + auto ptr_ref = (std::shared_ptr*)( PyCapsule_GetPointer(crush_capsule, nullptr)); // We passed a pointer to a shared pointer, which is weird, but diff --git a/src/mon/MonOpRequest.h b/src/mon/MonOpRequest.h index 364232b1f9d88..ef0af47be8e61 100644 --- a/src/mon/MonOpRequest.h +++ b/src/mon/MonOpRequest.h @@ -18,7 +18,6 @@ #include #include "common/TrackedOp.h" -#include "include/memory.h" #include "mon/Session.h" #include "msg/Message.h" diff --git a/src/mon/Monitor.h b/src/mon/Monitor.h index 43556be430b56..324da5ded989a 100644 --- a/src/mon/Monitor.h +++ b/src/mon/Monitor.h @@ -45,7 +45,6 @@ #include "auth/KeyRing.h" #include "messages/MMonCommand.h" #include "mon/MonitorDBStore.h" -#include "include/memory.h" #include "mgr/MgrClient.h" #include "mon/MonOpRequest.h" @@ -285,7 +284,7 @@ private: ScrubState() : finished(false) { } virtual ~ScrubState() { } }; - ceph::shared_ptr scrub_state; ///< keeps track of current scrub + std::shared_ptr scrub_state; ///< keeps track of current scrub /** * @defgroup Monitor_h_sync Synchronization diff --git a/src/mon/MonitorDBStore.h b/src/mon/MonitorDBStore.h index f6bb2d748ccbb..93fa2ac5f57ab 100644 --- a/src/mon/MonitorDBStore.h +++ b/src/mon/MonitorDBStore.h @@ -99,7 +99,7 @@ class MonitorDBStore }; struct Transaction; - typedef ceph::shared_ptr TransactionRef; + typedef std::shared_ptr TransactionRef; struct Transaction { list ops; uint64_t bytes, keys; @@ -421,7 +421,7 @@ class MonitorDBStore virtual void get_chunk_tx(TransactionRef tx, uint64_t max) = 0; virtual pair get_next_key() = 0; }; - typedef ceph::shared_ptr Synchronizer; + typedef std::shared_ptr Synchronizer; class WholeStoreIteratorImpl : public StoreIteratorImpl { KeyValueDB::WholeSpaceIterator iter; @@ -492,7 +492,7 @@ class MonitorDBStore else iter->seek_to_first(); - return ceph::shared_ptr( + return std::shared_ptr( new WholeStoreIteratorImpl(iter, prefixes) ); } diff --git a/src/msg/async/AsyncConnection.h b/src/msg/async/AsyncConnection.h index 0a3da9ddccac8..cd5ab7328ef96 100644 --- a/src/msg/async/AsyncConnection.h +++ b/src/msg/async/AsyncConnection.h @@ -367,7 +367,7 @@ class AsyncConnection : public Connection { uint64_t state_offset; Worker *worker; EventCenter *center; - ceph::shared_ptr session_security; + std::shared_ptr session_security; public: // used by eventcallback diff --git a/src/msg/async/dpdk/DPDK.h b/src/msg/async/dpdk/DPDK.h index a57fcd7cdd81b..04127f4aaae6d 100644 --- a/src/msg/async/dpdk/DPDK.h +++ b/src/msg/async/dpdk/DPDK.h @@ -38,7 +38,6 @@ #include "const.h" #include "circular_buffer.h" #include "ethernet.h" -#include "memory.h" #include "Packet.h" #include "stream.h" #include "net.h" diff --git a/src/msg/simple/Pipe.cc b/src/msg/simple/Pipe.cc index 9f44dd8b7c006..a42ecedf4519f 100644 --- a/src/msg/simple/Pipe.cc +++ b/src/msg/simple/Pipe.cc @@ -1635,7 +1635,7 @@ void Pipe::reader() } // get a reference to the AuthSessionHandler while we have the pipe_lock - ceph::shared_ptr auth_handler = session_security; + std::shared_ptr auth_handler = session_security; pipe_lock.Unlock(); diff --git a/src/msg/simple/Pipe.h b/src/msg/simple/Pipe.h index ca67770cc8192..ce9925bd0d9b6 100644 --- a/src/msg/simple/Pipe.h +++ b/src/msg/simple/Pipe.h @@ -15,7 +15,6 @@ #ifndef CEPH_MSGR_PIPE_H #define CEPH_MSGR_PIPE_H -#include "include/memory.h" #include "auth/AuthSessionHandler.h" #include "msg/msg_types.h" @@ -128,7 +127,7 @@ static const int SM_IOV_MAX = (IOV_MAX >= 1024 ? IOV_MAX / 4 : IOV_MAX); // session_security handles any signatures or encryptions required for this pipe's msgs. PLR - ceph::shared_ptr session_security; + std::shared_ptr session_security; protected: friend class SimpleMessenger; diff --git a/src/msg/xio/XioConnection.h b/src/msg/xio/XioConnection.h index a6dc950c2d70c..00024ef3177b6 100644 --- a/src/msg/xio/XioConnection.h +++ b/src/msg/xio/XioConnection.h @@ -132,7 +132,7 @@ private: Messenger::Policy policy; CryptoKey session_key; - ceph::shared_ptr session_security; + std::shared_ptr session_security; AuthAuthorizer *authorizer; XioConnection *xcon; uint32_t protocol_version; diff --git a/src/os/ObjectMap.h b/src/os/ObjectMap.h index 4db3f17dc4ba5..8d0a39e423465 100644 --- a/src/os/ObjectMap.h +++ b/src/os/ObjectMap.h @@ -15,9 +15,9 @@ #ifndef OS_KEYVALUESTORE_H #define OS_KEYVALUESTORE_H +#include #include #include -#include "include/memory.h" #include "kv/KeyValueDB.h" #include "common/hobject.h" @@ -157,7 +157,7 @@ public: virtual void compact() {} typedef KeyValueDB::SimplestIteratorImpl ObjectMapIteratorImpl; - typedef ceph::shared_ptr ObjectMapIterator; + typedef std::shared_ptr ObjectMapIterator; virtual ObjectMapIterator get_iterator(const ghobject_t &oid) { return ObjectMapIterator(); } diff --git a/src/os/ObjectStore.cc b/src/os/ObjectStore.cc index be6248c1f219f..d9b9cf6d1ab65 100644 --- a/src/os/ObjectStore.cc +++ b/src/os/ObjectStore.cc @@ -13,7 +13,6 @@ */ #include #include -#include "include/memory.h" #include "ObjectStore.h" #include "common/Formatter.h" #include "common/safe_io.h" diff --git a/src/os/bluestore/BitmapFreelistManager.cc b/src/os/bluestore/BitmapFreelistManager.cc index 45bcd2b42d7d2..5270dbc9e2010 100644 --- a/src/os/bluestore/BitmapFreelistManager.cc +++ b/src/os/bluestore/BitmapFreelistManager.cc @@ -42,7 +42,7 @@ struct XorMergeOperator : public KeyValueDB::MergeOperator { void BitmapFreelistManager::setup_merge_operator(KeyValueDB *db, string prefix) { - ceph::shared_ptr merge_op(new XorMergeOperator); + std::shared_ptr merge_op(new XorMergeOperator); db->set_merge_operator(prefix, merge_op); } diff --git a/src/os/bluestore/BitmapFreelistManager.h b/src/os/bluestore/BitmapFreelistManager.h index 65e9f5d925f1f..e9dabbbeeb19c 100644 --- a/src/os/bluestore/BitmapFreelistManager.h +++ b/src/os/bluestore/BitmapFreelistManager.h @@ -15,7 +15,7 @@ class BitmapFreelistManager : public FreelistManager { std::string meta_prefix, bitmap_prefix; KeyValueDB *kvdb; - ceph::shared_ptr merge_op; + std::shared_ptr merge_op; std::mutex lock; uint64_t size; ///< size of device (bytes) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 1d5b5e7695c49..1c8a7aae75f6e 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -4780,7 +4780,7 @@ int BlueStore::_open_db(bool create, bool to_repair_db) string fn = path + "/db"; string options; stringstream err; - ceph::shared_ptr merge_op(new Int64ArrayMergeOperator); + std::shared_ptr merge_op(new Int64ArrayMergeOperator); string kv_backend; std::vector cfs; diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index b586444275dcb..33aa3f82d8a31 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -31,7 +31,6 @@ #include "include/assert.h" #include "include/unordered_map.h" -#include "include/memory.h" #include "include/mempool.h" #include "common/bloom_filter.hpp" #include "common/Finisher.h" diff --git a/src/os/filestore/CollectionIndex.h b/src/os/filestore/CollectionIndex.h index c5d120e1accc3..38cda3e5d7ec2 100644 --- a/src/os/filestore/CollectionIndex.h +++ b/src/os/filestore/CollectionIndex.h @@ -17,7 +17,6 @@ #include #include -#include "include/memory.h" #include "osd/osd_types.h" #include "include/object.h" @@ -77,7 +76,7 @@ protected: RWLock access_lock; /// Type of returned paths - typedef ceph::shared_ptr IndexedPath; + typedef std::shared_ptr IndexedPath; static IndexedPath get_testing_path(string path, coll_t collection) { return std::make_shared(path, collection); diff --git a/src/os/filestore/DBObjectMap.cc b/src/os/filestore/DBObjectMap.cc index aaabdebd23ff9..3bb2cb538b434 100644 --- a/src/os/filestore/DBObjectMap.cc +++ b/src/os/filestore/DBObjectMap.cc @@ -7,7 +7,6 @@ #include #include #include -#include "include/memory.h" #include #include "os/ObjectMap.h" diff --git a/src/os/filestore/DBObjectMap.h b/src/os/filestore/DBObjectMap.h index ba189ff065678..7746483c3d3ab 100644 --- a/src/os/filestore/DBObjectMap.h +++ b/src/os/filestore/DBObjectMap.h @@ -8,7 +8,6 @@ #include #include -#include "include/memory.h" #include #include "os/ObjectMap.h" @@ -365,7 +364,7 @@ public: const string &in); private: /// Implicit lock on Header->seq - typedef ceph::shared_ptr<_Header> Header; + typedef std::shared_ptr<_Header> Header; Mutex cache_lock; SimpleLRU caches; @@ -405,12 +404,12 @@ private: Header header; /// parent_iter == NULL iff no parent - ceph::shared_ptr parent_iter; + std::shared_ptr parent_iter; KeyValueDB::Iterator key_iter; KeyValueDB::Iterator complete_iter; /// cur_iter points to currently valid iterator - ceph::shared_ptr cur_iter; + std::shared_ptr cur_iter; int r; /// init() called, key_iter, complete_iter, parent_iter filled in @@ -456,7 +455,7 @@ private: int adjust(); }; - typedef ceph::shared_ptr DBObjectMapIterator; + typedef std::shared_ptr DBObjectMapIterator; DBObjectMapIterator _get_iterator(Header header) { return std::make_shared(this, header); } diff --git a/src/os/filestore/FDCache.h b/src/os/filestore/FDCache.h index 723cc722f4b9d..e81c5a47d8bf5 100644 --- a/src/os/filestore/FDCache.h +++ b/src/os/filestore/FDCache.h @@ -70,7 +70,7 @@ public: cct->_conf->remove_observer(this); delete[] registry; } - typedef ceph::shared_ptr FDRef; + typedef std::shared_ptr FDRef; FDRef lookup(const ghobject_t &hoid) { int registry_id = hoid.hobj.get_hash() % registry_shards; diff --git a/src/os/filestore/IndexManager.cc b/src/os/filestore/IndexManager.cc index 88e17eb156b72..730950264cac2 100644 --- a/src/os/filestore/IndexManager.cc +++ b/src/os/filestore/IndexManager.cc @@ -12,7 +12,6 @@ * */ -#include "include/memory.h" #include "include/unordered_map.h" #if defined(__FreeBSD__) diff --git a/src/os/filestore/IndexManager.h b/src/os/filestore/IndexManager.h index 4162ffa5f347f..e56ed0f8daf1d 100644 --- a/src/os/filestore/IndexManager.h +++ b/src/os/filestore/IndexManager.h @@ -14,7 +14,6 @@ #ifndef OS_INDEXMANAGER_H #define OS_INDEXMANAGER_H -#include "include/memory.h" #include "include/unordered_map.h" #include "common/Mutex.h" diff --git a/src/os/filestore/LFNIndex.h b/src/os/filestore/LFNIndex.h index 2f2d2e0f8feab..0d068260af9ff 100644 --- a/src/os/filestore/LFNIndex.h +++ b/src/os/filestore/LFNIndex.h @@ -20,7 +20,6 @@ #include #include #include -#include "include/memory.h" #include #include "osd/osd_types.h" diff --git a/src/os/filestore/WBThrottle.h b/src/os/filestore/WBThrottle.h index 5c71dacafe112..b10b0bb8e3b98 100644 --- a/src/os/filestore/WBThrottle.h +++ b/src/os/filestore/WBThrottle.h @@ -17,7 +17,6 @@ #include "include/unordered_map.h" #include -#include "include/memory.h" #include "common/Formatter.h" #include "common/hobject.h" #include "include/interval_set.h" diff --git a/src/os/kstore/KStore.h b/src/os/kstore/KStore.h index 3f8e959964f51..fa1c88a6a5b93 100644 --- a/src/os/kstore/KStore.h +++ b/src/os/kstore/KStore.h @@ -25,7 +25,6 @@ #include "include/assert.h" #include "include/unordered_map.h" -#include "include/memory.h" #include "common/Finisher.h" #include "common/RWLock.h" #include "common/Throttle.h" diff --git a/src/os/memstore/MemStore.cc b/src/os/memstore/MemStore.cc index 71266a635a561..5e6d30ff6a230 100644 --- a/src/os/memstore/MemStore.cc +++ b/src/os/memstore/MemStore.cc @@ -24,7 +24,6 @@ #include "include/types.h" #include "include/stringify.h" #include "include/unordered_map.h" -#include "include/memory.h" #include "common/errno.h" #include "MemStore.h" #include "include/compat.h" diff --git a/src/os/memstore/MemStore.h b/src/os/memstore/MemStore.h index d73b59afe1dea..c0b8978c8b480 100644 --- a/src/os/memstore/MemStore.h +++ b/src/os/memstore/MemStore.h @@ -20,7 +20,6 @@ #include #include "include/unordered_map.h" -#include "include/memory.h" #include "common/Finisher.h" #include "common/RefCountedObj.h" #include "common/RWLock.h" diff --git a/src/osd/ECUtil.h b/src/osd/ECUtil.h index 1627741a10841..610e0ff451d06 100644 --- a/src/osd/ECUtil.h +++ b/src/osd/ECUtil.h @@ -159,7 +159,7 @@ public: friend std::ostream& operator<<(std::ostream& out, const HashInfo& hi); }; -typedef ceph::shared_ptr HashInfoRef; +typedef std::shared_ptr HashInfoRef; bool is_hinfo_key_string(const std::string &key); const std::string &get_hinfo_key(); diff --git a/src/osd/OSD.h b/src/osd/OSD.h index c4cf9fcea9555..eccbe601c2118 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -46,7 +46,6 @@ #include #include #include -#include "include/memory.h" #include "include/unordered_map.h" diff --git a/src/osd/OSDMap.h b/src/osd/OSDMap.h index e18407fc022b7..6c7b1362a953f 100644 --- a/src/osd/OSDMap.h +++ b/src/osd/OSDMap.h @@ -33,7 +33,7 @@ #include #include #include -#include "include/memory.h" +#include #include "include/btree_map.h" // forward declaration @@ -524,21 +524,21 @@ private: CEPH_FEATUREMASK_SERVER_NAUTILUS; struct addrs_s { - mempool::osdmap::vector > client_addrs; - mempool::osdmap::vector > cluster_addr; - mempool::osdmap::vector > hb_back_addr; - mempool::osdmap::vector > hb_front_addr; + mempool::osdmap::vector > client_addrs; + mempool::osdmap::vector > cluster_addr; + mempool::osdmap::vector > hb_back_addr; + mempool::osdmap::vector > hb_front_addr; }; - ceph::shared_ptr osd_addrs; + std::shared_ptr osd_addrs; entity_addr_t _blank_addr; entity_addrvec_t _blank_addrvec; mempool::osdmap::vector<__u32> osd_weight; // 16.16 fixed point, 0x10000 = "in", 0 = "out" mempool::osdmap::vector osd_info; - ceph::shared_ptr pg_temp; // temp pg mapping (e.g. while we rebuild) - ceph::shared_ptr< mempool::osdmap::map > primary_temp; // temp primary mapping (e.g. while we rebuild) - ceph::shared_ptr< mempool::osdmap::vector<__u32> > osd_primary_affinity; ///< 16.16 fixed point, 0x10000 = baseline + std::shared_ptr pg_temp; // temp pg mapping (e.g. while we rebuild) + std::shared_ptr< mempool::osdmap::map > primary_temp; // temp primary mapping (e.g. while we rebuild) + std::shared_ptr< mempool::osdmap::vector<__u32> > osd_primary_affinity; ///< 16.16 fixed point, 0x10000 = baseline // remap (post-CRUSH, pre-up) mempool::osdmap::map> pg_upmap; ///< remap pg @@ -549,7 +549,7 @@ private: mempool::osdmap::map > erasure_code_profiles; mempool::osdmap::map name_pool; - ceph::shared_ptr< mempool::osdmap::vector > osd_uuid; + std::shared_ptr< mempool::osdmap::vector > osd_uuid; mempool::osdmap::vector osd_xinfo; mempool::osdmap::unordered_map blacklist; @@ -588,7 +588,7 @@ private: bool have_crc() const { return crc_defined; } uint32_t get_crc() const { return crc; } - ceph::shared_ptr crush; // hierarchical map + std::shared_ptr crush; // hierarchical map private: uint32_t crush_version = 1; @@ -1474,7 +1474,7 @@ public: WRITE_CLASS_ENCODER_FEATURES(OSDMap) WRITE_CLASS_ENCODER_FEATURES(OSDMap::Incremental) -typedef ceph::shared_ptr OSDMapRef; +typedef std::shared_ptr OSDMapRef; inline ostream& operator<<(ostream& out, const OSDMap& m) { m.print_oneline_summary(out); diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 70b7184ad65ac..51e4403a1a404 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -5841,7 +5841,7 @@ struct FlushState { pg->unlock(); } }; -typedef ceph::shared_ptr FlushStateRef; +typedef std::shared_ptr FlushStateRef; void PG::start_flush(ObjectStore::Transaction *t) { diff --git a/src/osd/PG.h b/src/osd/PG.h index 31cda1b7128cf..c206e5a65c595 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -25,7 +25,6 @@ #include #include #include -#include "include/memory.h" #include "include/mempool.h" // re-include our assert to clobber boost's diff --git a/src/osd/PGBackend.h b/src/osd/PGBackend.h index 51c35a8118027..370694a7421f2 100644 --- a/src/osd/PGBackend.h +++ b/src/osd/PGBackend.h @@ -35,7 +35,7 @@ struct inconsistent_obj_wrapper; //forward declaration class OSDMap; class PGLog; -typedef ceph::shared_ptr OSDMapRef; +typedef std::shared_ptr OSDMapRef; /** * PGBackend diff --git a/src/osd/PGPeeringEvent.h b/src/osd/PGPeeringEvent.h index a3236de64fb69..c698a77215297 100644 --- a/src/osd/PGPeeringEvent.h +++ b/src/osd/PGPeeringEvent.h @@ -66,7 +66,7 @@ public: return desc; } }; -typedef ceph::shared_ptr PGPeeringEventRef; +typedef std::shared_ptr PGPeeringEventRef; struct MInfoRec : boost::statechart::event< MInfoRec > { pg_shard_t from; diff --git a/src/osd/PrimaryLogPG.h b/src/osd/PrimaryLogPG.h index ec3f57319a047..5d0315972c041 100644 --- a/src/osd/PrimaryLogPG.h +++ b/src/osd/PrimaryLogPG.h @@ -117,7 +117,7 @@ public: }; struct CopyOp; - typedef ceph::shared_ptr CopyOpRef; + typedef std::shared_ptr CopyOpRef; struct CopyOp { CopyCallback *cb; @@ -210,7 +210,7 @@ public: user_version(0), data_offset(0), canceled(false) { } }; - typedef ceph::shared_ptr ProxyReadOpRef; + typedef std::shared_ptr ProxyReadOpRef; struct ProxyWriteOp { OpContext *ctx; @@ -231,7 +231,7 @@ public: canceled(false), reqid(_reqid) { } }; - typedef ceph::shared_ptr ProxyWriteOpRef; + typedef std::shared_ptr ProxyWriteOpRef; struct FlushOp { ObjectContextRef obc; ///< obc we are flushing @@ -253,7 +253,7 @@ public: blocking(false), removal(false), chunks(0) {} ~FlushOp() { assert(!on_flush); } }; - typedef ceph::shared_ptr FlushOpRef; + typedef std::shared_ptr FlushOpRef; boost::scoped_ptr pgbackend; PGBackend *get_pgbackend() override { diff --git a/src/osd/ReplicatedBackend.h b/src/osd/ReplicatedBackend.h index 7c4d1a17980aa..6dbba861a9a62 100644 --- a/src/osd/ReplicatedBackend.h +++ b/src/osd/ReplicatedBackend.h @@ -16,7 +16,6 @@ #define REPBACKEND_H #include "PGBackend.h" -#include "include/memory.h" struct C_ReplicatedBackend_OnPullComplete; class ReplicatedBackend : public PGBackend { @@ -412,7 +411,7 @@ private: RepModify() : committed(false), ackerosd(-1), epoch_started(0) {} }; - typedef ceph::shared_ptr RepModifyRef; + typedef std::shared_ptr RepModifyRef; struct C_OSD_RepModifyCommit; diff --git a/src/osd/Watch.h b/src/osd/Watch.h index 08a54b7426232..65408c276dce2 100644 --- a/src/osd/Watch.h +++ b/src/osd/Watch.h @@ -14,7 +14,6 @@ #ifndef CEPH_WATCH_H #define CEPH_WATCH_H -#include "include/memory.h" #include #include "msg/Connection.h" #include "include/Context.h" @@ -32,12 +31,12 @@ struct ObjectContext; class MWatchNotify; class Watch; -typedef ceph::shared_ptr WatchRef; -typedef ceph::weak_ptr WWatchRef; +typedef std::shared_ptr WatchRef; +typedef std::weak_ptr WWatchRef; class Notify; -typedef ceph::shared_ptr NotifyRef; -typedef ceph::weak_ptr WNotifyRef; +typedef std::shared_ptr NotifyRef; +typedef std::weak_ptr WNotifyRef; struct CancelableContext; @@ -154,7 +153,7 @@ class Watch { OSDService *osd; boost::intrusive_ptr pg; - ceph::shared_ptr obc; + std::shared_ptr obc; std::map in_progress_notifies; @@ -171,7 +170,7 @@ class Watch { Watch( PrimaryLogPG *pg, OSDService *osd, - ceph::shared_ptr obc, uint32_t timeout, + std::shared_ptr obc, uint32_t timeout, uint64_t cookie, entity_name_t entity, const entity_addr_t& addr); @@ -210,7 +209,7 @@ public: std::ostream& gen_dbg_prefix(std::ostream& out); static WatchRef makeWatchRef( PrimaryLogPG *pg, OSDService *osd, - ceph::shared_ptr obc, uint32_t timeout, uint64_t cookie, entity_name_t entity, const entity_addr_t &addr); + std::shared_ptr obc, uint32_t timeout, uint64_t cookie, entity_name_t entity, const entity_addr_t &addr); void set_self(WatchRef _self) { self = _self; } @@ -218,7 +217,7 @@ public: /// Does not grant a ref count! boost::intrusive_ptr get_pg() { return pg; } - ceph::shared_ptr get_obc() { return obc; } + std::shared_ptr get_obc() { return obc; } uint64_t get_cookie() const { return cookie; } entity_name_t get_entity() const { return entity; } diff --git a/src/osd/osd_internal_types.h b/src/osd/osd_internal_types.h index 9cc451c4cbf1d..79ef12b9f594c 100644 --- a/src/osd/osd_internal_types.h +++ b/src/osd/osd_internal_types.h @@ -37,7 +37,7 @@ struct ObjectState { : oi(oi_), exists(exists_) {} }; -typedef ceph::shared_ptr ObjectContextRef; +typedef std::shared_ptr ObjectContextRef; struct ObjectContext { ObjectState obs; diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index de0040014caa9..1ade94a21a1e3 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -2755,8 +2755,8 @@ public: int new_up_primary, ///< [in] up primary of osdmap const vector &old_up, ///< [in] up as of lastmap const vector &new_up, ///< [in] up as of osdmap - ceph::shared_ptr osdmap, ///< [in] current map - ceph::shared_ptr lastmap, ///< [in] last map + std::shared_ptr osdmap, ///< [in] current map + std::shared_ptr lastmap, ///< [in] last map pg_t pgid ///< [in] pgid for pg ); @@ -2775,8 +2775,8 @@ public: const vector &new_up, ///< [in] up as of osdmap epoch_t same_interval_since, ///< [in] as of osdmap epoch_t last_epoch_clean, ///< [in] current - ceph::shared_ptr osdmap, ///< [in] current map - ceph::shared_ptr lastmap, ///< [in] last map + std::shared_ptr osdmap, ///< [in] current map + std::shared_ptr lastmap, ///< [in] last map pg_t pgid, ///< [in] pgid for pg IsPGRecoverablePredicate *could_have_gone_active, /// [in] predicate whether the pg can be active PastIntervals *past_intervals, ///< [out] intervals diff --git a/src/rgw/rgw_bucket.h b/src/rgw/rgw_bucket.h index 6542b5bf87951..f66295eb797cb 100644 --- a/src/rgw/rgw_bucket.h +++ b/src/rgw/rgw_bucket.h @@ -437,7 +437,7 @@ class RGWDataChangesLog { } }; - typedef ceph::shared_ptr ChangeStatusPtr; + typedef std::shared_ptr ChangeStatusPtr; lru_map changes; diff --git a/src/test/ObjectMap/KeyValueDBMemory.cc b/src/test/ObjectMap/KeyValueDBMemory.cc index bf6570b1dd40e..971a14339451b 100644 --- a/src/test/ObjectMap/KeyValueDBMemory.cc +++ b/src/test/ObjectMap/KeyValueDBMemory.cc @@ -4,7 +4,6 @@ #include "KeyValueDBMemory.h" #include #include -#include "include/memory.h" #include using namespace std; @@ -236,7 +235,7 @@ int KeyValueDBMemory::rm_range_keys(const string &prefix, const string &start, c } KeyValueDB::WholeSpaceIterator KeyValueDBMemory::get_wholespace_iterator() { - return ceph::shared_ptr( + return std::shared_ptr( new WholeSpaceMemIterator(this) ); } diff --git a/src/test/ObjectMap/KeyValueDBMemory.h b/src/test/ObjectMap/KeyValueDBMemory.h index f82762d4fcbe1..415399e0a30dc 100644 --- a/src/test/ObjectMap/KeyValueDBMemory.h +++ b/src/test/ObjectMap/KeyValueDBMemory.h @@ -3,7 +3,6 @@ #include #include #include -#include "include/memory.h" #include "kv/KeyValueDB.h" #include "include/buffer.h" diff --git a/src/test/ObjectMap/test_keyvaluedb_atomicity.cc b/src/test/ObjectMap/test_keyvaluedb_atomicity.cc index 6e7fc8d2fa775..a97cb9fb93c80 100644 --- a/src/test/ObjectMap/test_keyvaluedb_atomicity.cc +++ b/src/test/ObjectMap/test_keyvaluedb_atomicity.cc @@ -6,7 +6,6 @@ #include #include #include -#include "include/memory.h" #include #include #include diff --git a/src/test/ObjectMap/test_keyvaluedb_iterators.cc b/src/test/ObjectMap/test_keyvaluedb_iterators.cc index 8c2bd0f648608..105c6dcb42dda 100644 --- a/src/test/ObjectMap/test_keyvaluedb_iterators.cc +++ b/src/test/ObjectMap/test_keyvaluedb_iterators.cc @@ -10,7 +10,6 @@ * License version 2.1, as published by the Free Software * Foundation. See file COPYING. */ -#include "include/memory.h" #include #include #include diff --git a/src/test/ObjectMap/test_object_map.cc b/src/test/ObjectMap/test_object_map.cc index d194db1865c3d..ddf23cffc7f5d 100644 --- a/src/test/ObjectMap/test_object_map.cc +++ b/src/test/ObjectMap/test_object_map.cc @@ -1,5 +1,4 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- -#include "include/memory.h" #include #include #include diff --git a/src/test/bufferlist.cc b/src/test/bufferlist.cc index 4dccb271da502..4e8a21f00fbfc 100644 --- a/src/test/bufferlist.cc +++ b/src/test/bufferlist.cc @@ -19,7 +19,6 @@ * */ -#include "include/memory.h" #include #include #include @@ -2916,7 +2915,7 @@ TEST(BufferList, TestCloneNonShareable) { TEST(BufferList, TestCopyAll) { const static size_t BIG_SZ = 10737414; - ceph::shared_ptr big( + std::shared_ptr big( (unsigned char*)malloc(BIG_SZ), free); unsigned char c = 0; for (size_t i = 0; i < BIG_SZ; ++i) { @@ -2928,7 +2927,7 @@ TEST(BufferList, TestCopyAll) { bufferlist bl2; i.copy_all(bl2); ASSERT_EQ(bl2.length(), BIG_SZ); - ceph::shared_ptr big2( + std::shared_ptr 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); @@ -2936,7 +2935,7 @@ TEST(BufferList, TestCopyAll) { TEST(BufferList, InvalidateCrc) { const static size_t buffer_size = 262144; - ceph::shared_ptr big( + std::shared_ptr big( (unsigned char*)malloc(buffer_size), free); unsigned char c = 0; char* ptr = (char*) big.get(); diff --git a/src/test/common/test_shared_cache.cc b/src/test/common/test_shared_cache.cc index 7b7602ffe08ba..026c99fe70b3b 100644 --- a/src/test/common/test_shared_cache.cc +++ b/src/test/common/test_shared_cache.cc @@ -30,7 +30,7 @@ class SharedLRUTest : public SharedLRU { public: Mutex &get_lock() { return lock; } Cond &get_cond() { return cond; } - map, int* > > &get_weak_refs() { + map, int* > > &get_weak_refs() { return weak_refs; } }; @@ -43,7 +43,7 @@ public: SharedLRUTest &cache; unsigned int key; int value; - ceph::shared_ptr ptr; + std::shared_ptr ptr; enum in_method_t { LOOKUP, LOWER_BOUND } in_method; Thread_wait(SharedLRUTest& _cache, unsigned int _key, @@ -59,7 +59,7 @@ public: ptr = cache.lower_bound(key); break; case LOOKUP: - ptr = ceph::shared_ptr(new int); + ptr = std::shared_ptr(new int); *ptr = value; ptr = cache.lookup(key); break; @@ -103,13 +103,13 @@ TEST_F(SharedLRU_all, add) { int value1 = 2; bool existed = false; { - ceph::shared_ptr ptr = cache.add(key, new int(value1), &existed); + std::shared_ptr ptr = cache.add(key, new int(value1), &existed); ASSERT_EQ(value1, *ptr); ASSERT_FALSE(existed); } { int value2 = 3; - ceph::shared_ptr ptr = cache.add(key, new int(value2), &existed); + std::shared_ptr ptr = cache.add(key, new int(value2), &existed); ASSERT_EQ(value1, *ptr); ASSERT_TRUE(existed); } @@ -122,7 +122,7 @@ TEST_F(SharedLRU_all, empty) { ASSERT_TRUE(cache.empty()); { int value1 = 2; - ceph::shared_ptr ptr = cache.add(key, new int(value1), &existed); + std::shared_ptr ptr = cache.add(key, new int(value1), &existed); ASSERT_EQ(value1, *ptr); ASSERT_FALSE(existed); } @@ -167,7 +167,7 @@ TEST_F(SharedLRU_all, wait_lookup) { int value = 2; { - ceph::shared_ptr ptr(new int); + std::shared_ptr ptr(new int); cache.get_weak_refs()[key] = make_pair(ptr, &*ptr); } EXPECT_FALSE(cache.get_weak_refs()[key].first.lock()); @@ -193,7 +193,7 @@ TEST_F(SharedLRU_all, wait_lookup_or_create) { int value = 2; { - ceph::shared_ptr ptr(new int); + std::shared_ptr ptr(new int); cache.get_weak_refs()[key] = make_pair(ptr, &*ptr); } EXPECT_FALSE(cache.get_weak_refs()[key].first.lock()); @@ -238,7 +238,7 @@ TEST_F(SharedLRU_all, wait_lower_bound) { ASSERT_TRUE(cache.add(other_key, new int(other_value)).get()); { - ceph::shared_ptr ptr(new int); + std::shared_ptr ptr(new int); cache.get_weak_refs()[key] = make_pair(ptr, &*ptr); } EXPECT_FALSE(cache.get_weak_refs()[key].first.lock()); @@ -270,15 +270,15 @@ TEST_F(SharedLRU_all, get_next) { SharedLRUTest cache; const unsigned int key2 = 333; - ceph::shared_ptr ptr2 = cache.lookup_or_create(key2); + std::shared_ptr ptr2 = cache.lookup_or_create(key2); const int value2 = *ptr2 = 400; // entries with expired pointers are silently ignored const unsigned int key_gone = 222; - cache.get_weak_refs()[key_gone] = make_pair(ceph::shared_ptr(), (int*)0); + cache.get_weak_refs()[key_gone] = make_pair(std::shared_ptr(), (int*)0); const unsigned int key1 = 111; - ceph::shared_ptr ptr1 = cache.lookup_or_create(key1); + std::shared_ptr ptr1 = cache.lookup_or_create(key1); const int value1 = *ptr1 = 800; pair i; @@ -297,11 +297,11 @@ TEST_F(SharedLRU_all, get_next) { { SharedLRUTest cache; const unsigned int key1 = 111; - ceph::shared_ptr *ptr1 = new shared_ptr(cache.lookup_or_create(key1)); + std::shared_ptr *ptr1 = new shared_ptr(cache.lookup_or_create(key1)); const unsigned int key2 = 222; - ceph::shared_ptr ptr2 = cache.lookup_or_create(key2); + std::shared_ptr ptr2 = cache.lookup_or_create(key2); - pair > i; + pair > i; EXPECT_TRUE(cache.get_next(i.first, &i)); EXPECT_EQ(key1, i.first); delete ptr1; @@ -315,7 +315,7 @@ TEST_F(SharedLRU_all, clear) { unsigned int key = 1; int value = 2; { - ceph::shared_ptr ptr = cache.add(key, new int(value)); + std::shared_ptr ptr = cache.add(key, new int(value)); ASSERT_EQ(value, *cache.lookup(key)); } ASSERT_TRUE(cache.lookup(key).get()); @@ -323,7 +323,7 @@ TEST_F(SharedLRU_all, clear) { ASSERT_FALSE(cache.lookup(key)); { - ceph::shared_ptr ptr = cache.add(key, new int(value)); + std::shared_ptr ptr = cache.add(key, new int(value)); } ASSERT_TRUE(cache.lookup(key).get()); cache.clear(key); @@ -334,14 +334,14 @@ TEST_F(SharedLRU_all, clear_all) { unsigned int key = 1; int value = 2; { - ceph::shared_ptr ptr = cache.add(key, new int(value)); + std::shared_ptr ptr = cache.add(key, new int(value)); ASSERT_EQ(value, *cache.lookup(key)); } ASSERT_TRUE(cache.lookup(key).get()); cache.clear(); ASSERT_FALSE(cache.lookup(key)); - ceph::shared_ptr ptr2 = cache.add(key, new int(value)); + std::shared_ptr ptr2 = cache.add(key, new int(value)); ASSERT_TRUE(cache.lookup(key).get()); cache.clear(); ASSERT_TRUE(cache.lookup(key).get()); @@ -352,7 +352,7 @@ TEST(SharedCache_all, add) { SharedLRU cache; unsigned int key = 1; int value = 2; - ceph::shared_ptr ptr = cache.add(key, new int(value)); + std::shared_ptr ptr = cache.add(key, new int(value)); ASSERT_EQ(ptr, cache.lookup(key)); ASSERT_EQ(value, *cache.lookup(key)); } @@ -362,11 +362,11 @@ TEST(SharedCache_all, lru) { SharedLRU cache(NULL, SIZE); bool existed = false; - ceph::shared_ptr ptr = cache.add(0, new int(0), &existed); + std::shared_ptr ptr = cache.add(0, new int(0), &existed); ASSERT_FALSE(existed); { int *tmpint = new int(0); - ceph::shared_ptr ptr2 = cache.add(0, tmpint, &existed); + std::shared_ptr ptr2 = cache.add(0, tmpint, &existed); ASSERT_TRUE(existed); delete tmpint; } @@ -385,9 +385,9 @@ TEST(SharedCache_all, lru) { cache.purge(0); ASSERT_FALSE(cache.lookup(0)); - ceph::shared_ptr ptr2 = cache.add(0, new int(0), &existed); + std::shared_ptr ptr2 = cache.add(0, new int(0), &existed); ASSERT_FALSE(ptr == ptr2); - ptr = ceph::shared_ptr(); + ptr = std::shared_ptr(); ASSERT_TRUE(cache.lookup(0).get()); } diff --git a/src/test/common/test_sharedptr_registry.cc b/src/test/common/test_sharedptr_registry.cc index ee61e5cb6e5cb..765cc814d8722 100644 --- a/src/test/common/test_sharedptr_registry.cc +++ b/src/test/common/test_sharedptr_registry.cc @@ -29,7 +29,7 @@ class SharedPtrRegistryTest : public SharedPtrRegistry { public: Mutex &get_lock() { return lock; } - map, int*> > &get_contents() { + map, int*> > &get_contents() { return contents; } }; @@ -42,7 +42,7 @@ public: SharedPtrRegistryTest ®istry; unsigned int key; int value; - ceph::shared_ptr ptr; + std::shared_ptr ptr; enum in_method_t { LOOKUP, LOOKUP_OR_CREATE } in_method; Thread_wait(SharedPtrRegistryTest& _registry, unsigned int _key, int _value, in_method_t _in_method) : @@ -62,7 +62,7 @@ public: ptr = registry.lookup_or_create(key); break; case LOOKUP: - ptr = ceph::shared_ptr(new int); + ptr = std::shared_ptr(new int); *ptr = value; ptr = registry.lookup(key); break; @@ -102,7 +102,7 @@ TEST_F(SharedPtrRegistry_all, lookup_or_create) { SharedPtrRegistryTest registry; unsigned int key = 1; int value = 2; - ceph::shared_ptr ptr = registry.lookup_or_create(key); + std::shared_ptr ptr = registry.lookup_or_create(key); *ptr = value; ASSERT_EQ(value, *registry.lookup_or_create(key)); } @@ -123,7 +123,7 @@ TEST_F(SharedPtrRegistry_all, wait_lookup_or_create) { { unsigned int key = 1; { - ceph::shared_ptr ptr(new int); + std::shared_ptr ptr(new int); registry.get_contents()[key] = make_pair(ptr, ptr.get()); } EXPECT_FALSE(registry.get_contents()[key].first.lock()); @@ -143,7 +143,7 @@ TEST_F(SharedPtrRegistry_all, wait_lookup_or_create) { unsigned int key = 2; int value = 3; { - ceph::shared_ptr ptr(new int); + std::shared_ptr ptr(new int); registry.get_contents()[key] = make_pair(ptr, ptr.get()); } EXPECT_FALSE(registry.get_contents()[key].first.lock()); @@ -156,7 +156,7 @@ TEST_F(SharedPtrRegistry_all, wait_lookup_or_create) { { int other_value = value + 1; unsigned int other_key = key + 1; - ceph::shared_ptr ptr = registry.lookup_or_create(other_key, other_value); + std::shared_ptr ptr = registry.lookup_or_create(other_key, other_value); EXPECT_TRUE(ptr.get()); EXPECT_EQ(other_value, *ptr); } @@ -172,7 +172,7 @@ TEST_F(SharedPtrRegistry_all, lookup) { SharedPtrRegistryTest registry; unsigned int key = 1; { - ceph::shared_ptr ptr = registry.lookup_or_create(key); + std::shared_ptr ptr = registry.lookup_or_create(key); int value = 2; *ptr = value; ASSERT_EQ(value, *registry.lookup(key)); @@ -186,7 +186,7 @@ TEST_F(SharedPtrRegistry_all, wait_lookup) { unsigned int key = 1; int value = 2; { - ceph::shared_ptr ptr(new int); + std::shared_ptr ptr(new int); registry.get_contents()[key] = make_pair(ptr, ptr.get()); } EXPECT_FALSE(registry.get_contents()[key].first.lock()); @@ -215,15 +215,15 @@ TEST_F(SharedPtrRegistry_all, get_next) { SharedPtrRegistryTest registry; const unsigned int key2 = 333; - ceph::shared_ptr ptr2 = registry.lookup_or_create(key2); + std::shared_ptr ptr2 = registry.lookup_or_create(key2); const int value2 = *ptr2 = 400; // entries with expired pointers are silentely ignored const unsigned int key_gone = 222; - registry.get_contents()[key_gone] = make_pair(ceph::shared_ptr(), (int*)0); + registry.get_contents()[key_gone] = make_pair(std::shared_ptr(), (int*)0); const unsigned int key1 = 111; - ceph::shared_ptr ptr1 = registry.lookup_or_create(key1); + std::shared_ptr ptr1 = registry.lookup_or_create(key1); const int value1 = *ptr1 = 800; pair i; @@ -244,11 +244,11 @@ TEST_F(SharedPtrRegistry_all, get_next) { // SharedPtrRegistryTest registry; const unsigned int key1 = 111; - ceph::shared_ptr *ptr1 = new ceph::shared_ptr(registry.lookup_or_create(key1)); + std::shared_ptr *ptr1 = new std::shared_ptr(registry.lookup_or_create(key1)); const unsigned int key2 = 222; - ceph::shared_ptr ptr2 = registry.lookup_or_create(key2); + std::shared_ptr ptr2 = registry.lookup_or_create(key2); - pair > i; + pair > i; EXPECT_TRUE(registry.get_next(i.first, &i)); EXPECT_EQ(key1, i.first); delete ptr1; @@ -261,15 +261,15 @@ TEST_F(SharedPtrRegistry_all, remove) { { SharedPtrRegistryTest registry; const unsigned int key1 = 1; - ceph::shared_ptr ptr1 = registry.lookup_or_create(key1); + std::shared_ptr ptr1 = registry.lookup_or_create(key1); *ptr1 = 400; registry.remove(key1); - ceph::shared_ptr ptr2 = registry.lookup_or_create(key1); + std::shared_ptr ptr2 = registry.lookup_or_create(key1); *ptr2 = 500; - ptr1 = ceph::shared_ptr(); - ceph::shared_ptr res = registry.lookup(key1); + ptr1 = std::shared_ptr(); + std::shared_ptr res = registry.lookup(key1); assert(res); assert(res == ptr2); assert(*res == 500); @@ -277,13 +277,13 @@ TEST_F(SharedPtrRegistry_all, remove) { { SharedPtrRegistryTest registry; const unsigned int key1 = 1; - ceph::shared_ptr ptr1 = registry.lookup_or_create(key1, 400); + std::shared_ptr ptr1 = registry.lookup_or_create(key1, 400); registry.remove(key1); - ceph::shared_ptr ptr2 = registry.lookup_or_create(key1, 500); + std::shared_ptr ptr2 = registry.lookup_or_create(key1, 500); - ptr1 = ceph::shared_ptr(); - ceph::shared_ptr res = registry.lookup(key1); + ptr1 = std::shared_ptr(); + std::shared_ptr res = registry.lookup(key1); assert(res); assert(res == ptr2); assert(*res == 500); @@ -315,7 +315,7 @@ TEST_F(SharedPtrRegistry_destructor, destructor) { EXPECT_EQ(UNDEFINED, died); int key = 101; { - ceph::shared_ptr a = registry.lookup_or_create(key); + std::shared_ptr a = registry.lookup_or_create(key); EXPECT_EQ(NO, died); EXPECT_TRUE(a.get()); } diff --git a/src/test/confutils.cc b/src/test/confutils.cc index f323c6859c65c..f78a2824a25d9 100644 --- a/src/test/confutils.cc +++ b/src/test/confutils.cc @@ -24,7 +24,6 @@ #include #include #include -#include "include/memory.h" using ceph::bufferlist; using std::cerr; @@ -78,7 +77,7 @@ static int create_tempfile(const std::string &fname, const char *text) << get_temp_dir() << "'. " << cpp_strerror(err) << std::endl; return err; } - ceph::shared_ptr fpp(fp, fclose); + std::shared_ptr fpp(fp, fclose); if (unlink_idx >= MAX_FILES_TO_DELETE) return -ENOBUFS; if (unlink_idx == 0) { diff --git a/src/test/osd/Object.cc b/src/test/osd/Object.cc index 7d799863c014a..d48bc04950bfb 100644 --- a/src/test/osd/Object.cc +++ b/src/test/osd/Object.cc @@ -126,7 +126,7 @@ const ContDesc &ObjectDesc::most_recent() { } void ObjectDesc::update(ContentsGenerator *gen, const ContDesc &next) { - layers.push_front(std::pair, ContDesc>(ceph::shared_ptr(gen), next)); + layers.push_front(std::pair, ContDesc>(std::shared_ptr(gen), next)); return; } diff --git a/src/test/osd/Object.h b/src/test/osd/Object.h index 03d9c454b965c..f73abe5291a3a 100644 --- a/src/test/osd/Object.h +++ b/src/test/osd/Object.h @@ -314,7 +314,7 @@ public: ObjectDesc(const ContDesc &init, ContentsGenerator *cont_gen) : exists(false), dirty(false), version(0) { - layers.push_front(std::pair, ContDesc>(ceph::shared_ptr(cont_gen), init)); + layers.push_front(std::pair, ContDesc>(std::shared_ptr(cont_gen), init)); } class iterator { @@ -329,12 +329,12 @@ public: public: ContDesc cont; - ceph::shared_ptr gen; + std::shared_ptr gen; ContentsGenerator::iterator iter; ContState( const ContDesc &_cont, - ceph::shared_ptr _gen, + std::shared_ptr _gen, ContentsGenerator::iterator _iter) : size(_gen->get_length(_cont)), cont(_cont), gen(_gen), iter(_iter) { gen->get_ranges(cont, ranges); @@ -516,7 +516,7 @@ public: std::string redirect_target; std::map chunk_info; private: - std::list, ContDesc> > layers; + std::list, ContDesc> > layers; }; #endif diff --git a/src/test/osd/RadosModel.h b/src/test/osd/RadosModel.h index a59b0a404ecd7..93f3a74a87866 100644 --- a/src/test/osd/RadosModel.h +++ b/src/test/osd/RadosModel.h @@ -19,7 +19,6 @@ #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" @@ -1209,7 +1208,7 @@ public: int snap; bool balance_reads; - ceph::shared_ptr in_use; + std::shared_ptr in_use; vector results; vector retvals; @@ -1727,7 +1726,7 @@ public: librados::ObjectWriteOperation zero_write_op2; librados::ObjectWriteOperation op; vector comps; - ceph::shared_ptr in_use; + std::shared_ptr in_use; int last_finished; int outstanding; @@ -1839,7 +1838,7 @@ public: context->update_object_version(oid, comps[tid]->get_version64()); context->oid_in_use.erase(oid); context->oid_not_in_use.insert(oid); - in_use = ceph::shared_ptr(); + in_use = std::shared_ptr(); context->kick(); } } @@ -1863,7 +1862,7 @@ public: librados::ObjectReadOperation rd_op; librados::AioCompletion *comp; librados::AioCompletion *comp_racing_read = nullptr; - ceph::shared_ptr in_use; + std::shared_ptr in_use; int snap; int done; uint64_t version; @@ -1995,7 +1994,7 @@ public: int snap; bool balance_reads; - ceph::shared_ptr in_use; + std::shared_ptr in_use; vector results; vector retvals; @@ -2300,7 +2299,7 @@ public: librados::ObjectWriteOperation op; librados::ObjectReadOperation rd_op; librados::AioCompletion *comp; - ceph::shared_ptr in_use; + std::shared_ptr in_use; int done; int r; uint64_t offset; @@ -2414,7 +2413,7 @@ public: librados::ObjectWriteOperation op; librados::ObjectReadOperation rd_op; librados::AioCompletion *comp; - ceph::shared_ptr in_use; + std::shared_ptr in_use; int done; int r; SetRedirectOp(int n, @@ -2630,7 +2629,7 @@ public: librados::AioCompletion *completion; librados::ObjectWriteOperation op; string oid; - ceph::shared_ptr in_use; + std::shared_ptr in_use; TierPromoteOp(int n, RadosTestContext *context, @@ -2838,7 +2837,7 @@ public: bool dirty; ObjectDesc old_value; int snap = 0; - ceph::shared_ptr in_use; + std::shared_ptr in_use; IsDirtyOp(int n, RadosTestContext *context, @@ -2933,7 +2932,7 @@ public: bool blocking; int snap; bool can_fail; - ceph::shared_ptr in_use; + std::shared_ptr in_use; CacheFlushOp(int n, RadosTestContext *context, @@ -3037,7 +3036,7 @@ public: librados::AioCompletion *completion; librados::ObjectReadOperation op; string oid; - ceph::shared_ptr in_use; + std::shared_ptr in_use; CacheEvictOp(int n, RadosTestContext *context, diff --git a/src/test/osd/types.cc b/src/test/osd/types.cc index 777cbe73de6fa..4f4e7dece237e 100644 --- a/src/test/osd/types.cc +++ b/src/test/osd/types.cc @@ -131,11 +131,11 @@ for (unsigned i = 0; i < 4; ++i) { // int osd_id = 1; epoch_t epoch = 40; - ceph::shared_ptr osdmap(new OSDMap()); + std::shared_ptr osdmap(new OSDMap()); osdmap->set_max_osd(10); osdmap->set_state(osd_id, CEPH_OSD_EXISTS); osdmap->set_epoch(epoch); - ceph::shared_ptr lastmap(new OSDMap()); + std::shared_ptr lastmap(new OSDMap()); lastmap->set_max_osd(10); lastmap->set_state(osd_id, CEPH_OSD_EXISTS); lastmap->set_epoch(epoch); @@ -282,7 +282,7 @@ for (unsigned i = 0; i < 4; ++i) { // PG is splitting // { - ceph::shared_ptr osdmap(new OSDMap()); + std::shared_ptr osdmap(new OSDMap()); osdmap->set_max_osd(10); osdmap->set_state(osd_id, CEPH_OSD_EXISTS); osdmap->set_epoch(epoch); @@ -316,7 +316,7 @@ for (unsigned i = 0; i < 4; ++i) { // PG size has changed // { - ceph::shared_ptr osdmap(new OSDMap()); + std::shared_ptr osdmap(new OSDMap()); osdmap->set_max_osd(10); osdmap->set_state(osd_id, CEPH_OSD_EXISTS); osdmap->set_epoch(epoch); @@ -393,7 +393,7 @@ for (unsigned i = 0; i < 4; ++i) { // The new osdmap is created so that it triggers the // bug. // - ceph::shared_ptr osdmap(new OSDMap()); + std::shared_ptr osdmap(new OSDMap()); osdmap->set_max_osd(10); osdmap->set_state(osd_id, CEPH_OSD_EXISTS); osdmap->set_epoch(epoch); @@ -469,7 +469,7 @@ for (unsigned i = 0; i < 4; ++i) { new_acting.push_back(osd_id + 4); new_acting.push_back(osd_id + 5); - ceph::shared_ptr lastmap(new OSDMap()); + std::shared_ptr lastmap(new OSDMap()); lastmap->set_max_osd(10); lastmap->set_state(osd_id, CEPH_OSD_EXISTS); lastmap->set_epoch(epoch); @@ -516,7 +516,7 @@ for (unsigned i = 0; i < 4; ++i) { epoch_t last_epoch_clean = epoch - 10; - ceph::shared_ptr lastmap(new OSDMap()); + std::shared_ptr lastmap(new OSDMap()); lastmap->set_max_osd(10); lastmap->set_state(osd_id, CEPH_OSD_EXISTS); lastmap->set_epoch(epoch); diff --git a/src/test/osdc/object_cacher_stress.cc b/src/test/osdc/object_cacher_stress.cc index 7c1d19d46df9a..4e7971153f245 100644 --- a/src/test/osdc/object_cacher_stress.cc +++ b/src/test/osdc/object_cacher_stress.cc @@ -69,7 +69,7 @@ int stress_test(uint64_t num_ops, uint64_t num_objs, obc.start(); std::atomic outstanding_reads = { 0 }; - vector > ops; + vector > ops; ObjectCacher::ObjectSet object_set(NULL, 0, 0); SnapContext snapc; ceph::buffer::ptr bp(max_op_len); @@ -94,7 +94,7 @@ int stress_test(uint64_t num_ops, uint64_t num_objs, uint64_t length = random() % (std::max(max_len - 1, 1)) + 1; std::string oid = "test" + stringify(random() % num_objs); bool is_read = random() < percent_reads * RAND_MAX; - ceph::shared_ptr op(new op_data(oid, offset, length, is_read)); + std::shared_ptr op(new op_data(oid, offset, length, is_read)); ops.push_back(op); std::cout << "op " << i << " " << (is_read ? "read" : "write") << " " << op->extent << "\n"; diff --git a/src/test/rbd_mirror/test_fixture.h b/src/test/rbd_mirror/test_fixture.h index 5cc99e454cbfe..217ae8102b2d7 100644 --- a/src/test/rbd_mirror/test_fixture.h +++ b/src/test/rbd_mirror/test_fixture.h @@ -7,6 +7,7 @@ #include "include/int_types.h" #include "include/rados/librados.hpp" #include +#include #include namespace librbd { diff --git a/src/test/test_snap_mapper.cc b/src/test/test_snap_mapper.cc index 9e22b5a16f889..a73942d993050 100644 --- a/src/test/test_snap_mapper.cc +++ b/src/test/test_snap_mapper.cc @@ -1,5 +1,4 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- -#include "include/memory.h" #include #include #include @@ -40,7 +39,7 @@ class PausyAsyncMap : public MapCacher::StoreDriver { virtual void operate(map *store) = 0; virtual ~_Op() {} }; - typedef ceph::shared_ptr<_Op> Op; + typedef std::shared_ptr<_Op> Op; struct Remove : public _Op { set to_remove; explicit Remove(const set &to_remove) : to_remove(to_remove) {} @@ -584,7 +583,7 @@ public: class SnapMapperTest : public ::testing::Test { protected: boost::scoped_ptr< PausyAsyncMap > driver; - map > mappers; + map > mappers; uint32_t pgnum; void SetUp() override { diff --git a/src/tools/ceph_monstore_tool.cc b/src/tools/ceph_monstore_tool.cc index 25d987ec2b2a7..3b5edc253d167 100644 --- a/src/tools/ceph_monstore_tool.cc +++ b/src/tools/ceph_monstore_tool.cc @@ -237,7 +237,7 @@ void usage(const char *n, po::options_description &d) } int update_osdmap(MonitorDBStore& store, version_t ver, bool copy, - ceph::shared_ptr crush, + std::shared_ptr crush, MonitorDBStore::Transaction* t) { const string prefix("osdmap"); @@ -320,7 +320,7 @@ int rewrite_transaction(MonitorDBStore& store, int version, // load/extract the crush map int r = 0; - ceph::shared_ptr crush(new CrushWrapper); + std::shared_ptr crush(new CrushWrapper); if (crush_file.empty()) { bufferlist bl; r = store.get(prefix, store.combine_strings("full", good_version), bl); diff --git a/src/tools/cephfs/JournalTool.cc b/src/tools/cephfs/JournalTool.cc index 3e746de958590..b6d4bcaa64ad7 100644 --- a/src/tools/cephfs/JournalTool.cc +++ b/src/tools/cephfs/JournalTool.cc @@ -710,9 +710,9 @@ int JournalTool::recover_dentries( std::set read_keys; // Compose list of potentially-existing dentries we would like to fetch - list > const &fb_list = + list > const &fb_list = lump.get_dfull(); - for (list >::const_iterator fbi = + for (list >::const_iterator fbi = fb_list.begin(); fbi != fb_list.end(); ++fbi) { EMetaBlob::fullbit const &fb = *(*fbi); @@ -759,7 +759,7 @@ int JournalTool::recover_dentries( // Compose list of dentries we will write back std::map write_vals; - for (list >::const_iterator fbi = + for (list >::const_iterator fbi = fb_list.begin(); fbi != fb_list.end(); ++fbi) { EMetaBlob::fullbit const &fb = *(*fbi); @@ -960,7 +960,7 @@ int JournalTool::recover_dentries( * important because clients use them to infer completeness * of directories */ - for (list >::const_iterator p = + for (list >::const_iterator p = metablob.roots.begin(); p != metablob.roots.end(); ++p) { EMetaBlob::fullbit const &fb = *(*p); inodeno_t ino = fb.inode.ino; diff --git a/src/tools/rbd_ggate/Server.cc b/src/tools/rbd_ggate/Server.cc index 6fde848dbc2bb..ca4863fd85146 100644 --- a/src/tools/rbd_ggate/Server.cc +++ b/src/tools/rbd_ggate/Server.cc @@ -113,7 +113,7 @@ void Server::wait_clean() { } while (!m_io_finished.empty()) { - ceph::unique_ptr free_ctx(m_io_finished.front()); + std::unique_ptr free_ctx(m_io_finished.front()); m_io_finished.pop_front(); } } @@ -158,7 +158,7 @@ void Server::reader_entry() { dout(20) << dendl; while (!m_stopping) { - ceph::unique_ptr ctx(new IOContext(this)); + std::unique_ptr ctx(new IOContext(this)); dout(20) << "waiting for ggate request" << dendl; @@ -215,7 +215,7 @@ void Server::writer_entry() { while (!m_stopping) { dout(20) << "waiting for io request" << dendl; - ceph::unique_ptr ctx(wait_io_finish()); + std::unique_ptr ctx(wait_io_finish()); if (!ctx) { dout(20) << "no io requests, terminating" << dendl; return; diff --git a/src/tools/rbd_mirror/types.h b/src/tools/rbd_mirror/types.h index ba8aa7df1fa61..41920b7bb4ff8 100644 --- a/src/tools/rbd_mirror/types.h +++ b/src/tools/rbd_mirror/types.h @@ -16,9 +16,9 @@ namespace rbd { namespace mirror { -typedef shared_ptr RadosRef; -typedef shared_ptr IoCtxRef; -typedef shared_ptr ImageRef; +typedef std::shared_ptr RadosRef; +typedef std::shared_ptr IoCtxRef; +typedef std::shared_ptr ImageRef; struct ImageId { std::string global_id; diff --git a/src/tools/rbd_nbd/rbd-nbd.cc b/src/tools/rbd_nbd/rbd-nbd.cc index 403136b4a971d..d5458404ed412 100644 --- a/src/tools/rbd_nbd/rbd-nbd.cc +++ b/src/tools/rbd_nbd/rbd-nbd.cc @@ -231,7 +231,7 @@ private: cond.Wait(lock); while(!io_finished.empty()) { - ceph::unique_ptr free_ctx(io_finished.front()); + std::unique_ptr free_ctx(io_finished.front()); io_finished.pop_front(); } } @@ -274,7 +274,7 @@ private: void reader_entry() { while (!terminated) { - ceph::unique_ptr ctx(new IOContext()); + std::unique_ptr ctx(new IOContext()); ctx->server = this; dout(20) << __func__ << ": waiting for nbd request" << dendl; @@ -350,7 +350,7 @@ private: { while (!terminated) { dout(20) << __func__ << ": waiting for io request" << dendl; - ceph::unique_ptr ctx(wait_io_finish()); + std::unique_ptr ctx(wait_io_finish()); if (!ctx) { dout(20) << __func__ << ": no io requests, terminating" << dendl; return; -- 2.39.5