]>
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 const std::string
& name
) :
17 AvlAllocator(cct
, device_size
, _block_size
, max_mem
, name
) {
22 uint64_t max_alloc_size
,
24 PExtentVector
*extents
) override
;
25 void release(const interval_set
<uint64_t>& release_set
) override
;
26 uint64_t get_free() override
;
27 double get_fragmentation() override
;
30 void dump(std::function
<void(uint64_t offset
, uint64_t length
)> notify
) override
;
31 void init_rm_free(uint64_t offset
, uint64_t length
) override
;
32 void shutdown() override
;
35 // intended primarily for UT
36 BitmapAllocator
* get_bmap() {
39 const BitmapAllocator
* get_bmap() const {
44 void _spillover_range(uint64_t start
, uint64_t end
) override
;
46 // called when extent to be released/marked free
47 void _add_to_tree(uint64_t start
, uint64_t size
) override
;