From: xie xingguo Date: Mon, 18 Jul 2016 06:32:28 +0000 (+0800) Subject: os/bluestore: en/decode csum_type/csum_chunk_order more efficiently X-Git-Tag: ses5-milestone5~354^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4a09620a01790064e1a5ddff9fd6d5a0d0045fcf;p=ceph.git os/bluestore: en/decode csum_type/csum_chunk_order more efficiently These two fields are of type uint8_t, so varint encoding/decoding is unnecessary. Signed-off-by: xie xingguo --- diff --git a/src/os/bluestore/bluestore_types.cc b/src/os/bluestore/bluestore_types.cc index 49b12c762773..fb8e6dca0421 100644 --- a/src/os/bluestore/bluestore_types.cc +++ b/src/os/bluestore/bluestore_types.cc @@ -436,13 +436,13 @@ void bluestore_blob_t::encode(bufferlist& bl) const small_encode_varint_lowz(compressed_length, bl); } if (has_csum()) { - small_encode_varint(csum_type, bl); - small_encode_varint(csum_chunk_order, bl); + ::encode(csum_type, bl); + ::encode(csum_chunk_order, bl); small_encode_buf_lowz(csum_data, bl); } ::encode(ref_map, bl); if (has_unused()) { - ::encode( unused_uint_t(unused.to_ullong()), bl); + ::encode(unused_uint_t(unused.to_ullong()), bl); } ENCODE_FINISH(bl); } @@ -458,8 +458,8 @@ void bluestore_blob_t::decode(bufferlist::iterator& p) compressed_length = 0; } if (has_csum()) { - small_decode_varint(csum_type, p); - small_decode_varint(csum_chunk_order, p); + ::decode(csum_type, p); + ::decode(csum_chunk_order, p); small_decode_buf_lowz(csum_data, p); } else { csum_type = CSUM_NONE;