]> git.hungrycats.org Git - bees/commit
context: route dedup() physical-address logging through bees_extent_addr
authorZygo Blaxell <bees@furryterror.org>
Thu, 23 Apr 2026 02:57:08 +0000 (22:57 -0400)
committerZygo Blaxell <bees@furryterror.org>
Tue, 6 Oct 2026 05:51:40 +0000 (01:51 -0400)
commit273cb156acdc4be99129df1c47f909031fc34d96
tree577febb116be659bc2456d908a3354a9e34a404f
parent0aa6053f7761201766307c9580fb8b8fa6586b85
context: route dedup() physical-address logging through bees_extent_addr

Replace the open-coded BeesAddress lookup in BeesContext::dedup() with
the new bees_extent_addr() / bees_extent_same_bytenr() helpers.

Three things go away:

  - The optional<BeesAddress> + addr_string() lambda + two try/catches
    that wrapped the legacy BeesAddress(int, off_t) constructor (which
    can throw on missing extents).  bees_extent_addr() never throws and
    renders {} for missing items, so the call sites become unconditional.

  - The {addr_string(...)} brace-wrapping in the BEESLOGINFO and BEESNOTE
    lines.  bees_extent_addr() returns its own braces, so the format
    string just embeds the call directly.

  - The first_addr / second_addr equality check via get_physical_or_zero(),
    replaced by a single bees_extent_same_bytenr() call that does the
    same "both defined and equal" check inside the helper.

Behavioural changes vs. the prior log output:

  - PREALLOC and compressed extents now render with a tag suffix
    (:prealloc, :zlib, :lzo, :zstd) instead of dropping back to
    "addr-unavailable" or printing only the bytenr.
  - HOLE/INLINE extents now render as {HOLE} / {INLINE} instead of
    triggering the catch path with "addr-unavailable".
  - The +OFFSET inside the braces is the data's logical offset within
    the uncompressed extent, not the physical bytenr-plus-something
    that the old BeesAddress<< produced for compressed extents.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Zygo Blaxell <bees@furryterror.org>
src/bees-context.cc