From: Sage Weil Date: Wed, 8 Mar 2017 20:01:35 +0000 (-0500) Subject: os/bluestore: move _osr_reap_done X-Git-Tag: v12.0.1~12^2~26 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3dc82d57e4a61c4d812f227fcb98326e73c93402;p=ceph.git os/bluestore: move _osr_reap_done Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 04ca35354cc8..ea734b5521dc 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;