Wait until after the kv transaction commits, and then
release extents directly into the usable pool.
This will let us remove the commit_{start,end} business.
Signed-off-by: Sage Weil <sage@redhat.com>
dout(10) << __func__ << " 0x"
<< std::hex << offset << "~" << length << std::dec
<< dendl;
- m_uncommitted.insert(offset, length);
- m_num_uncommitted += length;
+ insert_free(offset, length);
return 0;
}
txc->state = TransContext::STATE_KV_SUBMITTED;
}
for (auto txc : kv_committing) {
- _txc_release_alloc(txc);
if (txc->had_ios) {
--txc->osr->txc_with_unstable_io;
}
while (!kv_committing.empty()) {
TransContext *txc = kv_committing.front();
assert(txc->state == TransContext::STATE_KV_SUBMITTED);
+ _txc_release_alloc(txc);
_txc_state_proc(txc);
kv_committing.pop_front();
}
std::lock_guard<std::mutex> l(lock);
dout(10) << __func__ << " 0x" << std::hex << offset << "~" << length
<< std::dec << dendl;
- uncommitted.insert(offset, length);
- num_uncommitted += length;
+ _insert_free(offset, length);
+ num_free += length;
return 0;
}