From bfc18d281c754b9517dfaf55987c6da24ce2e204 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 6 Oct 2009 10:05:57 -0700 Subject: [PATCH] rgw: encode time_t, size_t using fixed-size types --- src/radosgw/rgw_common.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/radosgw/rgw_common.h b/src/radosgw/rgw_common.h index 8a27fe2ebfe16..deca3606b6999 100644 --- a/src/radosgw/rgw_common.h +++ b/src/radosgw/rgw_common.h @@ -163,14 +163,20 @@ struct RGWObjEnt { char etag[MD5_DIGEST_LENGTH * 2 + 1]; void encode(bufferlist& bl) const { - ::encode(name, bl); - ::encode(size, bl); - ::encode(mtime, bl); + __u64 s = size; + __u32 mt = mtime; + ::encode(name, bl); + ::encode(s, bl); + ::encode(mt, bl); } void decode(bufferlist::iterator& bl) { + __u32 mt; + __u64 s; ::decode(name, bl); - ::decode(size, bl); - ::decode(mtime, bl); + ::decode(s, bl); + ::decode(mt, bl); + size = s; + mtime = mt; } }; WRITE_CLASS_ENCODER(RGWObjEnt) -- 2.39.5