From: Igor Fedotov Date: Wed, 7 Feb 2018 18:18:34 +0000 (+0300) Subject: os/bluestore: kill AllocExtent[Vector] to simplify code a bit X-Git-Tag: v13.0.2~290^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e0cd948298ce8a7416315e3aa4777935e0290b73;p=ceph.git os/bluestore: kill AllocExtent[Vector] to simplify code a bit Signed-off-by: Igor Fedotov --- diff --git a/src/os/bluestore/Allocator.h b/src/os/bluestore/Allocator.h index de9eb6c0ea1d9..e12fe88b7aed5 100644 --- a/src/os/bluestore/Allocator.h +++ b/src/os/bluestore/Allocator.h @@ -34,10 +34,10 @@ public: */ virtual int64_t allocate(uint64_t want_size, uint64_t alloc_unit, uint64_t max_alloc_size, int64_t hint, - AllocExtentVector *extents) = 0; + PExtentVector *extents) = 0; int64_t allocate(uint64_t want_size, uint64_t alloc_unit, - int64_t hint, AllocExtentVector *extents) { + int64_t hint, PExtentVector *extents) { return allocate(want_size, alloc_unit, want_size, hint, extents); } diff --git a/src/os/bluestore/BitMapAllocator.cc b/src/os/bluestore/BitMapAllocator.cc index 46dc939eaecf7..9c07648b5f453 100644 --- a/src/os/bluestore/BitMapAllocator.cc +++ b/src/os/bluestore/BitMapAllocator.cc @@ -111,7 +111,7 @@ void BitMapAllocator::unreserve(uint64_t unused) int64_t BitMapAllocator::allocate( uint64_t want_size, uint64_t alloc_unit, uint64_t max_alloc_size, - int64_t hint, mempool::bluestore_alloc::vector *extents) + int64_t hint, PExtentVector *extents) { assert(!(alloc_unit % m_block_size)); @@ -131,7 +131,7 @@ int64_t BitMapAllocator::allocate( int64_t BitMapAllocator::allocate_dis( uint64_t want_size, uint64_t alloc_unit, uint64_t max_alloc_size, - int64_t hint, mempool::bluestore_alloc::vector *extents) + int64_t hint, PExtentVector *extents) { ExtentList block_list = ExtentList(extents, m_block_size, max_alloc_size); int64_t nblks = (want_size + m_block_size - 1) / m_block_size; diff --git a/src/os/bluestore/BitMapAllocator.h b/src/os/bluestore/BitMapAllocator.h index b9a51714e880d..7a1d84e6dfc5d 100644 --- a/src/os/bluestore/BitMapAllocator.h +++ b/src/os/bluestore/BitMapAllocator.h @@ -21,7 +21,7 @@ class BitMapAllocator : public Allocator { int64_t allocate_dis( uint64_t want_size, uint64_t alloc_unit, uint64_t max_alloc_size, - int64_t hint, mempool::bluestore_alloc::vector *extents); + int64_t hint, PExtentVector *extents); public: BitMapAllocator(CephContext* cct, int64_t device_size, int64_t block_size); @@ -32,7 +32,7 @@ public: int64_t allocate( uint64_t want_size, uint64_t alloc_unit, uint64_t max_alloc_size, - int64_t hint, mempool::bluestore_alloc::vector *extents) override; + int64_t hint, PExtentVector *extents) override; void release( const interval_set& release_set) override; diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index 2e7c13c7c0f29..5c3c2e0bac1a7 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -184,7 +184,7 @@ void BlueFS::add_block_extent(unsigned id, uint64_t offset, uint64_t length) } int BlueFS::reclaim_blocks(unsigned id, uint64_t want, - AllocExtentVector *extents) + PExtentVector *extents) { std::unique_lock l(lock); dout(1) << __func__ << " bdev " << id @@ -1935,7 +1935,7 @@ int BlueFS::_allocate(uint8_t id, uint64_t len, uint64_t left = round_up_to(len, min_alloc_size); int r = -ENOSPC; int64_t alloc_len = 0; - AllocExtentVector extents; + PExtentVector extents; if (alloc[id]) { r = alloc[id]->reserve(left); diff --git a/src/os/bluestore/BlueFS.h b/src/os/bluestore/BlueFS.h index 36ce36e59b5bf..78f5e8b3274e9 100644 --- a/src/os/bluestore/BlueFS.h +++ b/src/os/bluestore/BlueFS.h @@ -403,7 +403,7 @@ public: /// reclaim block space int reclaim_blocks(unsigned bdev, uint64_t want, - AllocExtentVector *extents); + PExtentVector *extents); void flush(FileWriter *h) { std::lock_guard l(lock); diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index cabaf1f8d466b..bd38f32cb1bd1 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -5094,9 +5094,8 @@ int BlueStore::_balance_bluefs_freespace(PExtentVector *extents) int r = alloc->reserve(gift); assert(r == 0); - AllocExtentVector exts; int64_t alloc_len = alloc->allocate(gift, cct->_conf->bluefs_alloc_size, - 0, 0, &exts); + 0, 0, extents); if (alloc_len <= 0) { dout(1) << __func__ << " no allocate on 0x" << std::hex << gift @@ -5112,10 +5111,8 @@ int BlueStore::_balance_bluefs_freespace(PExtentVector *extents) alloc->unreserve(gift - alloc_len); alloc->dump(); } - for (auto& p : exts) { - bluestore_pextent_t e = bluestore_pextent_t(p); + for (auto& e : *extents) { dout(1) << __func__ << " gifting " << e << " to bluefs" << dendl; - extents->push_back(e); } ret = 1; } @@ -5132,7 +5129,7 @@ int BlueStore::_balance_bluefs_freespace(PExtentVector *extents) while (reclaim > 0) { // NOTE: this will block and do IO. - AllocExtentVector extents; + PExtentVector extents; int r = bluefs->reclaim_blocks(bluefs_shared_bdev, reclaim, &extents); if (r < 0) { @@ -10104,7 +10101,7 @@ int BlueStore::_do_alloc_write( << dendl; return r; } - AllocExtentVector prealloc; + PExtentVector prealloc; prealloc.reserve(2 * wctx->writes.size());; int prealloc_left = 0; prealloc_left = alloc->allocate( @@ -10161,7 +10158,7 @@ int BlueStore::_do_alloc_write( } } - AllocExtentVector extents; + PExtentVector extents; int64_t left = final_length; while (left > 0) { assert(prealloc_left > 0); diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index 6656f3c47a68f..1f6550454743d 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -937,7 +937,7 @@ public: uint64_t min_alloc_size); /// return a collection of extents to perform GC on - const vector& get_extents_to_collect() const { + const vector& get_extents_to_collect() const { return extents_to_collect; } GarbageCollector(CephContext* _cct) : cct(_cct) {} @@ -967,8 +967,8 @@ public: ///< copies that are affected by the ///< specific write - vector extents_to_collect; ///< protrusive extents that should - ///< be collected if GC takes place + ///< protrusive extents that should be collected if GC takes place + vector extents_to_collect; boost::optional used_alloc_unit; ///< last processed allocation ///< unit when traversing diff --git a/src/os/bluestore/StupidAllocator.cc b/src/os/bluestore/StupidAllocator.cc index 39f31e0e09bba..f8ef54eb7c897 100644 --- a/src/os/bluestore/StupidAllocator.cc +++ b/src/os/bluestore/StupidAllocator.cc @@ -208,7 +208,7 @@ int64_t StupidAllocator::allocate( uint64_t alloc_unit, uint64_t max_alloc_size, int64_t hint, - mempool::bluestore_alloc::vector *extents) + PExtentVector *extents) { uint64_t allocated_size = 0; uint64_t offset = 0; diff --git a/src/os/bluestore/StupidAllocator.h b/src/os/bluestore/StupidAllocator.h index ccf0f0ec14b60..e3d86531f3f86 100644 --- a/src/os/bluestore/StupidAllocator.h +++ b/src/os/bluestore/StupidAllocator.h @@ -43,7 +43,7 @@ public: int64_t allocate( uint64_t want_size, uint64_t alloc_unit, uint64_t max_alloc_size, - int64_t hint, mempool::bluestore_alloc::vector *extents) override; + int64_t hint, PExtentVector *extents) override; int64_t allocate_int( uint64_t want_size, uint64_t alloc_unit, int64_t hint, diff --git a/src/os/bluestore/bluefs_types.h b/src/os/bluestore/bluefs_types.h index c78c782575a0a..e7585bb176368 100644 --- a/src/os/bluestore/bluefs_types.h +++ b/src/os/bluestore/bluefs_types.h @@ -8,13 +8,16 @@ #include "include/encoding.h" #include "include/denc.h" -class bluefs_extent_t : public AllocExtent{ +class bluefs_extent_t { public: uint8_t bdev; + uint64_t offset = 0; + uint32_t length = 0; bluefs_extent_t(uint8_t b = 0, uint64_t o = 0, uint32_t l = 0) - : AllocExtent(o, l), bdev(b) {} + : bdev(b), offset(o), length(l) {} + uint64_t end() const { return offset + length; } DENC(bluefs_extent_t, v, p) { DENC_START(1, 1, p); denc_lba(v.offset, p); diff --git a/src/os/bluestore/bluestore_types.cc b/src/os/bluestore/bluestore_types.cc index 09a7677c1e74b..32bcfa8db3954 100644 --- a/src/os/bluestore/bluestore_types.cc +++ b/src/os/bluestore/bluestore_types.cc @@ -18,7 +18,7 @@ #include "include/stringify.h" void ExtentList::add_extents(int64_t start, int64_t count) { - AllocExtent *last_extent = NULL; + bluestore_pextent_t *last_extent = NULL; bool can_merge = false; if (!m_extents->empty()) { @@ -34,7 +34,7 @@ void ExtentList::add_extents(int64_t start, int64_t count) { if (can_merge) { last_extent->length += (count * m_block_size); } else { - m_extents->emplace_back(AllocExtent(start * m_block_size, + m_extents->emplace_back(bluestore_pextent_t(start * m_block_size, count * m_block_size)); } } @@ -762,7 +762,7 @@ int bluestore_blob_t::verify_csum(uint64_t b_off, const bufferlist& bl, return 0; } -void bluestore_blob_t::allocated(uint32_t b_off, uint32_t length, const AllocExtentVector& allocs) +void bluestore_blob_t::allocated(uint32_t b_off, uint32_t length, const PExtentVector& allocs) { if (extents.size() == 0) { // if blob is compressed then logical length to be already configured @@ -774,6 +774,7 @@ void bluestore_blob_t::allocated(uint32_t b_off, uint32_t length, const AllocExt if (b_off) { extents.emplace_back( bluestore_pextent_t(bluestore_pextent_t::INVALID_OFFSET, b_off)); + } uint32_t new_len = b_off; for (auto& a : allocs) { @@ -854,7 +855,8 @@ struct vecbuilder { void flush() { if (invalid) { v.emplace_back(bluestore_pextent_t(bluestore_pextent_t::INVALID_OFFSET, - invalid)); + invalid)); + invalid = 0; } } @@ -864,7 +866,7 @@ struct vecbuilder { } else { flush(); - v.emplace_back(bluestore_pextent_t(offset, length)); + v.emplace_back(offset, length); } } }; diff --git a/src/os/bluestore/bluestore_types.h b/src/os/bluestore/bluestore_types.h index ece69413b1955..b7df3db81abf4 100644 --- a/src/os/bluestore/bluestore_types.h +++ b/src/os/bluestore/bluestore_types.h @@ -64,92 +64,27 @@ struct bluestore_cnode_t { }; WRITE_CLASS_DENC(bluestore_cnode_t) -class AllocExtent; -typedef mempool::bluestore_alloc::vector AllocExtentVector; -class AllocExtent { -public: - uint64_t offset; - uint32_t length; - - AllocExtent() { - offset = 0; - length = 0; - } - - AllocExtent(int64_t off, int32_t len) : offset(off), length(len) { } - uint64_t end() const { - return offset + length; - } - bool operator==(const AllocExtent& other) const { - return offset == other.offset && length == other.length; - } -}; - -inline static ostream& operator<<(ostream& out, const AllocExtent& e) { - return out << "0x" << std::hex << e.offset << "~" << e.length << std::dec; -} - -class ExtentList { - AllocExtentVector *m_extents; - int64_t m_block_size; - int64_t m_max_blocks; - -public: - void init(AllocExtentVector *extents, int64_t block_size, - uint64_t max_alloc_size) { - m_extents = extents; - m_block_size = block_size; - m_max_blocks = max_alloc_size / block_size; - assert(m_extents->empty()); - } - - ExtentList(AllocExtentVector *extents, int64_t block_size) { - init(extents, block_size, 0); - } - - ExtentList(AllocExtentVector *extents, int64_t block_size, - uint64_t max_alloc_size) { - init(extents, block_size, max_alloc_size); - } +/// pextent: physical extent +struct bluestore_pextent_t { + static const uint64_t INVALID_OFFSET = ~0ull; - void reset() { - m_extents->clear(); - } + uint64_t offset = 0; + uint32_t length = 0; - void add_extents(int64_t start, int64_t count); + bluestore_pextent_t() {} + bluestore_pextent_t(uint64_t o, uint64_t l) : offset(o), length(l) {} + bluestore_pextent_t(const bluestore_pextent_t &ext) : + offset(ext.offset), length(ext.length) {} - AllocExtentVector *get_extents() { - return m_extents; + bool is_valid() const { + return offset != INVALID_OFFSET; } - - std::pair get_nth_extent(int index) { - return std::make_pair - ((*m_extents)[index].offset / m_block_size, - (*m_extents)[index].length / m_block_size); + uint64_t end() const { + return offset != INVALID_OFFSET ? offset + length : INVALID_OFFSET; } - int64_t get_extent_count() { - return m_extents->size(); - } -}; - - -/// pextent: physical extent -struct bluestore_pextent_t : public AllocExtent { - const static uint64_t INVALID_OFFSET = ~0ull; - - bluestore_pextent_t() : AllocExtent() {} - bluestore_pextent_t(uint64_t o, uint64_t l) : AllocExtent(o, l) {} - bluestore_pextent_t(const AllocExtent &ext) : - AllocExtent(ext.offset, ext.length) { } - - bluestore_pextent_t& operator=(const AllocExtent &ext) { - offset = ext.offset; - length = ext.length; - return *this; - } - bool is_valid() const { - return offset != INVALID_OFFSET; + bool operator==(const bluestore_pextent_t& other) const { + return offset == other.offset && length == other.length; } DENC(bluestore_pextent_t, v, p) { @@ -200,6 +135,50 @@ struct denc_traits { }; +class ExtentList { + PExtentVector *m_extents; + int64_t m_block_size; + int64_t m_max_blocks; + +public: + void init(PExtentVector *extents, int64_t block_size, + uint64_t max_alloc_size) { + m_extents = extents; + m_block_size = block_size; + m_max_blocks = max_alloc_size / block_size; + assert(m_extents->empty()); + } + + ExtentList(PExtentVector *extents, int64_t block_size) { + init(extents, block_size, 0); + } + + ExtentList(PExtentVector *extents, int64_t block_size, + uint64_t max_alloc_size) { + init(extents, block_size, max_alloc_size); + } + + void reset() { + m_extents->clear(); + } + + void add_extents(int64_t start, int64_t count); + + PExtentVector *get_extents() { + return m_extents; + } + + std::pair get_nth_extent(int index) { + return std::make_pair + ((*m_extents)[index].offset / m_block_size, + (*m_extents)[index].length / m_block_size); + } + + int64_t get_extent_count() { + return m_extents->size(); + } +}; + /// extent_map: a map of reference counted extents struct bluestore_extent_ref_map_t { struct record_t { @@ -893,7 +872,7 @@ public: } void split(uint32_t blob_offset, bluestore_blob_t& rb); - void allocated(uint32_t b_off, uint32_t length, const AllocExtentVector& allocs); + void allocated(uint32_t b_off, uint32_t length, const PExtentVector& allocs); void allocated_test(const bluestore_pextent_t& alloc); // intended for UT only /// updates blob's pextents container and return unused pextents eligible diff --git a/src/test/objectstore/Allocator_test.cc b/src/test/objectstore/Allocator_test.cc index a52fd53c3c6ba..66a5567238a4c 100644 --- a/src/test/objectstore/Allocator_test.cc +++ b/src/test/objectstore/Allocator_test.cc @@ -58,7 +58,7 @@ TEST_P(AllocTest, test_alloc_min_alloc) init_alloc(blocks, block_size); alloc->init_add_free(block_size, block_size); EXPECT_EQ(alloc->reserve(block_size), 0); - AllocExtentVector extents; + PExtentVector extents; EXPECT_EQ(block_size, alloc->allocate(block_size, block_size, 0, (int64_t) 0, &extents)); } @@ -69,7 +69,7 @@ TEST_P(AllocTest, test_alloc_min_alloc) { alloc->init_add_free(0, block_size * 4); EXPECT_EQ(alloc->reserve(block_size * 4), 0); - AllocExtentVector extents; + PExtentVector extents; EXPECT_EQ(4*block_size, alloc->allocate(4 * (uint64_t)block_size, (uint64_t) block_size, 0, (int64_t) 0, &extents)); @@ -84,7 +84,7 @@ TEST_P(AllocTest, test_alloc_min_alloc) alloc->init_add_free(0, block_size * 2); alloc->init_add_free(3 * block_size, block_size * 2); EXPECT_EQ(alloc->reserve(block_size * 4), 0); - AllocExtentVector extents; + PExtentVector extents; EXPECT_EQ(4*block_size, alloc->allocate(4 * (uint64_t)block_size, (uint64_t) block_size, @@ -110,7 +110,7 @@ TEST_P(AllocTest, test_alloc_min_max_alloc) { alloc->init_add_free(0, block_size * 4); EXPECT_EQ(alloc->reserve(block_size * 4), 0); - AllocExtentVector extents; + PExtentVector extents; EXPECT_EQ(4*block_size, alloc->allocate(4 * (uint64_t)block_size, (uint64_t) block_size, block_size, (int64_t) 0, &extents)); @@ -128,7 +128,7 @@ TEST_P(AllocTest, test_alloc_min_max_alloc) { alloc->init_add_free(0, block_size * 4); EXPECT_EQ(alloc->reserve(block_size * 4), 0); - AllocExtentVector extents; + PExtentVector extents; EXPECT_EQ(4*block_size, alloc->allocate(4 * (uint64_t)block_size, (uint64_t) block_size, 2 * block_size, (int64_t) 0, &extents)); @@ -144,7 +144,7 @@ TEST_P(AllocTest, test_alloc_min_max_alloc) { alloc->init_add_free(0, block_size * 1024); EXPECT_EQ(alloc->reserve(block_size * 1024), 0); - AllocExtentVector extents; + PExtentVector extents; EXPECT_EQ(1024 * block_size, alloc->allocate(1024 * (uint64_t)block_size, (uint64_t) block_size * 4, @@ -161,7 +161,7 @@ TEST_P(AllocTest, test_alloc_min_max_alloc) { alloc->init_add_free(0, block_size * 16); EXPECT_EQ(alloc->reserve(block_size * 16), 0); - AllocExtentVector extents; + PExtentVector extents; EXPECT_EQ(16 * block_size, alloc->allocate(16 * (uint64_t)block_size, (uint64_t) block_size, 2 * block_size, (int64_t) 0, &extents)); @@ -184,7 +184,7 @@ TEST_P(AllocTest, test_alloc_failure) alloc->init_add_free(block_size * 512, block_size * 256); EXPECT_EQ(alloc->reserve(block_size * 512), 0); - AllocExtentVector extents; + PExtentVector extents; EXPECT_EQ(512 * block_size, alloc->allocate(512 * (uint64_t)block_size, (uint64_t) block_size * 256, @@ -210,7 +210,7 @@ TEST_P(AllocTest, test_alloc_big) for (int64_t big = mas; big < 1048576*128; big*=2) { cout << big << std::endl; EXPECT_EQ(alloc->reserve(big), 0); - AllocExtentVector extents; + PExtentVector extents; EXPECT_EQ(big, alloc->allocate(big, mas, 0, &extents)); } @@ -230,7 +230,7 @@ TEST_P(AllocTest, test_alloc_hint_bmap) init_alloc(blocks, 1); alloc->init_add_free(0, blocks); - AllocExtentVector extents; + PExtentVector extents; alloc->reserve(blocks); allocated = alloc->allocate(1, 1, 1, zone_size, &extents); @@ -286,7 +286,7 @@ TEST_P(AllocTest, test_alloc_non_aligned_len) alloc->init_add_free(3670016, 2097152); EXPECT_EQ(0, alloc->reserve(want_size)); - AllocExtentVector extents; + PExtentVector extents; EXPECT_EQ(want_size, alloc->allocate(want_size, alloc_unit, 0, &extents)); } diff --git a/src/test/objectstore/BitAllocator_test.cc b/src/test/objectstore/BitAllocator_test.cc index 3b8168ef34c71..8858885583de2 100644 --- a/src/test/objectstore/BitAllocator_test.cc +++ b/src/test/objectstore/BitAllocator_test.cc @@ -283,7 +283,7 @@ TEST(BitAllocator, test_zone_alloc) bmap_test_assert(lock); int64_t blk_size = 1024; - AllocExtentVector extents; + PExtentVector extents; std::unique_ptr block_list = std::make_unique(&extents, blk_size); allocated = zone->alloc_blocks_dis(zone->size() / 2, 1, 0, 0, block_list.get()); bmap_test_assert(allocated == zone->size() / 2); @@ -291,7 +291,7 @@ TEST(BitAllocator, test_zone_alloc) { int64_t blk_size = 1024; - AllocExtentVector extents; + PExtentVector extents; std::unique_ptr block_list = std::make_unique(&extents, blk_size); zone = std::make_unique(g_ceph_context, total_blocks, 0); @@ -314,7 +314,7 @@ TEST(BitAllocator, test_zone_alloc) */ { int64_t blk_size = 1; - AllocExtentVector extents; + PExtentVector extents; for (int i = 1; i <= total_blocks - BmapEntry::size(); i = i << 1) { for (int64_t j = 0; j <= BmapEntry::size(); j = 1 << j) { @@ -425,7 +425,7 @@ TEST(BitAllocator, test_bmap_alloc) for (int64_t iter = 0; iter < max_iter; iter++) { for (int64_t j = 0; alloc_size <= total_blocks; j++) { int64_t blk_size = 1024; - AllocExtentVector extents; + PExtentVector extents; std::unique_ptr block_list = std::make_unique(&extents, blk_size, alloc_size); for (int64_t i = 0; i < total_blocks; i += alloc_size) { bmap_test_assert(alloc->reserve_blocks(alloc_size) == true); @@ -447,7 +447,7 @@ TEST(BitAllocator, test_bmap_alloc) } int64_t blk_size = 1024; - AllocExtentVector extents; + PExtentVector extents; ExtentList *block_list = new ExtentList(&extents, blk_size); @@ -488,7 +488,7 @@ bool alloc_extents_max_block(BitAllocator *alloc, int64_t allocated = 0; int64_t verified = 0; int64_t count = 0; - AllocExtentVector extents; + PExtentVector extents; std::unique_ptr block_list = std::make_unique(&extents, blk_size, max_alloc); @@ -533,7 +533,7 @@ do_work_dis(BitAllocator *alloc) int64_t alloced = 0; int64_t num_blocks = alloc->size() / NUM_THREADS; - AllocExtentVector extents; + PExtentVector extents; std::unique_ptr block_list = std::make_unique(&extents, 4096); while (num_iters--) { diff --git a/src/test/objectstore/test_bluestore_types.cc b/src/test/objectstore/test_bluestore_types.cc index f16f8452c4c55..3aad5f6840849 100644 --- a/src/test/objectstore/test_bluestore_types.cc +++ b/src/test/objectstore/test_bluestore_types.cc @@ -1242,7 +1242,7 @@ TEST(GarbageCollector, BasicTest) ASSERT_EQ(saving, 1); auto& to_collect = gc.get_extents_to_collect(); ASSERT_EQ(to_collect.size(), 1u); - ASSERT_EQ(to_collect[0], AllocExtent(100,10) ); + ASSERT_EQ(to_collect[0], bluestore_pextent_t(100,10) ); em.clear(); old_extents.clear(); @@ -1312,10 +1312,10 @@ TEST(GarbageCollector, BasicTest) ASSERT_EQ(saving, 2); auto& to_collect = gc.get_extents_to_collect(); ASSERT_EQ(to_collect.size(), 2u); - ASSERT_TRUE(to_collect[0] == AllocExtent(0x0,0x8000) || - to_collect[1] == AllocExtent(0x0,0x8000)); - ASSERT_TRUE(to_collect[0] == AllocExtent(0x3f000,0x1000) || - to_collect[1] == AllocExtent(0x3f000,0x1000)); + ASSERT_TRUE(to_collect[0] == bluestore_pextent_t(0x0,0x8000) || + to_collect[1] == bluestore_pextent_t(0x0,0x8000)); + ASSERT_TRUE(to_collect[0] == bluestore_pextent_t(0x3f000,0x1000) || + to_collect[1] == bluestore_pextent_t(0x3f000,0x1000)); em.clear(); old_extents.clear(); @@ -1433,10 +1433,10 @@ TEST(GarbageCollector, BasicTest) ASSERT_EQ(saving, 2); auto& to_collect = gc.get_extents_to_collect(); ASSERT_EQ(to_collect.size(), 2u); - ASSERT_TRUE(to_collect[0] == AllocExtent(0x0,0x8000) || - to_collect[1] == AllocExtent(0x0,0x8000)); - ASSERT_TRUE(to_collect[0] == AllocExtent(0x3f000,0x1000) || - to_collect[1] == AllocExtent(0x3f000,0x1000)); + ASSERT_TRUE(to_collect[0] == bluestore_pextent_t(0x0,0x8000) || + to_collect[1] == bluestore_pextent_t(0x0,0x8000)); + ASSERT_TRUE(to_collect[0] == bluestore_pextent_t(0x3f000,0x1000) || + to_collect[1] == bluestore_pextent_t(0x3f000,0x1000)); em.clear(); old_extents.clear();