]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore: Mute warnings
authorAdam Kupczyk <akupczyk@ibm.com>
Fri, 1 Mar 2024 14:01:08 +0000 (14:01 +0000)
committerIgor Fedotov <igor.fedotov@croit.io>
Wed, 14 Aug 2024 10:27:42 +0000 (13:27 +0300)
+ simplify op_bl size estimation
+ fix seq size estimation
+ skip useless calculation of crc32c

Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
(cherry picked from commit 4acd7beed7b3f5b457e8641313f9384c36ae6140)

src/os/bluestore/bluefs_types.cc

index ff9c96ab660ff27541bb46b372d35a6c91ed2c10..5b2281a9ffd5606155c7510ed661946f9220ddb1 100644 (file)
@@ -228,21 +228,15 @@ std::ostream& operator<<(std::ostream& out, const bluefs_fnode_delta_t& delta)
 
 // bluefs_transaction_t
 
-DENC_HELPERS
 void bluefs_transaction_t::bound_encode(size_t &s) const {
-  uint32_t crc = op_bl.crc32c(-1);
-  DENC_START(1, 1, s);
+  uint32_t crc = -1;
+  s += 1; // version
+  s += 1; // compat
+  s += 4; // size
   denc(uuid, s);
-  denc_varint(seq, s);
-  // not using bufferlist encode method, as it merely copies the bufferptr and not
-  // contents, meaning we're left with fragmented target bl
-  __u32 len = op_bl.length();
-  denc(len, s);
-  for (auto& it : op_bl.buffers()) {
-    s += it.length();
-  }
+  denc(seq, s);
+  denc(op_bl, s);
   denc(crc, s);
-  DENC_FINISH(s);
 }
 
 void bluefs_transaction_t::encode(bufferlist& bl) const