From: Sage Weil Date: Wed, 15 Mar 2017 19:01:52 +0000 (-0400) Subject: os/bluestore: take Collection ref from SharedBlob X-Git-Tag: v12.0.1~12^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=01ef844421e3f9c9ded988a113512e3d0bc7d5b2;p=ceph.git os/bluestore: take Collection ref from SharedBlob 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 --- diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index e5b5a41e109..89ca1c532ea 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -128,6 +128,7 @@ public: struct BufferSpace; struct Collection; + typedef boost::intrusive_ptr 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 CollectionRef; class OmapIteratorImpl : public ObjectMap::ObjectMapIteratorImpl { CollectionRef c;