OSDN Git Service

btrfs: reloc: refactor direct tree backref processing into its own function
authorQu Wenruo <wqu@suse.com>
Thu, 5 Mar 2020 06:06:29 +0000 (14:06 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 May 2020 09:25:17 +0000 (11:25 +0200)
commit4007ea87d900e20a7986cdcdcfdc866e8f8bd473
tree2374d8e2be9d502584eaa98730b31b820299291a
parent2433bea592d26daf6bd15492ce4262b598a7f804
btrfs: reloc: refactor direct tree backref processing into its own function

For BTRFS_SHARED_BLOCK_REF_KEY, its processing is straightforward, as we
now the parent node bytenr directly.

If the parent is already cached, or a root, call it a day.
If the parent is not cached, add it pending list.

This patch will just refactor this part into its own function,
handle_direct_tree_backref() and add some comment explaining the
@ref_key parameter.

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