Sage Weil | 1fe60e5 | 2012-07-30 16:23:22 -0700 | [diff] [blame] | 1 | #ifndef __CEPH_FEATURES |
| 2 | #define __CEPH_FEATURES |
| 3 | |
| 4 | /* |
| 5 | * feature bits |
| 6 | */ |
Ilya Dryomov | 2b3e0c9 | 2013-12-24 21:19:24 +0200 | [diff] [blame] | 7 | #define CEPH_FEATURE_UID (1ULL<<0) |
| 8 | #define CEPH_FEATURE_NOSRCADDR (1ULL<<1) |
| 9 | #define CEPH_FEATURE_MONCLOCKCHECK (1ULL<<2) |
| 10 | #define CEPH_FEATURE_FLOCK (1ULL<<3) |
| 11 | #define CEPH_FEATURE_SUBSCRIBE2 (1ULL<<4) |
| 12 | #define CEPH_FEATURE_MONNAMES (1ULL<<5) |
| 13 | #define CEPH_FEATURE_RECONNECT_SEQ (1ULL<<6) |
| 14 | #define CEPH_FEATURE_DIRLAYOUTHASH (1ULL<<7) |
| 15 | #define CEPH_FEATURE_OBJECTLOCATOR (1ULL<<8) |
| 16 | #define CEPH_FEATURE_PGID64 (1ULL<<9) |
| 17 | #define CEPH_FEATURE_INCSUBOSDMAP (1ULL<<10) |
| 18 | #define CEPH_FEATURE_PGPOOL3 (1ULL<<11) |
| 19 | #define CEPH_FEATURE_OSDREPLYMUX (1ULL<<12) |
| 20 | #define CEPH_FEATURE_OSDENC (1ULL<<13) |
| 21 | #define CEPH_FEATURE_OMAP (1ULL<<14) |
| 22 | #define CEPH_FEATURE_MONENC (1ULL<<15) |
| 23 | #define CEPH_FEATURE_QUERY_T (1ULL<<16) |
| 24 | #define CEPH_FEATURE_INDEP_PG_MAP (1ULL<<17) |
| 25 | #define CEPH_FEATURE_CRUSH_TUNABLES (1ULL<<18) |
| 26 | #define CEPH_FEATURE_CHUNKY_SCRUB (1ULL<<19) |
| 27 | #define CEPH_FEATURE_MON_NULLROUTE (1ULL<<20) |
| 28 | #define CEPH_FEATURE_MON_GV (1ULL<<21) |
| 29 | #define CEPH_FEATURE_BACKFILL_RESERVATION (1ULL<<22) |
| 30 | #define CEPH_FEATURE_MSG_AUTH (1ULL<<23) |
| 31 | #define CEPH_FEATURE_RECOVERY_RESERVATION (1ULL<<24) |
| 32 | #define CEPH_FEATURE_CRUSH_TUNABLES2 (1ULL<<25) |
| 33 | #define CEPH_FEATURE_CREATEPOOLID (1ULL<<26) |
| 34 | #define CEPH_FEATURE_REPLY_CREATE_INODE (1ULL<<27) |
| 35 | #define CEPH_FEATURE_OSD_HBMSGS (1ULL<<28) |
| 36 | #define CEPH_FEATURE_MDSENC (1ULL<<29) |
| 37 | #define CEPH_FEATURE_OSDHASHPSPOOL (1ULL<<30) |
| 38 | #define CEPH_FEATURE_MON_SINGLE_PAXOS (1ULL<<31) |
| 39 | #define CEPH_FEATURE_OSD_SNAPMAPPER (1ULL<<32) |
| 40 | #define CEPH_FEATURE_MON_SCRUB (1ULL<<33) |
| 41 | #define CEPH_FEATURE_OSD_PACKED_RECOVERY (1ULL<<34) |
| 42 | #define CEPH_FEATURE_OSD_CACHEPOOL (1ULL<<35) |
| 43 | #define CEPH_FEATURE_CRUSH_V2 (1ULL<<36) /* new indep; SET_* steps */ |
| 44 | #define CEPH_FEATURE_EXPORT_PEER (1ULL<<37) |
| 45 | #define CEPH_FEATURE_OSD_ERASURE_CODES (1ULL<<38) |
Ilya Dryomov | 07bd7de | 2014-03-19 16:58:37 +0200 | [diff] [blame] | 46 | #define CEPH_FEATURE_OSD_TMAP2OMAP (1ULL<<38) /* overlap with EC */ |
| 47 | /* The process supports new-style OSDMap encoding. Monitors also use |
| 48 | this bit to determine if peers support NAK messages. */ |
| 49 | #define CEPH_FEATURE_OSDMAP_ENC (1ULL<<39) |
| 50 | #define CEPH_FEATURE_MDS_INLINE_DATA (1ULL<<40) |
| 51 | #define CEPH_FEATURE_CRUSH_TUNABLES3 (1ULL<<41) |
| 52 | #define CEPH_FEATURE_OSD_PRIMARY_AFFINITY (1ULL<<41) /* overlap w/ tunables3 */ |
Ilya Dryomov | 7c1c474 | 2015-04-14 23:13:31 +0300 | [diff] [blame] | 53 | #define CEPH_FEATURE_MSGR_KEEPALIVE2 (1ULL<<42) |
| 54 | #define CEPH_FEATURE_OSD_POOLRESEND (1ULL<<43) |
| 55 | #define CEPH_FEATURE_ERASURE_CODE_PLUGINS_V2 (1ULL<<44) |
| 56 | #define CEPH_FEATURE_OSD_SET_ALLOC_HINT (1ULL<<45) |
| 57 | #define CEPH_FEATURE_OSD_FADVISE_FLAGS (1ULL<<46) |
| 58 | #define CEPH_FEATURE_OSD_REPOP (1ULL<<46) /* overlap with fadvise */ |
| 59 | #define CEPH_FEATURE_OSD_OBJECT_DIGEST (1ULL<<46) /* overlap with fadvise */ |
| 60 | #define CEPH_FEATURE_OSD_TRANSACTION_MAY_LAYOUT (1ULL<<46) /* overlap w/ fadvise */ |
| 61 | #define CEPH_FEATURE_MDS_QUOTA (1ULL<<47) |
| 62 | #define CEPH_FEATURE_CRUSH_V4 (1ULL<<48) /* straw2 buckets */ |
| 63 | #define CEPH_FEATURE_OSD_MIN_SIZE_RECOVERY (1ULL<<49) |
| 64 | // duplicated since it was introduced at the same time as MIN_SIZE_RECOVERY |
| 65 | #define CEPH_FEATURE_OSD_PROXY_FEATURES (1ULL<<49) /* overlap w/ above */ |
Ilya Dryomov | 97db9a8 | 2016-02-01 17:08:33 +0100 | [diff] [blame] | 66 | #define CEPH_FEATURE_MON_METADATA (1ULL<<50) |
| 67 | #define CEPH_FEATURE_OSD_BITWISE_HOBJ_SORT (1ULL<<51) /* can sort objs bitwise */ |
| 68 | #define CEPH_FEATURE_OSD_PROXY_WRITE_FEATURES (1ULL<<52) |
| 69 | #define CEPH_FEATURE_ERASURE_CODE_PLUGINS_V3 (1ULL<<53) |
| 70 | #define CEPH_FEATURE_OSD_HITSET_GMT (1ULL<<54) |
| 71 | #define CEPH_FEATURE_HAMMER_0_94_4 (1ULL<<55) |
| 72 | #define CEPH_FEATURE_NEW_OSDOP_ENCODING (1ULL<<56) /* New, v7 encoding */ |
| 73 | #define CEPH_FEATURE_MON_STATEFUL_SUB (1ULL<<57) /* stateful mon subscription */ |
| 74 | #define CEPH_FEATURE_MON_ROUTE_OSDMAP (1ULL<<57) /* peon sends osdmaps */ |
| 75 | #define CEPH_FEATURE_CRUSH_TUNABLES5 (1ULL<<58) /* chooseleaf stable mode */ |
Ilya Dryomov | b0b31a8 | 2016-02-03 15:25:48 +0100 | [diff] [blame] | 76 | // duplicated since it was introduced at the same time as CEPH_FEATURE_CRUSH_TUNABLES5 |
| 77 | #define CEPH_FEATURE_NEW_OSDOPREPLY_ENCODING (1ULL<<58) /* New, v7 encoding */ |
Yan, Zheng | 5ea5c5e | 2016-02-14 18:06:41 +0800 | [diff] [blame] | 78 | #define CEPH_FEATURE_FS_FILE_LAYOUT_V2 (1ULL<<58) /* file_layout_t */ |
Ilya Dryomov | 2b3e0c9 | 2013-12-24 21:19:24 +0200 | [diff] [blame] | 79 | |
| 80 | /* |
| 81 | * The introduction of CEPH_FEATURE_OSD_SNAPMAPPER caused the feature |
| 82 | * vector to evaluate to 64 bit ~0. To cope, we designate 1ULL << 63 |
| 83 | * to mean 33 bit ~0, and introduce a helper below to do the |
| 84 | * translation. |
| 85 | * |
| 86 | * This was introduced by ceph.git commit |
| 87 | * 9ea02b84104045c2ffd7e7f4e7af512953855ecd v0.58-657-g9ea02b8 |
| 88 | * and fixed by ceph.git commit |
| 89 | * 4255b5c2fb54ae40c53284b3ab700fdfc7e61748 v0.65-263-g4255b5c |
| 90 | */ |
| 91 | #define CEPH_FEATURE_RESERVED (1ULL<<63) |
| 92 | |
| 93 | static inline u64 ceph_sanitize_features(u64 features) |
| 94 | { |
| 95 | if (features & CEPH_FEATURE_RESERVED) { |
| 96 | /* everything through OSD_SNAPMAPPER */ |
| 97 | return 0x1ffffffffull; |
| 98 | } else { |
| 99 | return features; |
| 100 | } |
| 101 | } |
Sage Weil | 1fe60e5 | 2012-07-30 16:23:22 -0700 | [diff] [blame] | 102 | |
| 103 | /* |
| 104 | * Features supported. |
| 105 | */ |
Ilya Dryomov | 2b3e0c9 | 2013-12-24 21:19:24 +0200 | [diff] [blame] | 106 | #define CEPH_FEATURES_SUPPORTED_DEFAULT \ |
Sage Weil | 4f6a7e5 | 2013-02-23 10:41:09 -0800 | [diff] [blame] | 107 | (CEPH_FEATURE_NOSRCADDR | \ |
Ilya Dryomov | 82dcaba | 2016-01-19 16:19:06 +0100 | [diff] [blame] | 108 | CEPH_FEATURE_SUBSCRIBE2 | \ |
Sage Weil | 3a23083 | 2013-03-25 08:47:40 -0700 | [diff] [blame] | 109 | CEPH_FEATURE_RECONNECT_SEQ | \ |
Sage Weil | 4f6a7e5 | 2013-02-23 10:41:09 -0800 | [diff] [blame] | 110 | CEPH_FEATURE_PGID64 | \ |
| 111 | CEPH_FEATURE_PGPOOL3 | \ |
| 112 | CEPH_FEATURE_OSDENC | \ |
| 113 | CEPH_FEATURE_CRUSH_TUNABLES | \ |
Yan, Zheng | 33d0733 | 2014-11-04 16:33:37 +0800 | [diff] [blame] | 114 | CEPH_FEATURE_MSG_AUTH | \ |
Sage Weil | 4f6a7e5 | 2013-02-23 10:41:09 -0800 | [diff] [blame] | 115 | CEPH_FEATURE_CRUSH_TUNABLES2 | \ |
Sage Weil | 83ca14f | 2013-02-26 10:39:09 -0800 | [diff] [blame] | 116 | CEPH_FEATURE_REPLY_CREATE_INODE | \ |
Ilya Dryomov | cdff499 | 2013-12-24 21:19:27 +0200 | [diff] [blame] | 117 | CEPH_FEATURE_OSDHASHPSPOOL | \ |
Ilya Dryomov | 80e163a | 2014-01-27 17:40:20 +0200 | [diff] [blame] | 118 | CEPH_FEATURE_OSD_CACHEPOOL | \ |
Yan, Zheng | 80213a8 | 2014-01-21 11:07:16 +0800 | [diff] [blame] | 119 | CEPH_FEATURE_CRUSH_V2 | \ |
Ilya Dryomov | 07bd7de | 2014-03-19 16:58:37 +0200 | [diff] [blame] | 120 | CEPH_FEATURE_EXPORT_PEER | \ |
Ilya Dryomov | ddf3a21 | 2014-03-21 19:05:31 +0200 | [diff] [blame] | 121 | CEPH_FEATURE_OSDMAP_ENC | \ |
Ilya Dryomov | 18cb95a | 2014-03-24 17:12:50 +0200 | [diff] [blame] | 122 | CEPH_FEATURE_CRUSH_TUNABLES3 | \ |
Ilya Dryomov | 7c1c474 | 2015-04-14 23:13:31 +0300 | [diff] [blame] | 123 | CEPH_FEATURE_OSD_PRIMARY_AFFINITY | \ |
Ilya Dryomov | 335c258 | 2015-09-14 12:44:22 +0300 | [diff] [blame] | 124 | CEPH_FEATURE_MSGR_KEEPALIVE2 | \ |
Ilya Dryomov | 97db9a8 | 2016-02-01 17:08:33 +0100 | [diff] [blame] | 125 | CEPH_FEATURE_CRUSH_V4 | \ |
Ilya Dryomov | b0b31a8 | 2016-02-03 15:25:48 +0100 | [diff] [blame] | 126 | CEPH_FEATURE_CRUSH_TUNABLES5 | \ |
| 127 | CEPH_FEATURE_NEW_OSDOPREPLY_ENCODING) |
Sage Weil | 1fe60e5 | 2012-07-30 16:23:22 -0700 | [diff] [blame] | 128 | |
| 129 | #define CEPH_FEATURES_REQUIRED_DEFAULT \ |
Sage Weil | 4f6a7e5 | 2013-02-23 10:41:09 -0800 | [diff] [blame] | 130 | (CEPH_FEATURE_NOSRCADDR | \ |
Ilya Dryomov | 82dcaba | 2016-01-19 16:19:06 +0100 | [diff] [blame] | 131 | CEPH_FEATURE_SUBSCRIBE2 | \ |
Sage Weil | 3a23083 | 2013-03-25 08:47:40 -0700 | [diff] [blame] | 132 | CEPH_FEATURE_RECONNECT_SEQ | \ |
Sage Weil | 4f6a7e5 | 2013-02-23 10:41:09 -0800 | [diff] [blame] | 133 | CEPH_FEATURE_PGID64 | \ |
| 134 | CEPH_FEATURE_PGPOOL3 | \ |
| 135 | CEPH_FEATURE_OSDENC) |
Ilya Dryomov | 2b3e0c9 | 2013-12-24 21:19:24 +0200 | [diff] [blame] | 136 | |
Sage Weil | 1fe60e5 | 2012-07-30 16:23:22 -0700 | [diff] [blame] | 137 | #endif |