]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore/BlueStore: make code more readable. 14162/head
authorJianpeng Ma <jianpeng.ma@intel.com>
Mon, 27 Mar 2017 17:49:56 +0000 (01:49 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Tue, 28 Mar 2017 12:03:29 +0000 (20:03 +0800)
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/os/bluestore/BlueStore.cc

index 96f72e9e5287e0bd93f59288a5bade4191a67c05..898c0063bedb30d8d9f3f901816367f8f807d2bd 100644 (file)
@@ -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;