From 71f28677dcdd602ece064d34a9c2f6fea062d3e1 Mon Sep 17 00:00:00 2001 From: Igor Fedotov Date: Tue, 12 Jun 2018 14:50:30 +0300 Subject: [PATCH] os/bluestore: rename new bitmap allocator class to BitmapAllocator. Signed-off-by: Igor Fedotov (cherry picked from commit a8e8c192acb48ce93553b04d1953ce8bee1b16e4) --- src/os/CMakeLists.txt | 2 +- src/os/bluestore/Allocator.cc | 4 ++-- .../{BitmapFastAllocator.cc => BitmapAllocator.cc} | 14 +++++++------- .../{BitmapFastAllocator.h => BitmapAllocator.h} | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) rename src/os/bluestore/{BitmapFastAllocator.cc => BitmapAllocator.cc} (85%) rename src/os/bluestore/{BitmapFastAllocator.h => BitmapAllocator.h} (85%) diff --git a/src/os/CMakeLists.txt b/src/os/CMakeLists.txt index cd39ebad5897d..e25f95a7fd991 100644 --- a/src/os/CMakeLists.txt +++ b/src/os/CMakeLists.txt @@ -32,7 +32,7 @@ if(HAVE_LIBAIO) bluestore/FreelistManager.cc bluestore/KernelDevice.cc bluestore/StupidAllocator.cc - bluestore/BitmapFastAllocator.cc + bluestore/BitmapAllocator.cc bluestore/aio.cc ) endif(HAVE_LIBAIO) diff --git a/src/os/bluestore/Allocator.cc b/src/os/bluestore/Allocator.cc index 9b12301bac8cc..b6026353165cb 100644 --- a/src/os/bluestore/Allocator.cc +++ b/src/os/bluestore/Allocator.cc @@ -3,7 +3,7 @@ #include "Allocator.h" #include "StupidAllocator.h" -#include "BitmapFastAllocator.h" +#include "BitmapAllocator.h" #include "common/debug.h" #define dout_subsys ceph_subsys_bluestore @@ -14,7 +14,7 @@ Allocator *Allocator::create(CephContext* cct, string type, if (type == "stupid") { return new StupidAllocator(cct); } else if (type == "bitmap") { - return new BitmapFastAllocator(cct, size, block_size); + return new BitmapAllocator(cct, size, block_size); } lderr(cct) << "Allocator::" << __func__ << " unknown alloc type " << type << dendl; diff --git a/src/os/bluestore/BitmapFastAllocator.cc b/src/os/bluestore/BitmapAllocator.cc similarity index 85% rename from src/os/bluestore/BitmapFastAllocator.cc rename to src/os/bluestore/BitmapAllocator.cc index 2f080882f75bb..2cf2bfd68e70e 100755 --- a/src/os/bluestore/BitmapFastAllocator.cc +++ b/src/os/bluestore/BitmapAllocator.cc @@ -1,14 +1,14 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab -#include "BitmapFastAllocator.h" +#include "BitmapAllocator.h" #define dout_context cct #define dout_subsys ceph_subsys_bluestore #undef dout_prefix #define dout_prefix *_dout << "fbmap_alloc 0x" << this << " " -BitmapFastAllocator::BitmapFastAllocator(CephContext* _cct, +BitmapAllocator::BitmapAllocator(CephContext* _cct, int64_t capacity, int64_t alloc_unit) : cct(_cct) @@ -18,7 +18,7 @@ BitmapFastAllocator::BitmapFastAllocator(CephContext* _cct, _init(capacity, alloc_unit, false); } -int64_t BitmapFastAllocator::allocate( +int64_t BitmapAllocator::allocate( uint64_t want_size, uint64_t alloc_unit, uint64_t max_alloc_size, int64_t hint, PExtentVector *extents) { @@ -43,7 +43,7 @@ int64_t BitmapFastAllocator::allocate( return int64_t(allocated); } -void BitmapFastAllocator::release( +void BitmapAllocator::release( const interval_set& release_set) { for (auto r : release_set) { @@ -55,7 +55,7 @@ void BitmapFastAllocator::release( } -void BitmapFastAllocator::init_add_free(uint64_t offset, uint64_t length) +void BitmapAllocator::init_add_free(uint64_t offset, uint64_t length) { ldout(cct, 10) << __func__ << " 0x" << std::hex << offset << "~" << length << std::dec << dendl; @@ -67,7 +67,7 @@ void BitmapFastAllocator::init_add_free(uint64_t offset, uint64_t length) _mark_free(offs, l); ldout(cct, 10) << __func__ << " done" << dendl; } -void BitmapFastAllocator::init_rm_free(uint64_t offset, uint64_t length) +void BitmapAllocator::init_rm_free(uint64_t offset, uint64_t length) { ldout(cct, 10) << __func__ << " 0x" << std::hex << offset << "~" << length << std::dec << dendl; @@ -78,7 +78,7 @@ void BitmapFastAllocator::init_rm_free(uint64_t offset, uint64_t length) ldout(cct, 10) << __func__ << " done" << dendl; } -void BitmapFastAllocator::shutdown() +void BitmapAllocator::shutdown() { ldout(cct, 1) << __func__ << dendl; _shutdown(); diff --git a/src/os/bluestore/BitmapFastAllocator.h b/src/os/bluestore/BitmapAllocator.h similarity index 85% rename from src/os/bluestore/BitmapFastAllocator.h rename to src/os/bluestore/BitmapAllocator.h index 9807780b50c8d..c4f7f7beb29a8 100755 --- a/src/os/bluestore/BitmapFastAllocator.h +++ b/src/os/bluestore/BitmapAllocator.h @@ -12,13 +12,13 @@ #include "include/mempool.h" #include "common/debug.h" -class BitmapFastAllocator : public Allocator, +class BitmapAllocator : public Allocator, public AllocatorLevel02 { CephContext* cct; public: - BitmapFastAllocator(CephContext* _cct, int64_t capacity, int64_t alloc_unit); - ~BitmapFastAllocator() override + BitmapAllocator(CephContext* _cct, int64_t capacity, int64_t alloc_unit); + ~BitmapAllocator() override { } -- 2.39.5