Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os/bluestore: simplified allocator interfaces to single apis #12355

Merged
merged 8 commits into from
Dec 19, 2016
16 changes: 6 additions & 10 deletions src/os/bluestore/Allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ class Allocator {
virtual int reserve(uint64_t need) = 0;
virtual void unreserve(uint64_t unused) = 0;

virtual int allocate(
uint64_t need_size, uint64_t alloc_unit, int64_t hint,
uint64_t *offset, uint32_t *length) = 0;

/*
* Allocate required number of blocks in n number of extents.
* Min and Max number of extents are limited by:
Expand All @@ -39,13 +35,13 @@ class Allocator {
* Apart from that extents can vary between these lower and higher limits according
* to free block search algorithm and availability of contiguous space.
*/
virtual int alloc_extents(uint64_t want_size, uint64_t alloc_unit,
uint64_t max_alloc_size, int64_t hint,
AllocExtentVector *extents, int *count) = 0;
virtual int allocate(uint64_t want_size, uint64_t alloc_unit,
uint64_t max_alloc_size, int64_t hint,
AllocExtentVector *extents, int *count, uint64_t *ret_len) = 0;

int alloc_extents(uint64_t want_size, uint64_t alloc_unit,
int64_t hint, AllocExtentVector *extents, int *count) {
return alloc_extents(want_size, alloc_unit, want_size, hint, extents, count);
int allocate(uint64_t want_size, uint64_t alloc_unit,
int64_t hint, AllocExtentVector *extents, int *count, uint64_t *ret_len) {
return allocate(want_size, alloc_unit, want_size, hint, extents, count, ret_len);
}

virtual int release(
Expand Down