]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/kstore: uniform Collection implementation with BlueStore one
authorIgor Fedotov <ifedotov@mirantis.com>
Tue, 18 Oct 2016 13:04:43 +0000 (13:04 +0000)
committerIgor Fedotov <ifedotov@mirantis.com>
Tue, 18 Oct 2016 13:04:43 +0000 (13:04 +0000)
Signed-off-by:Igor Fedotov <ifedotov@mirantis.com>

src/os/kstore/KStore.h

index 103a45a7b74f16c2eaf514aac78e1b81eb404b1e..f04a3f16aa08106b8ccacc2439526464ded247d6 100644 (file)
@@ -126,7 +126,7 @@ public:
     int trim(int max=-1);
   };
 
-  struct Collection {
+  struct Collection : public CollectionImpl {
     KStore *store;
     coll_t cid;
     kstore_cnode_t cnode;
@@ -138,6 +138,10 @@ public:
 
     OnodeRef get_onode(const ghobject_t& oid, bool create);
 
+    const coll_t &get_cid() override {
+      return cid;
+    }
+
     bool contains(const ghobject_t& oid) {
       if (cid.is_meta())
        return oid.hobj.pool == -1;
@@ -151,7 +155,7 @@ public:
 
     Collection(KStore *ns, coll_t c);
   };
-  typedef ceph::shared_ptr<Collection> CollectionRef;
+  typedef boost::intrusive_ptr<Collection> CollectionRef;
 
   class OmapIteratorImpl : public ObjectMap::ObjectMapIteratorImpl {
     CollectionRef c;