From: Jianpeng Ma Date: Mon, 27 Mar 2017 17:49:56 +0000 (+0800) Subject: os/bluestore/BlueStore: make code more readable. X-Git-Tag: v12.0.2~242^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=54e16d4f22fec5e686bfe2799399b7b2678d1eea;p=ceph.git os/bluestore/BlueStore: make code more readable. Signed-off-by: Jianpeng Ma --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 96f72e9e5287e..898c0063bedb3 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -7660,18 +7660,19 @@ void BlueStore::_kv_sync_thread() // can rely on the bluefs commit to flush the device and make // deferred aios stable. that means that if we do have done deferred // txcs AND we are not on a single device, we need to force a flush. - if (!bluefs || (!bluefs_single_shared_device && !deferred_done.empty())) { - force_flush = true; - } - if (kv_committing.empty() && kv_submitting.empty() && - deferred_stable.empty()) { - force_flush = true; // there's nothing else to commit! - } - if (deferred_aggressive) { + if (bluefs_single_shared_device && bluefs) { + if (num_aios) { + force_flush = true; + } else if (kv_committing.empty() && kv_submitting.empty() && + deferred_stable.empty()) { + force_flush = true; // there's nothing else to commit! + } else if (deferred_aggressive) { + force_flush = true; + } + } else force_flush = true; - } - if (num_aios || force_flush) { + if (force_flush) { dout(20) << __func__ << " num_aios=" << num_aios << " force_flush=" << (int)force_flush << ", flushing, deferred done->stable" << dendl;