summaryrefslogtreecommitdiffstats
path: root/src/os/memstore/MemStore.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/os/memstore/MemStore.h')
-rw-r--r--src/os/memstore/MemStore.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/os/memstore/MemStore.h b/src/os/memstore/MemStore.h
index ec7cf53b501..55f55ee4bfa 100644
--- a/src/os/memstore/MemStore.h
+++ b/src/os/memstore/MemStore.h
@@ -36,11 +36,8 @@ public:
bufferlist omap_header;
map<string,bufferlist> omap;
- typedef boost::intrusive_ptr<Object> Ref;
- friend void intrusive_ptr_add_ref(Object *o) { o->get(); }
- friend void intrusive_ptr_release(Object *o) { o->put(); }
+ using Ref = ceph::ref_t<Object>;
- Object() : RefCountedObject(nullptr, 0) {}
// interface for object data
virtual size_t get_size() const = 0;
virtual int read(uint64_t offset, uint64_t len, bufferlist &bl) = 0;
@@ -90,8 +87,10 @@ public:
}
f->close_section();
}
+ protected:
+ Object() = default;
};
- typedef Object::Ref ObjectRef;
+ using ObjectRef = Object::Ref;
struct PageSetObject;
struct Collection : public CollectionImpl {
@@ -110,8 +109,6 @@ public:
ceph::make_mutex("MemStore::Collection::sequencer_mutex")};
typedef boost::intrusive_ptr<Collection> Ref;
- friend void intrusive_ptr_add_ref(Collection *c) { c->get(); }
- friend void intrusive_ptr_release(Collection *c) { c->put(); }
ObjectRef create_object() const;
@@ -184,8 +181,10 @@ public:
return true;
}
+ private:
+ FRIEND_MAKE_REF(Collection);
explicit Collection(CephContext *cct, coll_t c)
- : CollectionImpl(c),
+ : CollectionImpl(cct, c),
cct(cct),
use_page_set(cct->_conf->memstore_page_set) {}
};