From 4a09620a01790064e1a5ddff9fd6d5a0d0045fcf Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Mon, 18 Jul 2016 14:32:28 +0800 Subject: [PATCH] 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 --- src/os/bluestore/bluestore_types.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/os/bluestore/bluestore_types.cc b/src/os/bluestore/bluestore_types.cc index 49b12c762773f..fb8e6dca0421c 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; -- 2.39.5