X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Fos%2Fbluestore%2FAllocator.cc;fp=src%2Fceph%2Fsrc%2Fos%2Fbluestore%2FAllocator.cc;h=8a4101eae2d817859debb0137ac1623cfd3fbe4e;hb=812ff6ca9fcd3e629e49d4328905f33eee8ca3f5;hp=0000000000000000000000000000000000000000;hpb=15280273faafb77777eab341909a3f495cf248d9;p=stor4nfv.git diff --git a/src/ceph/src/os/bluestore/Allocator.cc b/src/ceph/src/os/bluestore/Allocator.cc new file mode 100644 index 0000000..8a4101e --- /dev/null +++ b/src/ceph/src/os/bluestore/Allocator.cc @@ -0,0 +1,22 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab + +#include "Allocator.h" +#include "StupidAllocator.h" +#include "BitMapAllocator.h" +#include "common/debug.h" + +#define dout_subsys ceph_subsys_bluestore + +Allocator *Allocator::create(CephContext* cct, string type, + int64_t size, int64_t block_size) +{ + if (type == "stupid") { + return new StupidAllocator(cct); + } else if (type == "bitmap") { + return new BitMapAllocator(cct, size, block_size); + } + lderr(cct) << "Allocator::" << __func__ << " unknown alloc type " + << type << dendl; + return nullptr; +}