]>
git.proxmox.com Git - ceph.git/blob - ceph/src/os/bluestore/BitmapAllocator.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 #ifndef CEPH_OS_BLUESTORE_BITMAPFASTALLOCATOR_H
5 #define CEPH_OS_BLUESTORE_BITMAPFASTALLOCATOR_H
10 #include "os/bluestore/bluestore_types.h"
11 #include "fastbmap_allocator_impl.h"
12 #include "include/mempool.h"
13 #include "common/debug.h"
15 class BitmapAllocator
: public Allocator
,
16 public AllocatorLevel02
<AllocatorLevel01Loose
> {
20 BitmapAllocator(CephContext
* _cct
, int64_t capacity
, int64_t alloc_unit
, const std::string
& name
);
21 ~BitmapAllocator() override
25 const char* get_type() const override
30 uint64_t want_size
, uint64_t alloc_unit
, uint64_t max_alloc_size
,
31 int64_t hint
, PExtentVector
*extents
) override
;
34 const interval_set
<uint64_t>& release_set
) override
;
36 using Allocator::release
;
38 uint64_t get_free() override
40 return get_available();
44 void dump(std::function
<void(uint64_t offset
, uint64_t length
)> notify
) override
;
45 double get_fragmentation() override
47 return _get_fragmentation();
50 void init_add_free(uint64_t offset
, uint64_t length
) override
;
51 void init_rm_free(uint64_t offset
, uint64_t length
) override
;
53 void shutdown() override
;