From: Sage Weil Date: Tue, 27 Sep 2016 21:07:16 +0000 (-0400) Subject: os/bluestore: remove deferred_csum machinery X-Git-Tag: v11.0.1~68^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ad7487d6419a217d0339ed9e174331beb4c3db8f;p=ceph.git os/bluestore: remove deferred_csum machinery When we added this way back in d4f4fa0312d943dd0ce3c27f5fc56c7a753bb471, we did not have our own buffer cache, and were relying on the cache at the BlockDevice layer. In that case, we would have the problem of a partial wal overwrite followed by another partial write that needed to read the rest of the chunk. However, now we have our own cache, and any data we write in the _do_write_small() wal path will go into the cache, which means we will never read the old data off of disk and need the old csum values. Remove this now-unnecessary kludge! Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 923bda285c26..505a6ccf7171 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -6488,14 +6488,6 @@ int BlueStore::queue_transactions( _txc_add_transaction(txc, &(*p)); } - // delayed csum calculation? - for (auto& d : txc->deferred_csum) { - dout(20) << __func__ << " deferred csum calc blob " << d.blob - << " b_off 0x" << std::hex << d.b_off << std::dec - << dendl; - d.blob->dirty_blob().calc_csum(d.b_off, d.data); - } - _txc_write_nodes(txc, txc->t); // journal wal items if (txc->wal_txn) { @@ -7203,7 +7195,7 @@ void BlueStore::_do_write_small( }); assert(r == 0); if (b->get_blob().csum_type) { - txc->add_deferred_csum(b, b_off, padded); + b->dirty_blob().calc_csum(b_off, padded); } op->data.claim(padded); dout(20) << __func__ << " wal write 0x" << std::hex << b_off << "~" @@ -8145,14 +8137,6 @@ int BlueStore::_do_clone_range( } } txc->write_shared_blob(e.blob->shared_blob); - // ugly: duplicate deferred csum work, if any. - for (auto& dc : txc->deferred_csum) { - if (dc.blob == e.blob) { - dout(20) << __func__ << " duplicating deferred csum for blob " - << *e.blob << dendl; - txc->add_deferred_csum(cb, dc.b_off, dc.data); - } - } dout(20) << __func__ << " new " << *cb << dendl; } // dup extent diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index 362e0316cf9f..507da0fdc9e2 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -1089,8 +1089,6 @@ public: : blob(b), b_off(bo), data(bl) {} }; - list deferred_csum; - explicit TransContext(OpSequencer *o) : state(STATE_PREPARE), osr(o), @@ -1115,10 +1113,6 @@ public: void write_shared_blob(SharedBlobRef &sb) { shared_blobs.insert(sb); } - - void add_deferred_csum(BlobRef& b, uint64_t bo, bufferlist& bl) { - deferred_csum.emplace_back(TransContext::DeferredCsum(b, bo, bl)); - } }; class OpSequencer : public Sequencer_impl {