2020-09-17 23:02:40 +03:00
|
|
|
// Copyright (c) Vitaliy Filippov, 2019+
|
2021-02-06 01:26:07 +03:00
|
|
|
// License: VNPL-1.1 (see README.md for details)
|
2020-09-17 23:02:40 +03:00
|
|
|
|
2019-12-15 14:49:10 +03:00
|
|
|
#include "blockstore_impl.h"
|
2019-11-01 02:47:57 +03:00
|
|
|
|
2021-03-28 22:47:35 +03:00
|
|
|
blockstore_t::blockstore_t(blockstore_config_t & config, ring_loop_t *ringloop, timerfd_manager_t *tfd)
|
2019-11-01 02:47:57 +03:00
|
|
|
{
|
2021-03-28 22:47:35 +03:00
|
|
|
impl = new blockstore_impl_t(config, ringloop, tfd);
|
2019-11-03 01:34:29 +03:00
|
|
|
}
|
2019-10-31 13:49:46 +03:00
|
|
|
|
2019-12-15 14:49:10 +03:00
|
|
|
blockstore_t::~blockstore_t()
|
2019-11-03 01:34:29 +03:00
|
|
|
{
|
2019-12-15 14:49:10 +03:00
|
|
|
delete impl;
|
2019-11-03 01:34:29 +03:00
|
|
|
}
|
|
|
|
|
2019-12-15 14:49:10 +03:00
|
|
|
void blockstore_t::loop()
|
2019-11-18 02:36:53 +03:00
|
|
|
{
|
2019-12-15 14:49:10 +03:00
|
|
|
impl->loop();
|
2019-11-18 02:36:53 +03:00
|
|
|
}
|
|
|
|
|
2019-12-15 14:49:10 +03:00
|
|
|
bool blockstore_t::is_started()
|
2019-11-05 02:12:04 +03:00
|
|
|
{
|
2019-12-15 14:49:10 +03:00
|
|
|
return impl->is_started();
|
2019-11-06 19:27:48 +03:00
|
|
|
}
|
|
|
|
|
2020-01-10 01:23:46 +03:00
|
|
|
bool blockstore_t::is_stalled()
|
|
|
|
{
|
|
|
|
return impl->is_stalled();
|
|
|
|
}
|
|
|
|
|
2019-12-15 14:49:10 +03:00
|
|
|
bool blockstore_t::is_safe_to_stop()
|
2019-11-11 21:22:28 +03:00
|
|
|
{
|
2019-12-15 14:49:10 +03:00
|
|
|
return impl->is_safe_to_stop();
|
2019-11-11 21:22:28 +03:00
|
|
|
}
|
|
|
|
|
2019-12-15 14:49:10 +03:00
|
|
|
void blockstore_t::enqueue_op(blockstore_op_t *op)
|
2019-11-10 01:40:48 +03:00
|
|
|
{
|
2021-03-06 22:53:18 +03:00
|
|
|
impl->enqueue_op(op);
|
2019-11-10 01:40:48 +03:00
|
|
|
}
|
|
|
|
|
2021-02-13 23:11:07 +03:00
|
|
|
int blockstore_t::read_bitmap(object_id oid, uint64_t target_version, void *bitmap, uint64_t *result_version)
|
|
|
|
{
|
|
|
|
return impl->read_bitmap(oid, target_version, bitmap, result_version);
|
|
|
|
}
|
|
|
|
|
2021-01-19 02:14:13 +03:00
|
|
|
std::map<uint64_t, uint64_t> & blockstore_t::get_inode_space_stats()
|
2021-01-18 01:28:36 +03:00
|
|
|
{
|
|
|
|
return impl->inode_space_stats;
|
|
|
|
}
|
|
|
|
|
2021-07-17 16:13:41 +03:00
|
|
|
void blockstore_t::dump_diagnostics()
|
|
|
|
{
|
|
|
|
return impl->dump_diagnostics();
|
|
|
|
}
|
|
|
|
|
2019-12-15 14:49:10 +03:00
|
|
|
uint32_t blockstore_t::get_block_size()
|
|
|
|
{
|
|
|
|
return impl->get_block_size();
|
|
|
|
}
|
|
|
|
|
|
|
|
uint64_t blockstore_t::get_block_count()
|
|
|
|
{
|
|
|
|
return impl->get_block_count();
|
2019-11-05 02:12:04 +03:00
|
|
|
}
|
2020-01-30 22:06:46 +03:00
|
|
|
|
2020-04-14 14:37:50 +03:00
|
|
|
uint64_t blockstore_t::get_free_block_count()
|
|
|
|
{
|
|
|
|
return impl->get_free_block_count();
|
|
|
|
}
|
|
|
|
|
2021-10-30 14:26:48 +03:00
|
|
|
uint64_t blockstore_t::get_journal_size()
|
|
|
|
{
|
|
|
|
return impl->get_journal_size();
|
|
|
|
}
|
|
|
|
|
2021-01-10 11:57:41 +03:00
|
|
|
uint32_t blockstore_t::get_bitmap_granularity()
|
2020-01-30 22:06:46 +03:00
|
|
|
{
|
2021-01-10 11:57:41 +03:00
|
|
|
return impl->get_bitmap_granularity();
|
2020-01-30 22:06:46 +03:00
|
|
|
}
|