From: Sage Weil Date: Wed, 14 Dec 2016 19:39:30 +0000 (-0500) Subject: os/bluestore/bluestore_types: single byte for blob struct_v X-Git-Tag: v11.1.1~54^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9be7c540ff940992d292a25119e85628ed2555ef;p=ceph.git os/bluestore/bluestore_types: single byte for blob struct_v We forego decoding compatibility by older code by dropping compat_v and len. We have to keep struct_v per blob here because decode doesn't have a feature bit argument (yet?). Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/bluestore_types.h b/src/os/bluestore/bluestore_types.h index 5c8697b6f47c..5f7fe18776a5 100644 --- a/src/os/bluestore/bluestore_types.h +++ b/src/os/bluestore/bluestore_types.h @@ -298,7 +298,7 @@ struct bluestore_blob_t { DENC_HELPERS; void bound_encode(size_t& p) const { - p += 2 + 4; + p += 1; denc(extents, p); denc_varint(flags, p); denc_varint(sbid, p); @@ -309,8 +309,10 @@ struct bluestore_blob_t { denc(csum_data, p); p += sizeof(unsigned long long); } + void encode(bufferlist::contiguous_appender& p) const { - DENC_START(1, 1, p); + __u8 struct_v = 1; + denc(struct_v, p); denc(extents, p); denc_varint(flags, p); if (is_shared()) { @@ -328,10 +330,12 @@ struct bluestore_blob_t { if (has_unused()) { denc(unused_uint_t(unused.to_ullong()), p); } - DENC_FINISH(p); } + void decode(bufferptr::iterator& p) { - DENC_START(1, 1, p); + __u8 struct_v; + denc(struct_v, p); + assert(struct_v == 1); denc(extents, p); denc_varint(flags, p); if (is_shared()) { @@ -351,7 +355,6 @@ struct bluestore_blob_t { denc(val, p); unused = unused_t(val); } - DENC_FINISH(p); } bool can_split() const {