#include "common/error_code.h"
#include "common/likely.h"
#include "ceph_release.h"
+#include "include/rados.h"
template<typename T, typename=void>
struct denc_traits {
__u8 struct_compat = compat; \
char *_denc_pchar; \
uint32_t _denc_u32; \
- static_assert(CEPH_RELEASE >= (19/*squid*/ + 2) || compat == 1); \
+ static_assert(CEPH_RELEASE >= (CEPH_RELEASE_SQUID /*19*/ + 2) || compat == 1); \
_denc_start(p, &struct_v, &struct_compat, &_denc_pchar, &_denc_u32); \
do {
-// For the only type that is with compat 2, osd_reqid_t, and unittest.
+// For the only type that is with compat 2: unittest.
#define DENC_START_COMPAT_2(v, compat, p) \
__u8 struct_v = v; \
__u8 struct_compat = compat; \
char *_denc_pchar; \
uint32_t _denc_u32; \
- static_assert(CEPH_RELEASE >= (19/*squid*/ + 2) || compat == 2); \
+ static_assert(CEPH_RELEASE >= (CEPH_RELEASE_SQUID /*19*/ + 2) || compat == 2); \
+ _denc_start(p, &struct_v, &struct_compat, &_denc_pchar, &_denc_u32); \
+ do {
+
+// For osd_reqid_t which cannot be upgraded at all.
+// We used it to communicate with clients and now we cannot safely upgrade.
+#define DENC_START_OSD_REQID(v, compat, p) \
+ __u8 struct_v = v; \
+ __u8 struct_compat = compat; \
+ char *_denc_pchar; \
+ uint32_t _denc_u32; \
+ static_assert(compat == 2, "osd_reqid_t cannot be upgraded"); \
_denc_start(p, &struct_v, &struct_compat, &_denc_pchar, &_denc_u32); \
do {