libceph: advertise support for NEW_OSDOP_ENCODING and SERVER_LUMINOUS
[sfrench/cifs-2.6.git] / include / linux / ceph / ceph_features.h
1 #ifndef __CEPH_FEATURES
2 #define __CEPH_FEATURES
3
4 /*
5  * Each time we reclaim bits for reuse we need to specify another bit
6  * that, if present, indicates we have the new incarnation of that
7  * feature.  Base case is 1 (first use).
8  */
9 #define CEPH_FEATURE_INCARNATION_1 (0ull)
10 #define CEPH_FEATURE_INCARNATION_2 (1ull<<57) // CEPH_FEATURE_SERVER_JEWEL
11
12 #define DEFINE_CEPH_FEATURE(bit, incarnation, name)                     \
13         const static uint64_t CEPH_FEATURE_##name = (1ULL<<bit);                \
14         const static uint64_t CEPH_FEATUREMASK_##name =                 \
15                 (1ULL<<bit | CEPH_FEATURE_INCARNATION_##incarnation);
16
17 /* this bit is ignored but still advertised by release *when* */
18 #define DEFINE_CEPH_FEATURE_DEPRECATED(bit, incarnation, name, when) \
19         const static uint64_t DEPRECATED_CEPH_FEATURE_##name = (1ULL<<bit); \
20         const static uint64_t DEPRECATED_CEPH_FEATUREMASK_##name =              \
21                 (1ULL<<bit | CEPH_FEATURE_INCARNATION_##incarnation);
22
23 /*
24  * this bit is ignored by release *unused* and not advertised by
25  * release *unadvertised*
26  */
27 #define DEFINE_CEPH_FEATURE_RETIRED(bit, inc, name, unused, unadvertised)
28
29
30 /*
31  * test for a feature.  this test is safer than a typical mask against
32  * the bit because it ensures that we have the bit AND the marker for the
33  * bit's incarnation.  this must be used in any case where the features
34  * bits may include an old meaning of the bit.
35  */
36 #define CEPH_HAVE_FEATURE(x, name)                      \
37         (((x) & (CEPH_FEATUREMASK_##name)) == (CEPH_FEATUREMASK_##name))
38
39
40 /*
41  * Notes on deprecation:
42  *
43  * A *major* release is a release through which all upgrades must pass
44  * (e.g., jewel).  For example, no pre-jewel server will ever talk to
45  * a post-jewel server (mon, osd, etc).
46  *
47  * For feature bits used *only* on the server-side:
48  *
49  *  - In the first phase we indicate that a feature is DEPRECATED as of
50  *    a particular release.  This is the first major release X (say,
51  *    jewel) that does not depend on its peers advertising the feature.
52  *    That is, it safely assumes its peers all have the feature.  We
53  *    indicate this with the DEPRECATED macro.  For example,
54  *
55  *      DEFINE_CEPH_FEATURE_DEPRECATED( 2, 1, MONCLOCKCHECK, JEWEL)
56  *
57  *    because 10.2.z (jewel) did not care if its peers advertised this
58  *    feature bit.
59  *
60  *  - In the second phase we stop advertising the the bit and call it
61  *    RETIRED.  This can normally be done in the *next* major release
62  *    following the one in which we marked the feature DEPRECATED.  In
63  *    the above example, for 12.0.z (luminous) we can say:
64  *
65  *      DEFINE_CEPH_FEATURE_RETIRED( 2, 1, MONCLOCKCHECK, JEWEL, LUMINOUS)
66  *
67  *  - The bit can be reused in the first post-luminous release, 13.0.z
68  *    (m).
69  *
70  * This ensures that no two versions who have different meanings for
71  * the bit ever speak to each other.
72  */
73
74 DEFINE_CEPH_FEATURE( 0, 1, UID)
75 DEFINE_CEPH_FEATURE( 1, 1, NOSRCADDR)
76 DEFINE_CEPH_FEATURE_RETIRED( 2, 1, MONCLOCKCHECK, JEWEL, LUMINOUS)
77
78 DEFINE_CEPH_FEATURE( 3, 1, FLOCK)
79 DEFINE_CEPH_FEATURE( 4, 1, SUBSCRIBE2)
80 DEFINE_CEPH_FEATURE( 5, 1, MONNAMES)
81 DEFINE_CEPH_FEATURE( 6, 1, RECONNECT_SEQ)
82 DEFINE_CEPH_FEATURE( 7, 1, DIRLAYOUTHASH)
83 DEFINE_CEPH_FEATURE( 8, 1, OBJECTLOCATOR)
84 DEFINE_CEPH_FEATURE( 9, 1, PGID64)
85 DEFINE_CEPH_FEATURE(10, 1, INCSUBOSDMAP)
86 DEFINE_CEPH_FEATURE(11, 1, PGPOOL3)
87 DEFINE_CEPH_FEATURE(12, 1, OSDREPLYMUX)
88 DEFINE_CEPH_FEATURE(13, 1, OSDENC)
89 DEFINE_CEPH_FEATURE_RETIRED(14, 1, OMAP, HAMMER, JEWEL)
90 DEFINE_CEPH_FEATURE(14, 2, SERVER_KRAKEN)
91 DEFINE_CEPH_FEATURE(15, 1, MONENC)
92 DEFINE_CEPH_FEATURE_RETIRED(16, 1, QUERY_T, JEWEL, LUMINOUS)
93
94 DEFINE_CEPH_FEATURE_RETIRED(17, 1, INDEP_PG_MAP, JEWEL, LUMINOUS)
95
96 DEFINE_CEPH_FEATURE(18, 1, CRUSH_TUNABLES)
97 DEFINE_CEPH_FEATURE_RETIRED(19, 1, CHUNKY_SCRUB, JEWEL, LUMINOUS)
98
99 DEFINE_CEPH_FEATURE_RETIRED(20, 1, MON_NULLROUTE, JEWEL, LUMINOUS)
100
101 DEFINE_CEPH_FEATURE_RETIRED(21, 1, MON_GV, HAMMER, JEWEL)
102 DEFINE_CEPH_FEATURE(21, 2, SERVER_LUMINOUS)
103 DEFINE_CEPH_FEATURE(21, 2, RESEND_ON_SPLIT)  // overlap
104 DEFINE_CEPH_FEATURE(21, 2, RADOS_BACKOFF)    // overlap
105 DEFINE_CEPH_FEATURE(21, 2, OSDMAP_PG_UPMAP)  // overlap
106 DEFINE_CEPH_FEATURE(21, 2, CRUSH_CHOOSE_ARGS) // overlap
107 DEFINE_CEPH_FEATURE_RETIRED(22, 1, BACKFILL_RESERVATION, JEWEL, LUMINOUS)
108
109 DEFINE_CEPH_FEATURE(23, 1, MSG_AUTH)
110 DEFINE_CEPH_FEATURE_RETIRED(24, 1, RECOVERY_RESERVATION, JEWEL, LUNINOUS)
111
112 DEFINE_CEPH_FEATURE(25, 1, CRUSH_TUNABLES2)
113 DEFINE_CEPH_FEATURE(26, 1, CREATEPOOLID)
114 DEFINE_CEPH_FEATURE(27, 1, REPLY_CREATE_INODE)
115 DEFINE_CEPH_FEATURE_RETIRED(28, 1, OSD_HBMSGS, HAMMER, JEWEL)
116 DEFINE_CEPH_FEATURE(28, 2, SERVER_M)
117 DEFINE_CEPH_FEATURE(29, 1, MDSENC)
118 DEFINE_CEPH_FEATURE(30, 1, OSDHASHPSPOOL)
119 DEFINE_CEPH_FEATURE(31, 1, MON_SINGLE_PAXOS)  // deprecate me
120 DEFINE_CEPH_FEATURE_RETIRED(32, 1, OSD_SNAPMAPPER, JEWEL, LUMINOUS)
121
122 DEFINE_CEPH_FEATURE_RETIRED(33, 1, MON_SCRUB, JEWEL, LUMINOUS)
123
124 DEFINE_CEPH_FEATURE_RETIRED(34, 1, OSD_PACKED_RECOVERY, JEWEL, LUMINOUS)
125
126 DEFINE_CEPH_FEATURE(35, 1, OSD_CACHEPOOL)
127 DEFINE_CEPH_FEATURE(36, 1, CRUSH_V2)
128 DEFINE_CEPH_FEATURE(37, 1, EXPORT_PEER)
129 DEFINE_CEPH_FEATURE(38, 1, OSD_ERASURE_CODES)
130 DEFINE_CEPH_FEATURE(38, 1, OSD_OSD_TMAP2OMAP) // overlap
131 DEFINE_CEPH_FEATURE(39, 1, OSDMAP_ENC)
132 DEFINE_CEPH_FEATURE(40, 1, MDS_INLINE_DATA)
133 DEFINE_CEPH_FEATURE(41, 1, CRUSH_TUNABLES3)
134 DEFINE_CEPH_FEATURE(41, 1, OSD_PRIMARY_AFFINITY) // overlap
135 DEFINE_CEPH_FEATURE(42, 1, MSGR_KEEPALIVE2)
136 DEFINE_CEPH_FEATURE(43, 1, OSD_POOLRESEND)
137 DEFINE_CEPH_FEATURE(44, 1, ERASURE_CODE_PLUGINS_V2)
138 DEFINE_CEPH_FEATURE_RETIRED(45, 1, OSD_SET_ALLOC_HINT, JEWEL, LUMINOUS)
139
140 DEFINE_CEPH_FEATURE(46, 1, OSD_FADVISE_FLAGS)
141 DEFINE_CEPH_FEATURE_RETIRED(46, 1, OSD_REPOP, JEWEL, LUMINOUS) // overlap
142 DEFINE_CEPH_FEATURE_RETIRED(46, 1, OSD_OBJECT_DIGEST, JEWEL, LUMINOUS) // overlap
143 DEFINE_CEPH_FEATURE_RETIRED(46, 1, OSD_TRANSACTION_MAY_LAYOUT, JEWEL, LUMINOUS) // overlap
144
145 DEFINE_CEPH_FEATURE(47, 1, MDS_QUOTA)
146 DEFINE_CEPH_FEATURE(48, 1, CRUSH_V4)
147 DEFINE_CEPH_FEATURE_RETIRED(49, 1, OSD_MIN_SIZE_RECOVERY, JEWEL, LUMINOUS)
148 DEFINE_CEPH_FEATURE_RETIRED(49, 1, OSD_PROXY_FEATURES, JEWEL, LUMINOUS) // overlap
149
150 DEFINE_CEPH_FEATURE(50, 1, MON_METADATA)
151 DEFINE_CEPH_FEATURE(51, 1, OSD_BITWISE_HOBJ_SORT)
152 DEFINE_CEPH_FEATURE(52, 1, OSD_PROXY_WRITE_FEATURES)
153 DEFINE_CEPH_FEATURE(53, 1, ERASURE_CODE_PLUGINS_V3)
154 DEFINE_CEPH_FEATURE(54, 1, OSD_HITSET_GMT)
155 DEFINE_CEPH_FEATURE(55, 1, HAMMER_0_94_4)
156 DEFINE_CEPH_FEATURE(56, 1, NEW_OSDOP_ENCODING)
157 DEFINE_CEPH_FEATURE(57, 1, MON_STATEFUL_SUB)
158 DEFINE_CEPH_FEATURE(57, 1, MON_ROUTE_OSDMAP) // overlap
159 DEFINE_CEPH_FEATURE(57, 1, OSDSUBOP_NO_SNAPCONTEXT) // overlap
160 DEFINE_CEPH_FEATURE(57, 1, SERVER_JEWEL) // overlap
161 DEFINE_CEPH_FEATURE(58, 1, CRUSH_TUNABLES5)
162 DEFINE_CEPH_FEATURE(58, 1, NEW_OSDOPREPLY_ENCODING) // overlap
163 DEFINE_CEPH_FEATURE(58, 1, FS_FILE_LAYOUT_V2) // overlap
164 DEFINE_CEPH_FEATURE(59, 1, FS_BTIME)
165 DEFINE_CEPH_FEATURE(59, 1, FS_CHANGE_ATTR) // overlap
166 DEFINE_CEPH_FEATURE(59, 1, MSG_ADDR2) // overlap
167 DEFINE_CEPH_FEATURE(60, 1, BLKIN_TRACING)  // *do not share this bit*
168
169 DEFINE_CEPH_FEATURE(61, 1, RESERVED2)          // unused, but slow down!
170 DEFINE_CEPH_FEATURE(62, 1, RESERVED)           // do not use; used as a sentinal
171 DEFINE_CEPH_FEATURE_DEPRECATED(63, 1, RESERVED_BROKEN, LUMINOUS) // client-facing
172
173
174 /*
175  * Features supported.
176  */
177 #define CEPH_FEATURES_SUPPORTED_DEFAULT         \
178         (CEPH_FEATURE_NOSRCADDR |               \
179          CEPH_FEATURE_FLOCK |                   \
180          CEPH_FEATURE_SUBSCRIBE2 |              \
181          CEPH_FEATURE_RECONNECT_SEQ |           \
182          CEPH_FEATURE_DIRLAYOUTHASH |           \
183          CEPH_FEATURE_PGID64 |                  \
184          CEPH_FEATURE_PGPOOL3 |                 \
185          CEPH_FEATURE_OSDENC |                  \
186          CEPH_FEATURE_CRUSH_TUNABLES |          \
187          CEPH_FEATURE_SERVER_LUMINOUS |         \
188          CEPH_FEATURE_RESEND_ON_SPLIT |         \
189          CEPH_FEATURE_RADOS_BACKOFF |           \
190          CEPH_FEATURE_OSDMAP_PG_UPMAP |         \
191          CEPH_FEATURE_CRUSH_CHOOSE_ARGS |       \
192          CEPH_FEATURE_MSG_AUTH |                \
193          CEPH_FEATURE_CRUSH_TUNABLES2 |         \
194          CEPH_FEATURE_REPLY_CREATE_INODE |      \
195          CEPH_FEATURE_MDSENC |                  \
196          CEPH_FEATURE_OSDHASHPSPOOL |           \
197          CEPH_FEATURE_OSD_CACHEPOOL |           \
198          CEPH_FEATURE_CRUSH_V2 |                \
199          CEPH_FEATURE_EXPORT_PEER |             \
200          CEPH_FEATURE_OSDMAP_ENC |              \
201          CEPH_FEATURE_MDS_INLINE_DATA |         \
202          CEPH_FEATURE_CRUSH_TUNABLES3 |         \
203          CEPH_FEATURE_OSD_PRIMARY_AFFINITY |    \
204          CEPH_FEATURE_MSGR_KEEPALIVE2 |         \
205          CEPH_FEATURE_OSD_POOLRESEND |          \
206          CEPH_FEATURE_CRUSH_V4 |                \
207          CEPH_FEATURE_NEW_OSDOP_ENCODING |      \
208          CEPH_FEATURE_SERVER_JEWEL |            \
209          CEPH_FEATURE_MON_STATEFUL_SUB |        \
210          CEPH_FEATURE_CRUSH_TUNABLES5 |         \
211          CEPH_FEATURE_NEW_OSDOPREPLY_ENCODING)
212
213 #define CEPH_FEATURES_REQUIRED_DEFAULT   \
214         (CEPH_FEATURE_NOSRCADDR |        \
215          CEPH_FEATURE_SUBSCRIBE2 |       \
216          CEPH_FEATURE_RECONNECT_SEQ |    \
217          CEPH_FEATURE_PGID64 |           \
218          CEPH_FEATURE_PGPOOL3 |          \
219          CEPH_FEATURE_OSDENC)
220
221 #endif