• Josef Bacik's avatar
    btrfs: only track ref_heads in delayed_ref_updates · 158ffa36
    Josef Bacik authored
    We use this number to figure out how many delayed refs to run, but
    __btrfs_run_delayed_refs really only checks every time we need a new
    delayed ref head, so we always run at least one ref head completely no
    matter what the number of items on it.  Fix the accounting to only be
    adjusted when we add/remove a ref head.
    
    In addition to using this number to limit the number of delayed refs
    run, a future patch is also going to use it to calculate the amount of
    space required for delayed refs space reservation.
    Reviewed-by: default avatarNikolay Borisov <nborisov@suse.com>
    Signed-off-by: default avatarJosef Bacik <jbacik@fb.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    158ffa36
delayed-ref.c 26.1 KB