From 796c34de918a1ecc9b25fc0d0beadf157789b6bb Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Wed, 5 Apr 2017 02:31:53 +0200 Subject: [PATCH] os/bluestore: don't use virtual for accessing BitMapZone::is_exhausted. Signed-off-by: Radoslaw Zarzynski --- src/os/bluestore/BitAllocator.cc | 4 ++-- src/os/bluestore/BitAllocator.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/os/bluestore/BitAllocator.cc b/src/os/bluestore/BitAllocator.cc index e8431a76c4e..22f1ce9a47d 100644 --- a/src/os/bluestore/BitAllocator.cc +++ b/src/os/bluestore/BitAllocator.cc @@ -323,7 +323,7 @@ BitMapZone::~BitMapZone() inline bool BitMapZone::is_exhausted() { /* BitMapZone::get_used_blocks operates atomically. No need for lock. */ - return get_used_blocks() == size(); + return BitMapZone::get_used_blocks() == BitMapZone::size(); } bool BitMapZone::is_allocated(int64_t start_block, int64_t num_blocks) @@ -989,7 +989,7 @@ inline bool BitMapAreaLeaf::child_check_n_lock(BitMapZone* const child, /* The exhausted check can be performed without acquiring the lock. This * is because 1) BitMapZone::is_exhausted() actually operates atomically * and 2) it's followed by the exclusive, required-aware re-verification. */ - if (child->is_exhausted()) { + if (child->BitMapZone::is_exhausted()) { return false; } diff --git a/src/os/bluestore/BitAllocator.h b/src/os/bluestore/BitAllocator.h index b1e5457ad04..90d9e862cf6 100644 --- a/src/os/bluestore/BitAllocator.h +++ b/src/os/bluestore/BitAllocator.h @@ -348,7 +348,7 @@ public: static void incr_count() { count++;} static int64_t get_total_blocks() {return total_blocks;} bool is_allocated(int64_t start_block, int64_t num_blocks) override; - bool is_exhausted() override; + bool is_exhausted() override final; void reset_marker(); int64_t sub_used_blocks(int64_t num_blocks) override; @@ -356,8 +356,8 @@ public: bool reserve_blocks(int64_t num_blocks) override; void unreserve(int64_t num_blocks, int64_t allocated) override; int64_t get_reserved_blocks() override; - int64_t get_used_blocks() override; - int64_t size() override { + int64_t get_used_blocks() override final; + int64_t size() override final { return get_total_blocks(); }