From: Ryne Li Date: Mon, 10 Oct 2016 20:00:12 +0000 (-0400) Subject: osd: add check of ceph_osd_op for compatibility X-Git-Tag: v11.1.0~307^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=037014c8d1a8c30532b588c53542d8546a29b983;p=ceph.git osd: add check of ceph_osd_op for compatibility Signed-off-by: Ryne Li --- diff --git a/src/include/rados.h b/src/include/rados.h index 66520ba5b22f..7525339b1b09 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;