]>
git.proxmox.com Git - ceph.git/blob - ceph/src/os/bluestore/HybridAllocator.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
8 #include "AvlAllocator.h"
9 #include "BitmapAllocator.h"
11 class HybridAllocator
: public AvlAllocator
{
12 BitmapAllocator
* bmap_alloc
= nullptr;
14 HybridAllocator(CephContext
* cct
, int64_t device_size
, int64_t _block_size
,
16 std::string_view name
) :
17 AvlAllocator(cct
, device_size
, _block_size
, max_mem
, name
) {
19 const char* get_type() const override
26 uint64_t max_alloc_size
,
28 PExtentVector
*extents
) override
;
29 void release(const interval_set
<uint64_t>& release_set
) override
;
30 uint64_t get_free() override
;
31 double get_fragmentation() override
;
34 void dump(std::function
<void(uint64_t offset
, uint64_t length
)> notify
) override
;
35 void init_rm_free(uint64_t offset
, uint64_t length
) override
;
36 void shutdown() override
;
39 // intended primarily for UT
40 BitmapAllocator
* get_bmap() {
43 const BitmapAllocator
* get_bmap() const {
48 void _spillover_range(uint64_t start
, uint64_t end
) override
;
50 // called when extent to be released/marked free
51 void _add_to_tree(uint64_t start
, uint64_t size
) override
;