+ 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)
// 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