]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: take Collection ref from SharedBlob
authorSage Weil <sage@redhat.com>
Wed, 15 Mar 2017 19:01:52 +0000 (15:01 -0400)
committerSage Weil <sage@redhat.com>
Tue, 21 Mar 2017 18:56:30 +0000 (13:56 -0500)
These can survive as long as the txc, which can be longer than the
Collection.  Make sure we have a valid ref as both finish_write and
~SharedBlob use coll for the SharedBlobSet (and coll->store->cct for
debug).

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.h

index e5b5a41e109d74f26ce492fe7b7ee4f4d49a7025..89ca1c532eaec7ab55bf535ad7b031f90ef0ed14 100644 (file)
@@ -128,6 +128,7 @@ public:
 
   struct BufferSpace;
   struct Collection;
+  typedef boost::intrusive_ptr<Collection> CollectionRef;
 
   /// cached buffer
   struct Buffer {
@@ -327,7 +328,7 @@ public:
     std::atomic_int nref = {0}; ///< reference count
     bool loaded = false;
 
-    Collection *coll = nullptr;
+    CollectionRef coll;
     union {
       uint64_t sbid_unloaded;              ///< sbid if persistent isn't loaded
       bluestore_shared_blob_t *persistent; ///< persistent part of the shared blob if any
@@ -1304,7 +1305,6 @@ public:
 
     Collection(BlueStore *ns, Cache *ca, coll_t c);
   };
-  typedef boost::intrusive_ptr<Collection> CollectionRef;
 
   class OmapIteratorImpl : public ObjectMap::ObjectMapIteratorImpl {
     CollectionRef c;