unshare && !*unshare ? unshare : nullptr);
}
-void BlueStore::SharedBlob::finish_write(uint64_t seq)
-{
- while (true) {
- BufferCacheShard *cache = coll->cache;
- std::lock_guard l(cache->lock);
- if (coll->cache != cache) {
- dout(20) << __func__
- << " raced with sb cache update, was " << cache
- << ", now " << coll->cache << ", retrying"
- << dendl;
- continue;
- }
- bc._finish_write(cache, seq);
- break;
- }
-}
-
// SharedBlobSet
#undef dout_prefix
return true;
}
+void BlueStore::Blob::finish_write(uint64_t seq)
+{
+ while (true) {
+ auto coll = shared_blob->coll;
+ BufferCacheShard *cache = coll->cache;
+ std::lock_guard l(cache->lock);
+ if (coll->cache != cache) {
+ dout(20) << __func__
+ << " raced with sb cache update, was " << cache
+ << ", now " << coll->cache << ", retrying"
+ << dendl;
+ continue;
+ }
+ shared_blob->bc._finish_write(cache, seq);
+ break;
+ }
+}
+
void BlueStore::Blob::split(Collection *coll, uint32_t blob_offset, Blob *r)
{
dout(10) << __func__ << " 0x" << std::hex << blob_offset << std::dec
ceph_assert(txc->get_state() == TransContext::STATE_FINISHING);
for (auto& sb : txc->blobs_written) {
- sb->shared_blob->finish_write(txc->seq);
+ sb->finish_write(txc->seq);
}
txc->blobs_written.clear();
void put_ref(uint64_t offset, uint32_t length,
PExtentVector *r, bool *unshare);
- void finish_write(uint64_t seq);
-
friend bool operator==(const SharedBlob &l, const SharedBlob &r) {
return l.get_sbid() == r.get_sbid();
}
/// put logical references, and get back any released extents
bool put_ref(Collection *coll, uint32_t offset, uint32_t length,
PExtentVector *r);
-
+ // update caches to reflect content up to seq
+ void finish_write(uint64_t seq);
/// split the blob
void split(Collection *coll, uint32_t blob_offset, Blob *o);