From: Sage Weil Date: Thu, 3 Apr 2008 19:42:01 +0000 (-0700) Subject: pack any types we use blobhash on X-Git-Tag: v0.2~209^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=975090730c1f6d28e4946d8fe72d7628f3ea1498;p=ceph.git pack any types we use blobhash on --- diff --git a/src/msg/msg_types.h b/src/msg/msg_types.h index b5ba1d3b6d4..96196210922 100644 --- a/src/msg/msg_types.h +++ b/src/msg/msg_types.h @@ -71,7 +71,7 @@ public: return n; } -}; +} __attribute__ ((packed)); inline bool operator== (const entity_name_t& l, const entity_name_t& r) { return (l.type() == r.type()) && (l.num() == r.num()); } @@ -149,7 +149,7 @@ struct entity_addr_t { nonce == other.nonce && memcmp(&ipaddr, &other.ipaddr, sizeof(ipaddr)) == 0; } -}; +} __attribute__ ((packed)); inline ostream& operator<<(ostream& out, const entity_addr_t &addr) { @@ -189,7 +189,7 @@ struct entity_inst_t { ceph_entity_inst i = {name, addr}; return i; } -}; +} __attribute__ ((packed)); inline bool operator==(const entity_inst_t& a, const entity_inst_t& b) { return memcmp(&a, &b, sizeof(a)) == 0; } diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index fec36a6499c..60ddf099dfc 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -24,11 +24,11 @@ */ struct osd_reqid_t { entity_name_t name; // who - int32_t inc; // incarnation tid_t tid; - osd_reqid_t() : inc(0), tid(0) {} - osd_reqid_t(const entity_name_t& a, int i, tid_t t) : name(a), inc(i), tid(t) {} -}; + int32_t inc; // incarnation + osd_reqid_t() : tid(0), inc(0) {} + osd_reqid_t(const entity_name_t& a, int i, tid_t t) : name(a), tid(t), inc(i) {} +} __attribute__ ((packed)); inline ostream& operator<<(ostream& out, const osd_reqid_t& r) { return out << r.name << "." << r.inc << ":" << r.tid;