From 037014c8d1a8c30532b588c53542d8546a29b983 Mon Sep 17 00:00:00 2001 From: Ryne Li Date: Mon, 10 Oct 2016 16:00:12 -0400 Subject: [PATCH] osd: add check of ceph_osd_op for compatibility Signed-off-by: Ryne Li --- src/include/rados.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/include/rados.h b/src/include/rados.h index 66520ba5b22..7525339b1b0 100644 --- a/src/include/rados.h +++ b/src/include/rados.h @@ -562,6 +562,18 @@ struct ceph_osd_op { __le32 payload_len; } __attribute__ ((packed)); +/* + * Check the compatibility of struct ceph_osd_op + * (2+4+(2*8+8+4)+4) = (sizeof(ceph_osd_op::op) + + * sizeof(ceph_osd_op::flags) + + * sizeof(ceph_osd_op::extent) + + * sizeof(ceph_osd_op::payload_len)) + */ +#ifdef __cplusplus +static_assert(sizeof(ceph_osd_op) == (2+4+(2*8+8+4)+4), + "sizeof(ceph_osd_op) breaks the compatibility"); +#endif + struct ceph_osd_reply_head { __le32 client_inc; /* client incarnation */ __le32 flags; -- 2.39.5