page.h \
crc32c.h \
rados_types.h \
- rados_types.hpp \
- memory.h
+ rados_types.hpp
_pkg $_libdir librados.so
_pkg $_bindir librados-config
}
%{_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
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
#include "include/types.h"
#include "include/utime.h"
-#include "include/memory.h"
#include "include/buffer.h"
#include <string>
// 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<CryptoKeyHandler> ckh;
+ mutable std::shared_ptr<CryptoKeyHandler> ckh;
int _set_secret(int type, const bufferptr& s);
#include <boost/iostreams/filtering_stream.hpp>
#include <boost/iostreams/filter/zlib.hpp>
-#include "include/memory.h"
#include "include/assert.h" // boost clobbers this
struct uuid_d;
void log_entry(Entry const * const e);
void log_log_entry(LogEntry const * const e);
- typedef ceph::shared_ptr<Graylog> Ref;
+ typedef std::shared_ptr<Graylog> Ref;
private:
SubsystemMap const * const m_subs;
template <class K, class V, class C = std::less<K>, class H = std::hash<K> >
class SharedLRU {
CephContext *cct;
- typedef ceph::shared_ptr<V> VPtr;
- typedef ceph::weak_ptr<V> WeakVPtr;
+ typedef std::shared_ptr<V> VPtr;
+ typedef std::weak_ptr<V> WeakVPtr;
Mutex lock;
size_t max_size;
Cond cond;
template <class K, class V, class C = std::less<K> >
class SharedPtrRegistry {
public:
- typedef ceph::shared_ptr<V> VPtr;
- typedef ceph::weak_ptr<V> WeakVPtr;
+ typedef std::shared_ptr<V> VPtr;
+ typedef std::weak_ptr<V> WeakVPtr;
int waiting;
private:
Mutex lock;
#include "include/Context.h"
class CryptoAccel;
-typedef ceph::shared_ptr<CryptoAccel> CryptoAccelRef;
+typedef std::shared_ptr<CryptoAccel> CryptoAccelRef;
class CryptoAccel {
public:
#define CRYPTO_PLUGIN_H
// -----------------------------------------------------------------------------
-#include "include/memory.h"
#include "common/PluginRegistry.h"
#include "ostream"
buffer.h
buffer_fwd.h
inline_memory.h
- memory.h
page.h
crc32c.h
rados/objclass.h
#include <memory>
#include "include/assert.h"
-#include "include/memory.h"
#define mydout(cct, v) lgeneric_subdout(cct, context, v)
to_run->complete(0);
}
};
-typedef ceph::shared_ptr<RunOnDelete> RunOnDeleteRef;
+typedef std::shared_ptr<RunOnDelete> RunOnDeleteRef;
template <typename T>
struct LambdaContext : public Context {
#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"
#include "include/int_types.h"
-#include "include/memory.h"
-
#include "common/convenience.h"
#include "byteorder.h"
inline std::enable_if_t<!traits::supported>
decode(std::list<T,Alloc>& ls, bufferlist::const_iterator& p);
template<class T, class Alloc>
-inline void encode(const std::list<ceph::shared_ptr<T>, Alloc>& ls,
+inline void encode(const std::list<std::shared_ptr<T>, Alloc>& ls,
bufferlist& bl);
template<class T, class Alloc>
-inline void encode(const std::list<ceph::shared_ptr<T>, Alloc>& ls,
+inline void encode(const std::list<std::shared_ptr<T>, Alloc>& ls,
bufferlist& bl, uint64_t features);
template<class T, class Alloc>
-inline void decode(std::list<ceph::shared_ptr<T>, Alloc>& ls,
+inline void decode(std::list<std::shared_ptr<T>, Alloc>& ls,
bufferlist::const_iterator& p);
template<class T, class Comp, class Alloc, typename traits=denc_traits<T>>
inline std::enable_if_t<!traits::supported>
inline std::enable_if_t<!traits::supported>
decode_nohead(int len, std::vector<T,Alloc>& v, bufferlist::const_iterator& p);
template<class T,class Alloc>
-inline void encode(const std::vector<ceph::shared_ptr<T>,Alloc>& v,
+inline void encode(const std::vector<std::shared_ptr<T>,Alloc>& v,
bufferlist& bl,
uint64_t features);
template<class T, class Alloc>
-inline void encode(const std::vector<ceph::shared_ptr<T>,Alloc>& v,
+inline void encode(const std::vector<std::shared_ptr<T>,Alloc>& v,
bufferlist& bl);
template<class T, class Alloc>
-inline void decode(std::vector<ceph::shared_ptr<T>,Alloc>& v,
+inline void decode(std::vector<std::shared_ptr<T>,Alloc>& v,
bufferlist::const_iterator& p);
template<class T, class U, class Comp, class Alloc,
typename t_traits=denc_traits<T>, typename u_traits=denc_traits<U>>
}
}
-// std::list<ceph::shared_ptr<T>>
+// std::list<std::shared_ptr<T>>
template<class T, class Alloc>
-inline void encode(const std::list<ceph::shared_ptr<T>, Alloc>& ls,
+inline void encode(const std::list<std::shared_ptr<T>, Alloc>& ls,
bufferlist& bl)
{
__u32 n = (__u32)(ls.size()); // c++11 std::list::size() is O(1)
encode(**p, bl);
}
template<class T, class Alloc>
-inline void encode(const std::list<ceph::shared_ptr<T>, Alloc>& ls,
+inline void encode(const std::list<std::shared_ptr<T>, Alloc>& ls,
bufferlist& bl, uint64_t features)
{
__u32 n = (__u32)(ls.size()); // c++11 std::list::size() is O(1)
encode(**p, bl, features);
}
template<class T, class Alloc>
-inline void decode(std::list<ceph::shared_ptr<T>, Alloc>& ls,
+inline void decode(std::list<std::shared_ptr<T>, Alloc>& ls,
bufferlist::const_iterator& p)
{
__u32 n;
decode(n, p);
ls.clear();
while (n--) {
- ceph::shared_ptr<T> v(std::make_shared<T>());
+ std::shared_ptr<T> v(std::make_shared<T>());
decode(*v, p);
ls.push_back(v);
}
// vector (shared_ptr)
template<class T,class Alloc>
-inline void encode(const std::vector<ceph::shared_ptr<T>,Alloc>& v,
+inline void encode(const std::vector<std::shared_ptr<T>,Alloc>& v,
bufferlist& bl,
uint64_t features)
{
encode(T(), bl, features);
}
template<class T, class Alloc>
-inline void encode(const std::vector<ceph::shared_ptr<T>,Alloc>& v,
+inline void encode(const std::vector<std::shared_ptr<T>,Alloc>& v,
bufferlist& bl)
{
__u32 n = (__u32)(v.size());
encode(T(), bl);
}
template<class T, class Alloc>
-inline void decode(std::vector<ceph::shared_ptr<T>,Alloc>& v,
+inline void decode(std::vector<std::shared_ptr<T>,Alloc>& v,
bufferlist::const_iterator& p)
{
__u32 n;
+++ /dev/null
-#ifndef CEPH_MEMORY_H
-#define CEPH_MEMORY_H
-
-#include <memory>
-
-namespace ceph {
- using std::shared_ptr;
- using std::weak_ptr;
- using std::unique_ptr;
- using std::static_pointer_cast;
-}
-
-#endif
#include <set>
#include <vector>
#include <utility>
-#include "memory.h"
#include "buffer.h"
#include "librados.h"
#include <set>
#include <map>
#include <string>
-#include "include/memory.h"
#include <boost/scoped_ptr.hpp>
#include "include/encoding.h"
#include "common/Formatter.h"
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,
}
}
};
- 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 {
}
virtual ~WholeSpaceIteratorImpl() { }
};
- typedef ceph::shared_ptr< WholeSpaceIteratorImpl > WholeSpaceIterator;
+ typedef std::shared_ptr< WholeSpaceIteratorImpl > WholeSpaceIterator;
private:
int64_t cache_bytes[PriorityCache::Priority::LAST+1] = { 0 };
#include <set>
#include <map>
#include <string>
-#include "include/memory.h"
#include <errno.h>
using std::string;
#include "common/perf_counters.h"
#include <set>
#include <map>
#include <string>
-#include "include/memory.h"
#include <kinetic/kinetic.h>
#include <errno.h>
using std::string;
-#include "include/memory.h"
-
#include "common/debug.h"
#include "common/perf_counters.h"
#include <set>
#include <map>
#include <string>
-#include "include/memory.h"
#include <boost/scoped_ptr.hpp>
#include "leveldb/db.h"
#include "leveldb/env.h"
#include <map>
#include <string>
#include <memory>
-#include "include/memory.h"
#include <boost/scoped_ptr.hpp>
#include "include/encoding.h"
#include "include/btree_map.h"
private:
NObjectIteratorImpl(ObjListCtx *ctx_);
void get_next();
- ceph::shared_ptr < ObjListCtx > ctx;
+ std::shared_ptr < ObjListCtx > ctx;
ListObject cur_obj;
};
};
-typedef ceph::shared_ptr<DamageEntry> DamageEntryRef;
+typedef std::shared_ptr<DamageEntry> DamageEntryRef;
class DirFragIdent
bool repaired = false; // May be set during scrub if repairs happened
};
-typedef ceph::shared_ptr<ScrubHeader> ScrubHeaderRef;
-typedef ceph::shared_ptr<const ScrubHeader> ScrubHeaderRefConst;
+typedef std::shared_ptr<ScrubHeader> ScrubHeaderRef;
+typedef std::shared_ptr<const ScrubHeader> ScrubHeaderRefConst;
#endif // SCRUB_HEADER_H_
}
}
-#include "include/memory.h"
struct MutationImpl;
typedef boost::intrusive_ptr<MutationImpl> MutationRef;
private:
mutable bufferlist dnbl;
mutable bool dn_decoded;
- mutable list<ceph::shared_ptr<fullbit> > dfull;
+ mutable list<std::shared_ptr<fullbit> > dfull;
mutable list<remotebit> dremote;
mutable list<nullbit> dnull;
bool is_dirty_dft() { return state & STATE_DIRTYDFT; }
void mark_dirty_dft() { state |= STATE_DIRTYDFT; }
- const list<ceph::shared_ptr<fullbit> > &get_dfull() const { return dfull; }
+ const list<std::shared_ptr<fullbit> > &get_dfull() const { return dfull; }
const list<remotebit> &get_dremote() const { return dremote; }
const list<nullbit> &get_dnull() const { return dnull; }
void add_dnull(nullbit const &n) { dnull.push_back(n); };
- void add_dfull(ceph::shared_ptr<fullbit> const &p) { dfull.push_back(p); };
+ void add_dfull(std::shared_ptr<fullbit> const &p) { dfull.push_back(p); };
void add_dremote(remotebit const &r) { dremote.push_back(r); };
void print(dirfrag_t dirfrag, ostream& out) {
<< " num " << nfull << "/" << nremote << "/" << nnull
<< std::endl;
_decode_bits();
- for (list<ceph::shared_ptr<fullbit> >::iterator p = dfull.begin(); p != dfull.end(); ++p)
+ for (list<std::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);
// my lumps. preserve the order we added them in a list.
list<dirfrag_t> lump_order;
map<dirfrag_t, dirlump> lump_map;
- list<ceph::shared_ptr<fullbit> > roots;
+ list<std::shared_ptr<fullbit> > roots;
public:
list<pair<__u8,version_t> > table_tids; // tableclient transactions
sr->encode(snapbl);
lump.nfull++;
- lump.add_dfull(ceph::shared_ptr<fullbit>(new fullbit(dn->get_name(),
+ lump.add_dfull(std::shared_ptr<fullbit>(new fullbit(dn->get_name(),
dn->first, dn->last,
dn->get_projected_version(),
*pi, in->dirfragtree,
if (sr)
sr->encode(snapbl);
- for (list<ceph::shared_ptr<fullbit> >::iterator p = roots.begin(); p != roots.end(); ++p) {
+ for (list<std::shared_ptr<fullbit> >::iterator p = roots.begin(); p != roots.end(); ++p) {
if ((*p)->inode.ino == in->ino()) {
roots.erase(p);
break;
}
string empty;
- roots.push_back(ceph::shared_ptr<fullbit>(new fullbit(empty, in->first, in->last, 0, pi,
+ roots.push_back(std::shared_ptr<fullbit>(new fullbit(empty, in->first, in->last, 0, pi,
pdft, px, in->symlink,
in->oldest_snap, snapbl,
dirty ? fullbit::STATE_DIRTY : 0,
f->dump_int("nnull", nnull);
f->open_array_section("full bits");
- for (list<ceph::shared_ptr<fullbit> >::const_iterator
+ for (list<std::shared_ptr<fullbit> >::const_iterator
iter = dfull.begin(); iter != dfull.end(); ++iter) {
f->open_object_section("fullbit");
(*iter)->dump(f);
decode(rootbl, bl);
if (rootbl.length()) {
auto p = rootbl.cbegin();
- roots.push_back(ceph::shared_ptr<fullbit>(new fullbit(p)));
+ roots.push_back(std::shared_ptr<fullbit>(new fullbit(p)));
}
}
decode(table_tids, bl);
dl._decode_bits();
// Record inodes of fullbits
- list<ceph::shared_ptr<fullbit> > const &fb_list = dl.get_dfull();
- for (list<ceph::shared_ptr<fullbit> >::const_iterator
+ list<std::shared_ptr<fullbit> > const &fb_list = dl.get_dfull();
+ for (list<std::shared_ptr<fullbit> >::const_iterator
iter = fb_list.begin(); iter != fb_list.end(); ++iter) {
inodes.insert((*iter)->inode.ino);
}
// Get all bits
dl._decode_bits();
- list<ceph::shared_ptr<fullbit> > const &fb_list = dl.get_dfull();
+ list<std::shared_ptr<fullbit> > const &fb_list = dl.get_dfull();
list<nullbit> const &nb_list = dl.get_dnull();
list<remotebit> const &rb_list = dl.get_dremote();
// For all bits, store dentry
- for (list<ceph::shared_ptr<fullbit> >::const_iterator
+ for (list<std::shared_ptr<fullbit> >::const_iterator
iter = fb_list.begin(); iter != fb_list.end(); ++iter) {
dentries[df].insert((*iter)->dn);
dirlump const &dl = i->second;
dl._decode_bits();
- list<ceph::shared_ptr<fullbit> > const &fb_list = dl.get_dfull();
+ list<std::shared_ptr<fullbit> > const &fb_list = dl.get_dfull();
list<nullbit> const &nb_list = dl.get_dnull();
list<remotebit> const &rb_list = dl.get_dremote();
- for (list<ceph::shared_ptr<fullbit> >::const_iterator
+ for (list<std::shared_ptr<fullbit> >::const_iterator
iter = fb_list.begin(); iter != fb_list.end(); ++iter) {
std::string_view dentry = (*iter)->dn;
children[dir_ino].emplace_back(dentry);
dirlump const &dl = i->second;
dl._decode_bits();
- list<ceph::shared_ptr<fullbit> > const &fb_list = dl.get_dfull();
- for (list<ceph::shared_ptr<fullbit> >::const_iterator
+ list<std::shared_ptr<fullbit> > const &fb_list = dl.get_dfull();
+ for (list<std::shared_ptr<fullbit> >::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()) {
f->close_section(); // lumps
f->open_array_section("roots");
- for (list<ceph::shared_ptr<fullbit> >::const_iterator i = roots.begin();
+ for (list<std::shared_ptr<fullbit> >::const_iterator i = roots.begin();
i != roots.end(); ++i) {
f->open_object_section("root");
(*i)->dump(f);
assert(g_conf->mds_kill_journal_replay_at != 1);
- for (list<ceph::shared_ptr<fullbit> >::iterator p = roots.begin(); p != roots.end(); ++p) {
+ for (list<std::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)
lump._decode_bits();
// full dentry+inode pairs
- for (list<ceph::shared_ptr<fullbit> >::const_iterator pp = lump.get_dfull().begin();
+ for (list<std::shared_ptr<fullbit> >::const_iterator pp = lump.get_dfull().begin();
pp != lump.get_dfull().end();
++pp) {
- ceph::shared_ptr<fullbit> p = *pp;
+ std::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);
typedef struct {
PyObject_HEAD
- ceph::shared_ptr<CrushWrapper> crush;
+ std::shared_ptr<CrushWrapper> crush;
} BasePyCRUSH;
// ----------
}
assert(PyObject_TypeCheck(crush_capsule, &PyCapsule_Type));
- auto ptr_ref = (ceph::shared_ptr<CrushWrapper>*)(
+ auto ptr_ref = (std::shared_ptr<CrushWrapper>*)(
PyCapsule_GetPointer(crush_capsule, nullptr));
// We passed a pointer to a shared pointer, which is weird, but
#include <stdint.h>
#include "common/TrackedOp.h"
-#include "include/memory.h"
#include "mon/Session.h"
#include "msg/Message.h"
#include "auth/KeyRing.h"
#include "messages/MMonCommand.h"
#include "mon/MonitorDBStore.h"
-#include "include/memory.h"
#include "mgr/MgrClient.h"
#include "mon/MonOpRequest.h"
ScrubState() : finished(false) { }
virtual ~ScrubState() { }
};
- ceph::shared_ptr<ScrubState> scrub_state; ///< keeps track of current scrub
+ std::shared_ptr<ScrubState> scrub_state; ///< keeps track of current scrub
/**
* @defgroup Monitor_h_sync Synchronization
};
struct Transaction;
- typedef ceph::shared_ptr<Transaction> TransactionRef;
+ typedef std::shared_ptr<Transaction> TransactionRef;
struct Transaction {
list<Op> ops;
uint64_t bytes, keys;
virtual void get_chunk_tx(TransactionRef tx, uint64_t max) = 0;
virtual pair<string,string> get_next_key() = 0;
};
- typedef ceph::shared_ptr<StoreIteratorImpl> Synchronizer;
+ typedef std::shared_ptr<StoreIteratorImpl> Synchronizer;
class WholeStoreIteratorImpl : public StoreIteratorImpl {
KeyValueDB::WholeSpaceIterator iter;
else
iter->seek_to_first();
- return ceph::shared_ptr<StoreIteratorImpl>(
+ return std::shared_ptr<StoreIteratorImpl>(
new WholeStoreIteratorImpl(iter, prefixes)
);
}
uint64_t state_offset;
Worker *worker;
EventCenter *center;
- ceph::shared_ptr<AuthSessionHandler> session_security;
+ std::shared_ptr<AuthSessionHandler> session_security;
public:
// used by eventcallback
#include "const.h"
#include "circular_buffer.h"
#include "ethernet.h"
-#include "memory.h"
#include "Packet.h"
#include "stream.h"
#include "net.h"
}
// get a reference to the AuthSessionHandler while we have the pipe_lock
- ceph::shared_ptr<AuthSessionHandler> auth_handler = session_security;
+ std::shared_ptr<AuthSessionHandler> auth_handler = session_security;
pipe_lock.Unlock();
#ifndef CEPH_MSGR_PIPE_H
#define CEPH_MSGR_PIPE_H
-#include "include/memory.h"
#include "auth/AuthSessionHandler.h"
#include "msg/msg_types.h"
// session_security handles any signatures or encryptions required for this pipe's msgs. PLR
- ceph::shared_ptr<AuthSessionHandler> session_security;
+ std::shared_ptr<AuthSessionHandler> session_security;
protected:
friend class SimpleMessenger;
Messenger::Policy policy;
CryptoKey session_key;
- ceph::shared_ptr<AuthSessionHandler> session_security;
+ std::shared_ptr<AuthSessionHandler> session_security;
AuthAuthorizer *authorizer;
XioConnection *xcon;
uint32_t protocol_version;
#ifndef OS_KEYVALUESTORE_H
#define OS_KEYVALUESTORE_H
+#include <memory>
#include <string>
#include <vector>
-#include "include/memory.h"
#include "kv/KeyValueDB.h"
#include "common/hobject.h"
virtual void compact() {}
typedef KeyValueDB::SimplestIteratorImpl ObjectMapIteratorImpl;
- typedef ceph::shared_ptr<ObjectMapIteratorImpl> ObjectMapIterator;
+ typedef std::shared_ptr<ObjectMapIteratorImpl> ObjectMapIterator;
virtual ObjectMapIterator get_iterator(const ghobject_t &oid) {
return ObjectMapIterator();
}
*/
#include <ctype.h>
#include <sstream>
-#include "include/memory.h"
#include "ObjectStore.h"
#include "common/Formatter.h"
#include "common/safe_io.h"
void BitmapFreelistManager::setup_merge_operator(KeyValueDB *db, string prefix)
{
- ceph::shared_ptr<XorMergeOperator> merge_op(new XorMergeOperator);
+ std::shared_ptr<XorMergeOperator> merge_op(new XorMergeOperator);
db->set_merge_operator(prefix, merge_op);
}
class BitmapFreelistManager : public FreelistManager {
std::string meta_prefix, bitmap_prefix;
KeyValueDB *kvdb;
- ceph::shared_ptr<KeyValueDB::MergeOperator> merge_op;
+ std::shared_ptr<KeyValueDB::MergeOperator> merge_op;
std::mutex lock;
uint64_t size; ///< size of device (bytes)
string fn = path + "/db";
string options;
stringstream err;
- ceph::shared_ptr<Int64ArrayMergeOperator> merge_op(new Int64ArrayMergeOperator);
+ std::shared_ptr<Int64ArrayMergeOperator> merge_op(new Int64ArrayMergeOperator);
string kv_backend;
std::vector<KeyValueDB::ColumnFamily> cfs;
#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"
#include <string>
#include <vector>
-#include "include/memory.h"
#include "osd/osd_types.h"
#include "include/object.h"
RWLock access_lock;
/// Type of returned paths
- typedef ceph::shared_ptr<Path> IndexedPath;
+ typedef std::shared_ptr<Path> IndexedPath;
static IndexedPath get_testing_path(string path, coll_t collection) {
return std::make_shared<Path>(path, collection);
#include <set>
#include <map>
#include <string>
-#include "include/memory.h"
#include <vector>
#include "os/ObjectMap.h"
#include <string>
#include <vector>
-#include "include/memory.h"
#include <boost/scoped_ptr.hpp>
#include "os/ObjectMap.h"
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<ghobject_t, _Header> caches;
Header header;
/// parent_iter == NULL iff no parent
- ceph::shared_ptr<DBObjectMapIteratorImpl> parent_iter;
+ std::shared_ptr<DBObjectMapIteratorImpl> parent_iter;
KeyValueDB::Iterator key_iter;
KeyValueDB::Iterator complete_iter;
/// cur_iter points to currently valid iterator
- ceph::shared_ptr<ObjectMapIteratorImpl> cur_iter;
+ std::shared_ptr<ObjectMapIteratorImpl> cur_iter;
int r;
/// init() called, key_iter, complete_iter, parent_iter filled in
int adjust();
};
- typedef ceph::shared_ptr<DBObjectMapIteratorImpl> DBObjectMapIterator;
+ typedef std::shared_ptr<DBObjectMapIteratorImpl> DBObjectMapIterator;
DBObjectMapIterator _get_iterator(Header header) {
return std::make_shared<DBObjectMapIteratorImpl>(this, header);
}
cct->_conf->remove_observer(this);
delete[] registry;
}
- typedef ceph::shared_ptr<FD> FDRef;
+ typedef std::shared_ptr<FD> FDRef;
FDRef lookup(const ghobject_t &hoid) {
int registry_id = hoid.hobj.get_hash() % registry_shards;
*
*/
-#include "include/memory.h"
#include "include/unordered_map.h"
#if defined(__FreeBSD__)
#ifndef OS_INDEXMANAGER_H
#define OS_INDEXMANAGER_H
-#include "include/memory.h"
#include "include/unordered_map.h"
#include "common/Mutex.h"
#include <map>
#include <set>
#include <vector>
-#include "include/memory.h"
#include <exception>
#include "osd/osd_types.h"
#include "include/unordered_map.h"
#include <boost/tuple/tuple.hpp>
-#include "include/memory.h"
#include "common/Formatter.h"
#include "common/hobject.h"
#include "include/interval_set.h"
#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"
#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"
#include <boost/intrusive_ptr.hpp>
#include "include/unordered_map.h"
-#include "include/memory.h"
#include "common/Finisher.h"
#include "common/RefCountedObj.h"
#include "common/RWLock.h"
friend std::ostream& operator<<(std::ostream& out, const HashInfo& hi);
};
-typedef ceph::shared_ptr<HashInfo> HashInfoRef;
+typedef std::shared_ptr<HashInfo> HashInfoRef;
bool is_hinfo_key_string(const std::string &key);
const std::string &get_hinfo_key();
#include <atomic>
#include <map>
#include <memory>
-#include "include/memory.h"
#include "include/unordered_map.h"
#include <list>
#include <set>
#include <map>
-#include "include/memory.h"
+#include <memory>
#include "include/btree_map.h"
// forward declaration
CEPH_FEATUREMASK_SERVER_NAUTILUS;
struct addrs_s {
- mempool::osdmap::vector<ceph::shared_ptr<entity_addrvec_t> > client_addrs;
- mempool::osdmap::vector<ceph::shared_ptr<entity_addr_t> > cluster_addr;
- mempool::osdmap::vector<ceph::shared_ptr<entity_addr_t> > hb_back_addr;
- mempool::osdmap::vector<ceph::shared_ptr<entity_addr_t> > hb_front_addr;
+ mempool::osdmap::vector<std::shared_ptr<entity_addrvec_t> > client_addrs;
+ mempool::osdmap::vector<std::shared_ptr<entity_addr_t> > cluster_addr;
+ mempool::osdmap::vector<std::shared_ptr<entity_addr_t> > hb_back_addr;
+ mempool::osdmap::vector<std::shared_ptr<entity_addr_t> > hb_front_addr;
};
- ceph::shared_ptr<addrs_s> osd_addrs;
+ std::shared_ptr<addrs_s> 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_t> osd_info;
- ceph::shared_ptr<PGTempMap> pg_temp; // temp pg mapping (e.g. while we rebuild)
- ceph::shared_ptr< mempool::osdmap::map<pg_t,int32_t > > 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<PGTempMap> pg_temp; // temp pg mapping (e.g. while we rebuild)
+ std::shared_ptr< mempool::osdmap::map<pg_t,int32_t > > 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_t,mempool::osdmap::vector<int32_t>> pg_upmap; ///< remap pg
mempool::osdmap::map<string,map<string,string> > erasure_code_profiles;
mempool::osdmap::map<string,int64_t> name_pool;
- ceph::shared_ptr< mempool::osdmap::vector<uuid_d> > osd_uuid;
+ std::shared_ptr< mempool::osdmap::vector<uuid_d> > osd_uuid;
mempool::osdmap::vector<osd_xinfo_t> osd_xinfo;
mempool::osdmap::unordered_map<entity_addr_t,utime_t> blacklist;
bool have_crc() const { return crc_defined; }
uint32_t get_crc() const { return crc; }
- ceph::shared_ptr<CrushWrapper> crush; // hierarchical map
+ std::shared_ptr<CrushWrapper> crush; // hierarchical map
private:
uint32_t crush_version = 1;
WRITE_CLASS_ENCODER_FEATURES(OSDMap)
WRITE_CLASS_ENCODER_FEATURES(OSDMap::Incremental)
-typedef ceph::shared_ptr<const OSDMap> OSDMapRef;
+typedef std::shared_ptr<const OSDMap> OSDMapRef;
inline ostream& operator<<(ostream& out, const OSDMap& m) {
m.print_oneline_summary(out);
pg->unlock();
}
};
-typedef ceph::shared_ptr<FlushState> FlushStateRef;
+typedef std::shared_ptr<FlushState> FlushStateRef;
void PG::start_flush(ObjectStore::Transaction *t)
{
#include <boost/scoped_ptr.hpp>
#include <boost/circular_buffer.hpp>
#include <boost/container/flat_set.hpp>
-#include "include/memory.h"
#include "include/mempool.h"
// re-include our assert to clobber boost's
//forward declaration
class OSDMap;
class PGLog;
-typedef ceph::shared_ptr<const OSDMap> OSDMapRef;
+typedef std::shared_ptr<const OSDMap> OSDMapRef;
/**
* PGBackend
return desc;
}
};
-typedef ceph::shared_ptr<PGPeeringEvent> PGPeeringEventRef;
+typedef std::shared_ptr<PGPeeringEvent> PGPeeringEventRef;
struct MInfoRec : boost::statechart::event< MInfoRec > {
pg_shard_t from;
};
struct CopyOp;
- typedef ceph::shared_ptr<CopyOp> CopyOpRef;
+ typedef std::shared_ptr<CopyOp> CopyOpRef;
struct CopyOp {
CopyCallback *cb;
user_version(0), data_offset(0),
canceled(false) { }
};
- typedef ceph::shared_ptr<ProxyReadOp> ProxyReadOpRef;
+ typedef std::shared_ptr<ProxyReadOp> ProxyReadOpRef;
struct ProxyWriteOp {
OpContext *ctx;
canceled(false),
reqid(_reqid) { }
};
- typedef ceph::shared_ptr<ProxyWriteOp> ProxyWriteOpRef;
+ typedef std::shared_ptr<ProxyWriteOp> ProxyWriteOpRef;
struct FlushOp {
ObjectContextRef obc; ///< obc we are flushing
blocking(false), removal(false), chunks(0) {}
~FlushOp() { assert(!on_flush); }
};
- typedef ceph::shared_ptr<FlushOp> FlushOpRef;
+ typedef std::shared_ptr<FlushOp> FlushOpRef;
boost::scoped_ptr<PGBackend> pgbackend;
PGBackend *get_pgbackend() override {
#define REPBACKEND_H
#include "PGBackend.h"
-#include "include/memory.h"
struct C_ReplicatedBackend_OnPullComplete;
class ReplicatedBackend : public PGBackend {
RepModify() : committed(false), ackerosd(-1),
epoch_started(0) {}
};
- typedef ceph::shared_ptr<RepModify> RepModifyRef;
+ typedef std::shared_ptr<RepModify> RepModifyRef;
struct C_OSD_RepModifyCommit;
#ifndef CEPH_WATCH_H
#define CEPH_WATCH_H
-#include "include/memory.h"
#include <set>
#include "msg/Connection.h"
#include "include/Context.h"
class MWatchNotify;
class Watch;
-typedef ceph::shared_ptr<Watch> WatchRef;
-typedef ceph::weak_ptr<Watch> WWatchRef;
+typedef std::shared_ptr<Watch> WatchRef;
+typedef std::weak_ptr<Watch> WWatchRef;
class Notify;
-typedef ceph::shared_ptr<Notify> NotifyRef;
-typedef ceph::weak_ptr<Notify> WNotifyRef;
+typedef std::shared_ptr<Notify> NotifyRef;
+typedef std::weak_ptr<Notify> WNotifyRef;
struct CancelableContext;
OSDService *osd;
boost::intrusive_ptr<PrimaryLogPG> pg;
- ceph::shared_ptr<ObjectContext> obc;
+ std::shared_ptr<ObjectContext> obc;
std::map<uint64_t, NotifyRef> in_progress_notifies;
Watch(
PrimaryLogPG *pg, OSDService *osd,
- ceph::shared_ptr<ObjectContext> obc, uint32_t timeout,
+ std::shared_ptr<ObjectContext> obc, uint32_t timeout,
uint64_t cookie, entity_name_t entity,
const entity_addr_t& addr);
std::ostream& gen_dbg_prefix(std::ostream& out);
static WatchRef makeWatchRef(
PrimaryLogPG *pg, OSDService *osd,
- ceph::shared_ptr<ObjectContext> obc, uint32_t timeout, uint64_t cookie, entity_name_t entity, const entity_addr_t &addr);
+ std::shared_ptr<ObjectContext> obc, uint32_t timeout, uint64_t cookie, entity_name_t entity, const entity_addr_t &addr);
void set_self(WatchRef _self) {
self = _self;
}
/// Does not grant a ref count!
boost::intrusive_ptr<PrimaryLogPG> get_pg() { return pg; }
- ceph::shared_ptr<ObjectContext> get_obc() { return obc; }
+ std::shared_ptr<ObjectContext> get_obc() { return obc; }
uint64_t get_cookie() const { return cookie; }
entity_name_t get_entity() const { return entity; }
: oi(oi_), exists(exists_) {}
};
-typedef ceph::shared_ptr<ObjectContext> ObjectContextRef;
+typedef std::shared_ptr<ObjectContext> ObjectContextRef;
struct ObjectContext {
ObjectState obs;
int new_up_primary, ///< [in] up primary of osdmap
const vector<int> &old_up, ///< [in] up as of lastmap
const vector<int> &new_up, ///< [in] up as of osdmap
- ceph::shared_ptr<const OSDMap> osdmap, ///< [in] current map
- ceph::shared_ptr<const OSDMap> lastmap, ///< [in] last map
+ std::shared_ptr<const OSDMap> osdmap, ///< [in] current map
+ std::shared_ptr<const OSDMap> lastmap, ///< [in] last map
pg_t pgid ///< [in] pgid for pg
);
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
- ceph::shared_ptr<const OSDMap> osdmap, ///< [in] current map
- ceph::shared_ptr<const OSDMap> lastmap, ///< [in] last map
+ std::shared_ptr<const OSDMap> osdmap, ///< [in] current map
+ std::shared_ptr<const OSDMap> 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
}
};
- typedef ceph::shared_ptr<ChangeStatus> ChangeStatusPtr;
+ typedef std::shared_ptr<ChangeStatus> ChangeStatusPtr;
lru_map<rgw_bucket_shard, ChangeStatusPtr> changes;
#include "KeyValueDBMemory.h"
#include <map>
#include <set>
-#include "include/memory.h"
#include <iostream>
using namespace std;
}
KeyValueDB::WholeSpaceIterator KeyValueDBMemory::get_wholespace_iterator() {
- return ceph::shared_ptr<KeyValueDB::WholeSpaceIteratorImpl>(
+ return std::shared_ptr<KeyValueDB::WholeSpaceIteratorImpl>(
new WholeSpaceMemIterator(this)
);
}
#include <map>
#include <set>
#include <string>
-#include "include/memory.h"
#include "kv/KeyValueDB.h"
#include "include/buffer.h"
#include <dirent.h>
#include <string>
#include <vector>
-#include "include/memory.h"
#include <boost/scoped_ptr.hpp>
#include <iostream>
#include <sstream>
* License version 2.1, as published by the Free Software
* Foundation. See file COPYING.
*/
-#include "include/memory.h"
#include <map>
#include <set>
#include <deque>
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-#include "include/memory.h"
#include <map>
#include <set>
#include <boost/scoped_ptr.hpp>
*
*/
-#include "include/memory.h"
#include <limits.h>
#include <errno.h>
#include <sys/uio.h>
TEST(BufferList, TestCopyAll) {
const static size_t BIG_SZ = 10737414;
- ceph::shared_ptr <unsigned char> big(
+ std::shared_ptr <unsigned char> big(
(unsigned char*)malloc(BIG_SZ), free);
unsigned char c = 0;
for (size_t i = 0; i < BIG_SZ; ++i) {
bufferlist bl2;
i.copy_all(bl2);
ASSERT_EQ(bl2.length(), BIG_SZ);
- ceph::shared_ptr <unsigned char> big2(
+ std::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);
TEST(BufferList, InvalidateCrc) {
const static size_t buffer_size = 262144;
- ceph::shared_ptr <unsigned char> big(
+ std::shared_ptr <unsigned char> big(
(unsigned char*)malloc(buffer_size), free);
unsigned char c = 0;
char* ptr = (char*) big.get();
public:
Mutex &get_lock() { return lock; }
Cond &get_cond() { return cond; }
- map<unsigned int, pair< ceph::weak_ptr<int>, int* > > &get_weak_refs() {
+ map<unsigned int, pair< std::weak_ptr<int>, int* > > &get_weak_refs() {
return weak_refs;
}
};
SharedLRUTest &cache;
unsigned int key;
int value;
- ceph::shared_ptr<int> ptr;
+ std::shared_ptr<int> ptr;
enum in_method_t { LOOKUP, LOWER_BOUND } in_method;
Thread_wait(SharedLRUTest& _cache, unsigned int _key,
ptr = cache.lower_bound(key);
break;
case LOOKUP:
- ptr = ceph::shared_ptr<int>(new int);
+ ptr = std::shared_ptr<int>(new int);
*ptr = value;
ptr = cache.lookup(key);
break;
int value1 = 2;
bool existed = false;
{
- ceph::shared_ptr<int> ptr = cache.add(key, new int(value1), &existed);
+ std::shared_ptr<int> ptr = cache.add(key, new int(value1), &existed);
ASSERT_EQ(value1, *ptr);
ASSERT_FALSE(existed);
}
{
int value2 = 3;
- ceph::shared_ptr<int> ptr = cache.add(key, new int(value2), &existed);
+ std::shared_ptr<int> ptr = cache.add(key, new int(value2), &existed);
ASSERT_EQ(value1, *ptr);
ASSERT_TRUE(existed);
}
ASSERT_TRUE(cache.empty());
{
int value1 = 2;
- ceph::shared_ptr<int> ptr = cache.add(key, new int(value1), &existed);
+ std::shared_ptr<int> ptr = cache.add(key, new int(value1), &existed);
ASSERT_EQ(value1, *ptr);
ASSERT_FALSE(existed);
}
int value = 2;
{
- ceph::shared_ptr<int> ptr(new int);
+ std::shared_ptr<int> ptr(new int);
cache.get_weak_refs()[key] = make_pair(ptr, &*ptr);
}
EXPECT_FALSE(cache.get_weak_refs()[key].first.lock());
int value = 2;
{
- ceph::shared_ptr<int> ptr(new int);
+ std::shared_ptr<int> ptr(new int);
cache.get_weak_refs()[key] = make_pair(ptr, &*ptr);
}
EXPECT_FALSE(cache.get_weak_refs()[key].first.lock());
ASSERT_TRUE(cache.add(other_key, new int(other_value)).get());
{
- ceph::shared_ptr<int> ptr(new int);
+ std::shared_ptr<int> ptr(new int);
cache.get_weak_refs()[key] = make_pair(ptr, &*ptr);
}
EXPECT_FALSE(cache.get_weak_refs()[key].first.lock());
SharedLRUTest cache;
const unsigned int key2 = 333;
- ceph::shared_ptr<int> ptr2 = cache.lookup_or_create(key2);
+ std::shared_ptr<int> 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>(), (int*)0);
+ cache.get_weak_refs()[key_gone] = make_pair(std::shared_ptr<int>(), (int*)0);
const unsigned int key1 = 111;
- ceph::shared_ptr<int> ptr1 = cache.lookup_or_create(key1);
+ std::shared_ptr<int> ptr1 = cache.lookup_or_create(key1);
const int value1 = *ptr1 = 800;
pair<unsigned int, int> i;
{
SharedLRUTest cache;
const unsigned int key1 = 111;
- ceph::shared_ptr<int> *ptr1 = new shared_ptr<int>(cache.lookup_or_create(key1));
+ std::shared_ptr<int> *ptr1 = new shared_ptr<int>(cache.lookup_or_create(key1));
const unsigned int key2 = 222;
- ceph::shared_ptr<int> ptr2 = cache.lookup_or_create(key2);
+ std::shared_ptr<int> ptr2 = cache.lookup_or_create(key2);
- pair<unsigned int, ceph::shared_ptr<int> > i;
+ pair<unsigned int, std::shared_ptr<int> > i;
EXPECT_TRUE(cache.get_next(i.first, &i));
EXPECT_EQ(key1, i.first);
delete ptr1;
unsigned int key = 1;
int value = 2;
{
- ceph::shared_ptr<int> ptr = cache.add(key, new int(value));
+ std::shared_ptr<int> ptr = cache.add(key, new int(value));
ASSERT_EQ(value, *cache.lookup(key));
}
ASSERT_TRUE(cache.lookup(key).get());
ASSERT_FALSE(cache.lookup(key));
{
- ceph::shared_ptr<int> ptr = cache.add(key, new int(value));
+ std::shared_ptr<int> ptr = cache.add(key, new int(value));
}
ASSERT_TRUE(cache.lookup(key).get());
cache.clear(key);
unsigned int key = 1;
int value = 2;
{
- ceph::shared_ptr<int> ptr = cache.add(key, new int(value));
+ std::shared_ptr<int> 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<int> ptr2 = cache.add(key, new int(value));
+ std::shared_ptr<int> ptr2 = cache.add(key, new int(value));
ASSERT_TRUE(cache.lookup(key).get());
cache.clear();
ASSERT_TRUE(cache.lookup(key).get());
SharedLRU<int, int> cache;
unsigned int key = 1;
int value = 2;
- ceph::shared_ptr<int> ptr = cache.add(key, new int(value));
+ std::shared_ptr<int> ptr = cache.add(key, new int(value));
ASSERT_EQ(ptr, cache.lookup(key));
ASSERT_EQ(value, *cache.lookup(key));
}
SharedLRU<int, int> cache(NULL, SIZE);
bool existed = false;
- ceph::shared_ptr<int> ptr = cache.add(0, new int(0), &existed);
+ std::shared_ptr<int> ptr = cache.add(0, new int(0), &existed);
ASSERT_FALSE(existed);
{
int *tmpint = new int(0);
- ceph::shared_ptr<int> ptr2 = cache.add(0, tmpint, &existed);
+ std::shared_ptr<int> ptr2 = cache.add(0, tmpint, &existed);
ASSERT_TRUE(existed);
delete tmpint;
}
cache.purge(0);
ASSERT_FALSE(cache.lookup(0));
- ceph::shared_ptr<int> ptr2 = cache.add(0, new int(0), &existed);
+ std::shared_ptr<int> ptr2 = cache.add(0, new int(0), &existed);
ASSERT_FALSE(ptr == ptr2);
- ptr = ceph::shared_ptr<int>();
+ ptr = std::shared_ptr<int>();
ASSERT_TRUE(cache.lookup(0).get());
}
class SharedPtrRegistryTest : public SharedPtrRegistry<unsigned int, int> {
public:
Mutex &get_lock() { return lock; }
- map<unsigned int, pair<ceph::weak_ptr<int>, int*> > &get_contents() {
+ map<unsigned int, pair<std::weak_ptr<int>, int*> > &get_contents() {
return contents;
}
};
SharedPtrRegistryTest ®istry;
unsigned int key;
int value;
- ceph::shared_ptr<int> ptr;
+ std::shared_ptr<int> 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) :
ptr = registry.lookup_or_create(key);
break;
case LOOKUP:
- ptr = ceph::shared_ptr<int>(new int);
+ ptr = std::shared_ptr<int>(new int);
*ptr = value;
ptr = registry.lookup(key);
break;
SharedPtrRegistryTest registry;
unsigned int key = 1;
int value = 2;
- ceph::shared_ptr<int> ptr = registry.lookup_or_create(key);
+ std::shared_ptr<int> ptr = registry.lookup_or_create(key);
*ptr = value;
ASSERT_EQ(value, *registry.lookup_or_create(key));
}
{
unsigned int key = 1;
{
- ceph::shared_ptr<int> ptr(new int);
+ std::shared_ptr<int> ptr(new int);
registry.get_contents()[key] = make_pair(ptr, ptr.get());
}
EXPECT_FALSE(registry.get_contents()[key].first.lock());
unsigned int key = 2;
int value = 3;
{
- ceph::shared_ptr<int> ptr(new int);
+ std::shared_ptr<int> ptr(new int);
registry.get_contents()[key] = make_pair(ptr, ptr.get());
}
EXPECT_FALSE(registry.get_contents()[key].first.lock());
{
int other_value = value + 1;
unsigned int other_key = key + 1;
- ceph::shared_ptr<int> ptr = registry.lookup_or_create<int>(other_key, other_value);
+ std::shared_ptr<int> ptr = registry.lookup_or_create<int>(other_key, other_value);
EXPECT_TRUE(ptr.get());
EXPECT_EQ(other_value, *ptr);
}
SharedPtrRegistryTest registry;
unsigned int key = 1;
{
- ceph::shared_ptr<int> ptr = registry.lookup_or_create(key);
+ std::shared_ptr<int> ptr = registry.lookup_or_create(key);
int value = 2;
*ptr = value;
ASSERT_EQ(value, *registry.lookup(key));
unsigned int key = 1;
int value = 2;
{
- ceph::shared_ptr<int> ptr(new int);
+ std::shared_ptr<int> ptr(new int);
registry.get_contents()[key] = make_pair(ptr, ptr.get());
}
EXPECT_FALSE(registry.get_contents()[key].first.lock());
SharedPtrRegistryTest registry;
const unsigned int key2 = 333;
- ceph::shared_ptr<int> ptr2 = registry.lookup_or_create(key2);
+ std::shared_ptr<int> 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>(), (int*)0);
+ registry.get_contents()[key_gone] = make_pair(std::shared_ptr<int>(), (int*)0);
const unsigned int key1 = 111;
- ceph::shared_ptr<int> ptr1 = registry.lookup_or_create(key1);
+ std::shared_ptr<int> ptr1 = registry.lookup_or_create(key1);
const int value1 = *ptr1 = 800;
pair<unsigned int, int> i;
//
SharedPtrRegistryTest registry;
const unsigned int key1 = 111;
- ceph::shared_ptr<int> *ptr1 = new ceph::shared_ptr<int>(registry.lookup_or_create(key1));
+ std::shared_ptr<int> *ptr1 = new std::shared_ptr<int>(registry.lookup_or_create(key1));
const unsigned int key2 = 222;
- ceph::shared_ptr<int> ptr2 = registry.lookup_or_create(key2);
+ std::shared_ptr<int> ptr2 = registry.lookup_or_create(key2);
- pair<unsigned int, ceph::shared_ptr<int> > i;
+ pair<unsigned int, std::shared_ptr<int> > i;
EXPECT_TRUE(registry.get_next(i.first, &i));
EXPECT_EQ(key1, i.first);
delete ptr1;
{
SharedPtrRegistryTest registry;
const unsigned int key1 = 1;
- ceph::shared_ptr<int> ptr1 = registry.lookup_or_create(key1);
+ std::shared_ptr<int> ptr1 = registry.lookup_or_create(key1);
*ptr1 = 400;
registry.remove(key1);
- ceph::shared_ptr<int> ptr2 = registry.lookup_or_create(key1);
+ std::shared_ptr<int> ptr2 = registry.lookup_or_create(key1);
*ptr2 = 500;
- ptr1 = ceph::shared_ptr<int>();
- ceph::shared_ptr<int> res = registry.lookup(key1);
+ ptr1 = std::shared_ptr<int>();
+ std::shared_ptr<int> res = registry.lookup(key1);
assert(res);
assert(res == ptr2);
assert(*res == 500);
{
SharedPtrRegistryTest registry;
const unsigned int key1 = 1;
- ceph::shared_ptr<int> ptr1 = registry.lookup_or_create(key1, 400);
+ std::shared_ptr<int> ptr1 = registry.lookup_or_create(key1, 400);
registry.remove(key1);
- ceph::shared_ptr<int> ptr2 = registry.lookup_or_create(key1, 500);
+ std::shared_ptr<int> ptr2 = registry.lookup_or_create(key1, 500);
- ptr1 = ceph::shared_ptr<int>();
- ceph::shared_ptr<int> res = registry.lookup(key1);
+ ptr1 = std::shared_ptr<int>();
+ std::shared_ptr<int> res = registry.lookup(key1);
assert(res);
assert(res == ptr2);
assert(*res == 500);
EXPECT_EQ(UNDEFINED, died);
int key = 101;
{
- ceph::shared_ptr<TellDie> a = registry.lookup_or_create(key);
+ std::shared_ptr<TellDie> a = registry.lookup_or_create(key);
EXPECT_EQ(NO, died);
EXPECT_TRUE(a.get());
}
#include <stdint.h>
#include <sys/stat.h>
#include <sys/types.h>
-#include "include/memory.h"
using ceph::bufferlist;
using std::cerr;
<< get_temp_dir() << "'. " << cpp_strerror(err) << std::endl;
return err;
}
- ceph::shared_ptr<FILE> fpp(fp, fclose);
+ std::shared_ptr<FILE> fpp(fp, fclose);
if (unlink_idx >= MAX_FILES_TO_DELETE)
return -ENOBUFS;
if (unlink_idx == 0) {
}
void ObjectDesc::update(ContentsGenerator *gen, const ContDesc &next) {
- layers.push_front(std::pair<ceph::shared_ptr<ContentsGenerator>, ContDesc>(ceph::shared_ptr<ContentsGenerator>(gen), next));
+ layers.push_front(std::pair<std::shared_ptr<ContentsGenerator>, ContDesc>(std::shared_ptr<ContentsGenerator>(gen), next));
return;
}
ObjectDesc(const ContDesc &init, ContentsGenerator *cont_gen)
: exists(false), dirty(false),
version(0) {
- layers.push_front(std::pair<ceph::shared_ptr<ContentsGenerator>, ContDesc>(ceph::shared_ptr<ContentsGenerator>(cont_gen), init));
+ layers.push_front(std::pair<std::shared_ptr<ContentsGenerator>, ContDesc>(std::shared_ptr<ContentsGenerator>(cont_gen), init));
}
class iterator {
public:
ContDesc cont;
- ceph::shared_ptr<ContentsGenerator> gen;
+ std::shared_ptr<ContentsGenerator> gen;
ContentsGenerator::iterator iter;
ContState(
const ContDesc &_cont,
- ceph::shared_ptr<ContentsGenerator> _gen,
+ std::shared_ptr<ContentsGenerator> _gen,
ContentsGenerator::iterator _iter)
: size(_gen->get_length(_cont)), cont(_cont), gen(_gen), iter(_iter) {
gen->get_ranges(cont, ranges);
std::string redirect_target;
std::map<uint64_t, ChunkDesc> chunk_info;
private:
- std::list<std::pair<ceph::shared_ptr<ContentsGenerator>, ContDesc> > layers;
+ std::list<std::pair<std::shared_ptr<ContentsGenerator>, ContDesc> > layers;
};
#endif
#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"
int snap;
bool balance_reads;
- ceph::shared_ptr<int> in_use;
+ std::shared_ptr<int> in_use;
vector<bufferlist> results;
vector<int> retvals;
librados::ObjectWriteOperation zero_write_op2;
librados::ObjectWriteOperation op;
vector<librados::AioCompletion *> comps;
- ceph::shared_ptr<int> in_use;
+ std::shared_ptr<int> in_use;
int last_finished;
int outstanding;
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<int>();
+ in_use = std::shared_ptr<int>();
context->kick();
}
}
librados::ObjectReadOperation rd_op;
librados::AioCompletion *comp;
librados::AioCompletion *comp_racing_read = nullptr;
- ceph::shared_ptr<int> in_use;
+ std::shared_ptr<int> in_use;
int snap;
int done;
uint64_t version;
int snap;
bool balance_reads;
- ceph::shared_ptr<int> in_use;
+ std::shared_ptr<int> in_use;
vector<bufferlist> results;
vector<int> retvals;
librados::ObjectWriteOperation op;
librados::ObjectReadOperation rd_op;
librados::AioCompletion *comp;
- ceph::shared_ptr<int> in_use;
+ std::shared_ptr<int> in_use;
int done;
int r;
uint64_t offset;
librados::ObjectWriteOperation op;
librados::ObjectReadOperation rd_op;
librados::AioCompletion *comp;
- ceph::shared_ptr<int> in_use;
+ std::shared_ptr<int> in_use;
int done;
int r;
SetRedirectOp(int n,
librados::AioCompletion *completion;
librados::ObjectWriteOperation op;
string oid;
- ceph::shared_ptr<int> in_use;
+ std::shared_ptr<int> in_use;
TierPromoteOp(int n,
RadosTestContext *context,
bool dirty;
ObjectDesc old_value;
int snap = 0;
- ceph::shared_ptr<int> in_use;
+ std::shared_ptr<int> in_use;
IsDirtyOp(int n,
RadosTestContext *context,
bool blocking;
int snap;
bool can_fail;
- ceph::shared_ptr<int> in_use;
+ std::shared_ptr<int> in_use;
CacheFlushOp(int n,
RadosTestContext *context,
librados::AioCompletion *completion;
librados::ObjectReadOperation op;
string oid;
- ceph::shared_ptr<int> in_use;
+ std::shared_ptr<int> in_use;
CacheEvictOp(int n,
RadosTestContext *context,
//
int osd_id = 1;
epoch_t epoch = 40;
- ceph::shared_ptr<OSDMap> osdmap(new OSDMap());
+ std::shared_ptr<OSDMap> osdmap(new OSDMap());
osdmap->set_max_osd(10);
osdmap->set_state(osd_id, CEPH_OSD_EXISTS);
osdmap->set_epoch(epoch);
- ceph::shared_ptr<OSDMap> lastmap(new OSDMap());
+ std::shared_ptr<OSDMap> lastmap(new OSDMap());
lastmap->set_max_osd(10);
lastmap->set_state(osd_id, CEPH_OSD_EXISTS);
lastmap->set_epoch(epoch);
// PG is splitting
//
{
- ceph::shared_ptr<OSDMap> osdmap(new OSDMap());
+ std::shared_ptr<OSDMap> osdmap(new OSDMap());
osdmap->set_max_osd(10);
osdmap->set_state(osd_id, CEPH_OSD_EXISTS);
osdmap->set_epoch(epoch);
// PG size has changed
//
{
- ceph::shared_ptr<OSDMap> osdmap(new OSDMap());
+ std::shared_ptr<OSDMap> osdmap(new OSDMap());
osdmap->set_max_osd(10);
osdmap->set_state(osd_id, CEPH_OSD_EXISTS);
osdmap->set_epoch(epoch);
// The new osdmap is created so that it triggers the
// bug.
//
- ceph::shared_ptr<OSDMap> osdmap(new OSDMap());
+ std::shared_ptr<OSDMap> osdmap(new OSDMap());
osdmap->set_max_osd(10);
osdmap->set_state(osd_id, CEPH_OSD_EXISTS);
osdmap->set_epoch(epoch);
new_acting.push_back(osd_id + 4);
new_acting.push_back(osd_id + 5);
- ceph::shared_ptr<OSDMap> lastmap(new OSDMap());
+ std::shared_ptr<OSDMap> lastmap(new OSDMap());
lastmap->set_max_osd(10);
lastmap->set_state(osd_id, CEPH_OSD_EXISTS);
lastmap->set_epoch(epoch);
epoch_t last_epoch_clean = epoch - 10;
- ceph::shared_ptr<OSDMap> lastmap(new OSDMap());
+ std::shared_ptr<OSDMap> lastmap(new OSDMap());
lastmap->set_max_osd(10);
lastmap->set_state(osd_id, CEPH_OSD_EXISTS);
lastmap->set_epoch(epoch);
obc.start();
std::atomic<unsigned> outstanding_reads = { 0 };
- vector<ceph::shared_ptr<op_data> > ops;
+ vector<std::shared_ptr<op_data> > ops;
ObjectCacher::ObjectSet object_set(NULL, 0, 0);
SnapContext snapc;
ceph::buffer::ptr bp(max_op_len);
uint64_t length = random() % (std::max<uint64_t>(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_data> op(new op_data(oid, offset, length, is_read));
+ std::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";
#include "include/int_types.h"
#include "include/rados/librados.hpp"
#include <gtest/gtest.h>
+#include <memory>
#include <set>
namespace librbd {
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-#include "include/memory.h"
#include <map>
#include <set>
#include <boost/scoped_ptr.hpp>
virtual void operate(map<string, bufferlist> *store) = 0;
virtual ~_Op() {}
};
- typedef ceph::shared_ptr<_Op> Op;
+ typedef std::shared_ptr<_Op> Op;
struct Remove : public _Op {
set<string> to_remove;
explicit Remove(const set<string> &to_remove) : to_remove(to_remove) {}
class SnapMapperTest : public ::testing::Test {
protected:
boost::scoped_ptr< PausyAsyncMap > driver;
- map<pg_t, ceph::shared_ptr<MapperVerifier> > mappers;
+ map<pg_t, std::shared_ptr<MapperVerifier> > mappers;
uint32_t pgnum;
void SetUp() override {
}
int update_osdmap(MonitorDBStore& store, version_t ver, bool copy,
- ceph::shared_ptr<CrushWrapper> crush,
+ std::shared_ptr<CrushWrapper> crush,
MonitorDBStore::Transaction* t) {
const string prefix("osdmap");
// load/extract the crush map
int r = 0;
- ceph::shared_ptr<CrushWrapper> crush(new CrushWrapper);
+ std::shared_ptr<CrushWrapper> crush(new CrushWrapper);
if (crush_file.empty()) {
bufferlist bl;
r = store.get(prefix, store.combine_strings("full", good_version), bl);
std::set<std::string> read_keys;
// Compose list of potentially-existing dentries we would like to fetch
- list<ceph::shared_ptr<EMetaBlob::fullbit> > const &fb_list =
+ list<std::shared_ptr<EMetaBlob::fullbit> > const &fb_list =
lump.get_dfull();
- for (list<ceph::shared_ptr<EMetaBlob::fullbit> >::const_iterator fbi =
+ for (list<std::shared_ptr<EMetaBlob::fullbit> >::const_iterator fbi =
fb_list.begin(); fbi != fb_list.end(); ++fbi) {
EMetaBlob::fullbit const &fb = *(*fbi);
// Compose list of dentries we will write back
std::map<std::string, bufferlist> write_vals;
- for (list<ceph::shared_ptr<EMetaBlob::fullbit> >::const_iterator fbi =
+ for (list<std::shared_ptr<EMetaBlob::fullbit> >::const_iterator fbi =
fb_list.begin(); fbi != fb_list.end(); ++fbi) {
EMetaBlob::fullbit const &fb = *(*fbi);
* important because clients use them to infer completeness
* of directories
*/
- for (list<ceph::shared_ptr<EMetaBlob::fullbit> >::const_iterator p =
+ for (list<std::shared_ptr<EMetaBlob::fullbit> >::const_iterator p =
metablob.roots.begin(); p != metablob.roots.end(); ++p) {
EMetaBlob::fullbit const &fb = *(*p);
inodeno_t ino = fb.inode.ino;
}
while (!m_io_finished.empty()) {
- ceph::unique_ptr<IOContext> free_ctx(m_io_finished.front());
+ std::unique_ptr<IOContext> free_ctx(m_io_finished.front());
m_io_finished.pop_front();
}
}
dout(20) << dendl;
while (!m_stopping) {
- ceph::unique_ptr<IOContext> ctx(new IOContext(this));
+ std::unique_ptr<IOContext> ctx(new IOContext(this));
dout(20) << "waiting for ggate request" << dendl;
while (!m_stopping) {
dout(20) << "waiting for io request" << dendl;
- ceph::unique_ptr<IOContext> ctx(wait_io_finish());
+ std::unique_ptr<IOContext> ctx(wait_io_finish());
if (!ctx) {
dout(20) << "no io requests, terminating" << dendl;
return;
namespace rbd {
namespace mirror {
-typedef shared_ptr<librados::Rados> RadosRef;
-typedef shared_ptr<librados::IoCtx> IoCtxRef;
-typedef shared_ptr<librbd::Image> ImageRef;
+typedef std::shared_ptr<librados::Rados> RadosRef;
+typedef std::shared_ptr<librados::IoCtx> IoCtxRef;
+typedef std::shared_ptr<librbd::Image> ImageRef;
struct ImageId {
std::string global_id;
cond.Wait(lock);
while(!io_finished.empty()) {
- ceph::unique_ptr<IOContext> free_ctx(io_finished.front());
+ std::unique_ptr<IOContext> free_ctx(io_finished.front());
io_finished.pop_front();
}
}
void reader_entry()
{
while (!terminated) {
- ceph::unique_ptr<IOContext> ctx(new IOContext());
+ std::unique_ptr<IOContext> ctx(new IOContext());
ctx->server = this;
dout(20) << __func__ << ": waiting for nbd request" << dendl;
{
while (!terminated) {
dout(20) << __func__ << ": waiting for io request" << dendl;
- ceph::unique_ptr<IOContext> ctx(wait_io_finish());
+ std::unique_ptr<IOContext> ctx(wait_io_finish());
if (!ctx) {
dout(20) << __func__ << ": no io requests, terminating" << dendl;
return;