Make allocator a class

This commit is contained in:
Vitaliy Filippov
2019-11-27 00:50:57 +03:00
parent b8e53f8c67
commit ff7469ee91
7 changed files with 39 additions and 40 deletions
+2 -2
View File
@@ -72,7 +72,7 @@ int blockstore::dequeue_write(blockstore_operation *op)
if (op->len == block_size || op->version == 1)
{
// Big (redirect) write
uint64_t loc = allocator_find_free(data_alloc);
uint64_t loc = data_alloc->find_free();
if (loc == UINT64_MAX)
{
// no space
@@ -83,7 +83,7 @@ int blockstore::dequeue_write(blockstore_operation *op)
BS_SUBMIT_GET_SQE(sqe, data);
dirty_it->second.location = loc << block_order;
dirty_it->second.state = ST_D_SUBMITTED;
allocator_set(data_alloc, loc, true);
data_alloc->set(loc, true);
int vcnt = 0;
if (op->version == 1 && op->len != block_size)
{