]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: kill BufferSpace.empty() 12871/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Wed, 11 Jan 2017 02:20:54 +0000 (10:20 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Wed, 11 Jan 2017 02:43:58 +0000 (10:43 +0800)
Because:
1. All other public methods are called under the protection of cache->lock,
which makes the usage of this method is weird.

2. The only caller is _dump_extent_map(), and we can do it without this
in a simpler way.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index 6816e5d718db878e568654d32f73cd34aeb218af..9eb88409e460695ef846e09efd86788fa5e91346 100644 (file)
@@ -7514,12 +7514,10 @@ void BlueStore::_dump_extent_map(ExtentMap &em, int log_level)
                      << dendl;
     }
     std::lock_guard<std::recursive_mutex> l(e.blob->shared_blob->bc.cache->lock);
-    if (!e.blob->shared_blob->bc.empty()) {
-      for (auto& i : e.blob->shared_blob->bc.buffer_map) {
-       dout(log_level) << __func__ << "       0x" << std::hex << i.first
-                       << "~" << i.second->length << std::dec
-                       << " " << *i.second << dendl;
-      }
+    for (auto& i : e.blob->shared_blob->bc.buffer_map) {
+      dout(log_level) << __func__ << "       0x" << std::hex << i.first
+                      << "~" << i.second->length << std::dec
+                      << " " << *i.second << dendl;
     }
   }
 }
index 00881854912b31b0ae860a2655607dfa877420cb..d74f9256d01a48fba7799376e033c96b15a305c4 100644 (file)
@@ -273,10 +273,6 @@ public:
       return i;
     }
 
-    bool empty() const {
-      return buffer_map.empty();
-    }
-
     // must be called under protection of the Cache lock
     void _clear();