• Kent Overstreet's avatar
    bcachefs: Move extent overwrite handling out of core btree code · e3e464ac
    Kent Overstreet authored
    Ever since the btree code was first written, handling of overwriting
    existing extents - including partially overwriting and splittin existing
    extents - was handled as part of the core btree insert path. The modern
    transaction and iterator infrastructure didn't exist then, so that was
    the only way for it to be done.
    
    This patch moves that outside of the core btree code to a pass that runs
    at transaction commit time.
    
    This is a significant simplification to the btree code and overall
    reduction in code size, but more importantly it gets us much closer to
    the core btree code being completely independent of extents and is
    important prep work for snapshots.
    
    This introduces a new feature bit; the old and new extent update models
    are incompatible when the filesystem needs journal replay.
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
    e3e464ac
fsck.c 34.2 KB