]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: remove deferred_csum machinery 11243/head
authorSage Weil <sage@redhat.com>
Tue, 27 Sep 2016 21:07:16 +0000 (17:07 -0400)
committerSage Weil <sage@redhat.com>
Tue, 27 Sep 2016 21:07:16 +0000 (17:07 -0400)
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 <sage@redhat.com>
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index 923bda285c26357c8c1d6bf5ca5b89ab50bf3658..505a6ccf7171ecb651bd69578f66dd8b3aed69d7 100644 (file)
@@ -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
index 362e0316cf9f10a9d4e4ec03f50d94a6a647e211..507da0fdc9e21fb68bb82bda082b3f1d82292775 100644 (file)
@@ -1089,8 +1089,6 @@ public:
        : blob(b), b_off(bo), data(bl) {}
     };
 
-    list<DeferredCsum> 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 {