[sheepdog] [PATCH 1/2] make sd_rsp 64 bit aligned

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Sat Oct 6 12:56:26 CEST 2012


Without this patch, the header size will end up being changed if we
add a 64 bit field to sd_rsp->obj or sd_rsp->vdi.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 include/sheepdog_proto.h |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/sheepdog_proto.h b/include/sheepdog_proto.h
index e887ca1..e97d029 100644
--- a/include/sheepdog_proto.h
+++ b/include/sheepdog_proto.h
@@ -139,18 +139,20 @@ struct sd_rsp {
 	uint32_t	epoch;
 	uint32_t        id;
 	uint32_t        data_length;
-	uint32_t        result;
 	union {
+		uint32_t        result;
 		struct {
+			uint32_t	__pad;
 			uint32_t	copies;
 		} obj;
 		struct {
+			uint32_t	__pad;
 			uint32_t	rsvd;
 			uint32_t	vdi_id;
 			uint32_t	attr_id;
 			uint32_t	copies;
 		} vdi;
-		uint32_t		__pad[7];
+		uint32_t		__pad[8];
 	};
 };
 
-- 
1.7.2.5




More information about the sheepdog mailing list