• Filipe Manana's avatar
    btrfs: reuse roots ulist on each leaf iteration for iterate_extent_inodes() · 1baea6f1
    Filipe Manana authored
    At iterate_extent_inodes() we collect a ulist of leaves for a given extent
    with a call to btrfs_find_all_leafs() and then we enter a loop where we
    iterate over all the collected leaves. Each iteration of that loop does a
    call to btrfs_find_all_roots_safe(), to determine all roots from which a
    leaf is accessible, and that results in allocating and releasing a ulist
    to store the root IDs.
    
    Instead of allocating and releasing the roots ulist on every iteration,
    allocate a ulist before entering the loop and keep using it on each
    iteration, reinitializing the ulist at the end of each iteration.
    Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    1baea6f1
backref.c 94.9 KB