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.
 
 
 
 
 
 

29 lines
678 B

  1. // Copyright (c) Vitaliy Filippov, 2019+
  2. // License: VNPL-1.0 or GNU GPL-2.0+ (see README.md for details)
  3. #pragma once
  4. #define POOL_SCHEME_REPLICATED 1
  5. #define POOL_SCHEME_XOR 2
  6. #define POOL_SCHEME_JERASURE 3
  7. #define POOL_ID_MAX 0x10000
  8. #define POOL_ID_BITS 16
  9. #define INODE_POOL(inode) (pool_id_t)((inode) >> (64 - POOL_ID_BITS))
  10. // Pool ID is 16 bits long
  11. typedef uint32_t pool_id_t;
  12. typedef uint64_t osd_num_t;
  13. typedef uint32_t pg_num_t;
  14. struct pool_pg_num_t
  15. {
  16. pool_id_t pool_id;
  17. pg_num_t pg_num;
  18. };
  19. inline bool operator < (const pool_pg_num_t & a, const pool_pg_num_t & b)
  20. {
  21. return a.pool_id < b.pool_id || a.pool_id == b.pool_id && a.pg_num < b.pg_num;
  22. }