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.
 
 
 
 
 
 

53 lines
1.7 KiB

  1. // Copyright (c) Vitaliy Filippov, 2019+
  2. // License: VNPL-1.0 (see README.md for details)
  3. #pragma once
  4. #include <stdint.h>
  5. #include "object_id.h"
  6. #include "osd_id.h"
  7. #ifndef MEM_ALIGNMENT
  8. #define MEM_ALIGNMENT 512
  9. #endif
  10. struct buf_len_t
  11. {
  12. void *buf;
  13. uint64_t len;
  14. };
  15. struct osd_rmw_stripe_t
  16. {
  17. void *read_buf, *write_buf;
  18. void *bmp_buf;
  19. uint32_t req_start, req_end;
  20. uint32_t read_start, read_end;
  21. uint32_t write_start, write_end;
  22. bool missing;
  23. };
  24. // Here pg_minsize is the number of data chunks, not the minimum number of alive OSDs for the PG to operate
  25. void split_stripes(uint64_t pg_minsize, uint32_t bs_block_size, uint32_t start, uint32_t len, osd_rmw_stripe_t *stripes);
  26. void reconstruct_stripes_xor(osd_rmw_stripe_t *stripes, int pg_size, uint32_t bitmap_size);
  27. int extend_missing_stripes(osd_rmw_stripe_t *stripes, osd_num_t *osd_set, int pg_minsize, int pg_size);
  28. void* alloc_read_buffer(osd_rmw_stripe_t *stripes, int read_pg_size, uint64_t add_size);
  29. void* calc_rmw(void *request_buf, osd_rmw_stripe_t *stripes, uint64_t *read_osd_set,
  30. uint64_t pg_size, uint64_t pg_minsize, uint64_t pg_cursize, uint64_t *write_osd_set,
  31. uint64_t chunk_size, uint32_t bitmap_size);
  32. void calc_rmw_parity_xor(osd_rmw_stripe_t *stripes, int pg_size, uint64_t *read_osd_set, uint64_t *write_osd_set,
  33. uint32_t chunk_size, uint32_t bitmap_size);
  34. void use_jerasure(int pg_size, int pg_minsize, bool use);
  35. void reconstruct_stripes_jerasure(osd_rmw_stripe_t *stripes, int pg_size, int pg_minsize, uint32_t bitmap_size);
  36. void calc_rmw_parity_jerasure(osd_rmw_stripe_t *stripes, int pg_size, int pg_minsize,
  37. uint64_t *read_osd_set, uint64_t *write_osd_set, uint32_t chunk_size, uint32_t bitmap_size);