]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: en/decode csum_type/csum_chunk_order more efficiently
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 18 Jul 2016 06:32:28 +0000 (14:32 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Mon, 18 Jul 2016 06:32:28 +0000 (14:32 +0800)
These two fields are of type uint8_t, so varint encoding/decoding
is unnecessary.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/bluestore_types.cc

index 49b12c762773f2f7c43b2165faa5d04e5f3e70b7..fb8e6dca0421cce72647fa73c89f68cfeeb7f826 100644 (file)
@@ -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;