Simplified distributed block storage with strong consistency, like in Ceph
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

70 lines
1.3 KiB

  1. // Copyright (c) Vitaliy Filippov, 2019+
  2. // License: VNPL-1.1 (see README.md for details)
  3. #include "blockstore_impl.h"
  4. blockstore_t::blockstore_t(blockstore_config_t & config, ring_loop_t *ringloop, timerfd_manager_t *tfd)
  5. {
  6. impl = new blockstore_impl_t(config, ringloop, tfd);
  7. }
  8. blockstore_t::~blockstore_t()
  9. {
  10. delete impl;
  11. }
  12. void blockstore_t::loop()
  13. {
  14. impl->loop();
  15. }
  16. bool blockstore_t::is_started()
  17. {
  18. return impl->is_started();
  19. }
  20. bool blockstore_t::is_stalled()
  21. {
  22. return impl->is_stalled();
  23. }
  24. bool blockstore_t::is_safe_to_stop()
  25. {
  26. return impl->is_safe_to_stop();
  27. }
  28. void blockstore_t::enqueue_op(blockstore_op_t *op)
  29. {
  30. impl->enqueue_op(op);
  31. }
  32. int blockstore_t::read_bitmap(object_id oid, uint64_t target_version, void *bitmap, uint64_t *result_version)
  33. {
  34. return impl->read_bitmap(oid, target_version, bitmap, result_version);
  35. }
  36. std::map<uint64_t, uint64_t> & blockstore_t::get_inode_space_stats()
  37. {
  38. return impl->inode_space_stats;
  39. }
  40. uint32_t blockstore_t::get_block_size()
  41. {
  42. return impl->get_block_size();
  43. }
  44. uint64_t blockstore_t::get_block_count()
  45. {
  46. return impl->get_block_count();
  47. }
  48. uint64_t blockstore_t::get_free_block_count()
  49. {
  50. return impl->get_free_block_count();
  51. }
  52. uint32_t blockstore_t::get_bitmap_granularity()
  53. {
  54. return impl->get_bitmap_granularity();
  55. }