dout(20) << __func__ << " txc " << txc << " osr " << txc->osr << dendl;
DeferredBatch *tmp;
+ bool need_lock_again = false;
+ txc->osr->deferred_lock.lock();
{
- txc->osr->deferred_lock.lock();
if (!txc->osr->deferred_pending) {
tmp = new DeferredBatch(cct, txc->osr.get());
+ txc->osr->deferred_lock.unlock();
+ need_lock_again = true;
} else {
tmp = txc->osr->deferred_pending;
- txc->osr->deferred_pending = nullptr;
}
- txc->osr->deferred_lock.unlock();
}
tmp->txcs.push_back(*txc);
}
{
- txc->osr->deferred_lock.lock();
+ if (need_lock_again) {
+ txc->osr->deferred_lock.lock();
+ }
++deferred_queue_size;
txc->osr->deferred_pending = tmp;
// condition "tmp->txcs.size() == 1" mean deferred_pending was originally empty.
txc->osr->deferred_lock.unlock();
}
}
-
}
void BlueStore::deferred_try_submit()