]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: kill AllocExtent[Vector] to simplify code a bit
authorIgor Fedotov <ifedotov@suse.com>
Wed, 7 Feb 2018 18:18:34 +0000 (21:18 +0300)
committerIgor Fedotov <ifedotov@suse.com>
Fri, 9 Feb 2018 15:46:21 +0000 (18:46 +0300)
Signed-off-by: Igor Fedotov <ifedotov@suse.com>
15 files changed:
src/os/bluestore/Allocator.h
src/os/bluestore/BitMapAllocator.cc
src/os/bluestore/BitMapAllocator.h
src/os/bluestore/BlueFS.cc
src/os/bluestore/BlueFS.h
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h
src/os/bluestore/StupidAllocator.cc
src/os/bluestore/StupidAllocator.h
src/os/bluestore/bluefs_types.h
src/os/bluestore/bluestore_types.cc
src/os/bluestore/bluestore_types.h
src/test/objectstore/Allocator_test.cc
src/test/objectstore/BitAllocator_test.cc
src/test/objectstore/test_bluestore_types.cc

index de9eb6c0ea1d9a769d35ca03c76e5ec0dd457e88..e12fe88b7aed52e93401c0515d2201487f022ca7 100644 (file)
@@ -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);
   }
 
index 46dc939eaecf759760d7134e3f95db5dd610d59b..9c07648b5f453cfac7fd040a3d69a6c9cf4fdb66 100644 (file)
@@ -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<AllocExtent> *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<AllocExtent> *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;
index b9a51714e880da7e0424a05f30ee406fd3235246..7a1d84e6dfc5d48e54b1d3a386eceaa46d062cf3 100644 (file)
@@ -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<AllocExtent> *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<AllocExtent> *extents) override;
+    int64_t hint, PExtentVector *extents) override;
 
   void release(
     const interval_set<uint64_t>& release_set) override;
index 2e7c13c7c0f29f28b6fc4e4e700c2a3785124529..5c3c2e0bac1a768a53f103880f93b68460443fdc 100644 (file)
@@ -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<std::mutex> 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);
index 36ce36e59b5bf6e0d313f7f227ab5f112a985f11..78f5e8b3274e902d596e8e1dfb2995171d417394 100644 (file)
@@ -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<std::mutex> l(lock);
index cabaf1f8d466b85b46fd462e7c54835e722c27a5..bd38f32cb1bd16d36b71755220154ba9151218cb 100644 (file)
@@ -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);
index 6656f3c47a68f1785fe70a90c135b8ed0773f034..1f6550454743dcf3a8222d174aad1f2a28a4aacf 100644 (file)
@@ -937,7 +937,7 @@ public:
       uint64_t min_alloc_size);
 
     /// return a collection of extents to perform GC on
-    const vector<AllocExtent>& get_extents_to_collect() const {
+    const vector<bluestore_pextent_t>& 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<AllocExtent> extents_to_collect; ///< protrusive extents that should
-                                            ///< be collected if GC takes place
+    ///< protrusive extents that should be collected if GC takes place
+    vector<bluestore_pextent_t> extents_to_collect;
 
     boost::optional<uint64_t > used_alloc_unit; ///< last processed allocation
                                                 ///<  unit when traversing 
index 39f31e0e09bba8ff6f81b9327a5ee9414f4be037..f8ef54eb7c8972827b28fec6ec620ee8ee122b7f 100644 (file)
@@ -208,7 +208,7 @@ int64_t StupidAllocator::allocate(
   uint64_t alloc_unit,
   uint64_t max_alloc_size,
   int64_t hint,
-  mempool::bluestore_alloc::vector<AllocExtent> *extents)
+  PExtentVector *extents)
 {
   uint64_t allocated_size = 0;
   uint64_t offset = 0;
index ccf0f0ec14b60b391003c326cff80cd18976738b..e3d86531f3f867f9e50b584eee9a6154f40e5932 100644 (file)
@@ -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<AllocExtent> *extents) override;
+    int64_t hint, PExtentVector *extents) override;
 
   int64_t allocate_int(
     uint64_t want_size, uint64_t alloc_unit, int64_t hint,
index c78c782575a0a089a912feccd0cfb00bc73a7b5a..e7585bb176368d3a9f50e4e6ccb84bdd2e749e0e 100644 (file)
@@ -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);
index 09a7677c1e74b5727da1b2a9cf5416f1f114b0fb..32bcfa8db39548c581c52e2348f20c571e026db3 100644 (file)
@@ -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);
     }
   }
 };
index ece69413b1955781d4c74054ebd3e819410ebd97..b7df3db81abf4783b0ba617fc2f0e1510531d50a 100644 (file)
@@ -64,92 +64,27 @@ struct bluestore_cnode_t {
 };
 WRITE_CLASS_DENC(bluestore_cnode_t)
 
-class AllocExtent;
-typedef mempool::bluestore_alloc::vector<AllocExtent> 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<int64_t, int64_t> 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<PExtentVector> {
 };
 
 
+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<int64_t, int64_t> 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
index a52fd53c3c6ba5d80a9d7809fa0af94bb6fa965e..66a5567238a4cd15c486919b3ac663fcfa817413 100644 (file)
@@ -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));
 }
 
index 3b8168ef34c713efc9611fd91aa751b56bee82f1..8858885583de20b1267c57c15516c297f25cfecb 100644 (file)
@@ -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<ExtentList> block_list = std::make_unique<ExtentList>(&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<ExtentList> block_list = std::make_unique<ExtentList>(&extents, blk_size);
 
     zone = std::make_unique<BitMapZone>(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<ExtentList> block_list = std::make_unique<ExtentList>(&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<ExtentList> block_list = std::make_unique<ExtentList>(&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<ExtentList> block_list = std::make_unique<ExtentList>(&extents, 4096);
 
   while (num_iters--) {
index f16f8452c4c55bf27d75cd716b49230691417a43..3aad5f68408490668b178dfacf7a4695b863876e 100644 (file)
@@ -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();