Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / os / bluestore / Allocator.cc
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3
4 #include "Allocator.h"
5 #include "StupidAllocator.h"
6 #include "BitMapAllocator.h"
7 #include "common/debug.h"
8
9 #define dout_subsys ceph_subsys_bluestore
10
11 Allocator *Allocator::create(CephContext* cct, string type,
12                              int64_t size, int64_t block_size)
13 {
14   if (type == "stupid") {
15     return new StupidAllocator(cct);
16   } else if (type == "bitmap") {
17     return new BitMapAllocator(cct, size, block_size);
18   }
19   lderr(cct) << "Allocator::" << __func__ << " unknown alloc type "
20              << type << dendl;
21   return nullptr;
22 }