]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
os: get rid of the Transaction::decode_bp()
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 18 Sep 2024 13:14:45 +0000 (13:14 +0000)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Sat, 8 Feb 2025 15:08:59 +0000 (15:08 +0000)
commite3a6680915780e4b03a380c0cbd20bd8771ef9f2
treed21bef0b789710f940ed9603cffdcd72dd2cb924
parent327d209151bd40cbce8ab0444d59829d75f66b9b
os: get rid of the Transaction::decode_bp()

`os::Transaction::decode_bp()` has only one user: `_setattrs()`
of `BlueStore`. It uses that for optimization purposes: keeping
up contigous space instead of potentially fragmented `bufferlist`
that would require rectifying memcpy later.
The problem is `_setattrs()` also needs to avoid keeping large
raw buffers with only small subset being referenced. It achieves
this by copying the data if `bufferptr:::is_partial()` returns
`true`. However, this means the memcpy happens virtually always
as it's hard to even imagine the `val`, decoded from the wire,
can fulfill the 0 waste requirement.
Therefore the optimization doesn't make sense; it only imposes
costs in terms of complexity breaking the symmetry between encode
and decode in `os::Transation` (there is no `encode_bp()`).

This commit kills the optimization and simplifies `os::Transaction`.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/os/Transaction.h
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h