• Josef Bacik's avatar
    btrfs: rework btrfs_check_space_for_delayed_refs · 64403612
    Josef Bacik authored
    Now with the delayed_refs_rsv we can now know exactly how much pending
    delayed refs space we need.  This means we can drastically simplify
    btrfs_check_space_for_delayed_refs by simply checking how much space we
    have reserved for the global rsv (which acts as a spill over buffer) and
    the delayed refs rsv.  If our total size is beyond that amount then we
    know it's time to commit the transaction and stop any more delayed refs
    from being generated.
    
    With the introduction of dealyed_refs_rsv infrastructure, namely
    btrfs_update_delayed_refs_rsv we now know exactly how much pending
    delayed refs space is required.
    Reviewed-by: default avatarNikolay Borisov <nborisov@suse.com>
    Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    64403612
transaction.c 65.6 KB