ceph_features.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. #ifndef __CEPH_FEATURES
  2. #define __CEPH_FEATURES
  3. /*
  4. * feature bits
  5. */
  6. #define CEPH_FEATURE_UID (1ULL<<0)
  7. #define CEPH_FEATURE_NOSRCADDR (1ULL<<1)
  8. #define CEPH_FEATURE_MONCLOCKCHECK (1ULL<<2)
  9. #define CEPH_FEATURE_FLOCK (1ULL<<3)
  10. #define CEPH_FEATURE_SUBSCRIBE2 (1ULL<<4)
  11. #define CEPH_FEATURE_MONNAMES (1ULL<<5)
  12. #define CEPH_FEATURE_RECONNECT_SEQ (1ULL<<6)
  13. #define CEPH_FEATURE_DIRLAYOUTHASH (1ULL<<7)
  14. #define CEPH_FEATURE_OBJECTLOCATOR (1ULL<<8)
  15. #define CEPH_FEATURE_PGID64 (1ULL<<9)
  16. #define CEPH_FEATURE_INCSUBOSDMAP (1ULL<<10)
  17. #define CEPH_FEATURE_PGPOOL3 (1ULL<<11)
  18. #define CEPH_FEATURE_OSDREPLYMUX (1ULL<<12)
  19. #define CEPH_FEATURE_OSDENC (1ULL<<13)
  20. #define CEPH_FEATURE_OMAP (1ULL<<14)
  21. #define CEPH_FEATURE_MONENC (1ULL<<15)
  22. #define CEPH_FEATURE_QUERY_T (1ULL<<16)
  23. #define CEPH_FEATURE_INDEP_PG_MAP (1ULL<<17)
  24. #define CEPH_FEATURE_CRUSH_TUNABLES (1ULL<<18)
  25. #define CEPH_FEATURE_CHUNKY_SCRUB (1ULL<<19)
  26. #define CEPH_FEATURE_MON_NULLROUTE (1ULL<<20)
  27. #define CEPH_FEATURE_MON_GV (1ULL<<21)
  28. #define CEPH_FEATURE_BACKFILL_RESERVATION (1ULL<<22)
  29. #define CEPH_FEATURE_MSG_AUTH (1ULL<<23)
  30. #define CEPH_FEATURE_RECOVERY_RESERVATION (1ULL<<24)
  31. #define CEPH_FEATURE_CRUSH_TUNABLES2 (1ULL<<25)
  32. #define CEPH_FEATURE_CREATEPOOLID (1ULL<<26)
  33. #define CEPH_FEATURE_REPLY_CREATE_INODE (1ULL<<27)
  34. #define CEPH_FEATURE_OSD_HBMSGS (1ULL<<28)
  35. #define CEPH_FEATURE_MDSENC (1ULL<<29)
  36. #define CEPH_FEATURE_OSDHASHPSPOOL (1ULL<<30)
  37. #define CEPH_FEATURE_MON_SINGLE_PAXOS (1ULL<<31)
  38. #define CEPH_FEATURE_OSD_SNAPMAPPER (1ULL<<32)
  39. #define CEPH_FEATURE_MON_SCRUB (1ULL<<33)
  40. #define CEPH_FEATURE_OSD_PACKED_RECOVERY (1ULL<<34)
  41. #define CEPH_FEATURE_OSD_CACHEPOOL (1ULL<<35)
  42. #define CEPH_FEATURE_CRUSH_V2 (1ULL<<36) /* new indep; SET_* steps */
  43. #define CEPH_FEATURE_EXPORT_PEER (1ULL<<37)
  44. #define CEPH_FEATURE_OSD_ERASURE_CODES (1ULL<<38)
  45. #define CEPH_FEATURE_OSD_TMAP2OMAP (1ULL<<38) /* overlap with EC */
  46. /* The process supports new-style OSDMap encoding. Monitors also use
  47. this bit to determine if peers support NAK messages. */
  48. #define CEPH_FEATURE_OSDMAP_ENC (1ULL<<39)
  49. #define CEPH_FEATURE_MDS_INLINE_DATA (1ULL<<40)
  50. #define CEPH_FEATURE_CRUSH_TUNABLES3 (1ULL<<41)
  51. #define CEPH_FEATURE_OSD_PRIMARY_AFFINITY (1ULL<<41) /* overlap w/ tunables3 */
  52. #define CEPH_FEATURE_MSGR_KEEPALIVE2 (1ULL<<42)
  53. #define CEPH_FEATURE_OSD_POOLRESEND (1ULL<<43)
  54. #define CEPH_FEATURE_ERASURE_CODE_PLUGINS_V2 (1ULL<<44)
  55. #define CEPH_FEATURE_OSD_SET_ALLOC_HINT (1ULL<<45)
  56. #define CEPH_FEATURE_OSD_FADVISE_FLAGS (1ULL<<46)
  57. #define CEPH_FEATURE_OSD_REPOP (1ULL<<46) /* overlap with fadvise */
  58. #define CEPH_FEATURE_OSD_OBJECT_DIGEST (1ULL<<46) /* overlap with fadvise */
  59. #define CEPH_FEATURE_OSD_TRANSACTION_MAY_LAYOUT (1ULL<<46) /* overlap w/ fadvise */
  60. #define CEPH_FEATURE_MDS_QUOTA (1ULL<<47)
  61. #define CEPH_FEATURE_CRUSH_V4 (1ULL<<48) /* straw2 buckets */
  62. #define CEPH_FEATURE_OSD_MIN_SIZE_RECOVERY (1ULL<<49)
  63. // duplicated since it was introduced at the same time as MIN_SIZE_RECOVERY
  64. #define CEPH_FEATURE_OSD_PROXY_FEATURES (1ULL<<49) /* overlap w/ above */
  65. /*
  66. * The introduction of CEPH_FEATURE_OSD_SNAPMAPPER caused the feature
  67. * vector to evaluate to 64 bit ~0. To cope, we designate 1ULL << 63
  68. * to mean 33 bit ~0, and introduce a helper below to do the
  69. * translation.
  70. *
  71. * This was introduced by ceph.git commit
  72. * 9ea02b84104045c2ffd7e7f4e7af512953855ecd v0.58-657-g9ea02b8
  73. * and fixed by ceph.git commit
  74. * 4255b5c2fb54ae40c53284b3ab700fdfc7e61748 v0.65-263-g4255b5c
  75. */
  76. #define CEPH_FEATURE_RESERVED (1ULL<<63)
  77. static inline u64 ceph_sanitize_features(u64 features)
  78. {
  79. if (features & CEPH_FEATURE_RESERVED) {
  80. /* everything through OSD_SNAPMAPPER */
  81. return 0x1ffffffffull;
  82. } else {
  83. return features;
  84. }
  85. }
  86. /*
  87. * Features supported.
  88. */
  89. #define CEPH_FEATURES_SUPPORTED_DEFAULT \
  90. (CEPH_FEATURE_NOSRCADDR | \
  91. CEPH_FEATURE_RECONNECT_SEQ | \
  92. CEPH_FEATURE_PGID64 | \
  93. CEPH_FEATURE_PGPOOL3 | \
  94. CEPH_FEATURE_OSDENC | \
  95. CEPH_FEATURE_CRUSH_TUNABLES | \
  96. CEPH_FEATURE_MSG_AUTH | \
  97. CEPH_FEATURE_CRUSH_TUNABLES2 | \
  98. CEPH_FEATURE_REPLY_CREATE_INODE | \
  99. CEPH_FEATURE_OSDHASHPSPOOL | \
  100. CEPH_FEATURE_OSD_CACHEPOOL | \
  101. CEPH_FEATURE_CRUSH_V2 | \
  102. CEPH_FEATURE_EXPORT_PEER | \
  103. CEPH_FEATURE_OSDMAP_ENC | \
  104. CEPH_FEATURE_CRUSH_TUNABLES3 | \
  105. CEPH_FEATURE_OSD_PRIMARY_AFFINITY | \
  106. CEPH_FEATURE_MSGR_KEEPALIVE2 | \
  107. CEPH_FEATURE_CRUSH_V4)
  108. #define CEPH_FEATURES_REQUIRED_DEFAULT \
  109. (CEPH_FEATURE_NOSRCADDR | \
  110. CEPH_FEATURE_RECONNECT_SEQ | \
  111. CEPH_FEATURE_PGID64 | \
  112. CEPH_FEATURE_PGPOOL3 | \
  113. CEPH_FEATURE_OSDENC)
  114. #endif