From 54e16d4f22fec5e686bfe2799399b7b2678d1eea Mon Sep 17 00:00:00 2001 From: Jianpeng Ma Date: Tue, 28 Mar 2017 01:49:56 +0800 Subject: [PATCH] os/bluestore/BlueStore: make code more readable. Signed-off-by: Jianpeng Ma --- src/os/bluestore/BlueStore.cc | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 96f72e9e528..898c0063bed 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; -- 2.47.3