]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
correct allocation block size for bluestore and bluefs 9538/head
authorRamesh Chander <Ramesh.Chander@sandisk.com>
Tue, 7 Jun 2016 07:32:53 +0000 (00:32 -0700)
committerRamesh Chander <Ramesh.Chander@sandisk.com>
Thu, 9 Jun 2016 09:51:09 +0000 (02:51 -0700)
Signed-off-by: Ramesh Chander <Ramesh.Chander@sandisk.com>
src/os/bluestore/Allocator.cc
src/os/bluestore/Allocator.h
src/os/bluestore/BitMapAllocator.cc
src/os/bluestore/BitMapAllocator.h
src/os/bluestore/BlueFS.cc
src/os/bluestore/BlueStore.cc

index 034fca660e0b4190d4c0d251990e0b30848586aa..115bd0cfa44858e39c17f40ded0c831501407b37 100644 (file)
@@ -8,12 +8,13 @@
 
 #define dout_subsys ceph_subsys_bluestore
 
-Allocator *Allocator::create(string type, int64_t size)
+Allocator *Allocator::create(string type,
+                             int64_t size, int64_t block_size)
 {
   if (type == "stupid") {
     return new StupidAllocator;
   } else if (type == "bitmap") {
-    return new BitMapAllocator(size);
+    return new BitMapAllocator(size, block_size);
   }
   derr << "Allocator::" << __func__ << " unknown alloc type " << type << dendl;
   return NULL;
index 964a2aa5af1ad52f756bd4b5ff7085ce7550cd35..d951142d9ce423404d197f3dd309066993263f48 100644 (file)
@@ -43,7 +43,7 @@ public:
   virtual uint64_t get_free() = 0;
 
   virtual void shutdown() = 0;
-  static Allocator *create(string type, int64_t size);
+  static Allocator *create(string type, int64_t size, int64_t block_size);
 };
 
 #endif
index 57356704bec09bbaf30e762b91f59a28f1dcbd41..077ff875af5d8bb80d10cd1a97f86b0afb8f6058 100644 (file)
 #define dout_prefix *_dout << "bitmapalloc:"
 
 
-BitMapAllocator::BitMapAllocator(int64_t device_size)
+BitMapAllocator::BitMapAllocator(int64_t device_size, int64_t block_size)
   : m_num_uncommitted(0),
     m_num_committing(0)
 {
-  int64_t block_size = g_conf->bdev_block_size;
   int64_t zone_size_blks = 1024; // Change it later
 
   m_block_size = block_size;
index e5cd32b1645e2780f588e5c7699244dc9f1f1c15..cb6002527b46272004235f0c8372416a8b908373 100644 (file)
@@ -26,7 +26,7 @@ class BitMapAllocator : public Allocator {
 
 public:
   BitMapAllocator();
-  BitMapAllocator(int64_t device_size);
+  BitMapAllocator(int64_t device_size, int64_t block_size);
   ~BitMapAllocator();
 
   int reserve(uint64_t need);
index da0ff9a4c73c1394995455c5abc57d410c51f8a9..3a4610a4f08bf1232e3d792143b3bef699c422cd 100644 (file)
@@ -286,7 +286,9 @@ void BlueFS::_init_alloc()
       continue;
     }
     assert(bdev[id]->get_size());
-    alloc[id] = Allocator::create(g_conf->bluestore_allocator, bdev[id]->get_size());
+    alloc[id] = Allocator::create(g_conf->bluestore_allocator,
+                                  bdev[id]->get_size(),
+                                  g_conf->bluefs_alloc_size);
     interval_set<uint64_t>& p = block_all[id];
     for (interval_set<uint64_t>::iterator q = p.begin(); q != p.end(); ++q) {
       alloc[id]->init_add_free(q.get_start(), q.get_len());
index 149635124c1a4c447e62f7b3e28aa3ad99172702..c58779101feaf3540a89df759a560dd37ac156e2 100644 (file)
@@ -1416,7 +1416,9 @@ int BlueStore::_open_alloc()
 {
   assert(alloc == NULL);
   assert(bdev->get_size());
-  alloc = Allocator::create(g_conf->bluestore_allocator, bdev->get_size());
+  alloc = Allocator::create(g_conf->bluestore_allocator,
+                            bdev->get_size(),
+                            min_alloc_size);
   uint64_t num = 0, bytes = 0;
   fm->enumerate_reset();
   uint64_t offset, length;