From: Sage Weil Date: Wed, 11 May 2016 19:11:13 +0000 (-0400) Subject: os/bluestore: rename _txc_update_fm -> _txc_finalize_kv X-Git-Tag: v11.0.0~359^2~96 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=212431a48d67e2e49b57606713e8133fdf99024d;p=ceph.git os/bluestore: rename _txc_update_fm -> _txc_finalize_kv Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 6c0c37c540a0..b0582363ed4c 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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::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::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::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); } diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index 0699ba5661f1..980587e16bf7 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -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(p));