]>
git.proxmox.com Git - ceph.git/blob - 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
5 #include "StupidAllocator.h"
6 #include "BitmapAllocator.h"
7 #include "common/debug.h"
9 #define dout_subsys ceph_subsys_bluestore
11 Allocator
*Allocator::create(CephContext
* cct
, string type
,
12 int64_t size
, int64_t block_size
)
14 if (type
== "stupid") {
15 return new StupidAllocator(cct
);
16 } else if (type
== "bitmap") {
17 return new BitmapAllocator(cct
, size
, block_size
);
19 lderr(cct
) << "Allocator::" << __func__
<< " unknown alloc type "
24 void Allocator::release(const PExtentVector
& release_vec
)
26 interval_set
<uint64_t> release_set
;
27 for (auto e
: release_vec
) {
28 release_set
.insert(e
.offset
, e
.length
);