• Josef Bacik's avatar
    btrfs: introduce an evict flushing state · d3984c90
    Josef Bacik authored
    We have this weird space flushing loop inside inode.c for evict where
    we'll do the normal LIMIT flush, and then commit the transaction and
    hope we get our space.  This is super janky, and in fact there's really
    nothing stopping us from using FLUSH_ALL except that we run delayed
    iputs, which means we could deadlock.  So introduce a new flush state
    for eviction that does the normal priority flushing with all of the
    states that are safe for eviction.
    
    The nice side-effect of this is that we'll try harder for evictions.
    Previously if (for example generic/269) you had a bunch of other
    operations happening on the fs you could race with those reservations
    when committing the transaction, and eventually miss getting a
    reservation for the evict.  With this code we'll have our ticket in
    place through the transaction commit, so any pinned bytes will go to our
    pending evictions first.
    Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    d3984c90
ctree.h 119 KB