• Kent Overstreet's avatar
    bcachefs: Ensure srcu lock is not held too long · c4accde4
    Kent Overstreet authored
    The SRCU read lock that btree_trans takes exists to make it safe for
    bch2_trans_relock() to deref pointers to btree nodes/key cache items we
    don't have locked, but as a side effect it blocks reclaim from freeing
    those items.
    
    Thus, it's important to not hold it for too long: we need to
    differentiate between bch2_trans_unlock() calls that will be only for a
    short duration, and ones that will be for an unbounded duration.
    
    This introduces bch2_trans_unlock_long(), to be used mainly by the data
    move paths.
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
    c4accde4
btree_iter.h 27.9 KB