]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: rename _txc_update_fm -> _txc_finalize_kv
authorSage Weil <sage@redhat.com>
Wed, 11 May 2016 19:11:13 +0000 (15:11 -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 6c0c37c540a03e31d2ba5b106bb78d8402d1fb04..b0582363ed4c6a474188523a5e6ab9dd463e4267 100644 (file)
@@ -3804,12 +3804,12 @@ void BlueStore::_txc_state_proc(TransContext *txc)
       txc->state = TransContext::STATE_KV_QUEUED;
       if (!g_conf->bluestore_sync_transaction) {
        if (g_conf->bluestore_sync_submit_transaction) {
-         _txc_update_fm(txc);
+         _txc_finalize_kv(txc, txc->t);
          int r = db->submit_transaction(txc->t);
          assert(r == 0);
        }
       } else {
-       _txc_update_fm(txc);
+       _txc_finalize_kv(txc, txc->t);
        int r = db->submit_transaction_sync(txc->t);
        assert(r == 0);
       }
@@ -4030,35 +4030,31 @@ void BlueStore::_osr_reap_done(OpSequencer *osr)
   }
 }
 
-void BlueStore::_txc_update_fm(TransContext *txc)
+void BlueStore::_txc_finalize_kv(TransContext *txc, KeyValueDB::Transaction t)
 {
-  if (txc->wal_txn)
-    dout(20) << __func__ << " txc " << txc
-      << " allocated " << txc->allocated
-      << " (will release " << txc->released << " after wal)"
-      << dendl;
-  else
-    dout(20) << __func__ << " txc " << txc
-      << " allocated " << txc->allocated
-      << " released " << txc->released
-      << dendl;
+  dout(20) << __func__ << " txc " << txc
+          << " allocated " << txc->allocated
+          << " released " << txc->released
+          << dendl;
 
   for (interval_set<uint64_t>::iterator p = txc->allocated.begin();
       p != txc->allocated.end();
       ++p) {
-    fm->allocate(p.get_start(), p.get_len(), txc->t);
+    fm->allocate(p.get_start(), p.get_len(), t);
   }
+  txc->allocated.clear();
 
   for (interval_set<uint64_t>::iterator p = txc->released.begin();
       p != txc->released.end();
       ++p) {
     dout(20) << __func__ << " release 0x" << std::hex << p.get_start()
             << "~0x" << p.get_len() << std::dec << dendl;
-    fm->release(p.get_start(), p.get_len(), txc->t);
+    fm->release(p.get_start(), p.get_len(), t);
 
     if (!g_conf->bluestore_debug_no_reuse_blocks)
       alloc->release(p.get_start(), p.get_len());
   }
+  txc->released.clear();
 }
 
 
@@ -4097,7 +4093,7 @@ void BlueStore::_kv_sync_thread()
        for (std::deque<TransContext *>::iterator it = kv_committing.begin();
             it != kv_committing.end();
             ++it) {
-         _txc_update_fm((*it));
+         _txc_finalize_kv((*it), (*it)->t);
          int r = db->submit_transaction((*it)->t);
          assert(r == 0);
        }
index 0699ba5661f1edb1d981bd8ed4dbc3e39e26fa68..980587e16bf72c1006ca7e32091538047e1d1881 100644 (file)
@@ -650,7 +650,7 @@ private:
   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);
+  void _txc_finalize_kv(TransContext *txc, KeyValueDB::Transaction t);
 public:
   void _txc_aio_finish(void *p) {
     _txc_state_proc(static_cast<TransContext*>(p));