From 3dc82d57e4a61c4d812f227fcb98326e73c93402 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 8 Mar 2017 15:01:35 -0500 Subject: [PATCH] os/bluestore: move _osr_reap_done Signed-off-by: Sage Weil --- src/os/bluestore/BlueStore.cc | 76 +++++++++++++++++------------------ 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 04ca35354cc80..ea734b5521dca 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -7326,44 +7326,6 @@ void BlueStore::BSPerfTracker::update_from_perfcounters( l_bluestore_commit_lat)); } -void BlueStore::_osr_reap_done(OpSequencer *osr) -{ - CollectionRef c; - - { - std::lock_guard l(osr->qlock); - dout(20) << __func__ << " osr " << osr << dendl; - while (!osr->q.empty()) { - TransContext *txc = &osr->q.front(); - dout(20) << __func__ << " txc " << txc << " " << txc->get_state_name() - << dendl; - if (txc->state != TransContext::STATE_DONE) { - break; - } - - // release to allocator only after all preceding txc's have also - // finished any deferred writes that potentially land in these - // blocks - _txc_release_alloc(txc); - - if (!c && txc->first_collection) { - c = txc->first_collection; - } - - osr->q.pop_front(); - txc->log_state_latency(logger, l_bluestore_state_done_lat); - delete txc; - osr->qcond.notify_all(); - } - if (osr->q.empty()) - dout(20) << __func__ << " osr " << osr << " q now empty" << dendl; - } - - if (c) { - c->trim_cache(); - } -} - void BlueStore::_txc_finalize_kv(TransContext *txc, KeyValueDB::Transaction t) { dout(20) << __func__ << " txc " << txc << std::hex @@ -7495,6 +7457,44 @@ void BlueStore::_txc_release_alloc(TransContext *txc) txc->released.clear(); } +void BlueStore::_osr_reap_done(OpSequencer *osr) +{ + CollectionRef c; + + { + std::lock_guard l(osr->qlock); + dout(20) << __func__ << " osr " << osr << dendl; + while (!osr->q.empty()) { + TransContext *txc = &osr->q.front(); + dout(20) << __func__ << " txc " << txc << " " << txc->get_state_name() + << dendl; + if (txc->state != TransContext::STATE_DONE) { + break; + } + + // release to allocator only after all preceding txc's have also + // finished any deferred writes that potentially land in these + // blocks + _txc_release_alloc(txc); + + if (!c && txc->first_collection) { + c = txc->first_collection; + } + + osr->q.pop_front(); + txc->log_state_latency(logger, l_bluestore_state_done_lat); + delete txc; + osr->qcond.notify_all(); + } + if (osr->q.empty()) + dout(20) << __func__ << " osr " << osr << " q now empty" << dendl; + } + + if (c) { + c->trim_cache(); + } +} + void BlueStore::_osr_drain_all() { dout(10) << __func__ << dendl; -- 2.39.5