2019-12-15 14:49:10 +03:00
|
|
|
#include "blockstore_impl.h"
|
2019-11-01 02:47:57 +03:00
|
|
|
|
2019-12-15 14:49:10 +03:00
|
|
|
blockstore_t::blockstore_t(blockstore_config_t & config, ring_loop_t *ringloop)
|
2019-11-01 02:47:57 +03:00
|
|
|
{
|
2019-12-15 14:49:10 +03:00
|
|
|
impl = new blockstore_impl_t(config, ringloop);
|
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
|
|
|
{
|
2020-01-10 20:05:17 +03:00
|
|
|
impl->enqueue_op(op, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
void blockstore_t::enqueue_op_first(blockstore_op_t *op)
|
|
|
|
{
|
|
|
|
impl->enqueue_op(op, true);
|
2019-11-10 01:40:48 +03:00
|
|
|
}
|
|
|
|
|
2020-02-12 12:30:50 +03:00
|
|
|
std::unordered_map<object_id, uint64_t> & blockstore_t::get_unstable_writes()
|
2019-11-06 19:27:48 +03:00
|
|
|
{
|
2019-12-15 14:49:10 +03:00
|
|
|
return impl->unstable_writes;
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
uint32_t blockstore_t::get_disk_alignment()
|
|
|
|
{
|
|
|
|
return impl->get_disk_alignment();
|
|
|
|
}
|