From 132a6414394d01c4adb4a1ad2f5b225ee201be61 Mon Sep 17 00:00:00 2001 From: Adam Kupczyk Date: Fri, 1 Mar 2024 14:01:08 +0000 Subject: [PATCH] os/bluestore: Mute warnings + simplify op_bl size estimation + fix seq size estimation + skip useless calculation of crc32c Signed-off-by: Adam Kupczyk (cherry picked from commit 4acd7beed7b3f5b457e8641313f9384c36ae6140) --- src/os/bluestore/bluefs_types.cc | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/os/bluestore/bluefs_types.cc b/src/os/bluestore/bluefs_types.cc index ff9c96ab660..5b2281a9ffd 100644 --- a/src/os/bluestore/bluefs_types.cc +++ b/src/os/bluestore/bluefs_types.cc @@ -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 -- 2.47.3