From 9ce95bb1fdcffc8ffa95bbcad78aa4650c792ec5 Mon Sep 17 00:00:00 2001 From: Ramesh Chander Date: Sun, 18 Dec 2016 20:13:58 -0800 Subject: [PATCH] remove unused wait argument and related function versions Signed-off-by: Ramesh Chander --- src/os/bluestore/BitAllocator.cc | 32 +++++++++++++++++--------------- src/os/bluestore/BitAllocator.h | 24 +++++++----------------- 2 files changed, 24 insertions(+), 32 deletions(-) diff --git a/src/os/bluestore/BitAllocator.cc b/src/os/bluestore/BitAllocator.cc index d2ed8102747..309d19ae204 100644 --- a/src/os/bluestore/BitAllocator.cc +++ b/src/os/bluestore/BitAllocator.cc @@ -908,7 +908,7 @@ bool BitMapAreaIN::is_allocated(int64_t start_block, int64_t num_blocks) return true; } -int64_t BitMapAreaIN::alloc_blocks_dis_int_work(bool wait, bool wrap, int64_t num_blocks, int64_t min_alloc, +int64_t BitMapAreaIN::alloc_blocks_dis_int_work(bool wrap, int64_t num_blocks, int64_t min_alloc, int64_t hint, int64_t area_blk_off, ExtentList *block_list) { BitMapArea *child = NULL; @@ -925,7 +925,7 @@ int64_t BitMapAreaIN::alloc_blocks_dis_int_work(bool wait, bool wrap, int64_t nu } blk_off = child->get_index() * m_child_size_blocks + area_blk_off; - allocated += child->alloc_blocks_dis(wait, num_blocks - allocated, min_alloc, + allocated += child->alloc_blocks_dis(num_blocks - allocated, min_alloc, hint % m_child_size_blocks, blk_off, block_list); hint = 0; child_unlock(child); @@ -937,20 +937,20 @@ int64_t BitMapAreaIN::alloc_blocks_dis_int_work(bool wait, bool wrap, int64_t nu return allocated; } -int64_t BitMapAreaIN::alloc_blocks_dis_int(bool wait, int64_t num_blocks, - int64_t min_alloc, int64_t hint, int64_t area_blk_off, ExtentList *block_list) +int64_t BitMapAreaIN::alloc_blocks_dis_int(int64_t num_blocks, int64_t min_alloc, + int64_t hint, int64_t area_blk_off, ExtentList *block_list) { - return alloc_blocks_dis_int_work(wait, false, num_blocks, min_alloc, hint, + return alloc_blocks_dis_int_work(false, num_blocks, min_alloc, hint, area_blk_off, block_list); } -int64_t BitMapAreaIN::alloc_blocks_dis(bool wait, int64_t num_blocks, int64_t min_alloc, +int64_t BitMapAreaIN::alloc_blocks_dis(int64_t num_blocks, int64_t min_alloc, int64_t hint, int64_t blk_off, ExtentList *block_list) { int64_t allocated = 0; lock_shared(); - allocated += alloc_blocks_dis_int(wait, num_blocks, min_alloc, hint, blk_off, block_list); + allocated += alloc_blocks_dis_int(num_blocks, min_alloc, hint, blk_off, block_list); add_used_blocks(allocated); unlock(); @@ -1125,7 +1125,7 @@ void BitMapAreaLeaf::child_unlock(BitMapArea *child) child->unlock(); } -int64_t BitMapAreaLeaf::alloc_blocks_dis_int(bool wait, int64_t num_blocks, int64_t min_alloc, +int64_t BitMapAreaLeaf::alloc_blocks_dis_int(int64_t num_blocks, int64_t min_alloc, int64_t hint, int64_t area_blk_off, ExtentList *block_list) { BitMapArea *child = NULL; @@ -1395,19 +1395,21 @@ void BitAllocator::set_blocks_used(int64_t start_block, int64_t num_blocks) /* * Allocate N dis-contiguous blocks. */ -int64_t BitAllocator::alloc_blocks_dis_int(bool wait, int64_t num_blocks, - int64_t min_alloc, int64_t hint, int64_t area_blk_off, ExtentList *block_list) +int64_t BitAllocator::alloc_blocks_dis_int(int64_t num_blocks, int64_t min_alloc, + int64_t hint, int64_t area_blk_off, ExtentList *block_list) { - return alloc_blocks_dis_int_work(wait, true, num_blocks, min_alloc, hint, + return alloc_blocks_dis_int_work(true, num_blocks, min_alloc, hint, area_blk_off, block_list); } -int64_t BitAllocator::alloc_blocks_dis_res(int64_t num_blocks, int64_t min_alloc, int64_t hint, ExtentList *block_list) +int64_t BitAllocator::alloc_blocks_dis_res(int64_t num_blocks, int64_t min_alloc, + int64_t hint, ExtentList *block_list) { return alloc_blocks_dis_work(num_blocks, min_alloc, hint, block_list, true); } -int64_t BitAllocator::alloc_blocks_dis_work(int64_t num_blocks, int64_t min_alloc, int64_t hint, ExtentList *block_list, bool reserved) +int64_t BitAllocator::alloc_blocks_dis_work(int64_t num_blocks, int64_t min_alloc, + int64_t hint, ExtentList *block_list, bool reserved) { int scans = 1; int64_t allocated = 0; @@ -1436,7 +1438,7 @@ int64_t BitAllocator::alloc_blocks_dis_work(int64_t num_blocks, int64_t min_allo } while (scans && allocated < num_blocks) { - allocated += alloc_blocks_dis_int(false, num_blocks - allocated, min_alloc, hint + allocated, blk_off, block_list); + allocated += alloc_blocks_dis_int(num_blocks - allocated, min_alloc, hint + allocated, blk_off, block_list); scans--; } @@ -1450,7 +1452,7 @@ int64_t BitAllocator::alloc_blocks_dis_work(int64_t num_blocks, int64_t min_allo unlock(); lock_excl(); serial_lock(); - allocated += alloc_blocks_dis_int(false, num_blocks - allocated, min_alloc, hint + allocated, + allocated += alloc_blocks_dis_int(num_blocks - allocated, min_alloc, hint + allocated, blk_off, block_list); if (is_stats_on()) { m_stats->add_serial_scans(1); diff --git a/src/os/bluestore/BitAllocator.h b/src/os/bluestore/BitAllocator.h index 682a40cba2c..2be2c4e3997 100644 --- a/src/os/bluestore/BitAllocator.h +++ b/src/os/bluestore/BitAllocator.h @@ -244,16 +244,12 @@ public: virtual void shutdown() = 0; - virtual int64_t alloc_blocks_dis(bool wait, int64_t num_blocks, int64_t min_alloc, - int64_t hint, int64_t blk_off, ExtentList *block_list) { - ceph_abort(); - return 0; - } virtual int64_t alloc_blocks_dis(int64_t num_blocks, int64_t min_alloc, int64_t hint, int64_t blk_off, ExtentList *block_list) { ceph_abort(); return 0; } + virtual void set_blocks_used(int64_t start_block, int64_t num_blocks) = 0; virtual void free_blocks(int64_t start_block, int64_t num_blocks) = 0; virtual int64_t size() = 0; @@ -358,12 +354,6 @@ public: ~BitMapZone(); void shutdown(); - - virtual int64_t alloc_blocks_dis(bool wait, int64_t num_blocks, int64_t min_alloc, - int64_t hint, int64_t blk_off, int64_t *block_list) { - ceph_abort(); - return 0; - } int64_t alloc_blocks_dis(int64_t num_blocks, int64_t min_alloc, int64_t hint, int64_t blk_off, ExtentList *block_list); void set_blocks_used(int64_t start_block, int64_t num_blocks); @@ -408,7 +398,7 @@ protected: void init(int64_t total_blocks, int64_t zone_size_block, bool def); void init_common(int64_t total_blocks, int64_t zone_size_block, bool def); - int64_t alloc_blocks_dis_int_work(bool wait, bool wrap, int64_t num_blocks, int64_t min_alloc, int64_t hint, + int64_t alloc_blocks_dis_int_work(bool wrap, int64_t num_blocks, int64_t min_alloc, int64_t hint, int64_t blk_off, ExtentList *block_list); public: @@ -430,9 +420,9 @@ public: } using BitMapArea::alloc_blocks_dis; //non-wait version - virtual int64_t alloc_blocks_dis_int(bool wait, int64_t num_blocks, int64_t min_alloc, int64_t hint, + virtual int64_t alloc_blocks_dis_int(int64_t num_blocks, int64_t min_alloc, int64_t hint, int64_t blk_off, ExtentList *block_list); - virtual int64_t alloc_blocks_dis(bool wait, int64_t num_blocks, int64_t min_alloc, int64_t hint, + virtual int64_t alloc_blocks_dis(int64_t num_blocks, int64_t min_alloc, int64_t hint, int64_t blk_off, ExtentList *block_list); virtual void set_blocks_used_int(int64_t start_block, int64_t num_blocks); virtual void set_blocks_used(int64_t start_block, int64_t num_blocks); @@ -464,8 +454,8 @@ public: bool child_check_n_lock(BitMapArea *child, int64_t required, bool lock); void child_unlock(BitMapArea *child); - int64_t alloc_blocks_int(bool wait, int64_t num_blocks, int64_t hint, int64_t *start_block); - int64_t alloc_blocks_dis_int(bool wait, int64_t num_blocks, int64_t min_alloc, int64_t hint, + int64_t alloc_blocks_int(int64_t num_blocks, int64_t hint, int64_t *start_block); + int64_t alloc_blocks_dis_int(int64_t num_blocks, int64_t min_alloc, int64_t hint, int64_t blk_off, ExtentList *block_list); void free_blocks_int(int64_t start_block, int64_t num_blocks); @@ -507,7 +497,7 @@ private: bmap_alloc_mode_t mode, bool def, bool stats_on); int64_t alloc_blocks_dis_work(int64_t num_blocks, int64_t min_alloc, int64_t hint, ExtentList *block_list, bool reserved); - int64_t alloc_blocks_dis_int(bool wait, int64_t num_blocks, int64_t min_alloc, + int64_t alloc_blocks_dis_int(int64_t num_blocks, int64_t min_alloc, int64_t hint, int64_t area_blk_off, ExtentList *block_list); public: -- 2.39.5