From 985514b278b9ec2894cc91db27094ea95f8c0970 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Wed, 11 Jan 2017 10:20:54 +0800 Subject: [PATCH] os/bluestore: kill BufferSpace.empty() 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 --- src/os/bluestore/BlueStore.cc | 10 ++++------ src/os/bluestore/BlueStore.h | 4 ---- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 6816e5d718d..9eb88409e46 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -7514,12 +7514,10 @@ void BlueStore::_dump_extent_map(ExtentMap &em, int log_level) << dendl; } std::lock_guard 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; } } } diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index 00881854912..d74f9256d01 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -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();