]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore/BlueStore: break _txc_finalize into _txc_write_nodes
authorSage Weil <sage@redhat.com>
Wed, 11 May 2016 19:06:21 +0000 (15:06 -0400)
committerSage Weil <sage@redhat.com>
Wed, 1 Jun 2016 15:38:46 +0000 (11:38 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index 1a822415a8071a9739be3afdab9affd413a913be..6c0c37c540a03e31d2ba5b106bb78d8402d1fb04 100644 (file)
@@ -3904,10 +3904,12 @@ void BlueStore::_txc_finish_io(TransContext *txc)
           p->state == TransContext::STATE_IO_DONE);
 }
 
-void BlueStore::_txc_finalize(OpSequencer *osr, TransContext *txc)
+void BlueStore::_txc_write_nodes(TransContext *txc, KeyValueDB::Transaction t)
 {
-  dout(20) << __func__ << " osr " << osr << " txc " << txc
-          << " onodes " << txc->onodes << dendl;
+  dout(20) << __func__ << " txc " << txc
+          << " onodes " << txc->onodes
+          << " bnodes " << txc->bnodes
+          << dendl;
 
   // finalize onodes
   for (set<OnodeRef>::iterator p = txc->onodes.begin();
@@ -3916,7 +3918,7 @@ void BlueStore::_txc_finalize(OpSequencer *osr, TransContext *txc)
     bufferlist bl;
     ::encode((*p)->onode, bl);
     dout(20) << "  onode " << (*p)->oid << " is " << bl.length() << dendl;
-    txc->t->set(PREFIX_OBJ, (*p)->key, bl);
+    t->set(PREFIX_OBJ, (*p)->key, bl);
 
     std::lock_guard<std::mutex> l((*p)->flush_lock);
     (*p)->flush_txns.insert(txc);
@@ -3929,28 +3931,15 @@ void BlueStore::_txc_finalize(OpSequencer *osr, TransContext *txc)
     if ((*p)->ref_map.empty()) {
       dout(20) << "  bnode " << std::hex << (*p)->hash << std::dec
               << " ref_map is empty" << dendl;
-      txc->t->rmkey(PREFIX_OBJ, (*p)->key);
+      t->rmkey(PREFIX_OBJ, (*p)->key);
     } else {
       bufferlist bl;
       ::encode((*p)->ref_map, bl);
       dout(20) << "  bnode " << std::hex << (*p)->hash << std::dec
               << " ref_map is " << bl.length() << dendl;
-      txc->t->set(PREFIX_OBJ, (*p)->key, bl);
+      t->set(PREFIX_OBJ, (*p)->key, bl);
     }
   }
-
-  // journal wal items
-  if (txc->wal_txn) {
-    txc->wal_txn->released.swap(txc->released);
-    assert(txc->released.empty());
-
-    txc->wal_txn->seq = wal_seq.inc();
-    bufferlist bl;
-    ::encode(*txc->wal_txn, bl);
-    string key;
-    get_wal_key(txc->wal_txn->seq, &key);
-    txc->t->set(PREFIX_WAL, key, bl);
-  }
 }
 
 void BlueStore::_txc_finish_kv(TransContext *txc)
@@ -4475,7 +4464,20 @@ int BlueStore::queue_transactions(
     _txc_add_transaction(txc, &(*p));
   }
 
-  _txc_finalize(osr, txc);
+  _txc_write_nodes(txc, txc->t);
+
+  // journal wal items
+  if (txc->wal_txn) {
+    txc->wal_txn->released.swap(txc->released);
+    assert(txc->released.empty());
+
+    txc->wal_txn->seq = wal_seq.inc();
+    bufferlist bl;
+    ::encode(*txc->wal_txn, bl);
+    string key;
+    get_wal_key(txc->wal_txn->seq, &key);
+    txc->t->set(PREFIX_WAL, key, bl);
+  }
 
   throttle_ops.get(txc->ops);
   throttle_bytes.get(txc->bytes);
index 0d191544792a7d327cbd2b19ea86e683b5a425cc..0699ba5661f1edb1d981bd8ed4dbc3e39e26fa68 100644 (file)
@@ -647,7 +647,7 @@ private:
                    uint64_t offset, uint64_t length,
                    bool shared);
   void _txc_add_transaction(TransContext *txc, Transaction *t);
-  void _txc_finalize(OpSequencer *osr, TransContext *txc);
+  void _txc_write_nodes(TransContext *txc, KeyValueDB::Transaction t);
   void _txc_state_proc(TransContext *txc);
   void _txc_aio_submit(TransContext *txc);
   void _txc_update_fm(TransContext *txc);