btrfs: reloc: add backref_cache::pending_edge and backref_cache::useless_node
authorQu Wenruo <wqu@suse.com>
Thu, 5 Mar 2020 05:48:31 +0000 (13:48 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 May 2020 09:25:17 +0000 (11:25 +0200)
commit84780289335fe614057e5ddf796050ce15751f4a
tree967607b3f529b05c13de125163cc028a7f4a9c02
parent9569cc203d23ddaed7f7f2ca986a7cda7f1c33c0
btrfs: reloc: add backref_cache::pending_edge and backref_cache::useless_node

These two new members will act the same as the existing local lists,
@useless and @list in build_backref_tree().

Currently build_backref_tree() is only executed serially, thus moving
such local list into backref_cache is still safe.

Also since we're here, use list_first_entry() to replace a lot of
list_entry() calls after !list_empty().

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/relocation.c