btrfs: reloc: use btrfs_backref_iter infrastructure
authorQu Wenruo <wqu@suse.com>
Fri, 14 Feb 2020 05:48:20 +0000 (13:48 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 May 2020 09:25:16 +0000 (11:25 +0200)
commit71f572a9e82fb7ed6f8c625e2682160f3a498db3
treeddbb219772a762ac10ea112662877ef631ba56bb
parentc39c2ddc67024979915c4df4e30da96a3e7619b0
btrfs: reloc: use btrfs_backref_iter infrastructure

In the core function of relocation, build_backref_tree, it needs to
iterate all backref items of one tree block.

Use btrfs_backref_iter infrastructure to do the loop and make the code
more readable.

The backref items look would be much more easier to read:

ret = btrfs_backref_iter_start(iter, cur->bytenr);
for (; ret == 0; ret = btrfs_backref_iter_next(iter)) {
/* The really important work */
}

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
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