• Brian Foster's avatar
    bcachefs: support btree updates of prejournaled keys · eabb10dc
    Brian Foster authored
    Introduce support for prejournaled key updates. This allows a
    transaction to commit an update for a key that already exists (and
    is pinned) in the journal. This is required for btree write buffer
    updates as the current scheme of journaling both on write buffer
    insertion and write buffer (slow path) flush is unsafe in certain
    crash recovery scenarios.
    
    Create a small trans update wrapper to pass along the seq where the
    key resides into the btree_insert_entry. From there, trans commit
    passes the seq into the btree insert path where it is used to manage
    the journal pin for the associated btree leaf.
    
    Note that this patch only introduces the underlying mechanism and
    otherwise includes no functional changes.
    Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
    eabb10dc
btree_update.h 11.5 KB