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.
 
 
 
 
 
 

75 lines
1.3 KiB

  1. // Copyright (c) Vitaliy Filippov, 2019+
  2. // License: VNPL-1.0 (see README.md for details)
  3. #include "blockstore_impl.h"
  4. blockstore_t::blockstore_t(blockstore_config_t & config, ring_loop_t *ringloop)
  5. {
  6. impl = new blockstore_impl_t(config, ringloop);
  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, false);
  31. }
  32. void blockstore_t::enqueue_op_first(blockstore_op_t *op)
  33. {
  34. impl->enqueue_op(op, true);
  35. }
  36. std::unordered_map<object_id, uint64_t> & blockstore_t::get_unstable_writes()
  37. {
  38. return impl->unstable_writes;
  39. }
  40. std::map<uint64_t, uint64_t> & blockstore_t::get_inode_space_stats()
  41. {
  42. return impl->inode_space_stats;
  43. }
  44. uint32_t blockstore_t::get_block_size()
  45. {
  46. return impl->get_block_size();
  47. }
  48. uint64_t blockstore_t::get_block_count()
  49. {
  50. return impl->get_block_count();
  51. }
  52. uint64_t blockstore_t::get_free_block_count()
  53. {
  54. return impl->get_free_block_count();
  55. }
  56. uint32_t blockstore_t::get_bitmap_granularity()
  57. {
  58. return impl->get_bitmap_granularity();
  59. }