]>
git.proxmox.com Git - ceph.git/blob - ceph/src/os/bluestore/FreelistManager.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_FREELISTMANAGER_H
5 #define CEPH_OS_BLUESTORE_FREELISTMANAGER_H
11 #include "kv/KeyValueDB.h"
13 class FreelistManager
{
16 FreelistManager(CephContext
* cct
) : cct(cct
) {}
17 virtual ~FreelistManager() {}
19 static FreelistManager
*create(
25 static void setup_merge_operators(KeyValueDB
*db
);
27 virtual int create(uint64_t size
, uint64_t granularity
,
28 KeyValueDB::Transaction txn
) = 0;
30 virtual int init(uint64_t dev_size
) = 0;
31 virtual void shutdown() = 0;
33 virtual void dump() = 0;
35 virtual void enumerate_reset() = 0;
36 virtual bool enumerate_next(uint64_t *offset
, uint64_t *length
) = 0;
38 virtual void allocate(
39 uint64_t offset
, uint64_t length
,
40 KeyValueDB::Transaction txn
) = 0;
42 uint64_t offset
, uint64_t length
,
43 KeyValueDB::Transaction txn
) = 0;
45 virtual uint64_t get_alloc_units() const = 0;
46 virtual uint64_t get_alloc_size() const = 0;